	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_durable_rename                 ## -- Begin function durable_rename
	.p2align	4, 0x90
_durable_rename:                        ## @durable_rename
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	xorl	%esi, %esi
	callq	_fsync_fname
	movl	$-1, %r14d
	testq	%rax, %rax
	je	LBB0_1
LBB0_11:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_PG_BINARY@GOTPCREL(%rip), %rax
	movq	_O_RDWR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_open
	testl	%eax, %eax
	js	LBB0_2
## %bb.4:
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_fsync
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_pg_log_error
	movl	%r12d, %edi
	callq	_close
	jmp	LBB0_11
LBB0_2:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.3:
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_pg_log_error
	jmp	LBB0_11
LBB0_6:
	movl	%r12d, %edi
	callq	_close
LBB0_7:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_rename
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_pg_log_error
	jmp	LBB0_11
LBB0_9:
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_fsync_fname
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:
	movq	%r15, %rdi
	callq	_fsync_parent_path
	negq	%rax
	sbbl	%ebx, %ebx
	movl	%ebx, %r14d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_PG_BINARY,4,2                  ## @PG_BINARY
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_errno,8,3                      ## @errno
	.comm	_ENOENT,8,3                     ## @ENOENT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not open file \"%s\": %m"

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

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

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_durable_rename                 ; -- Begin function durable_rename
	.p2align	2
_durable_rename:                        ; @durable_rename
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	mov	w1, #0
	bl	_fsync_fname
	cbnz	x0, LBB0_10
; %bb.1:
Lloh0:
	adrp	x8, _PG_BINARY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PG_BINARY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _O_RDWR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _O_RDWR@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x19
	mov	w2, #0
	bl	_open
	tbnz	w0, #31, LBB0_4
; %bb.2:
	mov	x21, x0
	bl	_fsync
	cbz	x0, LBB0_6
; %bb.3:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_pg_log_error
	mov	x0, x21
	bl	_close
	b	LBB0_10
LBB0_4:
Lloh8:
	adrp	x8, _errno@GOTPAGE
Lloh9:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _ENOENT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ENOENT@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_7
; %bb.5:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	b	LBB0_9
LBB0_6:
	mov	x0, x21
	bl	_close
LBB0_7:
	mov	x0, x20
	mov	x1, x19
	bl	_rename
	cbz	x0, LBB0_12
; %bb.8:
	str	x19, [sp]
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
LBB0_9:
	bl	_pg_log_error
LBB0_10:
	mov	w0, #-1
LBB0_11:
	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
	add	sp, sp, #64
	ret
LBB0_12:
	mov	x0, x19
	mov	w1, #0
	bl	_fsync_fname
	cbnz	x0, LBB0_10
; %bb.13:
	mov	x0, x19
	bl	_fsync_parent_path
	cmp	x0, #0
	csetm	w0, ne
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_PG_BINARY,4,2                  ; @PG_BINARY
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_errno,8,3                      ; @errno
	.comm	_ENOENT,8,3                     ; @ENOENT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not open file \"%s\": %m"

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

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

.subsections_via_symbols
