	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %rax
	movq	%rdi, %r14
	movq	_O_RDONLY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	xorl	%eax, %eax
	callq	_open
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	testb	$73, %bl
	movl	$438, %eax                      ## imm = 0x1B6
	movl	$511, %edx                      ## imm = 0x1FF
	cmovel	%eax, %edx
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_O_EXCL@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_open
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_copy_fd
	movl	%eax, %r12d
	cmpl	$129, %eax
	je	LBB0_5
## %bb.6:
	cmpl	$128, %r12d
	jne	LBB0_9
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_8
LBB0_1:
	movl	%r15d, %ebx
	jmp	LBB0_13
LBB0_3:
	movl	%r15d, %edi
	callq	_close
	jmp	LBB0_13
LBB0_5:
	leaq	L_.str(%rip), %rdi
LBB0_8:
	xorl	%eax, %eax
	callq	_error_errno
LBB0_9:
	movl	%r15d, %edi
	callq	_close
	movl	%ebx, %edi
	callq	_close
	testq	%rax, %rax
	je	LBB0_10
## %bb.14:
	leaq	L_.str.2(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_error_errno                    ## TAILCALL
LBB0_10:
	testl	%r12d, %r12d
	jne	LBB0_12
## %bb.11:
	movq	%r14, %rdi
	callq	_adjust_shared_perm
	movl	$-1, %ebx
	testq	%rax, %rax
	jne	LBB0_13
LBB0_12:
	movl	%r12d, %ebx
LBB0_13:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_EXCL,4,2                     ## @O_EXCL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"copy-fd: read returned"

L_.str.1:                               ## @.str.1
	.asciz	"copy-fd: write returned"

L_.str.2:                               ## @.str.2
	.asciz	"%s: close error"

.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:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x2
	mov	x8, x1
	mov	x19, x0
Lloh0:
	adrp	x9, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _O_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	mov	x0, x8
	bl	_open
	mov	x20, x0
	tbnz	w0, #31, LBB0_5
; %bb.1:
Lloh3:
	adrp	x8, _O_WRONLY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _O_WRONLY@GOTPAGEOFF]
Lloh5:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _O_EXCL@GOTPAGE
Lloh10:
	ldr	x9, [x9, _O_EXCL@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	w8, #73
	tst	w21, w8
	mov	w8, #511
	mov	w9, #438
	csel	x8, x9, x8, eq
	str	x8, [sp]
	mov	x0, x19
	bl	_open
	mov	x22, x0
	tbnz	w0, #31, LBB0_6
; %bb.2:
	mov	x0, x20
	mov	x1, x22
	bl	_copy_fd
	mov	x21, x0
	cmp	w0, #129
	b.eq	LBB0_7
; %bb.3:
	cmp	w21, #128
	b.ne	LBB0_9
; %bb.4:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_5:
	mov	x21, x20
	b	LBB0_14
LBB0_6:
	mov	x0, x20
	bl	_close
	mov	x21, x22
	b	LBB0_14
LBB0_7:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
LBB0_8:
	bl	_error_errno
LBB0_9:
	mov	x0, x20
	bl	_close
	mov	x0, x22
	bl	_close
	cbz	x0, LBB0_11
; %bb.10:
	str	x19, [sp]
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_error_errno
	b	LBB0_15
LBB0_11:
	cbnz	w21, LBB0_14
; %bb.12:
	mov	x0, x19
	bl	_adjust_shared_perm
	cbz	x0, LBB0_14
; %bb.13:
	mov	w21, #-1
LBB0_14:
	mov	x0, x21
LBB0_15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_EXCL,4,2                     ; @O_EXCL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"copy-fd: read returned"

l_.str.1:                               ; @.str.1
	.asciz	"copy-fd: write returned"

l_.str.2:                               ; @.str.2
	.asciz	"%s: close error"

.subsections_via_symbols
