	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_copy_file                      ## -- Begin function copy_file
	.p2align	4, 0x90
_copy_file:                             ## @copy_file
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movq	_O_TRUNC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	movq	%rdi, %r12
	movq	_O_WRONLY@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	movl	%eax, %esi
	movl	$438, %edx                      ## imm = 0x1B6
	callq	_open
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	%eax, %r15d
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_open
	movl	%eax, %r13d
	testl	%eax, %eax
	jns	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	callq	_pfatal
LBB0_4:
	movq	_buf@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_buf_size@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movl	%r13d, %edi
	callq	_read
	testq	%rax, %rax
	jle	LBB0_9
## %bb.5:
	movq	%rax, %rbx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	(%r12), %esi
	movl	(%r14), %edx
	movl	%r13d, %edi
	callq	_read
	movq	%rax, %rbx
	testq	%rax, %rax
	jle	LBB0_9
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movl	%r15d, %edi
	movq	%rbx, %rdx
	callq	_write
	cmpq	%rbx, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	leaq	L_.str.1(%rip), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_pfatal
	jmp	LBB0_8
LBB0_9:
	movl	%r13d, %edi
	callq	_close
	movl	%r15d, %edi
	callq	_close
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_1:
	movl	$-1, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_TRUNC,4,2                    ## @O_TRUNC
	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"internal error, can't reopen %s"

	.comm	_buf,4,2                        ## @buf
	.comm	_buf_size,4,2                   ## @buf_size
L_.str.1:                               ## @.str.1
	.asciz	"write to %s failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_copy_file                      ; -- Begin function copy_file
	.p2align	2
_copy_file:                             ; @copy_file
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _O_CREAT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_CREAT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _O_TRUNC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _O_TRUNC@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _O_WRONLY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _O_WRONLY@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	x0, x19
	mov	w2, #438
	bl	_open
	tbnz	w0, #31, LBB0_9
; %bb.1:
	mov	x20, x0
Lloh9:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x22
	mov	w2, #0
	bl	_open
	mov	x21, x0
	tbz	w0, #31, LBB0_3
; %bb.2:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_pfatal
LBB0_3:
Lloh14:
	adrp	x24, _buf@GOTPAGE
Lloh15:
	ldr	x24, [x24, _buf@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh16:
	adrp	x25, _buf_size@GOTPAGE
Lloh17:
	ldr	x25, [x25, _buf_size@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x0, x21
	bl	_read
	cmp	x0, #1
	b.lt	LBB0_8
; %bb.4:
	mov	x23, x0
Lloh18:
	adrp	x22, l_.str.1@PAGE
Lloh19:
	add	x22, x22, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x24]
	ldr	w2, [x25]
	mov	x0, x21
	bl	_read
	mov	x23, x0
	cmp	x0, #0
	b.le	LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x24]
	mov	x0, x20
	mov	x2, x23
	bl	_write
	cmp	x0, x23
	b.eq	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x22
	mov	x1, x19
	bl	_pfatal
	b	LBB0_5
LBB0_8:
	mov	x0, x21
	bl	_close
	mov	x0, x20
	bl	_close
	mov	w0, #0
	b	LBB0_10
LBB0_9:
	mov	w0, #-1
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_TRUNC,4,2                    ; @O_TRUNC
	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"internal error, can't reopen %s"

	.comm	_buf,4,2                        ; @buf
	.comm	_buf_size,4,2                   ; @buf_size
l_.str.1:                               ; @.str.1
	.asciz	"write to %s failed"

.subsections_via_symbols
