	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_copy_reference_file            ## -- Begin function copy_reference_file
	.p2align	4, 0x90
_copy_reference_file:                   ## @copy_reference_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
	subq	$1040, %rsp                     ## imm = 0x410
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_refdir@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str(%rip), %rsi
	leaq	-1072(%rbp), %rbx
	movq	%rbx, %rdi
	movq	%r14, %rcx
	callq	_sprintf
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_fopen
	movq	%rax, %r15
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rsi
	callq	_failure
	xorl	%edi, %edi
	testq	%r15, %r15
	setne	%dil
	callq	_assert
	testq	%r15, %r15
	je	LBB0_6
## %bb.1:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_fopen
	movq	%rax, %r14
	leaq	-1072(%rbp), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1024, %edx                     ## imm = 0x400
	movq	%r15, %rcx
	callq	_fread
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rbx
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%rax, %rdx
	movq	%r14, %rcx
	callq	_fwrite
	cmpq	%rbx, %rax
	je	LBB0_2
## %bb.4:
	leaq	L_.str.4(%rip), %rdi
	callq	_logprintf
LBB0_5:
	movq	%r14, %rdi
	callq	_fclose
	movq	%r15, %rdi
	callq	_fclose
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	addq	$1040, %rsp                     ## imm = 0x410
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/%s"

	.comm	_refdir,8,3                     ## @refdir
L_.str.1:                               ## @.str.1
	.asciz	"rb"

L_.str.2:                               ## @.str.2
	.asciz	"Couldn't open reference file %s"

L_.str.3:                               ## @.str.3
	.asciz	"wb"

L_.str.4:                               ## @.str.4
	.asciz	"Error: fwrite\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_copy_reference_file            ; -- Begin function copy_reference_file
	.p2align	2
_copy_reference_file:                   ; @copy_reference_file
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	sub	sp, sp, #1040
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x8, _refdir@GOTPAGE
Lloh4:
	ldr	x8, [x8, _refdir@GOTPAGEOFF]
Lloh5:
	ldr	x2, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #8
	mov	x3, x20
	bl	_sprintf
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #8
	bl	_fopen
	mov	x19, x0
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	add	x1, sp, #8
	bl	_failure
	cmp	x19, #0
	cset	w0, ne
	bl	_assert
	cbz	x19, LBB0_6
; %bb.1:
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_fopen
	mov	x20, x0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #8
	mov	w1, #1
	mov	w2, #1024
	mov	x3, x19
	bl	_fread
	cbz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x21, x0
	add	x0, sp, #8
	mov	w1, #1
	mov	x2, x21
	mov	x3, x20
	bl	_fwrite
	cmp	x0, x21
	b.eq	LBB0_2
; %bb.4:
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_logprintf
LBB0_5:
	mov	x0, x20
	bl	_fclose
	mov	x0, x19
	bl	_fclose
LBB0_6:
	ldur	x8, [x29, #-40]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	add	sp, sp, #1040
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/%s"

	.comm	_refdir,8,3                     ; @refdir
l_.str.1:                               ; @.str.1
	.asciz	"rb"

l_.str.2:                               ; @.str.2
	.asciz	"Couldn't open reference file %s"

l_.str.3:                               ; @.str.3
	.asciz	"wb"

l_.str.4:                               ; @.str.4
	.asciz	"Error: fwrite\n"

.subsections_via_symbols
