	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_elftc_copyfile                 ## -- Begin function elftc_copyfile
	.p2align	4, 0x90
_elftc_copyfile:                        ## @elftc_copyfile
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movl	%edi, %r12d
	leaq	-56(%rbp), %rsi
	callq	_fstat
	movl	$-1, %r13d
	testq	%rax, %rax
	js	LBB0_13
## %bb.1:
	movq	-56(%rbp), %r14
	testq	%r14, %r14
	je	LBB0_2
## %bb.3:
	movq	%r14, %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_13
## %bb.4:
	movq	%r14, %r13
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rbx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	_read
	testq	%rax, %rax
	js	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	addq	%rax, %rbx
	subq	%rax, %r13
	jne	LBB0_5
## %bb.8:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_write
	testq	%rax, %rax
	jle	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	subq	%rax, %r14
	addq	%rax, %rbx
	testq	%r14, %r14
	jne	LBB0_9
LBB0_11:
	xorl	%r13d, %r13d
	testq	%rax, %rax
	setle	%r13b
	negl	%r13d
	jmp	LBB0_12
LBB0_2:
	xorl	%r13d, %r13d
	jmp	LBB0_13
LBB0_6:
	movl	$-1, %r13d
LBB0_12:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_free
LBB0_13:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_PROT_READ,4,2                  ## @PROT_READ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_elftc_copyfile                 ; -- Begin function elftc_copyfile
	.p2align	2
_elftc_copyfile:                        ; @elftc_copyfile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x1
	mov	x22, x0
	add	x1, sp, #8
	bl	_fstat
	tbnz	x0, #63, LBB0_10
; %bb.1:
	ldr	x21, [sp, #8]
	cbz	x21, LBB0_11
; %bb.2:
	mov	x0, x21
	bl	_malloc
	cbz	x0, LBB0_10
; %bb.3:
	mov	x20, x0
	mov	x23, x21
	mov	x24, x0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x24
	mov	x2, x23
	bl	_read
	tbnz	x0, #63, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, x0
	subs	x23, x23, x0
	b.ne	LBB0_4
; %bb.6:
	mov	x22, x20
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_write
	cmp	x0, #1
	b.lt	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x22, x22, x0
	sub	x21, x21, x0
	cbnz	x21, LBB0_7
LBB0_9:
	cmp	x0, #1
	csetm	w19, lt
	b	LBB0_13
LBB0_10:
	mov	w19, #-1
	b	LBB0_14
LBB0_11:
	mov	w19, #0
	b	LBB0_14
LBB0_12:
	mov	w19, #-1
LBB0_13:
	mov	x0, x20
	bl	_free
LBB0_14:
	mov	x0, x19
	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
	add	sp, sp, #80
	ret
	.cfi_endproc
                                        ; -- End function
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_PROT_READ,4,2                  ; @PROT_READ
.subsections_via_symbols
