	.file	"extr_pager.c_pager_delmaster.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	pager_delmaster, @function
pager_delmaster:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	r12, QWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR [r12]
	lea	edi, [rax+rax]
	call	sqlite3MallocZero@PLT
	mov	rbp, rax
	movsx	rax, DWORD PTR [r12]
	lea	r14, 0[rbp+rax*4]
	test	rbp, rbp
	jne	.L2
	mov	r15d, DWORD PTR SQLITE_NOMEM_BKPT[rip]
	cmp	r15d, DWORD PTR SQLITE_OK[rip]
	je	.L28
.L18:
	xor	edi, edi
	call	sqlite3_free@PLT
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L29
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	xor	edi, edi
	lea	rsi, 32[rsp]
	call	sqlite3OsFileSize@PLT
	cmp	eax, DWORD PTR SQLITE_OK[rip]
	mov	r15d, eax
	jne	.L18
.L17:
	mov	eax, DWORD PTR 4[r12]
	mov	edi, DWORD PTR 32[rsp]
	add	eax, 1
	add	edi, eax
	mov	DWORD PTR 28[rsp], eax
	add	edi, 1
	call	sqlite3Malloc@PLT
	mov	r15d, DWORD PTR SQLITE_NOMEM_BKPT[rip]
	mov	QWORD PTR [rsp], rax
	test	rax, rax
	je	.L8
	movsx	rbx, DWORD PTR 32[rsp]
	mov	rsi, QWORD PTR [rsp]
	xor	ecx, ecx
	mov	rdi, rbp
	mov	edx, ebx
	call	sqlite3OsRead@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r15d, eax
	jne	.L8
	movsx	rax, DWORD PTR 32[rsp]
	mov	rcx, QWORD PTR [rsp]
	mov	BYTE PTR [rcx+rax], 0
	mov	edx, DWORD PTR 32[rsp]
	test	edx, edx
	jle	.L9
	lea	rbx, 1[rcx+rbx]
	lea	rax, 36[rsp]
	mov	QWORD PTR 8[rsp], rbx
	mov	rbx, rcx
	mov	QWORD PTR 16[rsp], rax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rdi, rbx
	call	sqlite3Strlen30@PLT
	lea	rbx, 1[rbx+rax]
	movsx	rax, DWORD PTR 32[rsp]
	mov	rdx, rbx
	sub	rdx, QWORD PTR [rsp]
	cmp	rdx, rax
	jge	.L9
.L12:
	mov	rcx, QWORD PTR 16[rsp]
	mov	edx, DWORD PTR SQLITE_ACCESS_EXISTS[rip]
	mov	rsi, rbx
	mov	rdi, r12
	call	sqlite3OsAccess@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r15d, eax
	jne	.L8
	mov	eax, DWORD PTR 36[rsp]
	test	eax, eax
	je	.L13
	mov	ecx, DWORD PTR SQLITE_OPEN_READONLY[rip]
	xor	r8d, r8d
	mov	rdx, r14
	mov	rsi, rbx
	or	ecx, DWORD PTR SQLITE_OPEN_MAIN_JOURNAL[rip]
	mov	rdi, r12
	call	sqlite3OsOpen@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r15d, eax
	jne	.L8
	mov	edx, DWORD PTR 28[rsp]
	mov	rsi, QWORD PTR 8[rsp]
	mov	rdi, r14
	call	readMasterJournal@PLT
	mov	rdi, r14
	mov	r15d, eax
	call	sqlite3OsClose@PLT
	cmp	DWORD PTR SQLITE_OK[rip], r15d
	jne	.L8
	mov	rax, QWORD PTR 8[rsp]
	cmp	BYTE PTR [rax], 0
	je	.L13
	mov	rsi, r13
	mov	rdi, rax
	call	strcmp@PLT
	test	rax, rax
	jne	.L13
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, QWORD PTR [rsp]
	call	sqlite3_free@PLT
	test	rbp, rbp
	je	.L1
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L2:
	mov	ecx, DWORD PTR SQLITE_OPEN_READONLY[rip]
	xor	r8d, r8d
	mov	rdx, rbp
	mov	rsi, r13
	or	ecx, DWORD PTR SQLITE_OPEN_MASTER_JOURNAL[rip]
	mov	rdi, r12
	call	sqlite3OsOpen@PLT
	cmp	eax, DWORD PTR SQLITE_OK[rip]
	mov	r15d, eax
	je	.L30
.L16:
	xor	edi, edi
	call	sqlite3_free@PLT
.L15:
	mov	rdi, rbp
	call	sqlite3OsClose@PLT
	mov	rdi, r14
	call	isOpen@PLT
	xor	edi, edi
	test	eax, eax
	sete	dil
	call	assert@PLT
	mov	rdi, rbp
	call	sqlite3_free@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L30:
	lea	rsi, 32[rsp]
	mov	rdi, rbp
	call	sqlite3OsFileSize@PLT
	cmp	eax, DWORD PTR SQLITE_OK[rip]
	mov	r15d, eax
	jne	.L16
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rdi, rbp
	call	sqlite3OsClose@PLT
	xor	edx, edx
	mov	rsi, r13
	mov	rdi, r12
	call	sqlite3OsDelete@PLT
	mov	r15d, eax
	jmp	.L8
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	pager_delmaster, .-pager_delmaster
	.comm	SQLITE_OPEN_READONLY,4,4
	.comm	SQLITE_OPEN_MASTER_JOURNAL,4,4
	.comm	SQLITE_OPEN_MAIN_JOURNAL,4,4
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_NOMEM_BKPT,4,4
	.comm	SQLITE_ACCESS_EXISTS,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_pager.c_pager_delmaster.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_delmaster, %function
pager_delmaster:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r5, [r0]
	ldr	r3, .L41
	ldr	r0, [r5]
	sub	sp, sp, #44
	lsl	r0, r0, #1
	mov	r7, r1
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	bl	sqlite3MallocZero
	ldr	r6, [r5]
	cmp	r0, #0
	mov	r4, r0
	add	r6, r0, r6, lsl #2
	bne	.L2
	ldr	r3, .L41+4
	ldr	r8, .L41+8
	ldr	r10, [r3]
	ldr	r2, [r8]
	cmp	r2, r10
	beq	.L35
.L33:
	bl	sqlite3_free
.L1:
	ldr	r3, .L41
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L36
	mov	r0, r10
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L35:
	add	r1, sp, #28
	bl	sqlite3OsFileSize
	ldr	r2, [r8]
	mov	r10, r0
	cmp	r0, r2
	movne	r0, r4
	bne	.L33
.L17:
	ldr	r3, [r5, #4]
	ldr	r0, [sp, #28]
	add	r3, r3, #1
	add	r0, r3, r0
	add	r0, r0, #1
	str	r3, [sp, #16]
	bl	sqlite3Malloc
	subs	r3, r0, #0
	str	r3, [sp, #12]
	beq	.L37
	ldr	fp, [sp, #28]
	ldr	r9, [sp, #12]
	mov	r2, fp
	mov	r3, #0
	mov	r1, r9
	mov	r0, r4
	bl	sqlite3OsRead
	ldr	r2, [r8]
	mov	r10, r0
	cmp	r2, r0
	bne	.L8
	mov	r3, #0
	ldr	r2, [sp, #28]
	strb	r3, [r9, r2]
	ldr	r2, [sp, #28]
	cmp	r2, r3
	ble	.L9
	add	fp, fp, #1
	ldr	r10, [sp, #16]
	str	r4, [sp, #20]
	str	r3, [sp, #8]
	mov	r4, r9
	add	fp, r9, fp
	str	r7, [sp, #16]
	b	.L12
.L39:
	ldr	r3, [sp, #32]
	cmp	r3, #0
	beq	.L13
	ldr	r3, .L41+12
	ldr	r1, [sp, #8]
	ldr	r2, [r3]
	ldr	r3, .L41+16
	mov	r0, r5
	ldr	r3, [r3]
	str	r1, [sp]
	orr	r3, r2, r3
	mov	r1, r9
	mov	r2, r6
	bl	sqlite3OsOpen
	ldr	r2, [r8]
	mov	r7, r0
	cmp	r2, r0
	bne	.L31
	mov	r2, r10
	mov	r1, fp
	mov	r0, r6
	bl	readMasterJournal
	mov	r7, r0
	mov	r0, r6
	bl	sqlite3OsClose
	ldr	r2, [r8]
	cmp	r2, r7
	bne	.L31
	ldrb	r2, [fp]	@ zero_extendqisi2
	cmp	r2, #0
	beq	.L13
	mov	r0, fp
	ldr	r1, [sp, #16]
	bl	strcmp
	cmp	r0, #0
	beq	.L31
.L13:
	mov	r0, r9
	bl	sqlite3Strlen30
	add	r0, r0, #1
	ldr	r3, [sp, #28]
	add	r9, r9, r0
	sub	r2, r9, r4
	cmp	r2, r3
	bge	.L38
.L12:
	ldr	r2, .L41+20
	mov	r1, r9
	ldr	r2, [r2]
	mov	r0, r5
	add	r3, sp, #32
	bl	sqlite3OsAccess
	ldr	r2, [r8]
	mov	r7, r0
	cmp	r2, r0
	beq	.L39
.L31:
	mov	r10, r7
	ldr	r4, [sp, #20]
.L8:
	ldr	r0, [sp, #12]
	bl	sqlite3_free
	cmp	r4, #0
	beq	.L1
	b	.L15
.L2:
	mov	r9, #0
	ldr	r2, .L41+12
	ldr	r3, .L41+24
	ldr	r2, [r2]
	ldr	r3, [r3]
	mov	r1, r7
	orr	r3, r2, r3
	str	r9, [sp]
	mov	r2, r0
	mov	r0, r5
	bl	sqlite3OsOpen
	ldr	r8, .L41+8
	mov	r10, r0
	ldr	r2, [r8]
	cmp	r0, r2
	beq	.L40
.L16:
	mov	r0, r9
	bl	sqlite3_free
.L15:
	mov	r0, r4
	bl	sqlite3OsClose
	mov	r0, r6
	bl	isOpen
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	mov	r0, r4
	bl	sqlite3_free
	b	.L1
.L40:
	mov	r0, r4
	add	r1, sp, #28
	bl	sqlite3OsFileSize
	ldr	r2, [r8]
	mov	r10, r0
	cmp	r2, r0
	bne	.L16
	b	.L17
.L37:
	ldr	r3, .L41+4
	ldr	r10, [r3]
	b	.L8
.L38:
	ldr	r4, [sp, #20]
	ldr	r7, [sp, #16]
.L9:
	mov	r0, r4
	bl	sqlite3OsClose
	mov	r1, r7
	mov	r0, r5
	mov	r2, #0
	bl	sqlite3OsDelete
	mov	r10, r0
	b	.L8
.L36:
	bl	__stack_chk_fail
.L42:
	.align	2
.L41:
	.word	.LC0
	.word	SQLITE_NOMEM_BKPT
	.word	SQLITE_OK
	.word	SQLITE_OPEN_READONLY
	.word	SQLITE_OPEN_MAIN_JOURNAL
	.word	SQLITE_ACCESS_EXISTS
	.word	SQLITE_OPEN_MASTER_JOURNAL
	.size	pager_delmaster, .-pager_delmaster
	.comm	SQLITE_OPEN_READONLY,4,4
	.comm	SQLITE_OPEN_MASTER_JOURNAL,4,4
	.comm	SQLITE_OPEN_MAIN_JOURNAL,4,4
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_NOMEM_BKPT,4,4
	.comm	SQLITE_ACCESS_EXISTS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
