	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_visibilitymap_prepare_truncate ## -- Begin function visibilitymap_prepare_truncate
	.p2align	4, 0x90
_visibilitymap_prepare_truncate:        ## @visibilitymap_prepare_truncate
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_HEAPBLK_TO_MAPBLOCK
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_HEAPBLK_TO_MAPBYTE
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_HEAPBLK_TO_OFFSET
	movq	%rax, %r13
	movq	%r15, %rdi
	callq	_RelationOpenSmgr
	movl	(%r15), %edi
	movq	_VISIBILITYMAP_FORKNUM@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_smgrexists
	testl	%eax, %eax
	je	LBB0_9
## %bb.1:
	movq	%r12, %rax
	orq	%r13, %rax
	je	LBB0_8
## %bb.2:
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_vm_readbuf
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_BufferIsValid
	testl	%eax, %eax
	je	LBB0_9
## %bb.3:
	movl	%ebx, %edi
	callq	_BufferGetPage
	movl	%eax, %edi
	callq	_PageGetContents
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%rax, %rbx
	movq	_BUFFER_LOCK_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_LockBuffer
	xorl	%eax, %eax
	callq	_START_CRIT_SECTION
	leaq	(%rbx,%r12), %rdi
	incq	%rdi
	movq	%r12, %rax
	incq	%rax
	movq	_MAPSIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	subq	%rax, %rdx
	xorl	%esi, %esi
	callq	_MemSet
	movl	$-1, %eax
	movl	%r13d, %ecx
	shll	%cl, %eax
	notb	%al
	andb	%al, (%rbx,%r12)
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_MarkBufferDirty
	movq	_InRecovery@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_7
## %bb.4:
	movq	%r15, %rdi
	callq	_RelationNeedsWAL
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	xorl	%eax, %eax
	callq	_XLogHintBitIsNeeded
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_log_newpage_buffer
LBB0_7:
	incq	%r14
	xorl	%eax, %eax
	callq	_END_CRIT_SECTION
	movl	%ebx, %edi
	callq	_UnlockReleaseBuffer
	movq	_VISIBILITYMAP_FORKNUM@GOTPCREL(%rip), %rbx
LBB0_8:
	movl	(%r15), %edi
	movl	(%rbx), %esi
	callq	_smgrnblocks
	cmpq	%r14, %rax
	jg	LBB0_10
LBB0_9:
	movq	_InvalidBlockNumber@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
LBB0_10:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VISIBILITYMAP_FORKNUM,4,2      ## @VISIBILITYMAP_FORKNUM
	.comm	_InvalidBlockNumber,8,3         ## @InvalidBlockNumber
	.comm	_BUFFER_LOCK_EXCLUSIVE,4,2      ## @BUFFER_LOCK_EXCLUSIVE
	.comm	_MAPSIZE,8,3                    ## @MAPSIZE
	.comm	_InRecovery,4,2                 ## @InRecovery
	.comm	_DEBUG1,4,2                     ## @DEBUG1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_visibilitymap_prepare_truncate ; -- Begin function visibilitymap_prepare_truncate
	.p2align	2
_visibilitymap_prepare_truncate:        ; @visibilitymap_prepare_truncate
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x1
	mov	x20, x0
	mov	x0, x1
	bl	_HEAPBLK_TO_MAPBLOCK
	mov	x19, x0
	mov	x0, x21
	bl	_HEAPBLK_TO_MAPBYTE
	mov	x22, x0
	mov	x0, x21
	bl	_HEAPBLK_TO_OFFSET
	mov	x23, x0
	mov	x0, x20
	bl	_RelationOpenSmgr
	ldr	w0, [x20]
Lloh0:
	adrp	x25, _VISIBILITYMAP_FORKNUM@GOTPAGE
Lloh1:
	ldr	x25, [x25, _VISIBILITYMAP_FORKNUM@GOTPAGEOFF]
	ldr	w1, [x25]
	bl	_smgrexists
	cbz	w0, LBB0_9
; %bb.1:
	orr	x8, x22, x23
	cbz	x8, LBB0_8
; %bb.2:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_vm_readbuf
	mov	x21, x0
	bl	_BufferIsValid
	cbz	w0, LBB0_9
; %bb.3:
	add	x19, x19, #1
	mov	x0, x21
	bl	_BufferGetPage
	bl	_PageGetContents
	mov	x24, x0
Lloh2:
	adrp	x8, _BUFFER_LOCK_EXCLUSIVE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BUFFER_LOCK_EXCLUSIVE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_LockBuffer
	bl	_START_CRIT_SECTION
	add	x8, x22, #1
	add	x0, x24, x8
Lloh5:
	adrp	x9, _MAPSIZE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MAPSIZE@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	sub	x2, x9, x8
	mov	w1, #0
	bl	_MemSet
	mov	w8, #-1
	lsl	w8, w8, w23
	ldrb	w9, [x24, x22]
	bic	w8, w9, w8
	strb	w8, [x24, x22]
	mov	x0, x21
	bl	_MarkBufferDirty
Lloh8:
	adrp	x8, _InRecovery@GOTPAGE
Lloh9:
	ldr	x8, [x8, _InRecovery@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cbnz	w8, LBB0_7
; %bb.4:
	mov	x0, x20
	bl	_RelationNeedsWAL
	cbz	x0, LBB0_7
; %bb.5:
	bl	_XLogHintBitIsNeeded
	cbz	x0, LBB0_7
; %bb.6:
	mov	x0, x21
	mov	w1, #0
	bl	_log_newpage_buffer
LBB0_7:
	bl	_END_CRIT_SECTION
	mov	x0, x21
	bl	_UnlockReleaseBuffer
LBB0_8:
	ldr	w0, [x20]
	ldr	w1, [x25]
	bl	_smgrnblocks
Lloh11:
	adrp	x8, _InvalidBlockNumber@GOTPAGE
Lloh12:
	ldr	x8, [x8, _InvalidBlockNumber@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x0, x19
	csel	x0, x19, x8, gt
	b	LBB0_10
LBB0_9:
Lloh14:
	adrp	x8, _InvalidBlockNumber@GOTPAGE
Lloh15:
	ldr	x8, [x8, _InvalidBlockNumber@GOTPAGEOFF]
Lloh16:
	ldr	x0, [x8]
LBB0_10:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_VISIBILITYMAP_FORKNUM,4,2      ; @VISIBILITYMAP_FORKNUM
	.comm	_InvalidBlockNumber,8,3         ; @InvalidBlockNumber
	.comm	_BUFFER_LOCK_EXCLUSIVE,4,2      ; @BUFFER_LOCK_EXCLUSIVE
	.comm	_MAPSIZE,8,3                    ; @MAPSIZE
	.comm	_InRecovery,4,2                 ; @InRecovery
	.comm	_DEBUG1,4,2                     ; @DEBUG1
.subsections_via_symbols
