	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_visibilitymap_set              ## -- Begin function visibilitymap_set
	.p2align	4, 0x90
_visibilitymap_set:                     ## @visibilitymap_set
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -68(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r14d
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r15
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movl	16(%rbp), %ebx
	movq	%rsi, %rdi
	callq	_HEAPBLK_TO_MAPBLOCK
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_HEAPBLK_TO_MAPBYTE
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_HEAPBLK_TO_OFFSET
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movq	_InRecovery@GOTPCREL(%rip), %r13
	movl	$1, %r12d
	cmpq	$0, (%r13)
	movl	$1, %edi
	jne	LBB0_2
## %bb.1:
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_XLogRecPtrIsInvalid
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
LBB0_2:
	callq	_Assert
	cmpq	$0, (%r13)
	jne	LBB0_4
## %bb.3:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_BufferIsValid
	xorl	%r12d, %r12d
	testq	%rax, %rax
	setne	%r12b
LBB0_4:
	movl	%r12d, %edi
	callq	_Assert
	movq	_VISIBILITYMAP_VALID_BITS@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	andl	%ebx, %edi
	callq	_Assert
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_BufferIsValid
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_BufferGetBlockNumber
	cmpq	%r15, %rax
	je	LBB0_7
## %bb.6:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_elog
LBB0_7:
	movl	%r14d, %edi
	callq	_BufferIsValid
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movl	%r14d, %edi
	callq	_BufferGetBlockNumber
	cmpq	-64(%rbp), %rax                 ## 8-byte Folded Reload
	je	LBB0_10
LBB0_9:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_elog
LBB0_10:
	movl	%r14d, %edi
	callq	_BufferGetPage
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_PageGetContents
	movq	%rax, %r13
	movq	_BUFFER_LOCK_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_LockBuffer
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	movl	(%r13,%rdx,4), %eax
	movl	-72(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %ecx
	sarl	%cl, %eax
	andl	(%r12), %eax
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	cmpl	%esi, %eax
	je	LBB0_17
## %bb.11:
	movl	%ebx, -64(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	movq	%rdx, %r12
	movl	%esi, %ebx
	callq	_START_CRIT_SECTION
	movl	%ebx, %eax
	movl	%r15d, %ecx
	shll	%cl, %eax
	orl	%eax, (%r13,%r12,4)
	movl	%r14d, %edi
	callq	_MarkBufferDirty
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_RelationNeedsWAL
	testq	%rax, %rax
	je	LBB0_16
## %bb.12:
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_XLogRecPtrIsInvalid
	testq	%rax, %rax
	movl	-64(%rbp), %r15d                ## 4-byte Reload
	je	LBB0_15
## %bb.13:
	xorl	%edi, %edi
	movq	_InRecovery@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	sete	%dil
	callq	_Assert
	movl	(%r12), %edi
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %esi
	movl	%r14d, %edx
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	callq	_log_heap_visible
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_XLogHintBitIsNeeded
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	movl	%r12d, %edi
	callq	_BufferGetPage
	movl	%ebx, %r12d
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_PageIsAllVisible
	movl	%eax, %edi
	callq	_Assert
	movl	%ebx, %edi
	movl	%r12d, %ebx
	movl	%r12d, %esi
	callq	_PageSetLSN
LBB0_15:
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_PageSetLSN
LBB0_16:
	xorl	%eax, %eax
	callq	_END_CRIT_SECTION
LBB0_17:
	movq	_BUFFER_LOCK_UNLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_LockBuffer                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_InRecovery,8,3                 ## @InRecovery
	.comm	_VISIBILITYMAP_VALID_BITS,4,2   ## @VISIBILITYMAP_VALID_BITS
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wrong heap buffer passed to visibilitymap_set"

L_.str.1:                               ## @.str.1
	.asciz	"wrong VM buffer passed to visibilitymap_set"

	.comm	_BUFFER_LOCK_EXCLUSIVE,4,2      ## @BUFFER_LOCK_EXCLUSIVE
	.comm	_BUFFER_LOCK_UNLOCK,4,2         ## @BUFFER_LOCK_UNLOCK
	.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_set              ; -- Begin function visibilitymap_set
	.p2align	2
_visibilitymap_set:                     ; @visibilitymap_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x6
	mov	x23, x5
	mov	x19, x4
	mov	x20, x3
	mov	x21, x2
	mov	x28, x1
	mov	x24, x0
	mov	x0, x1
	bl	_HEAPBLK_TO_MAPBLOCK
	mov	x27, x0
	mov	x0, x28
	bl	_HEAPBLK_TO_MAPBYTE
	mov	x25, x0
	mov	x0, x28
	bl	_HEAPBLK_TO_OFFSET
	mov	x26, x0
Lloh0:
	adrp	x8, _InRecovery@GOTPAGE
Lloh1:
	ldr	x8, [x8, _InRecovery@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w0, #1
	b	LBB0_3
LBB0_2:
	mov	x0, x20
	bl	_XLogRecPtrIsInvalid
	cmp	x0, #0
	cset	w0, ne
LBB0_3:
	bl	_Assert
Lloh3:
	adrp	x8, _InRecovery@GOTPAGE
Lloh4:
	ldr	x8, [x8, _InRecovery@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	stp	w23, w20, [sp, #8]              ; 8-byte Folded Spill
	mov	x20, x24
	cbz	x8, LBB0_5
; %bb.4:
	mov	w0, #1
	b	LBB0_6
LBB0_5:
	mov	x0, x21
	bl	_BufferIsValid
	cmp	x0, #0
	cset	w0, ne
LBB0_6:
	bl	_Assert
Lloh6:
	adrp	x24, _VISIBILITYMAP_VALID_BITS@GOTPAGE
Lloh7:
	ldr	x24, [x24, _VISIBILITYMAP_VALID_BITS@GOTPAGEOFF]
	ldr	w8, [x24]
	and	w0, w8, w22
	bl	_Assert
	mov	x0, x21
	bl	_BufferIsValid
Lloh8:
	adrp	x23, _ERROR@GOTPAGE
Lloh9:
	ldr	x23, [x23, _ERROR@GOTPAGEOFF]
	cbz	x0, LBB0_9
; %bb.7:
	mov	x0, x21
	bl	_BufferGetBlockNumber
	cmp	x0, x28
	b.eq	LBB0_9
; %bb.8:
	ldr	w0, [x23]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_9:
	mov	x0, x19
	bl	_BufferIsValid
	cbz	x0, LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_BufferGetBlockNumber
	cmp	x0, x27
	b.eq	LBB0_12
LBB0_11:
	ldr	w0, [x23]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_elog
LBB0_12:
	mov	x0, x19
	bl	_BufferGetPage
	mov	x27, x0
	bl	_PageGetContents
	mov	x28, x0
Lloh14:
	adrp	x8, _BUFFER_LOCK_EXCLUSIVE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BUFFER_LOCK_EXCLUSIVE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_LockBuffer
	ldr	w8, [x28, x25, lsl #2]
	asr	w8, w8, w26
	ldr	w9, [x24]
	and	w8, w8, w9
	cmp	w8, w22
	b.eq	LBB0_19
; %bb.13:
	bl	_START_CRIT_SECTION
	lsl	w8, w22, w26
	lsl	x9, x25, #2
	ldr	w10, [x28, x9]
	orr	w8, w10, w8
	str	w8, [x28, x9]
	mov	x0, x19
	bl	_MarkBufferDirty
	mov	x23, x20
	mov	x0, x20
	bl	_RelationNeedsWAL
	cbz	x0, LBB0_18
; %bb.14:
	ldr	w20, [sp, #12]                  ; 4-byte Folded Reload
	mov	x0, x20
	bl	_XLogRecPtrIsInvalid
	cbz	x0, LBB0_17
; %bb.15:
Lloh17:
	adrp	x8, _InRecovery@GOTPAGE
Lloh18:
	ldr	x8, [x8, _InRecovery@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	cmp	x8, #0
	cset	w0, eq
	bl	_Assert
	ldr	w0, [x23]
	mov	x1, x21
	mov	x2, x19
	ldr	w3, [sp, #8]                    ; 4-byte Folded Reload
	mov	x4, x22
	bl	_log_heap_visible
	mov	x20, x0
	bl	_XLogHintBitIsNeeded
	cbz	x0, LBB0_17
; %bb.16:
	mov	x0, x21
	bl	_BufferGetPage
	mov	x21, x0
	bl	_PageIsAllVisible
	bl	_Assert
	mov	x0, x21
	mov	x1, x20
	bl	_PageSetLSN
LBB0_17:
	mov	x0, x27
	mov	x1, x20
	bl	_PageSetLSN
LBB0_18:
	bl	_END_CRIT_SECTION
LBB0_19:
Lloh20:
	adrp	x8, _BUFFER_LOCK_UNLOCK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BUFFER_LOCK_UNLOCK@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_LockBuffer
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_InRecovery,8,3                 ; @InRecovery
	.comm	_VISIBILITYMAP_VALID_BITS,4,2   ; @VISIBILITYMAP_VALID_BITS
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wrong heap buffer passed to visibilitymap_set"

l_.str.1:                               ; @.str.1
	.asciz	"wrong VM buffer passed to visibilitymap_set"

	.comm	_BUFFER_LOCK_EXCLUSIVE,4,2      ; @BUFFER_LOCK_EXCLUSIVE
	.comm	_BUFFER_LOCK_UNLOCK,4,2         ; @BUFFER_LOCK_UNLOCK
	.comm	_DEBUG1,4,2                     ; @DEBUG1
.subsections_via_symbols
