	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_version_file
_write_version_file:                    ## @write_version_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_pg_data@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rdx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_psprintf
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_psprintf
LBB0_3:
	movq	%rax, %r14
	movq	_PG_BINARY_W@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	%rax, %rbx
	movq	_PG_MAJORVERSION@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_fprintf
	testq	%rax, %rax
	js	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_fclose
	testq	%rax, %rax
	jne	LBB0_8
## %bb.9:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_free                           ## TAILCALL
LBB0_8:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_5
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
LBB0_5:
	movq	%r14, %rsi
	callq	_pg_log_error
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/PG_VERSION"

	.comm	_pg_data,4,2                    ## @pg_data
L_.str.1:                               ## @.str.1
	.asciz	"%s/%s/PG_VERSION"

	.comm	_PG_BINARY_W,4,2                ## @PG_BINARY_W
L_.str.2:                               ## @.str.2
	.asciz	"could not open file \"%s\" for writing: %m"

L_.str.3:                               ## @.str.3
	.asciz	"%s\n"

	.comm	_PG_MAJORVERSION,8,3            ## @PG_MAJORVERSION
L_.str.4:                               ## @.str.4
	.asciz	"could not write file \"%s\": %m"

	.no_dead_strip	_write_version_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_version_file
_write_version_file:                    ; @write_version_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
Lloh0:
	adrp	x8, _pg_data@GOTPAGE
Lloh1:
	ldr	x8, [x8, _pg_data@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	cbz	x0, LBB0_2
; %bb.1:
	str	x0, [sp]
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_2:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
LBB0_3:
	bl	_psprintf
	mov	x19, x0
Lloh7:
	adrp	x8, _PG_BINARY_W@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PG_BINARY_W@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_fopen
	cbz	x0, LBB0_8
; %bb.4:
	mov	x20, x0
Lloh10:
	adrp	x8, _PG_MAJORVERSION@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PG_MAJORVERSION@GOTPAGEOFF]
Lloh12:
	ldr	x2, [x8]
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fprintf
	tbnz	x0, #63, LBB0_7
; %bb.5:
	mov	x0, x20
	bl	_fclose
	cbnz	x0, LBB0_7
; %bb.6:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_free
LBB0_7:
Lloh15:
	adrp	x0, l_.str.4@PAGE
Lloh16:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_9:
	mov	x1, x19
	bl	_pg_log_error
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/PG_VERSION"

	.comm	_pg_data,4,2                    ; @pg_data
l_.str.1:                               ; @.str.1
	.asciz	"%s/%s/PG_VERSION"

	.comm	_PG_BINARY_W,4,2                ; @PG_BINARY_W
l_.str.2:                               ; @.str.2
	.asciz	"could not open file \"%s\" for writing: %m"

l_.str.3:                               ; @.str.3
	.asciz	"%s\n"

	.comm	_PG_MAJORVERSION,8,3            ; @PG_MAJORVERSION
l_.str.4:                               ; @.str.4
	.asciz	"could not write file \"%s\": %m"

	.no_dead_strip	_write_version_file
.subsections_via_symbols
