	.file	"extr_sqlite3.c_pager_truncate.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	pager_truncate, @function
pager_truncate:
.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
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rdi
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	r12d, DWORD PTR SQLITE_OK[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR PAGER_ERROR[rip]
	cmp	QWORD PTR [rdi], rax
	setne	dil
	movzx	edi, dil
	call	assert@PLT
	mov	rax, QWORD PTR PAGER_READER[rip]
	xor	edi, edi
	cmp	QWORD PTR [rbx], rax
	setne	dil
	call	assert@PLT
	mov	edi, DWORD PTR 40[rbx]
	call	isOpen@PLT
	test	rax, rax
	je	.L1
	mov	rax, QWORD PTR [rbx]
	cmp	rax, QWORD PTR PAGER_WRITER_DBMOD[rip]
	jge	.L3
	cmp	rax, QWORD PTR PAGER_OPEN[rip]
	je	.L3
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L14
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r12d
	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
.L3:
	.cfi_restore_state
	mov	rax, QWORD PTR EXCLUSIVE_LOCK[rip]
	xor	edi, edi
	cmp	QWORD PTR 16[rbx], rax
	sete	dil
	mov	r13d, DWORD PTR 8[rbx]
	call	assert@PLT
	mov	edi, DWORD PTR 40[rbx]
	lea	rsi, 4[rsp]
	call	sqlite3OsFileSize@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r12d, eax
	jne	.L1
	mov	r14d, r13d
	mov	eax, DWORD PTR 4[rsp]
	imul	r14d, ebp
	cmp	eax, r14d
	je	.L1
	jg	.L15
	add	eax, r13d
	cmp	eax, r14d
	jle	.L16
.L7:
	mov	QWORD PTR 32[rbx], rbp
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L15:
	mov	edi, DWORD PTR 40[rbx]
	mov	esi, r14d
	call	sqlite3OsTruncate@PLT
	mov	r12d, eax
.L6:
	cmp	DWORD PTR SQLITE_OK[rip], r12d
	jne	.L1
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L16:
	mov	r12, QWORD PTR 24[rbx]
	xor	esi, esi
	mov	edx, r13d
	sub	r14d, r13d
	mov	rdi, r12
	call	memset@PLT
	xor	edi, edi
	cmp	DWORD PTR 4[rsp], r14d
	sete	dil
	call	testcase@PLT
	xor	edi, edi
	cmp	r14d, DWORD PTR 4[rsp]
	setg	dil
	call	testcase@PLT
	mov	edi, DWORD PTR 40[rbx]
	mov	rsi, r12
	mov	ecx, r14d
	mov	edx, r13d
	call	sqlite3OsWrite@PLT
	mov	r12d, eax
	jmp	.L6
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	pager_truncate, .-pager_truncate
	.comm	SQLITE_OK,4,4
	.comm	PAGER_WRITER_DBMOD,8,8
	.comm	PAGER_READER,8,8
	.comm	PAGER_OPEN,8,8
	.comm	PAGER_ERROR,8,8
	.comm	EXCLUSIVE_LOCK,8,8
	.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_pager_truncate.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	pager_truncate, %function
pager_truncate:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r4, r0
	ldr	r3, .L17
	ldr	r0, [r0]
	ldr	r3, [r3]
	ldr	r6, .L17+4
	subs	r0, r0, r3
	ldr	r3, .L17+8
	sub	sp, sp, #12
	movne	r0, #1
	mov	r7, r1
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	ldr	r5, [r6]
	bl	assert
	ldr	r3, .L17+12
	ldr	r0, [r4]
	ldr	r3, [r3]
	subs	r0, r0, r3
	movne	r0, #1
	bl	assert
	ldr	r0, [r4, #20]
	bl	isOpen
	cmp	r0, #0
	beq	.L1
	ldr	r2, .L17+16
	ldr	r3, [r4]
	ldr	r2, [r2]
	cmp	r3, r2
	bge	.L3
	ldr	r2, .L17+20
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L3
.L1:
	ldr	r3, .L17+8
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L3:
	ldr	r3, .L17+24
	ldr	r0, [r4, #8]
	ldr	r3, [r3]
	ldr	r8, [r4, #4]
	sub	r0, r0, r3
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	mov	r1, sp
	ldr	r0, [r4, #20]
	bl	sqlite3OsFileSize
	ldr	r3, [r6]
	mov	r5, r0
	cmp	r3, r0
	bne	.L1
	mul	r9, r7, r8
	ldr	r3, [sp]
	cmp	r3, r9
	beq	.L1
	bgt	.L15
	add	r3, r3, r8
	cmp	r3, r9
	ble	.L16
.L7:
	str	r7, [r4, #16]
	b	.L1
.L15:
	mov	r1, r9
	ldr	r0, [r4, #20]
	bl	sqlite3OsTruncate
	mov	r5, r0
.L6:
	ldr	r3, [r6]
	cmp	r3, r5
	bne	.L1
	b	.L7
.L16:
	ldr	r5, [r4, #12]
	mov	r2, r8
	mov	r1, #0
	mov	r0, r5
	bl	memset
	ldr	r0, [sp]
	sub	r9, r9, r8
	sub	r0, r0, r9
	clz	r0, r0
	lsr	r0, r0, #5
	bl	testcase
	ldr	r0, [sp]
	cmp	r9, r0
	movle	r0, #0
	movgt	r0, #1
	bl	testcase
	mov	r1, r5
	mov	r3, r9
	mov	r2, r8
	ldr	r0, [r4, #20]
	bl	sqlite3OsWrite
	mov	r5, r0
	b	.L6
.L14:
	bl	__stack_chk_fail
.L18:
	.align	2
.L17:
	.word	PAGER_ERROR
	.word	SQLITE_OK
	.word	.LC0
	.word	PAGER_READER
	.word	PAGER_WRITER_DBMOD
	.word	PAGER_OPEN
	.word	EXCLUSIVE_LOCK
	.size	pager_truncate, .-pager_truncate
	.comm	SQLITE_OK,4,4
	.comm	PAGER_WRITER_DBMOD,4,4
	.comm	PAGER_READER,4,4
	.comm	PAGER_OPEN,4,4
	.comm	PAGER_ERROR,4,4
	.comm	EXCLUSIVE_LOCK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
