	.file	"extr_btree.c_getAndInitPage.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	getAndInitPage, @function
getAndInitPage:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14, rdx
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13d, r8d
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rcx
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	edi, DWORD PTR 4[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	sqlite3_mutex_held@PLT
	mov	edi, eax
	call	assert@PLT
	test	rbx, rbx
	je	.L2
	lea	rax, 32[rbx]
	xor	edi, edi
	cmp	r14, rax
	sete	dil
	call	assert@PLT
	xor	edi, edi
	cmp	DWORD PTR [rbx], r13d
	sete	dil
	call	assert@PLT
	xor	edi, edi
	cmp	QWORD PTR 8[rbx], 0
	setne	dil
.L12:
	call	assert@PLT
	mov	rdi, r12
	call	btreePagecount@PLT
	cmp	eax, ebp
	jge	.L3
	mov	r13d, DWORD PTR SQLITE_CORRUPT_BKPT[rip]
.L4:
	test	rbx, rbx
	je	.L10
	mov	rax, QWORD PTR 8[rbx]
	mov	rdx, QWORD PTR 24[rbx]
	sub	rax, 1
	mov	QWORD PTR 8[rbx], rax
	mov	rax, QWORD PTR [rdx+rax*8]
	mov	QWORD PTR 32[rbx], rax
.L10:
	xor	edi, edi
	test	ebp, ebp
	sete	dil
	call	testcase@PLT
	mov	edi, 1
	test	ebp, ebp
	je	.L23
.L11:
	call	assert@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L24
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	xor	edi, edi
	cmp	DWORD PTR SQLITE_CORRUPT[rip], r13d
	sete	dil
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edi, DWORD PTR [r12]
	mov	ecx, r13d
	mov	rdx, rsp
	mov	esi, ebp
	call	sqlite3PagerGet@PLT
	mov	r13d, eax
	test	eax, eax
	jne	.L4
	mov	rdi, QWORD PTR [rsp]
	call	sqlite3PagerGetExtra@PLT
	cmp	QWORD PTR [rax], 0
	mov	QWORD PTR [r14], rax
	je	.L25
.L5:
	xor	edi, edi
	cmp	DWORD PTR 32[rax], ebp
	sete	dil
	call	assert@PLT
	mov	rax, QWORD PTR [r14]
	mov	rdi, QWORD PTR [rsp]
	mov	r12, QWORD PTR 8[rax]
	call	sqlite3PagerGetData@PLT
	xor	edi, edi
	cmp	r12, rax
	sete	dil
	call	assert@PLT
	test	rbx, rbx
	je	.L7
	mov	rax, QWORD PTR [r14]
	mov	edx, DWORD PTR 16[rax]
	test	edx, edx
	jle	.L8
	mov	rcx, QWORD PTR 16[rbx]
	cmp	QWORD PTR 24[rax], rcx
	je	.L7
.L8:
	mov	edi, ebp
	call	SQLITE_CORRUPT_PGNO@PLT
	mov	r13d, eax
.L6:
	mov	rdi, QWORD PTR [r14]
	call	releasePage@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	mov	edi, 1
	call	assert@PLT
	mov	edi, 1
	call	assert@PLT
	mov	edi, 1
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L25:
	mov	rdi, QWORD PTR [rsp]
	mov	rdx, r12
	mov	esi, ebp
	call	btreePageFromDbPage@PLT
	mov	rdi, QWORD PTR [r14]
	call	btreeInitPage@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r13d, eax
	jne	.L6
	mov	rax, QWORD PTR [r14]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L7:
	mov	r13d, DWORD PTR SQLITE_OK[rip]
	jmp	.L1
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	getAndInitPage, .-getAndInitPage
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_CORRUPT_BKPT,4,4
	.comm	SQLITE_CORRUPT,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_btree.c_getAndInitPage.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	getAndInitPage, %function
getAndInitPage:
	@ args = 4, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r3
	ldr	r3, .L25
	sub	sp, sp, #8
	mov	r6, r0
	ldr	r0, [r0, #4]
	mov	r5, r1
	mov	r8, r2
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	ldr	r7, [sp, #32]
	bl	sqlite3_mutex_held
	bl	assert
	cmp	r4, #0
	beq	.L2
	add	r0, r4, #16
	sub	r0, r8, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	ldr	r0, [r4]
	sub	r0, r0, r7
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	ldr	r0, [r4, #4]
	subs	r0, r0, #0
	movne	r0, #1
.L12:
	bl	assert
	mov	r0, r6
	bl	btreePagecount
	cmp	r0, r5
	bge	.L3
	ldr	r3, .L25+4
	ldr	r7, [r3]
.L4:
	cmp	r4, #0
	beq	.L10
	ldr	r3, [r4, #4]
	ldr	r2, [r4, #12]
	sub	r3, r3, #1
	ldr	r2, [r2, r3, lsl #2]
	str	r3, [r4, #4]
	str	r2, [r4, #16]
.L10:
	clz	r0, r5
	lsr	r0, r0, #5
	bl	testcase
	cmp	r5, #0
	ldreq	r3, .L25+8
	movne	r0, #1
	ldreq	r0, [r3]
	subeq	r0, r0, r7
	clzeq	r0, r0
	lsreq	r0, r0, #5
	bl	assert
.L1:
	ldr	r3, .L25
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L23
	mov	r0, r7
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L3:
	mov	r3, r7
	mov	r2, sp
	mov	r1, r5
	ldr	r0, [r6]
	bl	sqlite3PagerGet
	subs	r7, r0, #0
	bne	.L4
	ldr	r0, [sp]
	bl	sqlite3PagerGetExtra
	ldr	r3, [r0]
	str	r0, [r8]
	cmp	r3, #0
	beq	.L24
.L5:
	ldr	r0, [r0, #16]
	sub	r0, r0, r5
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	ldr	r3, [r8]
	ldr	r0, [sp]
	ldr	r6, [r3, #4]
	bl	sqlite3PagerGetData
	sub	r0, r6, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	cmp	r4, #0
	beq	.L7
	ldr	r3, [r8]
	ldr	r2, [r3, #8]
	cmp	r2, #0
	ble	.L8
	ldr	r2, [r3, #12]
	ldr	r3, [r4, #8]
	cmp	r2, r3
	beq	.L7
.L8:
	mov	r0, r5
	bl	SQLITE_CORRUPT_PGNO
	mov	r7, r0
.L6:
	ldr	r0, [r8]
	bl	releasePage
	b	.L4
.L2:
	mov	r0, #1
	bl	assert
	mov	r0, #1
	bl	assert
	mov	r0, #1
	b	.L12
.L24:
	mov	r2, r6
	mov	r1, r5
	ldr	r0, [sp]
	bl	btreePageFromDbPage
	ldr	r0, [r8]
	bl	btreeInitPage
	ldr	r3, .L25+12
	mov	r7, r0
	ldr	r3, [r3]
	cmp	r3, r0
	bne	.L6
	ldr	r0, [r8]
	b	.L5
.L7:
	ldr	r3, .L25+12
	ldr	r7, [r3]
	b	.L1
.L23:
	bl	__stack_chk_fail
.L26:
	.align	2
.L25:
	.word	.LC0
	.word	SQLITE_CORRUPT_BKPT
	.word	SQLITE_CORRUPT
	.word	SQLITE_OK
	.size	getAndInitPage, .-getAndInitPage
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_CORRUPT_BKPT,4,4
	.comm	SQLITE_CORRUPT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
