	.file	"extr_nbtsearch.c__bt_readnextpage.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	_bt_readnextpage, @function
_bt_readnextpage:
.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
	mov	r13d, edx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	movsx	rbx, DWORD PTR 16[rdi]
	mov	r12d, DWORD PTR 12[rdi]
	mov	edi, edx
	mov	QWORD PTR 8[rsp], rsi
	call	ScanDirectionIsForward@PLT
	test	rax, rax
	je	.L2
	lea	r14, 8[rsp]
	.p2align 4,,10
	.p2align 3
.L26:
	mov	rax, QWORD PTR P_NONE[rip]
	cmp	QWORD PTR 8[rsp], rax
	je	.L27
.L3:
	mov	eax, DWORD PTR 20[rbx]
	test	eax, eax
	je	.L27
	xor	eax, eax
	call	CHECK_FOR_INTERRUPTS@PLT
	mov	edx, DWORD PTR BT_READ[rip]
	mov	rsi, QWORD PTR 8[rsp]
	mov	edi, r12d
	call	_bt_getbuf@PLT
	mov	QWORD PTR [rbx], rax
	mov	rdi, rax
	call	BufferGetPage@PLT
	mov	edi, DWORD PTR 8[rbp]
	mov	esi, r12d
	mov	r15d, eax
	mov	edx, eax
	call	TestForOldSnapshot@PLT
	mov	edi, r15d
	call	PageGetSpecialPointer@PLT
	mov	rdi, rax
	mov	r15, rax
	call	P_IGNORE@PLT
	test	eax, eax
	je	.L30
	cmp	QWORD PTR 0[rbp], 0
	mov	rsi, QWORD PTR [r15]
	je	.L9
	mov	rdi, rbp
	call	_bt_parallel_release@PLT
.L8:
	cmp	QWORD PTR 0[rbp], 0
	mov	rsi, QWORD PTR [rbx]
	je	.L31
	mov	edi, r12d
	call	_bt_relbuf@PLT
	mov	rsi, r14
	mov	rdi, rbp
	call	_bt_parallel_seize@PLT
	mov	r15d, eax
	test	eax, eax
	jne	.L26
.L28:
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	push	QWORD PTR 16[rbx]
	.cfi_def_cfa_offset 96
	push	QWORD PTR 8[rbx]
	.cfi_def_cfa_offset 104
	push	QWORD PTR [rbx]
	.cfi_def_cfa_offset 112
	call	BTScanPosInvalidate@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 80
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L30:
	mov	edx, DWORD PTR 8[rbp]
	mov	rsi, QWORD PTR 8[rsp]
	mov	edi, r12d
	call	PredicateLockPage@PLT
	mov	rdi, r15
	call	P_FIRSTDATAKEY@PLT
	mov	esi, r13d
	mov	rdi, rbp
	mov	edx, eax
	call	_bt_readpage@PLT
	test	rax, rax
	je	.L8
.L7:
	mov	r15d, 1
	jmp	.L1
.L31:
	mov	rsi, QWORD PTR [r15]
	.p2align 4,,10
	.p2align 3
.L9:
	mov	QWORD PTR 8[rsp], rsi
	mov	rsi, QWORD PTR [rbx]
	mov	edi, r12d
	call	_bt_relbuf@PLT
	mov	rax, QWORD PTR P_NONE[rip]
	cmp	QWORD PTR 8[rsp], rax
	jne	.L3
	.p2align 4,,10
	.p2align 3
.L27:
	mov	rdi, rbp
	xor	r15d, r15d
	call	_bt_parallel_done@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	push	QWORD PTR 16[rbx]
	.cfi_def_cfa_offset 96
	push	QWORD PTR 8[rbx]
	.cfi_def_cfa_offset 104
	push	QWORD PTR [rbx]
	.cfi_def_cfa_offset 112
	call	BTScanPosInvalidate@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 80
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	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
.L2:
	.cfi_restore_state
	mov	rax, QWORD PTR 8[rsp]
	cmp	QWORD PTR 8[rbx], rax
	jne	.L32
.L12:
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	push	QWORD PTR 16[rbx]
	.cfi_def_cfa_offset 96
	push	QWORD PTR 8[rbx]
	.cfi_def_cfa_offset 104
	push	QWORD PTR [rbx]
	.cfi_def_cfa_offset 112
	call	BTScanPosIsPinned@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 80
	test	rax, rax
	jne	.L33
	mov	rsi, QWORD PTR 8[rbx]
	mov	edx, DWORD PTR BT_READ[rip]
	mov	edi, r12d
	call	_bt_getbuf@PLT
	mov	QWORD PTR [rbx], rax
	mov	rsi, rax
.L15:
	lea	rax, 8[rsp]
	mov	QWORD PTR [rsp], rax
	.p2align 4,,10
	.p2align 3
.L22:
	mov	r15d, DWORD PTR 16[rbx]
	test	r15d, r15d
	je	.L34
.L16:
	mov	edx, DWORD PTR 8[rbp]
	mov	edi, r12d
	call	_bt_walk_left@PLT
	cmp	rax, QWORD PTR InvalidBuffer[rip]
	mov	QWORD PTR [rbx], rax
	mov	rdi, rax
	je	.L27
	call	BufferGetPage@PLT
	mov	edi, DWORD PTR 8[rbp]
	mov	esi, r12d
	mov	r15d, eax
	mov	edx, eax
	call	TestForOldSnapshot@PLT
	mov	edi, r15d
	call	PageGetSpecialPointer@PLT
	mov	rdi, rax
	call	P_IGNORE@PLT
	test	eax, eax
	je	.L35
	cmp	QWORD PTR 0[rbp], 0
	mov	rsi, QWORD PTR [rbx]
	je	.L22
	mov	rdi, rsi
	call	BufferGetBlockNumber@PLT
	mov	rdi, rbp
	mov	rsi, rax
	call	_bt_parallel_release@PLT
.L19:
	cmp	QWORD PTR 0[rbp], 0
	mov	rsi, QWORD PTR [rbx]
	je	.L22
	mov	edi, r12d
	call	_bt_relbuf@PLT
	mov	rsi, QWORD PTR [rsp]
	mov	rdi, rbp
	call	_bt_parallel_seize@PLT
	mov	r15d, eax
	test	eax, eax
	je	.L28
	mov	rsi, QWORD PTR 8[rsp]
	mov	edx, DWORD PTR BT_READ[rip]
	mov	edi, r12d
	call	_bt_getbuf@PLT
	mov	r15d, DWORD PTR 16[rbx]
	mov	QWORD PTR [rbx], rax
	mov	rsi, rax
	test	r15d, r15d
	jne	.L16
	.p2align 4,,10
	.p2align 3
.L34:
	mov	edi, r12d
	call	_bt_relbuf@PLT
	mov	rdi, rbp
	call	_bt_parallel_done@PLT
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L33:
	mov	esi, DWORD PTR BT_READ[rip]
	mov	rdi, QWORD PTR [rbx]
	call	LockBuffer@PLT
	mov	rsi, QWORD PTR [rbx]
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L32:
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	push	QWORD PTR 16[rbx]
	.cfi_def_cfa_offset 96
	push	QWORD PTR 8[rbx]
	.cfi_def_cfa_offset 104
	push	QWORD PTR [rbx]
	.cfi_def_cfa_offset 112
	call	BTScanPosUnpinIfPinned@PLT
	mov	rax, QWORD PTR 40[rsp]
	add	rsp, 32
	.cfi_def_cfa_offset 80
	mov	QWORD PTR 8[rbx], rax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L35:
	mov	rdi, QWORD PTR [rbx]
	mov	r14d, DWORD PTR 8[rbp]
	call	BufferGetBlockNumber@PLT
	mov	edx, r14d
	mov	edi, r12d
	mov	rsi, rax
	call	PredicateLockPage@PLT
	mov	edi, r15d
	call	PageGetMaxOffsetNumber@PLT
	mov	esi, r13d
	mov	rdi, rbp
	mov	edx, eax
	call	_bt_readpage@PLT
	test	rax, rax
	je	.L19
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	_bt_readnextpage, .-_bt_readnextpage
	.comm	P_NONE,8,8
	.comm	InvalidBuffer,8,8
	.comm	BT_READ,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_nbtsearch.c__bt_readnextpage.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	_bt_readnextpage, %function
_bt_readnextpage:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r0
	sub	sp, sp, #8
	mov	r0, r2
	mov	r8, r2
	ldr	r5, [r4, #12]
	ldr	r7, [r4, #8]
	str	r1, [sp, #4]
	bl	ScanDirectionIsForward
	cmp	r0, #0
	beq	.L2
	ldr	r9, .L43
	ldr	r3, [sp, #4]
	ldr	r2, [r9]
	cmp	r2, r3
	beq	.L35
	ldr	r10, .L43+4
	b	.L3
.L6:
	ldr	r3, [r4]
	ldr	r2, [r6]
	cmp	r3, #0
	beq	.L38
	mov	r1, r2
	mov	r0, r4
	bl	_bt_parallel_release
.L8:
	ldr	r3, [r4]
	ldr	r1, [r5]
	cmp	r3, #0
	ldreq	r2, [r6]
	beq	.L9
	mov	r0, r7
	bl	_bt_relbuf
	mov	r0, r4
	add	r1, sp, #4
	bl	_bt_parallel_seize
	subs	r6, r0, #0
	beq	.L36
.L11:
	ldr	r2, [sp, #4]
	ldr	r3, [r9]
	cmp	r2, r3
	beq	.L35
.L3:
	ldr	r3, [r5, #12]
	cmp	r3, #0
	beq	.L35
	bl	CHECK_FOR_INTERRUPTS
	ldr	r2, [r10]
	ldr	r1, [sp, #4]
	mov	r0, r7
	bl	_bt_getbuf
	str	r0, [r5]
	bl	BufferGetPage
	mov	r6, r0
	mov	r2, r0
	mov	r1, r7
	ldr	r0, [r4, #4]
	bl	TestForOldSnapshot
	mov	r0, r6
	bl	PageGetSpecialPointer
	mov	r6, r0
	bl	P_IGNORE
	cmp	r0, #0
	bne	.L6
	ldr	r2, [r4, #4]
	ldr	r1, [sp, #4]
	mov	r0, r7
	bl	PredicateLockPage
	mov	r0, r6
	bl	P_FIRSTDATAKEY
	mov	r1, r8
	mov	r2, r0
	mov	r0, r4
	bl	_bt_readpage
	cmp	r0, #0
	beq	.L8
.L7:
	mov	r6, #1
	mov	r0, r6
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L35:
	mov	r6, #0
	mov	r0, r4
	bl	_bt_parallel_done
	ldm	r5, {r0, r1, r2, r3}
	bl	BTScanPosInvalidate
	mov	r0, r6
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	ldr	r2, [r5, #4]
	ldr	r3, [sp, #4]
	cmp	r2, r3
	bne	.L39
.L12:
	ldm	r5, {r0, r1, r2, r3}
	bl	BTScanPosIsPinned
	cmp	r0, #0
	ldr	r10, .L43+4
	bne	.L40
	ldr	r1, [r5, #4]
	mov	r0, r7
	ldr	r2, [r10]
	bl	_bt_getbuf
	mov	r1, r0
	str	r0, [r5]
.L15:
	ldr	r9, .L43+8
.L22:
	ldr	r6, [r5, #8]
	cmp	r6, #0
	beq	.L41
.L16:
	ldr	r2, [r4, #4]
	mov	r0, r7
	bl	_bt_walk_left
	ldr	r2, [r9]
	str	r0, [r5]
	cmp	r0, r2
	beq	.L35
	bl	BufferGetPage
	mov	r6, r0
	mov	r2, r0
	mov	r1, r7
	ldr	r0, [r4, #4]
	bl	TestForOldSnapshot
	mov	r0, r6
	bl	PageGetSpecialPointer
	bl	P_IGNORE
	cmp	r0, #0
	beq	.L42
	ldr	r3, [r4]
	ldr	r1, [r5]
	cmp	r3, #0
	beq	.L22
	mov	r0, r1
	bl	BufferGetBlockNumber
	mov	r1, r0
	mov	r0, r4
	bl	_bt_parallel_release
.L19:
	ldr	r3, [r4]
	ldr	r1, [r5]
	cmp	r3, #0
	beq	.L22
	mov	r0, r7
	bl	_bt_relbuf
	mov	r0, r4
	add	r1, sp, #4
	bl	_bt_parallel_seize
	subs	r6, r0, #0
	beq	.L36
	ldr	r1, [sp, #4]
	mov	r0, r7
	ldr	r2, [r10]
	bl	_bt_getbuf
	ldr	r6, [r5, #8]
	mov	r1, r0
	cmp	r6, #0
	str	r0, [r5]
	bne	.L16
.L41:
	mov	r0, r7
	bl	_bt_relbuf
	mov	r0, r4
	bl	_bt_parallel_done
	ldm	r5, {r0, r1, r2, r3}
	bl	BTScanPosInvalidate
	mov	r0, r6
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L40:
	ldr	r1, [r10]
	ldr	r0, [r5]
	bl	LockBuffer
	ldr	r1, [r5]
	b	.L15
.L39:
	ldm	r5, {r0, r1, r2, r3}
	bl	BTScanPosUnpinIfPinned
	ldr	r3, [sp, #4]
	str	r3, [r5, #4]
	b	.L12
.L42:
	ldr	r0, [r5]
	bl	BufferGetBlockNumber
	ldr	r2, [r4, #4]
	mov	r1, r0
	mov	r0, r7
	bl	PredicateLockPage
	mov	r0, r6
	bl	PageGetMaxOffsetNumber
	mov	r1, r8
	mov	r2, r0
	mov	r0, r4
	bl	_bt_readpage
	cmp	r0, #0
	beq	.L19
	b	.L7
.L38:
	ldr	r1, [r5]
.L9:
	mov	r0, r7
	str	r2, [sp, #4]
	bl	_bt_relbuf
	b	.L11
.L36:
	ldm	r5, {r0, r1, r2, r3}
	bl	BTScanPosInvalidate
	mov	r0, r6
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L44:
	.align	2
.L43:
	.word	P_NONE
	.word	BT_READ
	.word	InvalidBuffer
	.size	_bt_readnextpage, .-_bt_readnextpage
	.comm	P_NONE,4,4
	.comm	InvalidBuffer,4,4
	.comm	BT_READ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
