	.file	"659406.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage:%s dest_file src_file.\n"
.LC1:
	.string	"a+"
.LC2:
	.string	"Can't open %s\n"
.LC3:
	.string	"Can't create dest buffer\n"
.LC4:
	.string	"r"
.LC5:
	.string	"Can't create input buffer\n"
.LC6:
	.string	"Error in reading file %s.\n"
.LC7:
	.string	"File %s appended.\n"
.LC8:
	.string	"Next file %s:\n"
.LC9:
	.string	"No more file to appended."
	.align 8
.LC10:
	.string	"Done appending, and %d files appended.\n"
.LC11:
	.string	"%s contents:\n"
.LC12:
	.string	"Done displaying"
	.text
	.globl	main
	.type	main, @function
main:
.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, 240
	mov	DWORD PTR -228[rbp], edi
	mov	QWORD PTR -240[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -216[rbp], 0
	cmp	DWORD PTR -228[rbp], 2
	jg	.L2
	mov	rax, QWORD PTR -240[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -240[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -208[rbp], rax
	cmp	QWORD PTR -208[rbp], 0
	jne	.L3
	mov	rax, QWORD PTR -240[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -208[rbp]
	mov	ecx, 4096
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	setvbuf@PLT
	test	eax, eax
	je	.L4
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 25
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	eax, DWORD PTR -228[rbp]
	sub	eax, 2
	mov	DWORD PTR -216[rbp], eax
	jmp	.L5
.L11:
	mov	eax, DWORD PTR -228[rbp]
	sub	eax, DWORD PTR -216[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -240[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -200[rbp], rax
	cmp	QWORD PTR -200[rbp], 0
	jne	.L6
	mov	eax, DWORD PTR -228[rbp]
	sub	eax, DWORD PTR -216[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -240[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L5
.L6:
	mov	rax, QWORD PTR -200[rbp]
	mov	ecx, 4096
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	setvbuf@PLT
	test	eax, eax
	je	.L7
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	jmp	.L5
.L7:
	mov	rdx, QWORD PTR -208[rbp]
	mov	rax, QWORD PTR -200[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	append
	mov	rax, QWORD PTR -200[rbp]
	mov	rdi, rax
	call	ferror@PLT
	test	eax, eax
	je	.L8
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -96[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L8:
	mov	rax, QWORD PTR -208[rbp]
	mov	rdi, rax
	call	ferror@PLT
	test	eax, eax
	je	.L9
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -192[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L9:
	mov	rax, QWORD PTR -200[rbp]
	mov	rdi, rax
	call	fclose@PLT
	lea	rax, -96[rbp]
	mov	rsi, rax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	DWORD PTR -216[rbp], 0
	jle	.L10
	sub	DWORD PTR -216[rbp], 1
	mov	eax, DWORD PTR -228[rbp]
	sub	eax, DWORD PTR -216[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -240[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L5
.L10:
	lea	rdi, .LC9[rip]
	call	puts@PLT
.L5:
	cmp	DWORD PTR -216[rbp], 0
	jg	.L11
	mov	eax, DWORD PTR -228[rbp]
	sub	eax, 2
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -208[rbp]
	mov	rdi, rax
	call	rewind@PLT
	lea	rax, -192[rbp]
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L12
.L13:
	mov	eax, DWORD PTR -212[rbp]
	mov	edi, eax
	call	putchar@PLT
.L12:
	mov	rax, QWORD PTR -208[rbp]
	mov	rdi, rax
	call	getc@PLT
	mov	DWORD PTR -212[rbp], eax
	cmp	DWORD PTR -212[rbp], -1
	jne	.L13
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -208[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	append
	.type	append, @function
append:
.LFB7:
	.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	QWORD PTR -32[rbp], rsi
	jmp	.L17
.L18:
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rdx
	mov	rdx, rax
	mov	esi, 1
	lea	rdi, temp.0[rip]
	call	fwrite@PLT
.L17:
	mov	rax, QWORD PTR -24[rbp]
	mov	rcx, rax
	mov	edx, 4096
	mov	esi, 1
	lea	rdi, temp.0[rip]
	call	fread@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L18
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	append, .-append
	.local	temp.0
	.comm	temp.0,4096,32
	.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	"659406.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage:%s dest_file src_file.\012\000"
	.align	2
.LC1:
	.ascii	"a+\000"
	.align	2
.LC2:
	.ascii	"Can't open %s\012\000"
	.align	2
.LC3:
	.ascii	"Can't create dest buffer\012\000"
	.align	2
.LC4:
	.ascii	"r\000"
	.align	2
.LC5:
	.ascii	"Can't create input buffer\012\000"
	.align	2
.LC6:
	.ascii	"Error in reading file %s.\012\000"
	.align	2
.LC7:
	.ascii	"File %s appended.\012\000"
	.align	2
.LC8:
	.ascii	"Next file %s:\012\000"
	.align	2
.LC9:
	.ascii	"No more file to appended.\000"
	.align	2
.LC10:
	.ascii	"Done appending, and %d files appended.\012\000"
	.align	2
.LC11:
	.ascii	"%s contents:\012\000"
	.align	2
.LC12:
	.ascii	"Done displaying\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 200
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #200
	str	r0, [fp, #-200]
	str	r1, [fp, #-204]
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-192]
	ldr	r3, [fp, #-200]
	cmp	r3, #2
	bgt	.L2
	ldr	r3, .L16+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-204]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L16+8
	bl	fprintf
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-204]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L16+12
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-188]
	ldr	r3, [fp, #-188]
	cmp	r3, #0
	bne	.L3
	ldr	r3, .L16+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-204]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L16+16
	bl	fprintf
	mov	r0, #1
	bl	exit
.L3:
	mov	r3, #4096
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-188]
	bl	setvbuf
	mov	r3, r0
	cmp	r3, #0
	beq	.L4
	ldr	r3, .L16+4
	ldr	r3, [r3]
	mov	r2, #25
	mov	r1, #1
	ldr	r0, .L16+20
	bl	fwrite
	mov	r0, #1
	bl	exit
.L4:
	ldr	r3, [fp, #-200]
	sub	r3, r3, #2
	str	r3, [fp, #-192]
	b	.L5
.L11:
	ldr	r2, [fp, #-200]
	ldr	r3, [fp, #-192]
	sub	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-204]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L16+24
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-180]
	ldr	r3, [fp, #-180]
	cmp	r3, #0
	bne	.L6
	ldr	r3, .L16+4
	ldr	r0, [r3]
	ldr	r2, [fp, #-200]
	ldr	r3, [fp, #-192]
	sub	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-204]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L16+16
	bl	fprintf
	b	.L5
.L6:
	mov	r3, #4096
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-180]
	bl	setvbuf
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	ldr	r3, .L16+4
	ldr	r3, [r3]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L16+28
	bl	fwrite
	b	.L5
.L7:
	ldr	r1, [fp, #-188]
	ldr	r0, [fp, #-180]
	bl	append
	ldr	r0, [fp, #-180]
	bl	ferror
	mov	r3, r0
	cmp	r3, #0
	beq	.L8
	ldr	r3, .L16+4
	ldr	r3, [r3]
	sub	r2, fp, #92
	ldr	r1, .L16+32
	mov	r0, r3
	bl	fprintf
.L8:
	ldr	r0, [fp, #-188]
	bl	ferror
	mov	r3, r0
	cmp	r3, #0
	beq	.L9
	ldr	r3, .L16+4
	ldr	r3, [r3]
	sub	r2, fp, #176
	ldr	r1, .L16+32
	mov	r0, r3
	bl	fprintf
.L9:
	ldr	r0, [fp, #-180]
	bl	fclose
	sub	r3, fp, #92
	mov	r1, r3
	ldr	r0, .L16+36
	bl	printf
	ldr	r3, [fp, #-192]
	cmp	r3, #0
	ble	.L10
	ldr	r3, [fp, #-192]
	sub	r3, r3, #1
	str	r3, [fp, #-192]
	ldr	r2, [fp, #-200]
	ldr	r3, [fp, #-192]
	sub	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-204]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L16+40
	bl	printf
	b	.L5
.L10:
	ldr	r0, .L16+44
	bl	puts
.L5:
	ldr	r3, [fp, #-192]
	cmp	r3, #0
	bgt	.L11
	ldr	r3, [fp, #-200]
	sub	r3, r3, #2
	mov	r1, r3
	ldr	r0, .L16+48
	bl	printf
	ldr	r0, [fp, #-188]
	bl	rewind
	sub	r3, fp, #176
	mov	r1, r3
	ldr	r0, .L16+52
	bl	printf
	b	.L12
.L13:
	ldr	r0, [fp, #-184]
	bl	putchar
.L12:
	ldr	r0, [fp, #-188]
	bl	getc
	str	r0, [fp, #-184]
	ldr	r3, [fp, #-184]
	cmn	r3, #1
	bne	.L13
	ldr	r0, .L16+56
	bl	puts
	ldr	r0, [fp, #-188]
	bl	fclose
	mov	r3, #0
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC13
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.align	2
	.global	append
	.syntax unified
	.arm
	.fpu softvfp
	.type	append, %function
append:
	@ 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]
	b	.L19
.L20:
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-8]
	mov	r1, #1
	ldr	r0, .L21
	bl	fwrite
.L19:
	ldr	r3, [fp, #-16]
	mov	r2, #4096
	mov	r1, #1
	ldr	r0, .L21
	bl	fread
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L20
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	temp.5319
	.size	append, .-append
	.local	temp.5319
	.comm	temp.5319,4096,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
