	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_file
_write_file:                            ## @write_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAX_ENTRY_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r13, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movl	$0, -52(%rbp)
	movq	_W_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	__nc_access
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_fopen
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_2
LBB0_3:
	movl	$1, %edi
	movq	%r15, %rsi
	callq	_DEBUG
	leaq	-52(%rbp), %rdx
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%r13d, %ecx
	callq	_write_object
	movq	_ERR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.4:
	movl	-52(%rbp), %edx
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rcx
	callq	_fwrite
	cmpl	-52(%rbp), %eax
	je	LBB0_6
LBB0_5:
	xorl	%edi, %edi
	callq	__nc_tic_dir
	leaq	L_.str.3(%rip), %rdi
	movl	%eax, %esi
	movq	%r15, %rdx
	callq	__nc_syserr_abort
LBB0_6:
	movq	%rbx, %rdi
	callq	_fclose
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r15, %rdi
	callq	_write_file.cold.1
	xorl	%ebx, %ebx
	jmp	LBB0_3
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function write_file.cold.1
_write_file.cold.1:                     ## @write_file.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	callq	_perror
	xorl	%edi, %edi
	callq	__nc_tic_dir
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	movq	%rbx, %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	__nc_syserr_abort               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_ENTRY_SIZE,4,2             ## @MAX_ENTRY_SIZE
	.comm	_W_OK,4,2                       ## @W_OK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wb"

L_.str.1:                               ## @.str.1
	.asciz	"can't open %s/%s"

	.comm	_ERR,8,3                        ## @ERR
L_.str.3:                               ## @.str.3
	.asciz	"error writing %s/%s"

	.no_dead_strip	_write_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_file
_write_file:                            ; @write_file
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #16
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _MAX_ENTRY_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_ENTRY_SIZE@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	x20, x8, x9
	mov	sp, x20
	stur	wzr, [x29, #-60]
Lloh8:
	adrp	x8, _W_OK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _W_OK@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	__nc_access
	cbnz	x0, LBB0_7
; %bb.1:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_fopen
	mov	x22, x0
	cbz	x0, LBB0_7
LBB0_2:
	mov	w0, #1
	mov	x1, x19
	bl	_DEBUG
	sub	x2, x29, #60
	mov	x0, x21
	mov	x1, x20
	mov	x3, x23
	bl	_write_object
Lloh13:
	adrp	x8, _ERR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ERR@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_4
; %bb.3:
	ldur	w2, [x29, #-60]
	mov	x0, x20
	mov	w1, #1
	mov	x3, x22
	bl	_fwrite
	ldur	w8, [x29, #-60]
	cmp	w0, w8
	b.eq	LBB0_5
LBB0_4:
	mov	w0, #0
	bl	__nc_tic_dir
	mov	x1, x0
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x2, x19
	bl	__nc_syserr_abort
LBB0_5:
	mov	x0, x22
	bl	_fclose
	ldur	x8, [x29, #-56]
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_8
; %bb.6:
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	x0, x19
	bl	_write_file.cold.1
	mov	x22, #0
	b	LBB0_2
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function write_file.cold.1
_write_file.cold.1:                     ; @write_file.cold.1
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_perror
	mov	w0, #0
	bl	__nc_tic_dir
	mov	x1, x0
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	__nc_syserr_abort
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_ENTRY_SIZE,4,2             ; @MAX_ENTRY_SIZE
	.comm	_W_OK,4,2                       ; @W_OK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wb"

l_.str.1:                               ; @.str.1
	.asciz	"can't open %s/%s"

	.comm	_ERR,8,3                        ; @ERR
l_.str.3:                               ; @.str.3
	.asciz	"error writing %s/%s"

	.no_dead_strip	_write_file
.subsections_via_symbols
