	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function logical_end_heap_rewrite
_logical_end_heap_rewrite:              ## @logical_end_heap_rewrite
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$0, 12(%rdi)
	je	LBB0_8
## %bb.1:
	movq	%rdi, %rbx
	cmpq	$0, (%rdi)
	jle	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_logical_heap_rewrite_flush_mappings
LBB0_3:
	movl	8(%rbx), %esi
	leaq	-44(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_hash_seq_init
	movq	%rbx, %rdi
	callq	_hash_seq_search
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	movq	%rax, %rbx
	movq	_WAIT_EVENT_LOGICAL_REWRITE_SYNC@GOTPCREL(%rip), %r13
	leaq	-44(%rbp), %r14
	leaq	L_.str(%rip), %r15
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	(%rbx), %edi
	callq	_FileClose
	movq	%r14, %rdi
	callq	_hash_seq_search
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_8
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edi
	movl	(%r13), %esi
	callq	_FileSync
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_data_sync_elevel
	movl	%eax, %r12d
	xorl	%eax, %eax
	callq	_errcode_for_file_access
	movl	4(%rbx), %esi
	movq	%r15, %rdi
	callq	_errmsg
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_ereport
	jmp	LBB0_7
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WAIT_EVENT_LOGICAL_REWRITE_SYNC,4,2 ## @WAIT_EVENT_LOGICAL_REWRITE_SYNC
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not fsync file \"%s\": %m"

	.no_dead_strip	_logical_end_heap_rewrite
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function logical_end_heap_rewrite
_logical_end_heap_rewrite:              ; @logical_end_heap_rewrite
	.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
	ldr	w8, [x0, #12]
	cbz	w8, LBB0_8
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0]
	cmp	x8, #1
	b.lt	LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_logical_heap_rewrite_flush_mappings
LBB0_3:
	ldr	w1, [x19, #8]
	add	x0, sp, #12
	bl	_hash_seq_init
	add	x0, sp, #12
	bl	_hash_seq_search
	cbz	x0, LBB0_8
; %bb.4:
	mov	x20, x0
Lloh0:
	adrp	x22, _WAIT_EVENT_LOGICAL_REWRITE_SYNC@GOTPAGE
Lloh1:
	ldr	x22, [x22, _WAIT_EVENT_LOGICAL_REWRITE_SYNC@GOTPAGEOFF]
Lloh2:
	adrp	x23, _ERROR@GOTPAGE
Lloh3:
	ldr	x23, [x23, _ERROR@GOTPAGEOFF]
Lloh4:
	adrp	x19, l_.str@PAGE
Lloh5:
	add	x19, x19, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x20]
	bl	_FileClose
	add	x0, sp, #12
	bl	_hash_seq_search
	mov	x20, x0
	cbz	x0, LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	ldr	w1, [x22]
	bl	_FileSync
	cbz	x0, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x23]
	bl	_data_sync_elevel
	mov	x21, x0
	bl	_errcode_for_file_access
	ldr	w1, [x20, #4]
	mov	x0, x19
	bl	_errmsg
	mov	x1, x0
	mov	x0, x21
	bl	_ereport
	b	LBB0_5
LBB0_8:
	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 AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_WAIT_EVENT_LOGICAL_REWRITE_SYNC,4,2 ; @WAIT_EVENT_LOGICAL_REWRITE_SYNC
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not fsync file \"%s\": %m"

	.no_dead_strip	_logical_end_heap_rewrite
.subsections_via_symbols
