	.file	"extr_sqlite3.c_vdbePmaWriterFinish.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	vdbePmaWriterFinish, @function
vdbePmaWriterFinish:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	mov	eax, DWORD PTR 0[rbp]
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rsi
	mov	rdi, QWORD PTR 32[rdi]
	test	eax, eax
	je	.L2
	mov	rdx, QWORD PTR 8[rbp]
	mov	rcx, QWORD PTR 24[rbp]
.L3:
	add	rdx, rcx
	mov	QWORD PTR [rbx], rdx
	call	sqlite3_free@PLT
	mov	r12d, DWORD PTR 0[rbp]
	mov	rdi, rbp
	xor	esi, esi
	mov	edx, 48
	call	memset@PLT
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	call	ALWAYS@PLT
	mov	rdx, QWORD PTR 8[rbp]
	test	rax, rax
	je	.L6
	mov	rax, QWORD PTR 16[rbp]
	mov	rcx, QWORD PTR 24[rbp]
	mov	rdi, QWORD PTR 32[rbp]
	cmp	rdx, rax
	jbe	.L3
	lea	rsi, [rdi+rax*4]
	mov	edi, DWORD PTR 40[rbp]
	sub	rdx, rax
	add	rcx, rax
	call	sqlite3OsWrite@PLT
	mov	rdx, QWORD PTR 8[rbp]
	mov	DWORD PTR 0[rbp], eax
.L6:
	mov	rdi, QWORD PTR 32[rbp]
	mov	rcx, QWORD PTR 24[rbp]
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	vdbePmaWriterFinish, .-vdbePmaWriterFinish
	.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_vdbePmaWriterFinish.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	vdbePmaWriterFinish, %function
vdbePmaWriterFinish:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r0]
	push	{r4, r5, r6, lr}
	cmp	r3, #0
	mov	r4, r0
	mov	r5, r1
	ldr	r0, [r0, #16]
	beq	.L2
	ldr	r2, [r4, #4]
	ldr	r3, [r4, #12]
.L3:
	add	r2, r2, r3
	str	r2, [r5]
	bl	sqlite3_free
	ldr	r5, [r4]
	mov	r0, r4
	mov	r2, #24
	mov	r1, #0
	bl	memset
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L2:
	bl	ALWAYS
	cmp	r0, #0
	ldr	r2, [r4, #4]
	beq	.L7
	ldr	r1, [r4, #8]
	ldr	r0, [r4, #16]
	cmp	r2, r1
	ldr	r3, [r4, #12]
	bls	.L3
	add	r3, r1, r3
	sub	r2, r2, r1
	add	r1, r0, r1, lsl #2
	ldr	r0, [r4, #20]
	bl	sqlite3OsWrite
	mov	r1, r0
	ldr	r2, [r4, #4]
	ldr	r0, [r4, #16]
	ldr	r3, [r4, #12]
	str	r1, [r4]
	b	.L3
.L7:
	ldr	r0, [r4, #16]
	ldr	r3, [r4, #12]
	b	.L3
	.size	vdbePmaWriterFinish, .-vdbePmaWriterFinish
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
