	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_out_file                 ## -- Begin function write_out_file
	.p2align	4, 0x90
_write_out_file:                        ## @write_out_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_FILE_BUF_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	movq	%r14, %rdx
	movq	%r13, %rcx
	callq	_DBG
	movq	_errno@GOTPCREL(%rip), %r12
	movq	$0, (%r12)
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_fopen
	cmpq	$0, (%r12)
	je	LBB0_2
## %bb.1:
	leaq	L_.str.2(%rip), %rdi
	movq	%r14, %rsi
	callq	_ERRS
	movl	$-1, %ebx
	jmp	LBB0_12
LBB0_2:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	testq	%r13, %r13
	je	LBB0_7
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rbx, %r13
	cmovbq	%r13, %rbx
	movq	$0, (%r12)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	movq	%rax, %r14
	movq	%rax, %rcx
	callq	_fread
	cmpq	$0, (%r12)
	jne	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	movq	%rbx, %rdx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	callq	_write_out_data
	testl	%eax, %eax
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	subq	%rbx, %r13
	movq	%r14, %rax
	jne	LBB0_3
LBB0_7:
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_8:
	leaq	L_.str.3(%rip), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_ERRS
	movl	$-1, %ebx
	jmp	LBB0_10
LBB0_9:
	movl	%eax, %ebx
LBB0_10:
	movq	%r14, %rax
LBB0_11:
	movq	%rax, %rdi
	callq	_fclose
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_FILE_BUF_LEN,4,2               ## @FILE_BUF_LEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"writing out file, name=%s, len=%zu"

	.comm	_errno,8,3                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"r"

L_.str.2:                               ## @.str.2
	.asciz	"unable to open file: %s"

L_.str.3:                               ## @.str.3
	.asciz	"unable to read from file: %s"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_out_file                 ; -- Begin function write_out_file
	.p2align	2
_write_out_file:                        ; @write_out_file
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x20, x3
	mov	x21, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _FILE_BUF_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FILE_BUF_LEN@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
	mov	x9, x23
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x23, #15
	and	x9, x9, #0x1fffffff0
	sub	x25, x8, x9
	mov	sp, x25
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	mov	x2, x19
	mov	x3, x21
	bl	_DBG
Lloh10:
	adrp	x27, _errno@GOTPAGE
Lloh11:
	ldr	x27, [x27, _errno@GOTPAGEOFF]
	str	xzr, [x27]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_fopen
	ldr	x8, [x27]
	cbz	x8, LBB0_2
; %bb.1:
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_ERRS
	mov	w26, #-1
	b	LBB0_10
LBB0_2:
	mov	x24, x0
	cbz	x21, LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x21, x23
	csel	x23, x21, x23, lo
	str	xzr, [x27]
	mov	x0, x25
	mov	x1, x23
	mov	w2, #1
	mov	x3, x24
	bl	_fread
	ldr	x8, [x27]
	cbnz	x8, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x22
	mov	x1, x25
	mov	x2, x23
	mov	x3, x20
	bl	_write_out_data
	cbnz	w0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	subs	x21, x21, x23
	b.ne	LBB0_3
LBB0_6:
	mov	w26, #0
	b	LBB0_9
LBB0_7:
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_ERRS
	mov	w26, #-1
	b	LBB0_9
LBB0_8:
	mov	x26, x0
LBB0_9:
	mov	x0, x24
	bl	_fclose
LBB0_10:
	ldur	x8, [x29, #-88]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	mov	x0, x26
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_FILE_BUF_LEN,4,2               ; @FILE_BUF_LEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"writing out file, name=%s, len=%zu"

	.comm	_errno,8,3                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"r"

l_.str.2:                               ; @.str.2
	.asciz	"unable to open file: %s"

l_.str.3:                               ; @.str.3
	.asciz	"unable to read from file: %s"

.subsections_via_symbols
