	.file	"extr_util.c_copy_file.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"internal error, can't reopen %s"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"write to %s failed"
	.text
	.p2align 4
	.globl	copy_file
	.type	copy_file, @function
copy_file:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	edx, 438
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rsi
	mov	esi, DWORD PTR O_CREAT[rip]
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	or	esi, DWORD PTR O_TRUNC[rip]
	mov	rdi, r13
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	or	esi, DWORD PTR O_WRONLY[rip]
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	open@PLT
	test	eax, eax
	js	.L7
	mov	esi, DWORD PTR O_RDONLY[rip]
	xor	edx, edx
	mov	rdi, r14
	mov	r12d, eax
	call	open@PLT
	mov	ebp, eax
	test	eax, eax
	js	.L11
.L3:
	lea	r14, .LC1[rip]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	mov	esi, DWORD PTR buf[rip]
	mov	rdx, rbx
	mov	edi, r12d
	call	write@PLT
	cmp	rax, rbx
	jne	.L12
.L5:
	mov	edx, DWORD PTR buf_size[rip]
	mov	esi, DWORD PTR buf[rip]
	mov	edi, ebp
	call	read@PLT
	mov	rbx, rax
	test	rax, rax
	jg	.L6
	mov	edi, ebp
	call	close@PLT
	mov	edi, r12d
	call	close@PLT
	xor	eax, eax
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	rsi, r13
	mov	rdi, r14
	call	pfatal@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rsi, r14
	lea	rdi, .LC0[rip]
	call	pfatal@PLT
	jmp	.L3
.L7:
	mov	eax, -1
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	copy_file, .-copy_file
	.comm	buf_size,4,4
	.comm	buf,4,4
	.comm	O_WRONLY,4,4
	.comm	O_TRUNC,4,4
	.comm	O_RDONLY,4,4
	.comm	O_CREAT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_util.c_copy_file.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"internal error, can't reopen %s\000"
	.align	2
.LC1:
	.ascii	"write to %s failed\000"
	.text
	.align	2
	.global	copy_file
	.syntax unified
	.arm
	.fpu softvfp
	.type	copy_file, %function
copy_file:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r9, r1
	ldr	r3, .L13
	ldr	r2, .L13+4
	ldr	r1, .L13+8
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r1, [r1]
	orr	r3, r3, r2
	mov	r4, r0
	ldr	r2, .L13+12
	mov	r0, r9
	orr	r1, r3, r1
	bl	open
	subs	r7, r0, #0
	blt	.L7
	ldr	r3, .L13+16
	mov	r2, #0
	mov	r0, r4
	ldr	r1, [r3]
	bl	open
	subs	r6, r0, #0
	blt	.L11
.L3:
	ldr	r8, .L13+20
	ldr	r5, .L13+24
	ldr	r10, .L13+28
	b	.L5
.L6:
	mov	r2, r4
	mov	r0, r7
	ldr	r1, [r5]
	bl	write
	cmp	r0, r4
	bne	.L12
.L5:
	mov	r0, r6
	ldr	r2, [r8]
	ldr	r1, [r5]
	bl	read
	subs	r4, r0, #0
	bgt	.L6
	mov	r0, r6
	bl	close
	mov	r0, r7
	bl	close
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L12:
	mov	r1, r9
	mov	r0, r10
	bl	pfatal
	b	.L5
.L11:
	mov	r1, r4
	ldr	r0, .L13+32
	bl	pfatal
	b	.L3
.L7:
	mvn	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L14:
	.align	2
.L13:
	.word	O_CREAT
	.word	O_TRUNC
	.word	O_WRONLY
	.word	438
	.word	O_RDONLY
	.word	buf_size
	.word	buf
	.word	.LC1
	.word	.LC0
	.size	copy_file, .-copy_file
	.comm	buf_size,4,4
	.comm	buf,4,4
	.comm	O_WRONLY,4,4
	.comm	O_TRUNC,4,4
	.comm	O_RDONLY,4,4
	.comm	O_CREAT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
