	.file	"extr_sqlite3.c_sqlite3_db_cacheflush.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	sqlite3_db_cacheflush
	.type	sqlite3_db_cacheflush, @function
sqlite3_db_cacheflush:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xor	r14d, r14d
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13d, DWORD PTR SQLITE_OK[rip]
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	edi, DWORD PTR 4[rdi]
	xor	ebx, ebx
	call	sqlite3_mutex_enter@PLT
	mov	rdi, rbp
	call	sqlite3BtreeEnterAll@PLT
	cmp	r13d, DWORD PTR SQLITE_OK[rip]
	je	.L2
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L4:
	cmp	DWORD PTR SQLITE_OK[rip], r13d
	jne	.L6
.L5:
	add	rbx, 1
.L2:
	cmp	DWORD PTR 0[rbp], ebx
	jle	.L6
	mov	rax, QWORD PTR 8[rbp]
	mov	r12, QWORD PTR [rax+rbx*8]
	test	r12, r12
	je	.L4
	mov	rdi, r12
	call	sqlite3BtreeIsInTrans@PLT
	test	rax, rax
	je	.L4
	mov	rdi, r12
	call	sqlite3BtreePager@PLT
	mov	rdi, rax
	call	sqlite3PagerFlush@PLT
	cmp	DWORD PTR SQLITE_BUSY[rip], eax
	mov	r13d, eax
	jne	.L4
	mov	r13d, DWORD PTR SQLITE_OK[rip]
	mov	r14d, 1
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdi, rbp
	call	sqlite3BtreeLeaveAll@PLT
	mov	edi, DWORD PTR 4[rbp]
	call	sqlite3_mutex_leave@PLT
	cmp	DWORD PTR SQLITE_OK[rip], r13d
	jne	.L1
	test	r14d, r14d
	cmovne	r13d, DWORD PTR SQLITE_BUSY[rip]
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	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
.L26:
	.cfi_restore_state
	mov	rdi, rbp
	call	sqlite3BtreeLeaveAll@PLT
	mov	edi, DWORD PTR 4[rbp]
	call	sqlite3_mutex_leave@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	sqlite3_db_cacheflush, .-sqlite3_db_cacheflush
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_MISUSE_BKPT,4,4
	.comm	SQLITE_BUSY,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.c_sqlite3_db_cacheflush.c"
	.text
	.align	2
	.global	sqlite3_db_cacheflush
	.syntax unified
	.arm
	.fpu softvfp
	.type	sqlite3_db_cacheflush, %function
sqlite3_db_cacheflush:
	@ 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
	ldr	r10, .L24
	ldr	r0, [r0, #4]
	ldr	r7, [r10]
	bl	sqlite3_mutex_enter
	mov	r0, r5
	bl	sqlite3BtreeEnterAll
	ldr	r3, [r10]
	cmp	r7, r3
	bne	.L22
	mov	r8, #0
	ldr	r9, .L24+4
	mov	r4, r8
	b	.L2
.L4:
	ldr	r3, [r10]
	cmp	r3, r7
	bne	.L6
.L2:
	ldr	r3, [r5]
	cmp	r3, r4
	ble	.L6
.L7:
	ldr	r3, [r5, #8]
	ldr	r6, [r3, r4, lsl #2]
	add	r4, r4, #1
	cmp	r6, #0
	beq	.L4
	mov	r0, r6
	bl	sqlite3BtreeIsInTrans
	cmp	r0, #0
	beq	.L4
	mov	r0, r6
	bl	sqlite3BtreePager
	bl	sqlite3PagerFlush
	ldr	r3, [r9]
	mov	r7, r0
	cmp	r3, r0
	bne	.L4
	ldr	r3, [r5]
	mov	r8, #1
	cmp	r3, r4
	ldr	r7, [r10]
	bgt	.L7
.L6:
	mov	r0, r5
	bl	sqlite3BtreeLeaveAll
	ldr	r0, [r5, #4]
	bl	sqlite3_mutex_leave
	ldr	r3, [r10]
	cmp	r3, r7
	movne	r8, #0
	andeq	r8, r8, #1
	cmp	r8, #0
	bne	.L23
.L1:
	mov	r0, r7
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L23:
	ldr	r3, .L24+4
	ldr	r7, [r3]
	mov	r0, r7
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L22:
	mov	r0, r5
	bl	sqlite3BtreeLeaveAll
	ldr	r0, [r5, #4]
	bl	sqlite3_mutex_leave
	b	.L1
.L25:
	.align	2
.L24:
	.word	SQLITE_OK
	.word	SQLITE_BUSY
	.size	sqlite3_db_cacheflush, .-sqlite3_db_cacheflush
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_MISUSE_BKPT,4,4
	.comm	SQLITE_BUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
