	.file	"extr_sqlite3_omit.c_walIndexRecover.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"failed"
.LC1:
	.string	"ok"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"recovered %d frames from WAL file %s"
	.text
	.p2align 4
	.type	walIndexRecover, @function
walIndexRecover:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	r12, rdi
	push	rbx
	sub	rsp, 120
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR [rdi], 1
	setbe	dil
	movzx	edi, dil
	call	assert@PLT
	mov	eax, DWORD PTR WAL_WRITE_LOCK[rip]
	xor	edi, edi
	add	eax, 1
	cmp	eax, DWORD PTR WAL_ALL_BUT_WRITE[rip]
	sete	dil
	call	assert@PLT
	mov	eax, DWORD PTR WAL_ALL_BUT_WRITE[rip]
	xor	edi, edi
	cmp	DWORD PTR WAL_CKPT_LOCK[rip], eax
	sete	dil
	call	assert@PLT
	mov	edi, DWORD PTR 4[r12]
	call	assert@PLT
	xor	edi, edi
	mov	r13d, DWORD PTR WAL_ALL_BUT_WRITE[rip]
	add	r13d, DWORD PTR [r12]
	call	WAL_READ_LOCK@PLT
	mov	esi, r13d
	mov	rdi, r12
	sub	eax, r13d
	mov	edx, eax
	call	walLockExclusive@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r15d, eax
	je	.L43
.L2:
	test	r15d, r15d
	je	.L44
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L45
	lea	rsp, -40[rbp]
	mov	eax, r15d
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L44:
	.cfi_restore_state
	mov	rdi, r12
	call	WALTRACE@PLT
	xor	esi, esi
	lea	rdi, 16[r12]
	mov	edx, 4
	call	memset@PLT
	mov	edi, DWORD PTR 56[r12]
	lea	rsi, -64[rbp]
	call	sqlite3OsFileSize@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	ebx, eax
	jne	.L24
	mov	rdx, QWORD PTR WAL_HDRSIZE[rip]
	xor	r14d, r14d
	cmp	QWORD PTR -64[rbp], rdx
	jg	.L46
.L5:
	mov	rax, QWORD PTR 24[r12]
	mov	rdi, r12
	mov	DWORD PTR [rax], r15d
	mov	DWORD PTR 4[rax], r14d
	call	walIndexWriteHdr@PLT
	mov	rdi, r12
	call	walCkptInfo@PLT
	mov	edx, DWORD PTR 32[r12]
	mov	QWORD PTR 16[rax], 0
	mov	DWORD PTR [rax], edx
	mov	rdx, QWORD PTR 8[rax]
	mov	DWORD PTR [rdx], 0
	cmp	DWORD PTR WAL_NREADER[rip], 1
	jle	.L19
	mov	ecx, 4
	mov	edx, 1
	.p2align 4,,10
	.p2align 3
.L20:
	mov	rsi, QWORD PTR 8[rax]
	mov	edi, DWORD PTR READMARK_NOT_USED[rip]
	add	edx, 1
	mov	DWORD PTR [rsi+rcx], edi
	add	rcx, 4
	cmp	DWORD PTR WAL_NREADER[rip], edx
	jg	.L20
.L19:
	mov	edx, DWORD PTR 32[r12]
	test	edx, edx
	je	.L21
	mov	rax, QWORD PTR 8[rax]
	mov	DWORD PTR 4[rax], edx
.L21:
	mov	eax, DWORD PTR 36[r12]
	mov	r15d, ebx
	test	eax, eax
	je	.L4
	mov	ecx, DWORD PTR 12[r12]
	mov	edx, DWORD PTR 32[r12]
	lea	rsi, .LC2[rip]
	mov	edi, DWORD PTR SQLITE_NOTICE_RECOVER_WAL[rip]
	call	sqlite3_log@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L24:
	mov	r15d, eax
.L4:
	test	r15d, r15d
	lea	rax, .LC1[rip]
	lea	rdi, .LC0[rip]
	cmove	rdi, rax
	call	WALTRACE@PLT
	xor	edi, edi
	call	WAL_READ_LOCK@PLT
	mov	esi, r13d
	mov	rdi, r12
	sub	eax, r13d
	mov	edx, eax
	call	walUnlockExclusive@PLT
	mov	eax, DWORD PTR WAL_NREADER[rip]
	mov	edi, 1
	lea	r13d, -1[rax]
	call	WAL_READ_LOCK@PLT
	mov	edx, r13d
	mov	rdi, r12
	mov	esi, eax
	call	walUnlockExclusive@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L43:
	mov	eax, DWORD PTR WAL_NREADER[rip]
	mov	edi, 1
	lea	r14d, -1[rax]
	call	WAL_READ_LOCK@PLT
	mov	edx, r14d
	mov	rdi, r12
	mov	esi, eax
	call	walLockExclusive@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r15d, eax
	je	.L2
	xor	edi, edi
	call	WAL_READ_LOCK@PLT
	mov	esi, r13d
	mov	rdi, r12
	sub	eax, r13d
	mov	edx, eax
	call	walUnlockExclusive@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L46:
	lea	rax, 15[0+rdx*8]
	mov	rbx, rsp
	mov	r15, rsp
	mov	rcx, rax
	and	rax, -4096
	sub	rbx, rax
	and	rcx, -16
	mov	rax, rbx
	cmp	rsp, rax
	je	.L7
.L47:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L47
.L7:
	and	ecx, 4095
	sub	rsp, rcx
	test	rcx, rcx
	je	.L8
	or	QWORD PTR -8[rsp+rcx], 0
.L8:
	mov	edi, DWORD PTR 56[r12]
	mov	rbx, rsp
	xor	ecx, ecx
	mov	rsi, rbx
	call	sqlite3OsRead@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r9d, eax
	je	.L48
.L9:
	mov	rsp, r15
	mov	r15d, r9d
	jmp	.L4
.L48:
	mov	rdi, rbx
	mov	DWORD PTR -84[rbp], eax
	call	sqlite3Get4byte@PLT
	lea	rdi, 64[rbx]
	mov	r14, rax
	call	sqlite3Get4byte@PLT
	mov	r9d, DWORD PTR -84[rbp]
	mov	r11, rax
	mov	eax, r14d
	and	eax, -2
	cmp	eax, DWORD PTR WAL_MAGIC[rip]
	jne	.L10
	lea	eax, -1[r11]
	mov	DWORD PTR -88[rbp], r11d
	and	eax, r11d
	mov	DWORD PTR -84[rbp], eax
	jne	.L10
	cmp	DWORD PTR SQLITE_MAX_PAGE_SIZE[rip], r11d
	jl	.L10
	cmp	r11d, 511
	jle	.L10
	and	r14d, 1
	mov	DWORD PTR 8[r12], r11d
	lea	rdi, 96[rbx]
	mov	QWORD PTR 16[r12], r14
	mov	DWORD PTR -104[rbp], r9d
	mov	QWORD PTR -96[rbp], r11
	call	sqlite3Get4byte@PLT
	lea	rdi, 48[r12]
	mov	edx, 8
	lea	rsi, 128[rbx]
	mov	QWORD PTR 64[r12], rax
	call	memcpy@PLT
	mov	r8, QWORD PTR 24[r12]
	xor	edi, edi
	mov	rsi, rbx
	mov	rax, QWORD PTR WAL_HDRSIZE[rip]
	lea	rdx, -8[rax]
	mov	rax, QWORD PTR SQLITE_BIGENDIAN[rip]
	cmp	QWORD PTR 16[r12], rax
	sete	dil
	xor	ecx, ecx
	call	walChecksumBytes@PLT
	mov	rax, QWORD PTR 24[r12]
	lea	rdi, 192[rbx]
	movsx	r14, DWORD PTR [rax]
	call	sqlite3Get4byte@PLT
	mov	r11, QWORD PTR -96[rbp]
	mov	r9d, DWORD PTR -104[rbp]
	cmp	r14, rax
	je	.L49
	.p2align 4,,10
	.p2align 3
.L10:
	xor	r14d, r14d
	xor	r11d, r11d
	mov	rsp, r15
	mov	r15d, r9d
.L18:
	cmp	DWORD PTR SQLITE_OK[rip], r9d
	jne	.L4
	mov	ebx, r9d
	mov	r15d, r11d
	jmp	.L5
.L49:
	mov	rax, QWORD PTR 24[r12]
	lea	rdi, 224[rbx]
	mov	DWORD PTR -96[rbp], r9d
	mov	QWORD PTR -104[rbp], r11
	movsx	r14, DWORD PTR 4[rax]
	call	sqlite3Get4byte@PLT
	mov	r9d, DWORD PTR -96[rbp]
	cmp	r14, rax
	jne	.L10
	lea	rdi, 32[rbx]
	call	sqlite3Get4byte@PLT
	cmp	DWORD PTR WAL_MAX_VERSION[rip], eax
	mov	r9d, DWORD PTR -96[rbp]
	mov	r11, QWORD PTR -104[rbp]
	je	.L11
	mov	r9d, DWORD PTR SQLITE_CANTOPEN_BKPT[rip]
	jmp	.L10
.L45:
	call	__stack_chk_fail@PLT
.L11:
	mov	eax, r11d
	add	eax, DWORD PTR WAL_FRAME_HDRSIZE[rip]
	mov	DWORD PTR -112[rbp], r9d
	mov	edi, eax
	mov	QWORD PTR -104[rbp], r11
	mov	DWORD PTR -96[rbp], eax
	call	sqlite3_malloc64@PLT
	mov	r11, QWORD PTR -104[rbp]
	mov	r9d, DWORD PTR -112[rbp]
	test	rax, rax
	mov	rbx, rax
	je	.L50
	movsx	rax, DWORD PTR WAL_FRAME_HDRSIZE[rip]
	mov	DWORD PTR -140[rbp], r13d
	xor	r14d, r14d
	mov	r13d, r9d
	mov	QWORD PTR -152[rbp], r15
	mov	rcx, QWORD PTR WAL_HDRSIZE[rip]
	mov	r15, r12
	lea	rax, [rbx+rax*8]
	mov	QWORD PTR -120[rbp], rax
	mov	eax, r11d
	sar	r11d, 16
	and	eax, 65280
	or	r11d, eax
	movsx	rax, r11d
	xor	r11d, r11d
	mov	QWORD PTR -104[rbp], rax
	movsx	rax, DWORD PTR -96[rbp]
	mov	r12d, r11d
	mov	QWORD PTR -128[rbp], rax
	lea	rax, -68[rbp]
	mov	QWORD PTR -136[rbp], rax
	jmp	.L13
.L15:
	mov	rcx, QWORD PTR -112[rbp]
.L13:
	mov	rax, QWORD PTR -128[rbp]
	add	rax, rcx
	mov	QWORD PTR -112[rbp], rax
	cmp	rax, QWORD PTR -64[rbp]
	jg	.L16
	mov	edi, DWORD PTR 56[r15]
	mov	edx, DWORD PTR -96[rbp]
	mov	rsi, rbx
	add	DWORD PTR -84[rbp], 1
	call	sqlite3OsRead@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r13d, eax
	jne	.L16
	mov	rcx, QWORD PTR -120[rbp]
	lea	rsi, -72[rbp]
	mov	r8, rbx
	mov	rdi, r15
	mov	rdx, QWORD PTR -136[rbp]
	call	walDecodeFrame@PLT
	test	eax, eax
	je	.L16
	mov	edx, DWORD PTR -72[rbp]
	mov	esi, DWORD PTR -84[rbp]
	mov	rdi, r15
	call	walIndexAppend@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r13d, eax
	jne	.L16
	mov	eax, DWORD PTR -68[rbp]
	test	eax, eax
	je	.L15
	mov	ecx, DWORD PTR -84[rbp]
	mov	r14d, DWORD PTR -88[rbp]
	mov	DWORD PTR 36[r15], eax
	xor	edi, edi
	mov	rax, QWORD PTR -104[rbp]
	mov	DWORD PTR 32[r15], ecx
	cmp	r14d, 32768
	mov	QWORD PTR 40[r15], rax
	setle	dil
	call	testcase@PLT
	xor	edi, edi
	cmp	r14d, 65535
	setg	dil
	call	testcase@PLT
	mov	rax, QWORD PTR 24[r15]
	mov	r12d, DWORD PTR [rax]
	mov	r14d, DWORD PTR 4[rax]
	jmp	.L15
.L16:
	mov	rdi, rbx
	mov	DWORD PTR -88[rbp], r13d
	mov	r13d, DWORD PTR -140[rbp]
	mov	DWORD PTR -84[rbp], r12d
	mov	r12, r15
	mov	r15, QWORD PTR -152[rbp]
	call	sqlite3_free@PLT
	mov	r9d, DWORD PTR -88[rbp]
	mov	r11d, DWORD PTR -84[rbp]
	mov	rsp, r15
	mov	r15d, r9d
	jmp	.L18
.L50:
	mov	r9d, DWORD PTR SQLITE_NOMEM_BKPT[rip]
	jmp	.L9
	.cfi_endproc
.LFE0:
	.size	walIndexRecover, .-walIndexRecover
	.comm	WAL_WRITE_LOCK,4,4
	.comm	WAL_NREADER,4,4
	.comm	WAL_MAX_VERSION,4,4
	.comm	WAL_MAGIC,4,4
	.comm	WAL_HDRSIZE,8,8
	.comm	WAL_FRAME_HDRSIZE,4,4
	.comm	WAL_CKPT_LOCK,4,4
	.comm	WAL_ALL_BUT_WRITE,4,4
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_NOTICE_RECOVER_WAL,4,4
	.comm	SQLITE_NOMEM_BKPT,4,4
	.comm	SQLITE_MAX_PAGE_SIZE,4,4
	.comm	SQLITE_CANTOPEN_BKPT,4,4
	.comm	SQLITE_BIGENDIAN,8,8
	.comm	READMARK_NOT_USED,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_sqlite3_omit.c_walIndexRecover.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"failed\000"
	.align	2
.LC1:
	.ascii	"ok\000"
	.align	2
.LC2:
	.ascii	"recovered %d frames from WAL file %s\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	walIndexRecover, %function
walIndexRecover:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #60
	mov	r4, r0
	ldr	r0, [r0]
	ldr	r3, .L46
	cmp	r0, #1
	movhi	r0, #0
	movls	r0, #1
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	bl	assert
	ldr	r3, .L46+4
	ldr	r5, .L46+8
	ldr	r3, [r3]
	ldr	r0, [r5]
	add	r3, r3, #1
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	ldr	r2, .L46+12
	ldr	r3, [r5]
	ldr	r0, [r2]
	ldr	r7, .L46+16
	sub	r0, r0, r3
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	ldr	r0, [r4, #4]
	bl	assert
	ldr	r3, [r5]
	ldr	r6, [r4]
	mov	r0, #0
	add	r6, r6, r3
	bl	WAL_READ_LOCK
	mov	r1, r6
	sub	r2, r0, r6
	mov	r0, r4
	bl	walLockExclusive
	ldr	r3, [r7]
	mov	r5, r0
	cmp	r3, r0
	beq	.L40
.L2:
	cmp	r5, #0
	beq	.L41
.L1:
	ldr	r3, .L46
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L42
	mov	r0, r5
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L41:
	mov	r0, r4
	bl	WALTRACE
	ldr	r0, [r4, #40]
	strb	r5, [r4, #16]
	strb	r5, [r4, #17]
	strb	r5, [r4, #18]
	strb	r5, [r4, #19]
	sub	r1, fp, #52
	bl	sqlite3OsFileSize
	ldr	r3, [r7]
	mov	r8, r0
	cmp	r3, r0
	bne	.L21
	ldr	r9, .L46+20
	ldr	r3, [fp, #-52]
	ldr	r2, [r9]
	cmp	r3, r2
	movle	r10, r5
	bgt	.L43
.L5:
	ldr	r3, [r4, #20]
	mov	r0, r4
	stm	r3, {r5, r10}
	bl	walIndexWriteHdr
	mov	r0, r4
	bl	walCkptInfo
	mov	r3, #0
	ldr	r2, [r4, #24]
	str	r3, [r0, #8]
	str	r2, [r0]
	ldr	r2, [r0, #4]
	ldr	r9, .L46+24
	str	r3, [r2]
	ldr	r3, [r9]
	cmp	r3, #1
	ble	.L16
	mov	r3, #1
	ldr	ip, .L46+28
.L17:
	ldr	r2, [r0, #4]
	ldr	r1, [ip]
	str	r1, [r2, r3, lsl #2]
	ldr	r2, [r9]
	add	r3, r3, #1
	cmp	r2, r3
	bgt	.L17
.L16:
	ldr	r3, [r4, #24]
	cmp	r3, #0
	ldrne	r2, [r0, #4]
	strne	r3, [r2, #4]
	ldr	r3, [r4, #28]
	cmp	r3, #0
	moveq	r5, r8
	beq	.L4
	ldr	r2, .L46+32
	ldr	r3, [r4, #12]
	ldr	r0, [r2]
	ldr	r1, .L46+36
	ldr	r2, [r4, #24]
	mov	r5, r8
	bl	sqlite3_log
	b	.L4
.L21:
	mov	r5, r0
.L38:
	ldr	r9, .L46+24
.L4:
	ldr	r3, .L46+40
	cmp	r5, #0
	ldr	r0, .L46+44
	moveq	r0, r3
	bl	WALTRACE
	mov	r0, #0
	bl	WAL_READ_LOCK
	mov	r1, r6
	sub	r2, r0, r6
	mov	r0, r4
	bl	walUnlockExclusive
	mov	r0, #1
	bl	WAL_READ_LOCK
	ldr	r2, [r9]
	mov	r1, r0
	sub	r2, r2, #1
	mov	r0, r4
	bl	walUnlockExclusive
	b	.L1
.L40:
	mov	r0, #1
	bl	WAL_READ_LOCK
	ldr	r9, .L46+24
	mov	r1, r0
	ldr	r2, [r9]
	mov	r0, r4
	sub	r2, r2, #1
	bl	walLockExclusive
	ldr	r3, [r7]
	mov	r5, r0
	cmp	r3, r0
	beq	.L2
	mov	r0, #0
	bl	WAL_READ_LOCK
	mov	r1, r6
	sub	r2, r0, r6
	mov	r0, r4
	bl	walUnlockExclusive
	b	.L2
.L43:
	lsl	r3, r2, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	str	sp, [fp, #-56]
	sub	sp, sp, r3
	add	r10, sp, #8
	mov	r3, r5
	mov	r1, r10
	ldr	r0, [r4, #40]
	bl	sqlite3OsRead
	ldr	r3, [r7]
	mov	r8, r0
	cmp	r3, r0
	beq	.L44
.L6:
	mov	r5, r8
	ldr	r9, .L46+24
	ldr	sp, [fp, #-56]
	b	.L4
.L44:
	mov	r0, r10
	bl	sqlite3Get4byte
	str	r0, [fp, #-60]
	add	r0, r10, #32
	bl	sqlite3Get4byte
	ldr	r2, .L46+48
	ldr	r3, [fp, #-60]
	ldr	r2, [r2]
	bic	r1, r3, #1
	cmp	r1, r2
	str	r0, [fp, #-60]
	bne	.L7
	sub	r2, r0, #1
	ands	r2, r0, r2
	str	r2, [fp, #-64]
	bne	.L7
	cmp	r0, #512
	movge	r2, #0
	movlt	r2, #1
	ldr	r1, .L46+52
	ldr	r1, [r1]
	cmp	r0, r1
	orrgt	r2, r2, #1
	cmp	r2, #0
	beq	.L45
.L7:
	mov	r10, #0
	mov	r5, r8
	mov	r9, r10
	ldr	sp, [fp, #-56]
.L15:
	ldr	r3, [r7]
	cmp	r3, r8
	bne	.L38
	mov	r5, r9
	b	.L5
.L45:
	and	r3, r3, #1
	str	r3, [r4, #16]
	str	r0, [r4, #8]
	add	r0, r10, #48
	bl	sqlite3Get4byte
	mov	r2, #8
	str	r0, [r4, #44]
	add	r1, r10, #64
	add	r0, r4, #36
	bl	memcpy
	ldr	r3, .L46+56
	ldr	ip, [r4, #16]
	ldr	r0, [r3]
	ldr	r2, [r9]
	sub	r0, ip, r0
	clz	r0, r0
	ldr	r1, [r4, #20]
	mov	r3, r5
	sub	r2, r2, #8
	str	r1, [sp]
	lsr	r0, r0, #5
	mov	r1, r10
	bl	walChecksumBytes
	ldr	r3, [r4, #20]
	add	r0, r10, #96
	ldr	r5, [r3]
	bl	sqlite3Get4byte
	cmp	r5, r0
	bne	.L7
	ldr	r3, [r4, #20]
	add	r0, r10, #112
	ldr	r5, [r3, #4]
	bl	sqlite3Get4byte
	cmp	r5, r0
	bne	.L7
	add	r0, r10, #16
	bl	sqlite3Get4byte
	ldr	r3, .L46+60
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L8
	ldr	r3, .L46+64
	ldr	r8, [r3]
	b	.L7
.L42:
	bl	__stack_chk_fail
.L8:
	ldr	r5, .L46+68
	ldr	r2, [fp, #-60]
	ldr	r3, [r5]
	add	r3, r2, r3
	mov	r0, r3
	str	r3, [fp, #-72]
	bl	sqlite3_malloc64
	subs	r3, r0, #0
	str	r3, [fp, #-68]
	ldreq	r3, .L46+72
	ldreq	r8, [r3]
	beq	.L6
	mov	r10, #0
	ldr	r1, [fp, #-60]
	ldr	r3, [r5]
	ldr	r0, [fp, #-68]
	and	r2, r1, #65280
	add	r3, r0, r3, lsl #2
	orr	r2, r2, r1, asr #16
	str	r3, [fp, #-80]
	str	r6, [fp, #-84]
	ldr	r3, [r9]
	ldr	r6, [fp, #-64]
	mov	r9, r10
	str	r2, [fp, #-76]
	b	.L10
.L12:
	mov	r3, r5
.L10:
	ldr	r1, [fp, #-72]
	ldr	r2, [fp, #-52]
	add	r5, r3, r1
	cmp	r5, r2
	bgt	.L13
	ldr	r2, [fp, #-72]
	ldr	r1, [fp, #-68]
	ldr	r0, [r4, #40]
	bl	sqlite3OsRead
	ldr	r3, [r7]
	mov	r8, r0
	cmp	r3, r0
	add	r6, r6, #1
	bne	.L13
	ldr	r3, [fp, #-68]
	mov	r0, r4
	str	r3, [sp]
	ldr	r3, [fp, #-80]
	sub	r2, fp, #44
	sub	r1, fp, #48
	bl	walDecodeFrame
	cmp	r0, #0
	beq	.L13
	mov	r1, r6
	mov	r0, r4
	ldr	r2, [fp, #-48]
	bl	walIndexAppend
	ldr	r3, [r7]
	mov	r8, r0
	cmp	r3, r0
	bne	.L13
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	beq	.L12
	ldr	r9, [fp, #-60]
	str	r3, [r4, #28]
	ldr	r3, [fp, #-76]
	cmp	r9, #32768
	str	r3, [r4, #32]
	movgt	r0, #0
	movle	r0, #1
	str	r6, [r4, #24]
	bl	testcase
	cmp	r9, #65536
	movlt	r0, #0
	movge	r0, #1
	bl	testcase
	ldr	r3, [r4, #20]
	ldm	r3, {r9, r10}
	b	.L12
.L13:
	ldr	r0, [fp, #-68]
	ldr	r6, [fp, #-84]
	mov	r5, r8
	bl	sqlite3_free
	ldr	sp, [fp, #-56]
	b	.L15
.L47:
	.align	2
.L46:
	.word	.LC3
	.word	WAL_WRITE_LOCK
	.word	WAL_ALL_BUT_WRITE
	.word	WAL_CKPT_LOCK
	.word	SQLITE_OK
	.word	WAL_HDRSIZE
	.word	WAL_NREADER
	.word	READMARK_NOT_USED
	.word	SQLITE_NOTICE_RECOVER_WAL
	.word	.LC2
	.word	.LC1
	.word	.LC0
	.word	WAL_MAGIC
	.word	SQLITE_MAX_PAGE_SIZE
	.word	SQLITE_BIGENDIAN
	.word	WAL_MAX_VERSION
	.word	SQLITE_CANTOPEN_BKPT
	.word	WAL_FRAME_HDRSIZE
	.word	SQLITE_NOMEM_BKPT
	.size	walIndexRecover, .-walIndexRecover
	.comm	WAL_WRITE_LOCK,4,4
	.comm	WAL_NREADER,4,4
	.comm	WAL_MAX_VERSION,4,4
	.comm	WAL_MAGIC,4,4
	.comm	WAL_HDRSIZE,4,4
	.comm	WAL_FRAME_HDRSIZE,4,4
	.comm	WAL_CKPT_LOCK,4,4
	.comm	WAL_ALL_BUT_WRITE,4,4
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_NOTICE_RECOVER_WAL,4,4
	.comm	SQLITE_NOMEM_BKPT,4,4
	.comm	SQLITE_MAX_PAGE_SIZE,4,4
	.comm	SQLITE_CANTOPEN_BKPT,4,4
	.comm	SQLITE_BIGENDIAN,4,4
	.comm	READMARK_NOT_USED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
