	.file	"extr_visibilitymap.c_visibilitymap_prepare_truncate.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	visibilitymap_prepare_truncate
	.type	visibilitymap_prepare_truncate, @function
visibilitymap_prepare_truncate:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	mov	rdi, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	HEAPBLK_TO_MAPBLOCK@PLT
	mov	rdi, rbp
	mov	r12, rax
	call	HEAPBLK_TO_MAPBYTE@PLT
	mov	rdi, rbp
	mov	r13, rax
	call	HEAPBLK_TO_OFFSET@PLT
	mov	rdi, rbx
	mov	rbp, rax
	call	RelationOpenSmgr@PLT
	mov	esi, DWORD PTR VISIBILITYMAP_FORKNUM[rip]
	mov	edi, DWORD PTR [rbx]
	call	smgrexists@PLT
	test	eax, eax
	je	.L19
	mov	rax, r13
	or	rax, rbp
	je	.L4
	xor	edx, edx
	mov	rdi, rbx
	mov	rsi, r12
	call	vm_readbuf@PLT
	mov	edi, eax
	mov	r14d, eax
	call	BufferIsValid@PLT
	test	eax, eax
	jne	.L5
.L19:
	mov	r12, QWORD PTR InvalidBlockNumber[rip]
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	edi, r14d
	call	BufferGetPage@PLT
	mov	edi, eax
	call	PageGetContents@PLT
	mov	esi, DWORD PTR BUFFER_LOCK_EXCLUSIVE[rip]
	mov	edi, r14d
	mov	r15, rax
	call	LockBuffer@PLT
	xor	eax, eax
	call	START_CRIT_SECTION@PLT
	mov	rdx, QWORD PTR MAPSIZE[rip]
	lea	rdi, 1[r13]
	xor	esi, esi
	sub	rdx, rdi
	add	rdi, r15
	call	MemSet@PLT
	mov	ecx, ebp
	mov	eax, 1
	mov	edi, r14d
	sal	eax, cl
	sub	eax, 1
	and	BYTE PTR [r15+r13], al
	call	MarkBufferDirty@PLT
	mov	eax, DWORD PTR InRecovery[rip]
	test	eax, eax
	je	.L21
.L7:
	xor	eax, eax
	add	r12, 1
	call	END_CRIT_SECTION@PLT
	mov	edi, r14d
	call	UnlockReleaseBuffer@PLT
.L4:
	mov	esi, DWORD PTR VISIBILITYMAP_FORKNUM[rip]
	mov	edi, DWORD PTR [rbx]
	call	smgrnblocks@PLT
	cmp	rax, r12
	cmovle	r12, QWORD PTR InvalidBlockNumber[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	mov	rdi, rbx
	call	RelationNeedsWAL@PLT
	test	rax, rax
	je	.L7
	xor	eax, eax
	call	XLogHintBitIsNeeded@PLT
	test	rax, rax
	je	.L7
	xor	esi, esi
	mov	edi, r14d
	call	log_newpage_buffer@PLT
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	visibilitymap_prepare_truncate, .-visibilitymap_prepare_truncate
	.comm	VISIBILITYMAP_FORKNUM,4,4
	.comm	MAPSIZE,8,8
	.comm	InvalidBlockNumber,8,8
	.comm	InRecovery,4,4
	.comm	DEBUG1,4,4
	.comm	BUFFER_LOCK_EXCLUSIVE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_visibilitymap.c_visibilitymap_prepare_truncate.c"
	.text
	.align	2
	.global	visibilitymap_prepare_truncate
	.syntax unified
	.arm
	.fpu softvfp
	.type	visibilitymap_prepare_truncate, %function
visibilitymap_prepare_truncate:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r5, r0
	mov	r0, r1
	mov	r4, r1
	bl	HEAPBLK_TO_MAPBLOCK
	mov	r6, r0
	mov	r0, r4
	bl	HEAPBLK_TO_MAPBYTE
	mov	r3, r0
	mov	r0, r4
	mov	r4, r3
	bl	HEAPBLK_TO_OFFSET
	ldr	r8, .L23
	mov	r7, r0
	mov	r0, r5
	bl	RelationOpenSmgr
	ldr	r0, [r5]
	ldr	r1, [r8]
	bl	smgrexists
	cmp	r0, #0
	beq	.L19
	orrs	r3, r4, r7
	beq	.L4
	mov	r2, #0
	mov	r1, r6
	mov	r0, r5
	bl	vm_readbuf
	mov	r9, r0
	bl	BufferIsValid
	cmp	r0, #0
	bne	.L5
.L19:
	ldr	r3, .L23+4
	ldr	r6, [r3]
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L5:
	mov	r0, r9
	bl	BufferGetPage
	bl	PageGetContents
	mov	r10, r0
	ldr	r3, .L23+8
	mov	r0, r9
	ldr	r1, [r3]
	bl	LockBuffer
	bl	START_CRIT_SECTION
	ldr	r2, .L23+12
	add	r3, r4, #1
	ldr	r2, [r2]
	mov	r1, #0
	sub	r2, r2, r3
	add	r0, r10, r3
	bl	MemSet
	mvn	r2, #0
	ldrb	r3, [r10, r4]	@ zero_extendqisi2
	mov	r0, r9
	bic	r3, r3, r2, lsl r7
	strb	r3, [r10, r4]
	bl	MarkBufferDirty
	ldr	r3, .L23+16
	ldr	r4, [r3]
	cmp	r4, #0
	beq	.L22
.L7:
	bl	END_CRIT_SECTION
	mov	r0, r9
	add	r6, r6, #1
	bl	UnlockReleaseBuffer
.L4:
	ldr	r1, [r8]
	ldr	r0, [r5]
	bl	smgrnblocks
	cmp	r0, r6
	ble	.L19
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L22:
	mov	r0, r5
	bl	RelationNeedsWAL
	cmp	r0, #0
	beq	.L7
	bl	XLogHintBitIsNeeded
	cmp	r0, #0
	beq	.L7
	mov	r1, r4
	mov	r0, r9
	bl	log_newpage_buffer
	b	.L7
.L24:
	.align	2
.L23:
	.word	VISIBILITYMAP_FORKNUM
	.word	InvalidBlockNumber
	.word	BUFFER_LOCK_EXCLUSIVE
	.word	MAPSIZE
	.word	InRecovery
	.size	visibilitymap_prepare_truncate, .-visibilitymap_prepare_truncate
	.comm	VISIBILITYMAP_FORKNUM,4,4
	.comm	MAPSIZE,4,4
	.comm	InvalidBlockNumber,4,4
	.comm	InRecovery,4,4
	.comm	DEBUG1,4,4
	.comm	BUFFER_LOCK_EXCLUSIVE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
