	.file	"187642022.c"
	.intel_syntax noprefix
	.text
	.globl	ENVIRONMENT_KEY_VAR
	.section	.rodata
.LC0:
	.string	"XOR_KEY"
	.section	.data.rel.local,"aw"
	.align 8
	.type	ENVIRONMENT_KEY_VAR, @object
	.size	ENVIRONMENT_KEY_VAR, 8
ENVIRONMENT_KEY_VAR:
	.quad	.LC0
	.section	.rodata
.LC1:
	.string	"r"
.LC2:
	.string	"\r\n"
	.align 8
.LC3:
	.string	"Unable to open the key file: errno=%d!\n"
	.text
	.globl	get_key_from_file
	.type	get_key_from_file, @function
get_key_from_file:
.LFB6:
	.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 -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -36[rbp], edx
	mov	QWORD PTR -16[rbp], 0
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L2
	mov	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	rdx, QWORD PTR -8[rbp]
	mov	ecx, DWORD PTR -36[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	fgets@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	strcspn@PLT
	mov	rdx, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	jmp	.L3
.L2:
	call	__errno_location@PLT
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L3:
	mov	rax, QWORD PTR -16[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_key_from_file, .-get_key_from_file
	.section	.rodata
	.align 8
.LC4:
	.string	"Usage: xor [options]\n\n  -h, --help       Show help message and quit.\n  -i, --in-file    Specify source file.\n  -o, --out-file   Specify out file.\n  -k, --key-file   Specify file contained xor key.\n\n"
.LC5:
	.string	"hi:o:k:"
.LC6:
	.string	"%s"
.LC7:
	.string	"Key %s not found!\n"
	.align 8
.LC8:
	.string	"Unable to open the file: errno=%d!\n"
.LC9:
	.string	"w"
	.align 8
.LC10:
	.string	"Unable to open the file for writing: errno=%d!\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 184
	.cfi_offset 3, -24
	mov	DWORD PTR -180[rbp], edi
	mov	QWORD PTR -192[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -152[rbp], 0
	mov	QWORD PTR -144[rbp], 0
	mov	QWORD PTR -136[rbp], 0
	mov	DWORD PTR -164[rbp], 0
	lea	rax, .LC4[rip]
	mov	QWORD PTR -104[rbp], rax
.L15:
	mov	DWORD PTR -168[rbp], 0
	lea	rdx, -168[rbp]
	mov	rsi, QWORD PTR -192[rbp]
	mov	eax, DWORD PTR -180[rbp]
	mov	r8, rdx
	lea	rcx, long_options.0[rip]
	lea	rdx, .LC5[rip]
	mov	edi, eax
	call	getopt_long@PLT
	mov	DWORD PTR -160[rbp], eax
	cmp	DWORD PTR -160[rbp], -1
	jne	.L6
	mov	rax, QWORD PTR ENVIRONMENT_KEY_VAR[rip]
	mov	rdi, rax
	call	getenv@PLT
	mov	QWORD PTR -128[rbp], rax
	cmp	QWORD PTR -128[rbp], 0
	je	.L7
	jmp	.L8
.L6:
	cmp	DWORD PTR -160[rbp], 111
	je	.L9
	cmp	DWORD PTR -160[rbp], 111
	jg	.L10
	cmp	DWORD PTR -160[rbp], 107
	je	.L11
	cmp	DWORD PTR -160[rbp], 107
	jg	.L10
	cmp	DWORD PTR -160[rbp], 104
	je	.L12
	cmp	DWORD PTR -160[rbp], 105
	je	.L13
	jmp	.L10
.L12:
	mov	rax, QWORD PTR -104[rbp]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	exit@PLT
.L13:
	mov	rax, QWORD PTR optarg[rip]
	mov	QWORD PTR -152[rbp], rax
	jmp	.L14
.L9:
	mov	rax, QWORD PTR optarg[rip]
	mov	QWORD PTR -144[rbp], rax
	jmp	.L14
.L11:
	mov	rax, QWORD PTR optarg[rip]
	mov	QWORD PTR -136[rbp], rax
	jmp	.L14
.L10:
	mov	rdx, QWORD PTR stderr[rip]
	mov	rax, QWORD PTR -104[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	fputs@PLT
	mov	edi, 1
	call	exit@PLT
.L14:
	jmp	.L15
.L7:
	cmp	QWORD PTR -136[rbp], 0
	jne	.L16
	mov	rdx, QWORD PTR ENVIRONMENT_KEY_VAR[rip]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L16:
	lea	rcx, -96[rbp]
	mov	rax, QWORD PTR -136[rbp]
	mov	edx, 64
	mov	rsi, rcx
	mov	rdi, rax
	call	get_key_from_file
	mov	QWORD PTR -128[rbp], rax
	cmp	QWORD PTR -128[rbp], 0
	jne	.L8
	mov	edi, 4
	call	exit@PLT
.L8:
	cmp	QWORD PTR -152[rbp], 0
	jne	.L17
	mov	rax, QWORD PTR stdin[rip]
	mov	QWORD PTR -120[rbp], rax
	jmp	.L18
.L17:
	mov	rax, QWORD PTR -152[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -120[rbp], rax
	cmp	QWORD PTR -120[rbp], 0
	jne	.L18
	call	__errno_location@PLT
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 2
	call	exit@PLT
.L18:
	cmp	QWORD PTR -144[rbp], 0
	jne	.L19
	mov	rax, QWORD PTR stdout[rip]
	mov	QWORD PTR -112[rbp], rax
	jmp	.L20
.L19:
	mov	rax, QWORD PTR -144[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -112[rbp], rax
	cmp	QWORD PTR -112[rbp], 0
	jne	.L20
	call	__errno_location@PLT
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 3
	call	exit@PLT
.L20:
	cmp	QWORD PTR -120[rbp], 0
	je	.L21
	cmp	QWORD PTR -112[rbp], 0
	je	.L22
	jmp	.L23
.L24:
	mov	eax, DWORD PTR -164[rbp]
	movsx	rbx, eax
	mov	rax, QWORD PTR -128[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rcx, rax
	mov	rax, rbx
	mov	edx, 0
	div	rcx
	mov	rcx, rdx
	mov	rdx, rcx
	mov	rax, QWORD PTR -128[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	xor	eax, DWORD PTR -156[rbp]
	mov	rdx, QWORD PTR -112[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	fputc@PLT
	add	DWORD PTR -164[rbp], 1
.L23:
	mov	rax, QWORD PTR -120[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR -156[rbp], eax
	cmp	DWORD PTR -156[rbp], -1
	jne	.L24
	mov	rax, QWORD PTR -112[rbp]
	mov	rdi, rax
	call	fclose@PLT
.L22:
	mov	rax, QWORD PTR -120[rbp]
	mov	rdi, rax
	call	fclose@PLT
.L21:
	mov	eax, 0
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.section	.rodata
.LC11:
	.string	"help"
.LC12:
	.string	"in-file"
.LC13:
	.string	"out-file"
.LC14:
	.string	"key-file"
	.section	.data.rel.ro.local,"aw"
	.align 32
	.type	long_options.0, @object
	.size	long_options.0, 160
long_options.0:
	.quad	.LC11
	.long	0
	.zero	4
	.quad	0
	.long	104
	.zero	4
	.quad	.LC12
	.long	1
	.zero	4
	.quad	0
	.long	105
	.zero	4
	.quad	.LC13
	.long	1
	.zero	4
	.quad	0
	.long	111
	.zero	4
	.quad	.LC14
	.long	1
	.zero	4
	.quad	0
	.long	107
	.zero	4
	.quad	0
	.long	0
	.zero	4
	.quad	0
	.long	0
	.zero	4
	.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	"187642022.c"
	.text
	.global	ENVIRONMENT_KEY_VAR
	.section	.rodata
	.align	2
.LC0:
	.ascii	"XOR_KEY\000"
	.data
	.align	2
	.type	ENVIRONMENT_KEY_VAR, %object
	.size	ENVIRONMENT_KEY_VAR, 4
ENVIRONMENT_KEY_VAR:
	.word	.LC0
	.section	.rodata
	.align	2
.LC1:
	.ascii	"r\000"
	.align	2
.LC2:
	.ascii	"\015\012\000"
	.align	2
.LC3:
	.ascii	"Unable to open the key file: errno=%d!\012\000"
	.text
	.align	2
	.global	get_key_from_file
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_key_from_file, %function
get_key_from_file:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-20]
	ldr	r1, .L5
	ldr	r0, [fp, #-24]
	bl	fopen
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L2
	ldr	r3, [fp, #-32]
	mov	r2, r3
	mov	r1, #0
	ldr	r0, [fp, #-28]
	bl	memset
	ldr	r2, [fp, #-16]
	ldr	r1, [fp, #-32]
	ldr	r0, [fp, #-28]
	bl	fgets
	str	r0, [fp, #-20]
	ldr	r1, .L5+4
	ldr	r0, [fp, #-28]
	bl	strcspn
	mov	r2, r0
	ldr	r3, [fp, #-28]
	add	r3, r3, r2
	mov	r2, #0
	strb	r2, [r3]
	b	.L3
.L2:
	ldr	r3, .L5+8
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L5+12
	mov	r0, r4
	bl	fprintf
.L3:
	ldr	r3, [fp, #-20]
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC1
	.word	.LC2
	.word	stderr
	.word	.LC3
	.size	get_key_from_file, .-get_key_from_file
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Usage: xor [options]\012\012  -h, --help       Show"
	.ascii	" help message and quit.\012  -i, --in-file    Speci"
	.ascii	"fy source file.\012  -o, --out-file   Specify out f"
	.ascii	"ile.\012  -k, --key-file   Specify file contained x"
	.ascii	"or key.\012\012\000"
	.align	2
.LC5:
	.ascii	"hi:o:k:\000"
	.align	2
.LC6:
	.ascii	"%s\000"
	.align	2
.LC7:
	.ascii	"Key %s not found!\012\000"
	.align	2
.LC8:
	.ascii	"Unable to open the file: errno=%d!\012\000"
	.align	2
.LC9:
	.ascii	"w\000"
	.align	2
.LC10:
	.ascii	"Unable to open the file for writing: errno=%d!\012\000"
	.global	__aeabi_uidivmod
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 120
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #132
	str	r0, [fp, #-128]
	str	r1, [fp, #-132]
	ldr	r3, .L30
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-120]
	mov	r3, #0
	str	r3, [fp, #-116]
	mov	r3, #0
	str	r3, [fp, #-112]
	mov	r3, #0
	str	r3, [fp, #-104]
	ldr	r3, .L30+4
	str	r3, [fp, #-92]
.L18:
	mov	r3, #0
	str	r3, [fp, #-124]
	sub	r3, fp, #124
	str	r3, [sp]
	ldr	r3, .L30+8
	ldr	r2, .L30+12
	ldr	r1, [fp, #-132]
	ldr	r0, [fp, #-128]
	bl	getopt_long
	str	r0, [fp, #-88]
	ldr	r3, [fp, #-88]
	cmn	r3, #1
	bne	.L8
	ldr	r3, .L30+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	getenv
	str	r0, [fp, #-108]
	ldr	r3, [fp, #-108]
	cmp	r3, #0
	beq	.L9
	b	.L10
.L8:
	ldr	r3, [fp, #-88]
	sub	r3, r3, #104
	cmp	r3, #7
	ldrls	pc, [pc, r3, asl #2]
	b	.L11
.L13:
	.word	.L16
	.word	.L15
	.word	.L11
	.word	.L14
	.word	.L11
	.word	.L11
	.word	.L11
	.word	.L12
.L16:
	ldr	r1, [fp, #-92]
	ldr	r0, .L30+20
	bl	printf
	mov	r0, #0
	bl	exit
.L15:
	ldr	r3, .L30+24
	ldr	r3, [r3]
	str	r3, [fp, #-120]
	b	.L17
.L12:
	ldr	r3, .L30+24
	ldr	r3, [r3]
	str	r3, [fp, #-116]
	b	.L17
.L14:
	ldr	r3, .L30+24
	ldr	r3, [r3]
	str	r3, [fp, #-112]
	b	.L17
.L11:
	ldr	r3, .L30+28
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, [fp, #-92]
	bl	fputs
	mov	r0, #1
	bl	exit
.L17:
	b	.L18
.L9:
	ldr	r3, [fp, #-112]
	cmp	r3, #0
	bne	.L19
	ldr	r3, .L30+28
	ldr	r3, [r3]
	ldr	r2, .L30+16
	ldr	r2, [r2]
	ldr	r1, .L30+32
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L19:
	sub	r3, fp, #80
	mov	r2, #64
	mov	r1, r3
	ldr	r0, [fp, #-112]
	bl	get_key_from_file
	str	r0, [fp, #-108]
	ldr	r3, [fp, #-108]
	cmp	r3, #0
	bne	.L10
	mov	r0, #4
	bl	exit
.L10:
	ldr	r3, [fp, #-120]
	cmp	r3, #0
	bne	.L20
	ldr	r3, .L30+36
	ldr	r3, [r3]
	str	r3, [fp, #-100]
	b	.L21
.L20:
	ldr	r1, .L30+40
	ldr	r0, [fp, #-120]
	bl	fopen
	str	r0, [fp, #-100]
	ldr	r3, [fp, #-100]
	cmp	r3, #0
	bne	.L21
	ldr	r3, .L30+28
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L30+44
	mov	r0, r4
	bl	fprintf
	mov	r0, #2
	bl	exit
.L21:
	ldr	r3, [fp, #-116]
	cmp	r3, #0
	bne	.L22
	ldr	r3, .L30+48
	ldr	r3, [r3]
	str	r3, [fp, #-96]
	b	.L23
.L22:
	ldr	r1, .L30+52
	ldr	r0, [fp, #-116]
	bl	fopen
	str	r0, [fp, #-96]
	ldr	r3, [fp, #-96]
	cmp	r3, #0
	bne	.L23
	ldr	r3, .L30+28
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L30+56
	mov	r0, r4
	bl	fprintf
	mov	r0, #3
	bl	exit
.L23:
	ldr	r3, [fp, #-100]
	cmp	r3, #0
	beq	.L24
	ldr	r3, [fp, #-96]
	cmp	r3, #0
	beq	.L25
	b	.L26
.L27:
	ldr	r4, [fp, #-104]
	ldr	r0, [fp, #-108]
	bl	strlen
	mov	r3, r0
	mov	r1, r3
	mov	r0, r4
	bl	__aeabi_uidivmod
	mov	r3, r1
	mov	r2, r3
	ldr	r3, [fp, #-108]
	add	r3, r3, r2
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, [fp, #-84]
	eor	r3, r3, r2
	ldr	r1, [fp, #-96]
	mov	r0, r3
	bl	fputc
	ldr	r3, [fp, #-104]
	add	r3, r3, #1
	str	r3, [fp, #-104]
.L26:
	ldr	r0, [fp, #-100]
	bl	fgetc
	str	r0, [fp, #-84]
	ldr	r3, [fp, #-84]
	cmn	r3, #1
	bne	.L27
	ldr	r0, [fp, #-96]
	bl	fclose
.L25:
	ldr	r0, [fp, #-100]
	bl	fclose
.L24:
	mov	r3, #0
	ldr	r2, .L30
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L29
	bl	__stack_chk_fail
.L29:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L31:
	.align	2
.L30:
	.word	.LC11
	.word	.LC4
	.word	long_options.5343
	.word	.LC5
	.word	ENVIRONMENT_KEY_VAR
	.word	.LC6
	.word	optarg
	.word	stderr
	.word	.LC7
	.word	stdin
	.word	.LC1
	.word	.LC8
	.word	stdout
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.section	.rodata
	.align	2
.LC12:
	.ascii	"help\000"
	.align	2
.LC13:
	.ascii	"in-file\000"
	.align	2
.LC14:
	.ascii	"out-file\000"
	.align	2
.LC15:
	.ascii	"key-file\000"
	.align	2
	.type	long_options.5343, %object
	.size	long_options.5343, 80
long_options.5343:
	.word	.LC12
	.word	0
	.word	0
	.word	104
	.word	.LC13
	.word	1
	.word	0
	.word	105
	.word	.LC14
	.word	1
	.word	0
	.word	111
	.word	.LC15
	.word	1
	.word	0
	.word	107
	.word	0
	.word	0
	.word	0
	.word	0
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
