	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_end_heap_rewrite               ## -- Begin function end_heap_rewrite
	.p2align	4, 0x90
_end_heap_rewrite:                      ## @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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	48(%rdi), %esi
	leaq	-28(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_hash_seq_init
	movq	%rbx, %rdi
	callq	_hash_seq_search
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %rbx
	leaq	-28(%rbp), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rax
	movq	(%rax), %rdi
	callq	_ItemPointerSetInvalid
	movq	(%rbx), %rsi
	movq	%r15, %rdi
	callq	_raw_heap_insert
	movq	%r14, %rdi
	callq	_hash_seq_search
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_2
LBB0_3:
	cmpq	$0, 40(%r15)
	je	LBB0_7
## %bb.4:
	cmpq	$0, 32(%r15)
	je	LBB0_6
## %bb.5:
	movq	8(%r15), %rdi
	movq	16(%r15), %rcx
	addq	$4, %rdi
	movq	_MAIN_FORKNUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	24(%r15), %edx
	movl	$1, %r8d
	callq	_log_newpage
LBB0_6:
	movq	8(%r15), %rdi
	callq	_RelationOpenSmgr
	movq	16(%r15), %rdi
	movl	24(%r15), %esi
	callq	_PageSetChecksumInplace
	movq	8(%r15), %rax
	movq	16(%r15), %rcx
	movl	(%rax), %edi
	movq	_MAIN_FORKNUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	24(%r15), %edx
	movl	$1, %r8d
	callq	_smgrextend
LBB0_7:
	movq	8(%r15), %rdi
	callq	_RelationNeedsWAL
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	8(%r15), %rdi
	callq	_heap_sync
LBB0_9:
	movq	%r15, %rdi
	callq	_logical_end_heap_rewrite
	movl	(%r15), %edi
	callq	_MemoryContextDelete
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAIN_FORKNUM,4,2               ## @MAIN_FORKNUM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_end_heap_rewrite               ; -- Begin function end_heap_rewrite
	.p2align	2
_end_heap_rewrite:                      ; @end_heap_rewrite
	.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
	mov	x19, x0
	ldr	w1, [x0, #48]
	add	x0, sp, #12
	bl	_hash_seq_init
	add	x0, sp, #12
	bl	_hash_seq_search
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	x0, [x8]
	bl	_ItemPointerSetInvalid
	ldr	x1, [x20]
	mov	x0, x19
	bl	_raw_heap_insert
	add	x0, sp, #12
	bl	_hash_seq_search
	mov	x20, x0
	cbnz	x0, LBB0_2
LBB0_3:
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_7
; %bb.4:
	ldr	x8, [x19, #32]
Lloh0:
	adrp	x20, _MAIN_FORKNUM@GOTPAGE
Lloh1:
	ldr	x20, [x20, _MAIN_FORKNUM@GOTPAGEOFF]
	cbz	x8, LBB0_6
; %bb.5:
	ldp	x8, x3, [x19, #8]
	add	x0, x8, #4
	ldr	w1, [x20]
	ldr	w2, [x19, #24]
	mov	w4, #1
	bl	_log_newpage
LBB0_6:
	ldr	x0, [x19, #8]
	bl	_RelationOpenSmgr
	ldr	x0, [x19, #16]
	ldr	w1, [x19, #24]
	bl	_PageSetChecksumInplace
	ldp	x8, x3, [x19, #8]
	ldr	w0, [x8]
	ldr	w1, [x20]
	ldr	w2, [x19, #24]
	mov	w4, #1
	bl	_smgrextend
LBB0_7:
	ldr	x0, [x19, #8]
	bl	_RelationNeedsWAL
	cbz	x0, LBB0_9
; %bb.8:
	ldr	x0, [x19, #8]
	bl	_heap_sync
LBB0_9:
	mov	x0, x19
	bl	_logical_end_heap_rewrite
	ldr	w0, [x19]
	bl	_MemoryContextDelete
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MAIN_FORKNUM,4,2               ; @MAIN_FORKNUM
.subsections_via_symbols
