	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function writefile
_writefile:                             ## @writefile
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %r15
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.2:
	addq	$8, %rbx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rsi
	callq	_fputs
	testq	%rax, %rax
	js	LBB0_4
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-8(%rbx), %rdi
	callq	_free
	movq	(%rbx), %rdi
	addq	$8, %rbx
	testq	%rdi, %rdi
	jne	LBB0_3
LBB0_8:
	movq	%r15, %rdi
	callq	_fclose
	testq	%rax, %rax
	jne	LBB0_4
## %bb.9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
LBB0_6:
	movq	%r14, %rsi
	callq	_pg_log_error
	movl	$1, %edi
	callq	_exit
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"w"

L_.str.1:                               ## @.str.1
	.asciz	"could not open file \"%s\" for writing: %m"

L_.str.2:                               ## @.str.2
	.asciz	"could not write file \"%s\": %m"

	.no_dead_strip	_writefile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function writefile
_writefile:                             ; @writefile
	.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
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_9
; %bb.1:
	mov	x20, x0
	ldr	x0, [x21]
	cbz	x0, LBB0_5
; %bb.2:
	add	x21, x21, #8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x1, x20
	bl	_fputs
	tbnz	x0, #63, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldur	x0, [x21, #-8]
	bl	_free
	ldr	x0, [x21], #8
	cbnz	x0, LBB0_3
LBB0_5:
	mov	x0, x20
	bl	_fclose
	cbnz	x0, LBB0_7
; %bb.6:
	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_7:
Lloh2:
	adrp	x0, l_.str.2@PAGE
Lloh3:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_8:
	mov	x1, x19
	bl	_pg_log_error
	mov	w0, #1
	bl	_exit
LBB0_9:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"w"

l_.str.1:                               ; @.str.1
	.asciz	"could not open file \"%s\" for writing: %m"

l_.str.2:                               ; @.str.2
	.asciz	"could not write file \"%s\": %m"

	.no_dead_strip	_writefile
.subsections_via_symbols
