	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pg_file_write_internal
_pg_file_write_internal:                ## @pg_file_write_internal
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r15
	xorl	%esi, %esi
	callq	_convert_and_check_filename
	movq	%rax, %r14
	testl	%ebx, %ebx
	je	LBB0_1
## %bb.4:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_5
LBB0_1:
	leaq	-40(%rbp), %rsi
	movq	%r14, %rdi
	callq	_stat
	testq	%rax, %rax
	js	LBB0_3
## %bb.2:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
LBB0_5:
	movq	%r14, %rdi
	callq	_AllocateFile
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_errcode_for_file_access
	leaq	L_.str.3(%rip), %rdi
	movq	%r14, %rsi
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_7:
	movq	%r15, %rdi
	callq	_VARDATA_ANY
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_VARSIZE_ANY_EXHDR
	movl	%ebx, %edi
	movl	$1, %esi
	movq	%rax, %rdx
	movq	%r12, %rcx
	callq	_fwrite
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_VARSIZE_ANY_EXHDR
	cmpq	%rax, %rbx
	jne	LBB0_9
## %bb.8:
	movq	%r12, %rdi
	callq	_FreeFile
	testq	%rax, %rax
	je	LBB0_10
LBB0_9:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	xorl	%eax, %eax
	callq	_errcode_for_file_access
	leaq	L_.str.4(%rip), %rdi
	movq	%r14, %rsi
	callq	_errmsg
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_ereport
LBB0_10:
	movq	%rbx, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERROR,4,2                      ## @ERROR
	.comm	_ERRCODE_DUPLICATE_FILE,4,2     ## @ERRCODE_DUPLICATE_FILE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"file \"%s\" exists"

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

L_.str.2:                               ## @.str.2
	.asciz	"ab"

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

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

	.no_dead_strip	_pg_file_write_internal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pg_file_write_internal
_pg_file_write_internal:                ; @pg_file_write_internal
	.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	x21, x2
	mov	x20, x1
	mov	w1, #0
	bl	_convert_and_check_filename
	mov	x19, x0
Lloh0:
	adrp	x23, _ERROR@GOTPAGE
Lloh1:
	ldr	x23, [x23, _ERROR@GOTPAGEOFF]
	cbz	w21, LBB0_2
; %bb.1:
Lloh2:
	adrp	x1, l_.str.2@PAGE
Lloh3:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_2:
	add	x1, sp, #8
	mov	x0, x19
	bl	_stat
	tbnz	x0, #63, LBB0_4
; %bb.3:
	ldr	w21, [x23]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_errmsg
	mov	x1, x0
	mov	x0, x21
	bl	_ereport
LBB0_4:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_5:
	mov	x0, x19
	bl	_AllocateFile
	mov	x21, x0
	cbnz	x0, LBB0_7
; %bb.6:
	ldr	w22, [x23]
	bl	_errcode_for_file_access
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_errmsg
	mov	x1, x0
	mov	x0, x22
	bl	_ereport
LBB0_7:
	mov	x0, x20
	bl	_VARDATA_ANY
	mov	x22, x0
	mov	x0, x20
	bl	_VARSIZE_ANY_EXHDR
	mov	x2, x0
	mov	x0, x22
	mov	w1, #1
	mov	x3, x21
	bl	_fwrite
	mov	x22, x0
	mov	x0, x20
	bl	_VARSIZE_ANY_EXHDR
	cmp	x22, x0
	b.ne	LBB0_9
; %bb.8:
	mov	x0, x21
	bl	_FreeFile
	cbz	x0, LBB0_10
LBB0_9:
	ldr	w20, [x23]
	bl	_errcode_for_file_access
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x19
	bl	_errmsg
	mov	x1, x0
	mov	x0, x20
	bl	_ereport
LBB0_10:
	mov	x0, x22
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ERROR,4,2                      ; @ERROR
	.comm	_ERRCODE_DUPLICATE_FILE,4,2     ; @ERRCODE_DUPLICATE_FILE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"file \"%s\" exists"

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

l_.str.2:                               ; @.str.2
	.asciz	"ab"

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

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

	.no_dead_strip	_pg_file_write_internal
.subsections_via_symbols
