	.file	"extr_backup.c_sqlite3BtreeCopyFile.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	sqlite3BtreeCopyFile
	.type	sqlite3BtreeCopyFile, @function
sqlite3BtreeCopyFile:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	sub	rsp, 56
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	r14, rsp
	call	sqlite3BtreeEnter@PLT
	mov	rdi, r12
	call	sqlite3BtreeEnter@PLT
	mov	rdi, rbp
	call	sqlite3BtreeIsInTrans@PLT
	mov	rdi, rax
	call	assert@PLT
	mov	rdi, rbp
	call	sqlite3BtreePager@PLT
	mov	edi, eax
	call	sqlite3PagerFile@PLT
	cmp	QWORD PTR [rax], 0
	je	.L2
	mov	rdi, r12
	mov	r13, rax
	call	sqlite3BtreeGetPageSize@PLT
	mov	rdi, r12
	mov	r14d, eax
	call	sqlite3BtreeLastPage@PLT
	mov	esi, DWORD PTR SQLITE_FCNTL_OVERWRITE[rip]
	mov	rdi, r13
	imul	r14d, eax
	mov	DWORD PTR [rsp], r14d
	mov	r14, rsp
	mov	rdx, r14
	call	sqlite3OsFileControl@PLT
	cmp	DWORD PTR SQLITE_NOTFOUND[rip], eax
	mov	r13d, eax
	je	.L16
	test	r13d, r13d
	jne	.L5
.L2:
	mov	edx, 32
	xor	esi, esi
	mov	rdi, r14
	call	memset@PLT
	mov	eax, DWORD PTR 8[r12]
	mov	esi, 2147483647
	mov	rdi, r14
	mov	QWORD PTR 16[rsp], r12
	mov	DWORD PTR 24[rsp], eax
	mov	QWORD PTR 8[rsp], rbp
	mov	DWORD PTR [rsp], 1
	call	sqlite3_backup_step@PLT
	mov	eax, DWORD PTR SQLITE_OK[rip]
	xor	edi, edi
	cmp	DWORD PTR 4[rsp], eax
	setne	dil
	call	assert@PLT
	mov	rdi, r14
	call	sqlite3_backup_finish@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r13d, eax
	jne	.L6
	mov	eax, DWORD PTR BTS_PAGESIZE_FIXED[rip]
	mov	rdx, QWORD PTR 0[rbp]
	not	eax
	and	DWORD PTR [rdx], eax
.L7:
	mov	rdi, rbp
	call	sqlite3BtreeIsInTrans@PLT
	xor	edi, edi
	test	rax, rax
	sete	dil
	call	assert@PLT
.L5:
	mov	rdi, r12
	call	sqlite3BtreeLeave@PLT
	mov	rdi, rbp
	call	sqlite3BtreeLeave@PLT
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L17
	add	rsp, 56
	.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
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	mov	rdi, QWORD PTR 8[rsp]
	call	sqlite3BtreePager@PLT
	mov	edi, eax
	call	sqlite3PagerClearCache@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L16:
	mov	r13d, DWORD PTR SQLITE_OK[rip]
	test	r13d, r13d
	je	.L2
	jmp	.L5
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	sqlite3BtreeCopyFile, .-sqlite3BtreeCopyFile
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_NOTFOUND,4,4
	.comm	SQLITE_FCNTL_OVERWRITE,4,4
	.comm	BTS_PAGESIZE_FIXED,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_backup.c_sqlite3BtreeCopyFile.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	sqlite3BtreeCopyFile
	.syntax unified
	.arm
	.fpu softvfp
	.type	sqlite3BtreeCopyFile, %function
sqlite3BtreeCopyFile:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r1
	mov	r4, r0
	ldr	r3, .L18
	sub	sp, sp, #24
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	bl	sqlite3BtreeEnter
	mov	r0, r5
	bl	sqlite3BtreeEnter
	mov	r0, r4
	bl	sqlite3BtreeIsInTrans
	bl	assert
	mov	r0, r4
	bl	sqlite3BtreePager
	bl	sqlite3PagerFile
	ldr	r3, [r0]
	cmp	r3, #0
	moveq	r8, sp
	beq	.L2
	mov	r6, r0
	mov	r0, r5
	bl	sqlite3BtreeGetPageSize
	mov	r7, r0
	mov	r0, r5
	bl	sqlite3BtreeLastPage
	mov	r8, sp
	mul	r7, r0, r7
	ldr	r3, .L18+4
	mov	r0, r6
	ldr	r1, [r3]
	mov	r2, r8
	str	r7, [sp]
	bl	sqlite3OsFileControl
	mov	r6, r0
	ldr	r3, .L18+8
	ldr	r3, [r3]
	cmp	r3, r0
	ldreq	r3, .L18+12
	ldreq	r6, [r3]
	cmp	r6, #0
	bne	.L5
.L2:
	mov	r1, #0
	mov	r2, #1
	ldr	r3, [r5, #4]
	ldr	r7, .L18+12
	stmib	sp, {r1, r4, r5}
	mov	r0, r8
	mvn	r1, #-2147483648
	str	r2, [sp]
	str	r3, [sp, #16]
	bl	sqlite3_backup_step
	ldr	r3, [r7]
	ldr	r0, [sp, #4]
	subs	r0, r0, r3
	movne	r0, #1
	bl	assert
	mov	r0, r8
	bl	sqlite3_backup_finish
	ldr	r3, [r7]
	mov	r6, r0
	cmp	r3, r0
	bne	.L6
	ldr	r2, [r4]
	ldr	r1, .L18+16
	ldr	r3, [r2]
	ldr	r1, [r1]
	bic	r3, r3, r1
	str	r3, [r2]
.L7:
	mov	r0, r4
	bl	sqlite3BtreeIsInTrans
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
.L5:
	mov	r0, r5
	bl	sqlite3BtreeLeave
	mov	r0, r4
	bl	sqlite3BtreeLeave
	ldr	r3, .L18
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L17
	mov	r0, r6
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L6:
	ldr	r0, [sp, #8]
	bl	sqlite3BtreePager
	bl	sqlite3PagerClearCache
	b	.L7
.L17:
	bl	__stack_chk_fail
.L19:
	.align	2
.L18:
	.word	.LC0
	.word	SQLITE_FCNTL_OVERWRITE
	.word	SQLITE_NOTFOUND
	.word	SQLITE_OK
	.word	BTS_PAGESIZE_FIXED
	.size	sqlite3BtreeCopyFile, .-sqlite3BtreeCopyFile
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_NOTFOUND,4,4
	.comm	SQLITE_FCNTL_OVERWRITE,4,4
	.comm	BTS_PAGESIZE_FIXED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
