	.file	"745135.c"
	.intel_syntax noprefix
	.text
	.globl	algorithmDirection
	.bss
	.align 4
	.type	algorithmDirection, @object
	.size	algorithmDirection, 4
algorithmDirection:
	.zero	4
	.section	.rodata
	.align 8
.LC0:
	.string	"Usage: ./a.out <encrypt|decrypt> <key>\n"
	.align 8
.LC1:
	.string	"       Pass plain text or encrypted text\n"
	.align 8
.LC2:
	.string	"       via 'stdin'. The program outputs\n"
	.align 8
.LC3:
	.string	"       to 'stdout'. Ciphertext is in hex\n"
	.align 8
.LC4:
	.string	"       numbers - not raw binary.\n"
	.align 8
.LC5:
	.string	"       The key is required to be exactly\n"
	.align 8
.LC6:
	.string	"       %lu characters long. This means that\n"
	.align 8
.LC7:
	.string	"       the key has %lu bits. All the characters\n"
	.align 8
.LC8:
	.string	"       exceeding this length are trimmed.\n"
	.text
	.globl	printUsage
	.type	printUsage, @function
printUsage:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	rax, QWORD PTR stderr[rip]
	mov	rsi, rax
	mov	edi, 10
	call	fputc@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 39
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rsi, rax
	mov	edi, 10
	call	fputc@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 41
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 40
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 41
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 33
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rsi, rax
	mov	edi, 10
	call	fputc@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 41
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, 16
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, 128
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 42
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	printUsage, .-printUsage
	.section	.rodata
	.align 8
.LC9:
	.string	"+-------------------------------------+\n"
	.align 8
.LC10:
	.string	"|                                     |\n"
	.align 8
.LC11:
	.string	"|   TEA - Tiny Encryption Algorithm   |\n"
	.align 8
.LC12:
	.string	"Note: https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm\n"
	.text
	.globl	printBanner
	.type	printBanner, @function
printBanner:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 40
	mov	esi, 1
	lea	rdi, .LC9[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 40
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 40
	mov	esi, 1
	lea	rdi, .LC11[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 40
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 40
	mov	esi, 1
	lea	rdi, .LC9[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rsi, rax
	mov	edi, 10
	call	fputc@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 62
	mov	esi, 1
	lea	rdi, .LC12[rip]
	call	fwrite@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	printBanner, .-printBanner
	.globl	encryptTwoValues
	.type	encryptTwoValues, @function
encryptTwoValues:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -12[rbp], 0
	mov	DWORD PTR -4[rbp], -1640531527
	mov	DWORD PTR -8[rbp], 0
	jmp	.L4
.L5:
	mov	eax, DWORD PTR -4[rbp]
	add	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 4
	mov	eax, DWORD PTR [rax]
	sal	eax, 4
	mov	ecx, eax
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR [rax]
	lea	esi, [rcx+rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 4
	mov	ecx, DWORD PTR [rax]
	mov	eax, DWORD PTR -12[rbp]
	add	eax, ecx
	xor	esi, eax
	mov	ecx, esi
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 4
	mov	eax, DWORD PTR [rax]
	shr	eax, 5
	mov	esi, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 4
	mov	eax, DWORD PTR [rax]
	add	eax, esi
	xor	eax, ecx
	add	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 4
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	sal	eax, 4
	mov	ecx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	eax, DWORD PTR [rax]
	lea	esi, [rcx+rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	ecx, DWORD PTR [rax]
	mov	eax, DWORD PTR -12[rbp]
	add	eax, ecx
	xor	esi, eax
	mov	ecx, esi
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	shr	eax, 5
	mov	esi, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 12
	mov	eax, DWORD PTR [rax]
	add	eax, esi
	xor	ecx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 4
	add	edx, ecx
	mov	DWORD PTR [rax], edx
	add	DWORD PTR -8[rbp], 1
.L4:
	cmp	DWORD PTR -8[rbp], 31
	jle	.L5
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	encryptTwoValues, .-encryptTwoValues
	.section	.rodata
.LC13:
	.string	"%c"
.LC14:
	.string	"(0x%08x, 0x%08x) -> "
.LC15:
	.string	"(0x%08x, 0x%08x)\n"
.LC16:
	.string	"%08x%08x"
	.text
	.globl	encryptStdStreamOnTheFly
	.type	encryptStdStreamOnTheFly, @function
encryptStdStreamOnTheFly:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -24[rbp], 0
	jmp	.L7
.L15:
	mov	DWORD PTR -20[rbp], 0
	jmp	.L8
.L11:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, -16[rbp]
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	cmp	eax, -1
	jne	.L9
	mov	DWORD PTR -24[rbp], 1
	jmp	.L10
.L9:
	add	DWORD PTR -20[rbp], 1
.L8:
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, 7
	jbe	.L11
.L10:
	cmp	DWORD PTR -24[rbp], 0
	je	.L12
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, -16[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	add	DWORD PTR -20[rbp], 1
.L13:
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, 7
	jbe	.L14
.L12:
	mov	ecx, DWORD PTR -12[rbp]
	mov	edx, DWORD PTR -16[rbp]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rdx, QWORD PTR -40[rbp]
	lea	rax, -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	encryptTwoValues
	mov	ecx, DWORD PTR -12[rbp]
	mov	edx, DWORD PTR -16[rbp]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC15[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edx, DWORD PTR -12[rbp]
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
.L7:
	cmp	DWORD PTR -24[rbp], 0
	je	.L15
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	encryptStdStreamOnTheFly, .-encryptStdStreamOnTheFly
	.section	.rodata
	.align 8
.LC17:
	.string	"Note: Interpreting the key as\n"
.LC18:
	.string	"      0x"
.LC19:
	.string	"%08x"
	.text
	.globl	parseKey
	.type	parseKey, @function
parseKey:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	esi, 4
	mov	edi, 4
	call	calloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 30
	mov	esi, 1
	lea	rdi, .LC17[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 8
	mov	esi, 1
	lea	rdi, .LC18[rip]
	call	fwrite@PLT
	mov	DWORD PTR -16[rbp], 0
	jmp	.L18
.L21:
	mov	DWORD PTR -12[rbp], 0
	jmp	.L19
.L20:
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	esi, DWORD PTR [rax]
	mov	eax, DWORD PTR -16[rbp]
	lea	edx, 0[0+rax*4]
	mov	eax, DWORD PTR -12[rbp]
	add	eax, edx
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	edx, al
	mov	eax, DWORD PTR -12[rbp]
	movsx	rcx, eax
	mov	eax, 3
	sub	rax, rcx
	sal	eax, 3
	mov	ecx, eax
	sal	edx, cl
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rcx
	or	edx, esi
	mov	DWORD PTR [rax], edx
	add	DWORD PTR -12[rbp], 1
.L19:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, 3
	jbe	.L20
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC19[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -16[rbp], 1
.L18:
	cmp	DWORD PTR -16[rbp], 3
	jle	.L21
	mov	rax, QWORD PTR stderr[rip]
	mov	rsi, rax
	mov	edi, 10
	call	fputc@PLT
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	parseKey, .-parseKey
	.globl	cleanupKey
	.type	cleanupKey, @function
cleanupKey:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR -8[rbp], 0
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	cleanupKey, .-cleanupKey
	.section	.rodata
	.align 8
.LC20:
	.string	"Error: Wrong number of arguments.\n"
.LC21:
	.string	"encrypt"
.LC22:
	.string	"decrypt"
	.align 8
.LC23:
	.string	"Error: Wrong algorithm direction.\n"
.LC24:
	.string	"Error: Wrong key size.\n"
	.text
	.globl	parseArgs
	.type	parseArgs, @function
parseArgs:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	cmp	DWORD PTR -4[rbp], 1
	jne	.L25
	mov	eax, 0
	call	printUsage
	mov	eax, 1
	jmp	.L26
.L25:
	cmp	DWORD PTR -4[rbp], 3
	je	.L27
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 34
	mov	esi, 1
	lea	rdi, .LC20[rip]
	call	fwrite@PLT
	mov	eax, 0
	call	printUsage
	mov	eax, 1
	jmp	.L26
.L27:
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC21[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L28
	mov	DWORD PTR algorithmDirection[rip], 0
	jmp	.L29
.L28:
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC22[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L30
	mov	DWORD PTR algorithmDirection[rip], 1
	jmp	.L29
.L30:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 34
	mov	esi, 1
	lea	rdi, .LC23[rip]
	call	fwrite@PLT
	mov	eax, 0
	call	printUsage
	mov	eax, 1
	jmp	.L26
.L29:
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rax, 15
	ja	.L31
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC24[rip]
	call	fwrite@PLT
	mov	eax, 0
	call	printUsage
	mov	eax, 1
	jmp	.L26
.L31:
	mov	eax, 0
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	parseArgs, .-parseArgs
	.globl	isHexChar
	.type	isHexChar, @function
isHexChar:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, edi
	mov	BYTE PTR -4[rbp], al
	cmp	BYTE PTR -4[rbp], 64
	jbe	.L33
	cmp	BYTE PTR -4[rbp], 70
	ja	.L33
	mov	eax, 1
	jmp	.L34
.L33:
	cmp	BYTE PTR -4[rbp], 96
	jbe	.L35
	cmp	BYTE PTR -4[rbp], 102
	ja	.L35
	mov	eax, 1
	jmp	.L34
.L35:
	cmp	BYTE PTR -4[rbp], 47
	jbe	.L36
	cmp	BYTE PTR -4[rbp], 57
	ja	.L36
	mov	eax, 1
	jmp	.L34
.L36:
	mov	eax, 0
.L34:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	isHexChar, .-isHexChar
	.globl	decryptTwoValues
	.type	decryptTwoValues, @function
decryptTwoValues:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -12[rbp], -957401312
	mov	DWORD PTR -4[rbp], -1640531527
	mov	DWORD PTR -8[rbp], 0
	jmp	.L38
.L39:
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 4
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	sal	eax, 4
	mov	ecx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	eax, DWORD PTR [rax]
	lea	esi, [rcx+rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	ecx, DWORD PTR [rax]
	mov	eax, DWORD PTR -12[rbp]
	add	eax, ecx
	xor	esi, eax
	mov	ecx, esi
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	shr	eax, 5
	mov	esi, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 12
	mov	eax, DWORD PTR [rax]
	add	eax, esi
	xor	ecx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 4
	sub	edx, ecx
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 4
	mov	eax, DWORD PTR [rax]
	sal	eax, 4
	mov	ecx, eax
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR [rax]
	lea	esi, [rcx+rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 4
	mov	ecx, DWORD PTR [rax]
	mov	eax, DWORD PTR -12[rbp]
	add	eax, ecx
	xor	esi, eax
	mov	ecx, esi
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 4
	mov	eax, DWORD PTR [rax]
	shr	eax, 5
	mov	esi, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 4
	mov	eax, DWORD PTR [rax]
	add	eax, esi
	xor	eax, ecx
	sub	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -4[rbp]
	sub	DWORD PTR -12[rbp], eax
	add	DWORD PTR -8[rbp], 1
.L38:
	cmp	DWORD PTR -8[rbp], 31
	jle	.L39
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	decryptTwoValues, .-decryptTwoValues
	.section	.rodata
	.align 8
.LC25:
	.string	"Error: Wrong chunk size. Ciphertext is\n"
	.align 8
.LC26:
	.string	"       required to have a size equal to\n"
	.align 8
.LC27:
	.string	"       a mutiple of %lu hexadecimal characters.\n"
	.align 8
.LC28:
	.string	"Error: Ciphertext has to be written using\n"
	.align 8
.LC29:
	.string	"       hexadecimal characters only.\n"
	.text
	.globl	decryptStdStreamOnTheFly
	.type	decryptStdStreamOnTheFly, @function
decryptStdStreamOnTheFly:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 96
	mov	QWORD PTR -88[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -76[rbp], 0
	mov	DWORD PTR -72[rbp], 0
	jmp	.L41
.L53:
	mov	DWORD PTR -68[rbp], 0
	jmp	.L42
.L47:
	lea	rdx, -32[rbp]
	mov	eax, DWORD PTR -68[rbp]
	cdqe
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	cmp	eax, -1
	jne	.L43
	mov	DWORD PTR -72[rbp], 1
	cmp	DWORD PTR -68[rbp], 0
	jle	.L56
	mov	DWORD PTR -76[rbp], 1
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 39
	mov	esi, 1
	lea	rdi, .LC25[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 40
	mov	esi, 1
	lea	rdi, .LC26[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, 16
	lea	rsi, .LC27[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L56
.L43:
	mov	eax, DWORD PTR -68[rbp]
	cdqe
	movzx	eax, BYTE PTR -32[rbp+rax]
	movzx	eax, al
	mov	edi, eax
	call	isHexChar
	test	eax, eax
	jne	.L46
	mov	DWORD PTR -72[rbp], 1
	mov	DWORD PTR -76[rbp], 1
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 42
	mov	esi, 1
	lea	rdi, .LC28[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 36
	mov	esi, 1
	lea	rdi, .LC29[rip]
	call	fwrite@PLT
	jmp	.L45
.L46:
	add	DWORD PTR -68[rbp], 1
.L42:
	mov	eax, DWORD PTR -68[rbp]
	cmp	eax, 15
	jbe	.L47
	jmp	.L45
.L56:
	nop
.L45:
	cmp	DWORD PTR -72[rbp], 0
	jne	.L41
	mov	BYTE PTR -33[rbp], 0
	mov	edi, 8
	call	malloc@PLT
	mov	QWORD PTR -56[rbp], rax
	mov	DWORD PTR -64[rbp], 0
	jmp	.L49
.L50:
	mov	eax, DWORD PTR -64[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, -32[rbp]
	lea	rcx, [rax+rdx]
	lea	rax, -41[rbp]
	mov	edx, 8
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	mov	eax, DWORD PTR -64[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -56[rbp]
	add	rdx, rax
	lea	rax, -41[rbp]
	lea	rsi, .LC19[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	add	DWORD PTR -64[rbp], 1
.L49:
	cmp	DWORD PTR -64[rbp], 1
	jle	.L50
	mov	rdx, QWORD PTR -88[rbp]
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	decryptTwoValues
	mov	DWORD PTR -60[rbp], 0
	jmp	.L51
.L52:
	mov	eax, DWORD PTR -60[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	edi, eax
	call	putchar@PLT
	add	DWORD PTR -60[rbp], 1
.L51:
	mov	eax, DWORD PTR -60[rbp]
	cmp	eax, 15
	jbe	.L52
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	free@PLT
.L41:
	cmp	DWORD PTR -72[rbp], 0
	je	.L53
	mov	eax, DWORD PTR -76[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L55
	call	__stack_chk_fail@PLT
.L55:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	decryptStdStreamOnTheFly, .-decryptStdStreamOnTheFly
	.section	.rodata
.LC30:
	.string	"Note: Encrypting...\n"
.LC31:
	.string	"Note: Decrypting...\n"
.LC32:
	.string	"Note: Finished!\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB16:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -12[rbp], 0
	mov	eax, 0
	call	printBanner
	mov	rdx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	parseArgs
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	je	.L58
	mov	eax, DWORD PTR -12[rbp]
	jmp	.L59
.L58:
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	parseKey
	mov	QWORD PTR -8[rbp], rax
	mov	eax, DWORD PTR algorithmDirection[rip]
	test	eax, eax
	jne	.L60
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 20
	mov	esi, 1
	lea	rdi, .LC30[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	encryptStdStreamOnTheFly
	jmp	.L61
.L60:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 20
	mov	esi, 1
	lea	rdi, .LC31[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	decryptStdStreamOnTheFly
	mov	DWORD PTR -12[rbp], eax
.L61:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 16
	mov	esi, 1
	lea	rdi, .LC32[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	cleanupKey
	mov	eax, DWORD PTR -12[rbp]
.L59:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"745135.c"
	.text
	.comm	algorithmDirection,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: ./a.out <encrypt|decrypt> <key>\012\000"
	.align	2
.LC1:
	.ascii	"       Pass plain text or encrypted text\012\000"
	.align	2
.LC2:
	.ascii	"       via 'stdin'. The program outputs\012\000"
	.align	2
.LC3:
	.ascii	"       to 'stdout'. Ciphertext is in hex\012\000"
	.align	2
.LC4:
	.ascii	"       numbers - not raw binary.\012\000"
	.align	2
.LC5:
	.ascii	"       The key is required to be exactly\012\000"
	.align	2
.LC6:
	.ascii	"       %lu characters long. This means that\012\000"
	.align	2
.LC7:
	.ascii	"       the key has %lu bits. All the characters\012"
	.ascii	"\000"
	.align	2
.LC8:
	.ascii	"       exceeding this length are trimmed.\012\000"
	.text
	.align	2
	.global	printUsage
	.syntax unified
	.arm
	.fpu softvfp
	.type	printUsage, %function
printUsage:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, #10
	bl	fputc
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #39
	mov	r1, #1
	ldr	r0, .L2+4
	bl	fwrite
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, #10
	bl	fputc
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #41
	mov	r1, #1
	ldr	r0, .L2+8
	bl	fwrite
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #40
	mov	r1, #1
	ldr	r0, .L2+12
	bl	fwrite
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #41
	mov	r1, #1
	ldr	r0, .L2+16
	bl	fwrite
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #33
	mov	r1, #1
	ldr	r0, .L2+20
	bl	fwrite
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, #10
	bl	fputc
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #41
	mov	r1, #1
	ldr	r0, .L2+24
	bl	fwrite
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #16
	ldr	r1, .L2+28
	mov	r0, r3
	bl	fprintf
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #128
	ldr	r1, .L2+32
	mov	r0, r3
	bl	fprintf
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #42
	mov	r1, #1
	ldr	r0, .L2+36
	bl	fwrite
	nop
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.size	printUsage, .-printUsage
	.section	.rodata
	.align	2
.LC9:
	.ascii	"+-------------------------------------+\012\000"
	.align	2
.LC10:
	.ascii	"|                                     |\012\000"
	.align	2
.LC11:
	.ascii	"|   TEA - Tiny Encryption Algorithm   |\012\000"
	.align	2
.LC12:
	.ascii	"Note: https://en.wikipedia.org/wiki/Tiny_Encryption"
	.ascii	"_Algorithm\012\000"
	.text
	.align	2
	.global	printBanner
	.syntax unified
	.arm
	.fpu softvfp
	.type	printBanner, %function
printBanner:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L5
	ldr	r3, [r3]
	mov	r2, #40
	mov	r1, #1
	ldr	r0, .L5+4
	bl	fwrite
	ldr	r3, .L5
	ldr	r3, [r3]
	mov	r2, #40
	mov	r1, #1
	ldr	r0, .L5+8
	bl	fwrite
	ldr	r3, .L5
	ldr	r3, [r3]
	mov	r2, #40
	mov	r1, #1
	ldr	r0, .L5+12
	bl	fwrite
	ldr	r3, .L5
	ldr	r3, [r3]
	mov	r2, #40
	mov	r1, #1
	ldr	r0, .L5+8
	bl	fwrite
	ldr	r3, .L5
	ldr	r3, [r3]
	mov	r2, #40
	mov	r1, #1
	ldr	r0, .L5+4
	bl	fwrite
	ldr	r3, .L5
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, #10
	bl	fputc
	ldr	r3, .L5
	ldr	r3, [r3]
	mov	r2, #62
	mov	r1, #1
	ldr	r0, .L5+16
	bl	fwrite
	nop
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	stderr
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	printBanner, .-printBanner
	.align	2
	.global	encryptTwoValues
	.syntax unified
	.arm
	.fpu softvfp
	.type	encryptTwoValues, %function
encryptTwoValues:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-16]
	ldr	r3, .L10
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L8
.L9:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-24]
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	ldr	r3, [r3]
	lsl	r1, r3, #4
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	add	r1, r1, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	ldr	r0, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r0, r3
	eor	r1, r1, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	ldr	r3, [r3]
	lsr	r0, r3, #5
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	add	r3, r0, r3
	eor	r3, r3, r1
	add	r2, r2, r3
	ldr	r3, [fp, #-24]
	str	r2, [r3]
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	ldr	r1, [r3]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	lsl	r2, r3, #4
	ldr	r3, [fp, #-28]
	add	r3, r3, #8
	ldr	r3, [r3]
	add	r2, r2, r3
	ldr	r3, [fp, #-24]
	ldr	r0, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r0, r3
	eor	r2, r2, r3
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	lsr	r0, r3, #5
	ldr	r3, [fp, #-28]
	add	r3, r3, #12
	ldr	r3, [r3]
	add	r3, r0, r3
	eor	r2, r2, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	add	r2, r1, r2
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L8:
	ldr	r3, [fp, #-12]
	cmp	r3, #31
	ble	.L9
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L11:
	.align	2
.L10:
	.word	-1640531527
	.size	encryptTwoValues, .-encryptTwoValues
	.section	.rodata
	.align	2
.LC13:
	.ascii	"%c\000"
	.align	2
.LC14:
	.ascii	"(0x%08x, 0x%08x) -> \000"
	.align	2
.LC15:
	.ascii	"(0x%08x, 0x%08x)\012\000"
	.align	2
.LC16:
	.ascii	"%08x%08x\000"
	.align	2
.LC17:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	encryptStdStreamOnTheFly
	.syntax unified
	.arm
	.fpu softvfp
	.type	encryptStdStreamOnTheFly, %function
encryptStdStreamOnTheFly:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L13
.L21:
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L14
.L17:
	ldr	r3, [fp, #-20]
	sub	r2, fp, #16
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L23+4
	bl	__isoc99_scanf
	mov	r3, r0
	cmn	r3, #1
	bne	.L15
	mov	r3, #1
	str	r3, [fp, #-24]
	b	.L16
.L15:
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L14:
	ldr	r3, [fp, #-20]
	cmp	r3, #7
	bls	.L17
.L16:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L18
	b	.L19
.L20:
	ldr	r3, [fp, #-20]
	sub	r2, fp, #16
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L19:
	ldr	r3, [fp, #-20]
	cmp	r3, #7
	bls	.L20
.L18:
	ldr	r3, .L23+8
	ldr	r0, [r3]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	ldr	r1, .L23+12
	bl	fprintf
	sub	r3, fp, #16
	ldr	r1, [fp, #-32]
	mov	r0, r3
	bl	encryptTwoValues
	ldr	r3, .L23+8
	ldr	r0, [r3]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	ldr	r1, .L23+16
	bl	fprintf
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	mov	r1, r3
	ldr	r0, .L23+20
	bl	printf
.L13:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L21
	nop
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L22
	bl	__stack_chk_fail
.L22:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC17
	.word	.LC13
	.word	stderr
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.size	encryptStdStreamOnTheFly, .-encryptStdStreamOnTheFly
	.section	.rodata
	.align	2
.LC18:
	.ascii	"Note: Interpreting the key as\012\000"
	.align	2
.LC19:
	.ascii	"      0x\000"
	.align	2
.LC20:
	.ascii	"%08x\000"
	.text
	.align	2
	.global	parseKey
	.syntax unified
	.arm
	.fpu softvfp
	.type	parseKey, %function
parseKey:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	mov	r1, #4
	mov	r0, #4
	bl	calloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, .L31
	ldr	r3, [r3]
	mov	r2, #30
	mov	r1, #1
	ldr	r0, .L31+4
	bl	fwrite
	ldr	r3, .L31
	ldr	r3, [r3]
	mov	r2, #8
	mov	r1, #1
	ldr	r0, .L31+8
	bl	fwrite
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L26
.L29:
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L27
.L28:
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, [fp, #-16]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	mov	r2, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, r2
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, [fp, #-12]
	rsb	r3, r3, #3
	lsl	r3, r3, #3
	lsl	r2, r2, r3
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r0, [fp, #-8]
	add	r3, r0, r3
	orr	r2, r1, r2
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L27:
	ldr	r3, [fp, #-12]
	cmp	r3, #3
	bls	.L28
	ldr	r3, .L31
	ldr	r0, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L31+12
	bl	fprintf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L26:
	ldr	r3, [fp, #-16]
	cmp	r3, #3
	ble	.L29
	ldr	r3, .L31
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, #10
	bl	fputc
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L32:
	.align	2
.L31:
	.word	stderr
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.size	parseKey, .-parseKey
	.align	2
	.global	cleanupKey
	.syntax unified
	.arm
	.fpu softvfp
	.type	cleanupKey, %function
cleanupKey:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	free
	mov	r3, #0
	str	r3, [fp, #-8]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	cleanupKey, .-cleanupKey
	.section	.rodata
	.align	2
.LC21:
	.ascii	"Error: Wrong number of arguments.\012\000"
	.align	2
.LC22:
	.ascii	"encrypt\000"
	.align	2
.LC23:
	.ascii	"decrypt\000"
	.align	2
.LC24:
	.ascii	"Error: Wrong algorithm direction.\012\000"
	.align	2
.LC25:
	.ascii	"Error: Wrong key size.\012\000"
	.text
	.align	2
	.global	parseArgs
	.syntax unified
	.arm
	.fpu softvfp
	.type	parseArgs, %function
parseArgs:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r3, #1
	bne	.L35
	bl	printUsage
	mov	r3, #1
	b	.L36
.L35:
	ldr	r3, [fp, #-8]
	cmp	r3, #3
	beq	.L37
	ldr	r3, .L42
	ldr	r3, [r3]
	mov	r2, #34
	mov	r1, #1
	ldr	r0, .L42+4
	bl	fwrite
	bl	printUsage
	mov	r3, #1
	b	.L36
.L37:
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L42+8
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L38
	ldr	r3, .L42+12
	mov	r2, #0
	str	r2, [r3]
	b	.L39
.L38:
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L42+16
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L40
	ldr	r3, .L42+12
	mov	r2, #1
	str	r2, [r3]
	b	.L39
.L40:
	ldr	r3, .L42
	ldr	r3, [r3]
	mov	r2, #34
	mov	r1, #1
	ldr	r0, .L42+20
	bl	fwrite
	bl	printUsage
	mov	r3, #1
	b	.L36
.L39:
	ldr	r3, [fp, #-12]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	cmp	r3, #15
	bhi	.L41
	ldr	r3, .L42
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L42+24
	bl	fwrite
	bl	printUsage
	mov	r3, #1
	b	.L36
.L41:
	mov	r3, #0
.L36:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L43:
	.align	2
.L42:
	.word	stderr
	.word	.LC21
	.word	.LC22
	.word	algorithmDirection
	.word	.LC23
	.word	.LC24
	.word	.LC25
	.size	parseArgs, .-parseArgs
	.align	2
	.global	isHexChar
	.syntax unified
	.arm
	.fpu softvfp
	.type	isHexChar, %function
isHexChar:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	mov	r3, r0
	strb	r3, [fp, #-5]
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #64
	bls	.L45
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #70
	bhi	.L45
	mov	r3, #1
	b	.L46
.L45:
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #96
	bls	.L47
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #102
	bhi	.L47
	mov	r3, #1
	b	.L46
.L47:
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #47
	bls	.L48
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #57
	bhi	.L48
	mov	r3, #1
	b	.L46
.L48:
	mov	r3, #0
.L46:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	isHexChar, .-isHexChar
	.align	2
	.global	decryptTwoValues
	.syntax unified
	.arm
	.fpu softvfp
	.type	decryptTwoValues, %function
decryptTwoValues:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, .L52
	str	r3, [fp, #-16]
	ldr	r3, .L52+4
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L50
.L51:
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	ldr	r1, [r3]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	lsl	r2, r3, #4
	ldr	r3, [fp, #-28]
	add	r3, r3, #8
	ldr	r3, [r3]
	add	r2, r2, r3
	ldr	r3, [fp, #-24]
	ldr	r0, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r0, r3
	eor	r2, r2, r3
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	lsr	r0, r3, #5
	ldr	r3, [fp, #-28]
	add	r3, r3, #12
	ldr	r3, [r3]
	add	r3, r0, r3
	eor	r2, r2, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	sub	r2, r1, r2
	str	r2, [r3]
	ldr	r3, [fp, #-24]
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	ldr	r3, [r3]
	lsl	r1, r3, #4
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	add	r1, r1, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	ldr	r0, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r0, r3
	eor	r1, r1, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	ldr	r3, [r3]
	lsr	r0, r3, #5
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	add	r3, r0, r3
	eor	r3, r3, r1
	sub	r2, r2, r3
	ldr	r3, [fp, #-24]
	str	r2, [r3]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-8]
	sub	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L50:
	ldr	r3, [fp, #-12]
	cmp	r3, #31
	ble	.L51
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L53:
	.align	2
.L52:
	.word	-957401312
	.word	-1640531527
	.size	decryptTwoValues, .-decryptTwoValues
	.section	.rodata
	.align	2
.LC26:
	.ascii	"Error: Wrong chunk size. Ciphertext is\012\000"
	.align	2
.LC27:
	.ascii	"       required to have a size equal to\012\000"
	.align	2
.LC28:
	.ascii	"       a mutiple of %lu hexadecimal characters.\012"
	.ascii	"\000"
	.align	2
.LC29:
	.ascii	"Error: Ciphertext has to be written using\012\000"
	.align	2
.LC30:
	.ascii	"       hexadecimal characters only.\012\000"
	.align	2
.LC31:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	decryptStdStreamOnTheFly
	.syntax unified
	.arm
	.fpu softvfp
	.type	decryptStdStreamOnTheFly, %function
decryptStdStreamOnTheFly:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #64
	str	r0, [fp, #-64]
	ldr	r3, .L71
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-60]
	mov	r3, #0
	str	r3, [fp, #-56]
	b	.L55
.L67:
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L56
.L61:
	sub	r2, fp, #24
	ldr	r3, [fp, #-52]
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L71+4
	bl	__isoc99_scanf
	mov	r3, r0
	cmn	r3, #1
	bne	.L57
	mov	r3, #1
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-52]
	cmp	r3, #0
	ble	.L70
	mov	r3, #1
	str	r3, [fp, #-60]
	ldr	r3, .L71+8
	ldr	r3, [r3]
	mov	r2, #39
	mov	r1, #1
	ldr	r0, .L71+12
	bl	fwrite
	ldr	r3, .L71+8
	ldr	r3, [r3]
	mov	r2, #40
	mov	r1, #1
	ldr	r0, .L71+16
	bl	fwrite
	ldr	r3, .L71+8
	ldr	r3, [r3]
	mov	r2, #16
	ldr	r1, .L71+20
	mov	r0, r3
	bl	fprintf
	b	.L70
.L57:
	sub	r2, fp, #24
	ldr	r3, [fp, #-52]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	isHexChar
	mov	r3, r0
	cmp	r3, #0
	bne	.L60
	mov	r3, #1
	str	r3, [fp, #-56]
	mov	r3, #1
	str	r3, [fp, #-60]
	ldr	r3, .L71+8
	ldr	r3, [r3]
	mov	r2, #42
	mov	r1, #1
	ldr	r0, .L71+24
	bl	fwrite
	ldr	r3, .L71+8
	ldr	r3, [r3]
	mov	r2, #36
	mov	r1, #1
	ldr	r0, .L71+28
	bl	fwrite
	b	.L59
.L60:
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L56:
	ldr	r3, [fp, #-52]
	cmp	r3, #15
	bls	.L61
	b	.L59
.L70:
	nop
.L59:
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L55
	mov	r3, #0
	strb	r3, [fp, #-28]
	mov	r0, #8
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-40]
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L63
.L64:
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #3
	sub	r2, fp, #24
	add	r1, r2, r3
	sub	r3, fp, #36
	mov	r2, #8
	mov	r0, r3
	bl	strncpy
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-40]
	add	r2, r2, r3
	sub	r3, fp, #36
	ldr	r1, .L71+32
	mov	r0, r3
	bl	__isoc99_sscanf
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L63:
	ldr	r3, [fp, #-48]
	cmp	r3, #1
	ble	.L64
	ldr	r1, [fp, #-64]
	ldr	r0, [fp, #-40]
	bl	decryptTwoValues
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L65
.L66:
	ldr	r3, [fp, #-44]
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	putchar
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L65:
	ldr	r3, [fp, #-44]
	cmp	r3, #15
	bls	.L66
	ldr	r0, [fp, #-40]
	bl	free
.L55:
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	beq	.L67
	ldr	r3, [fp, #-60]
	ldr	r2, .L71
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L69
	bl	__stack_chk_fail
.L69:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L72:
	.align	2
.L71:
	.word	.LC31
	.word	.LC13
	.word	stderr
	.word	.LC26
	.word	.LC27
	.word	.LC28
	.word	.LC29
	.word	.LC30
	.word	.LC20
	.size	decryptStdStreamOnTheFly, .-decryptStdStreamOnTheFly
	.section	.rodata
	.align	2
.LC32:
	.ascii	"Note: Encrypting...\012\000"
	.align	2
.LC33:
	.ascii	"Note: Decrypting...\012\000"
	.align	2
.LC34:
	.ascii	"Note: Finished!\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-12]
	bl	printBanner
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	parseArgs
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L74
	ldr	r3, [fp, #-12]
	b	.L75
.L74:
	ldr	r3, [fp, #-20]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	parseKey
	str	r0, [fp, #-8]
	ldr	r3, .L78
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L76
	ldr	r3, .L78+4
	ldr	r3, [r3]
	mov	r2, #20
	mov	r1, #1
	ldr	r0, .L78+8
	bl	fwrite
	ldr	r0, [fp, #-8]
	bl	encryptStdStreamOnTheFly
	b	.L77
.L76:
	ldr	r3, .L78+4
	ldr	r3, [r3]
	mov	r2, #20
	mov	r1, #1
	ldr	r0, .L78+12
	bl	fwrite
	ldr	r0, [fp, #-8]
	bl	decryptStdStreamOnTheFly
	str	r0, [fp, #-12]
.L77:
	ldr	r3, .L78+4
	ldr	r3, [r3]
	mov	r2, #16
	mov	r1, #1
	ldr	r0, .L78+16
	bl	fwrite
	ldr	r0, [fp, #-8]
	bl	cleanupKey
	ldr	r3, [fp, #-12]
.L75:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L79:
	.align	2
.L78:
	.word	algorithmDirection
	.word	stderr
	.word	.LC32
	.word	.LC33
	.word	.LC34
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
