	.file	"extr_fts3_write.c_fts3RepackSegdirLevel.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	fts3RepackSegdirLevel, @function
fts3RepackSegdirLevel:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xor	ecx, ecx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	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	DWORD PTR 12[rsp], esi
	mov	esi, DWORD PTR SQL_SELECT_INDEXES[rip]
	lea	rdx, 24[rsp]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	QWORD PTR 24[rsp], 0
	mov	QWORD PTR 32[rsp], 0
	call	fts3SqlStmt@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r15d, eax
	je	.L30
	xor	ebx, ebx
	xor	ebp, ebp
	xor	r12d, r12d
.L8:
	mov	eax, DWORD PTR 0[r13]
	xor	edi, edi
	test	eax, eax
	sete	dil
	call	assert@PLT
	mov	DWORD PTR 0[r13], 1
	cmp	DWORD PTR SQLITE_OK[rip], r15d
	jne	.L9
	test	bl, bl
	je	.L9
	mov	r14, r12
	xor	ebx, ebx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L31:
	cmp	ebx, ebp
	jge	.L9
.L11:
	mov	edx, DWORD PTR [r14]
	cmp	edx, ebx
	je	.L10
	mov	rdi, QWORD PTR 32[rsp]
	mov	esi, 3
	call	sqlite3_bind_int@PLT
	mov	rdi, QWORD PTR 32[rsp]
	mov	edx, ebx
	mov	esi, 1
	call	sqlite3_bind_int@PLT
	mov	rdi, QWORD PTR 32[rsp]
	call	sqlite3_step@PLT
	mov	rdi, QWORD PTR 32[rsp]
	call	sqlite3_reset@PLT
	mov	r15d, eax
.L10:
	add	ebx, 1
	add	r14, 4
	cmp	DWORD PTR SQLITE_OK[rip], r15d
	je	.L31
.L9:
	mov	DWORD PTR 0[r13], 0
	mov	rdi, r12
	call	sqlite3_free@PLT
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L32
	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
.L30:
	.cfi_restore_state
	mov	edx, DWORD PTR 12[rsp]
	mov	rdi, QWORD PTR 24[rsp]
	mov	esi, 1
	xor	ebx, ebx
	xor	r14d, r14d
	xor	r12d, r12d
	call	sqlite3_bind_int64@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L6:
	cmp	r14d, ebx
	jg	.L4
	add	r14d, 16
	mov	rdi, r12
	lea	esi, 0[0+r14*4]
	call	sqlite3_realloc@PLT
	test	rax, rax
	je	.L33
	mov	r12, rax
.L4:
	mov	rdi, QWORD PTR 24[rsp]
	xor	esi, esi
	lea	rbp, [r12+rbx*4]
	add	rbx, 1
	call	sqlite3_column_int@PLT
	mov	DWORD PTR 0[rbp], eax
.L3:
	mov	rdi, QWORD PTR 24[rsp]
	mov	ebp, ebx
	call	sqlite3_step@PLT
	cmp	rax, QWORD PTR SQLITE_ROW[rip]
	je	.L6
.L5:
	mov	rdi, QWORD PTR 24[rsp]
	call	sqlite3_reset@PLT
	test	ebp, ebp
	setg	bl
	cmp	DWORD PTR SQLITE_OK[rip], r15d
	jne	.L8
	cmp	r15d, eax
	jne	.L16
	mov	esi, DWORD PTR SQL_SHIFT_SEGDIR_ENTRY[rip]
	xor	ecx, ecx
	lea	rdx, 32[rsp]
	mov	rdi, r13
	call	fts3SqlStmt@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r15d, eax
	jne	.L8
	mov	edx, DWORD PTR 12[rsp]
	mov	rdi, QWORD PTR 32[rsp]
	mov	esi, 2
	call	sqlite3_bind_int64@PLT
	jmp	.L8
.L33:
	mov	r15d, DWORD PTR SQLITE_NOMEM[rip]
	jmp	.L5
.L32:
	call	__stack_chk_fail@PLT
.L16:
	mov	r15d, eax
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	fts3RepackSegdirLevel, .-fts3RepackSegdirLevel
	.comm	SQL_SHIFT_SEGDIR_ENTRY,4,4
	.comm	SQL_SELECT_INDEXES,4,4
	.comm	SQLITE_ROW,8,8
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_NOMEM,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_fts3_write.c_fts3RepackSegdirLevel.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	fts3RepackSegdirLevel, %function
fts3RepackSegdirLevel:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, #0
	mov	r10, r1
	ldr	r2, .L26
	sub	sp, sp, #28
	ldr	ip, .L26+4
	str	r10, [sp, #4]
	ldr	r1, [r2]
	mov	r3, r4
	add	r2, sp, #12
	ldr	ip, [ip]
	str	ip, [sp, #20]
	mov	ip,#0
	mov	r8, r0
	str	r4, [sp, #12]
	str	r4, [sp, #16]
	bl	fts3SqlStmt
	ldr	r5, .L26+8
	mov	r10, r0
	ldr	r2, [r5]
	cmp	r2, r0
	movne	r6, r4
	movne	r7, r4
	beq	.L23
.L8:
	ldr	r0, [r8]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	mov	r2, #1
	str	r2, [r8]
	ldr	r2, [r5]
	cmp	r2, r10
	movne	r4, #0
	andeq	r4, r4, #1
	cmp	r4, #0
	beq	.L9
	mov	r4, #0
	sub	r9, r7, #4
.L11:
	ldr	r2, [r9, #4]!
	cmp	r2, r4
	beq	.L10
	mov	r1, #3
	ldr	r0, [sp, #16]
	bl	sqlite3_bind_int
	mov	r2, r4
	mov	r1, #1
	ldr	r0, [sp, #16]
	bl	sqlite3_bind_int
	ldr	r0, [sp, #16]
	bl	sqlite3_step
	ldr	r0, [sp, #16]
	bl	sqlite3_reset
	mov	r10, r0
.L10:
	ldr	r2, [r5]
	add	r4, r4, #1
	sub	r2, r2, r10
	clz	r2, r2
	cmp	r4, r6
	lsr	r2, r2, #5
	movge	r2, #0
	cmp	r2, #0
	bne	.L11
.L9:
	mov	r2, #0
	mov	r0, r7
	str	r2, [r8]
	bl	sqlite3_free
	ldr	r3, .L26+4
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L24
	mov	r0, r10
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L23:
	mov	r1, #1
	ldr	r2, [sp, #4]
	ldr	r0, [sp, #12]
	mov	r9, r4
	mov	r7, r4
	bl	sqlite3_bind_int64
	ldr	fp, .L26+12
	b	.L3
.L6:
	cmp	r4, r9
	blt	.L4
	add	r9, r9, #16
	mov	r0, r7
	lsl	r1, r9, #2
	bl	sqlite3_realloc
	cmp	r0, #0
	beq	.L25
	mov	r7, r0
.L4:
	mov	r1, #0
	ldr	r0, [sp, #12]
	bl	sqlite3_column_int
	str	r0, [r7, r4, lsl #2]
	add	r4, r4, #1
.L3:
	ldr	r0, [sp, #12]
	bl	sqlite3_step
	ldr	r2, [fp]
	mov	r6, r4
	cmp	r0, r2
	beq	.L6
.L5:
	ldr	r0, [sp, #12]
	bl	sqlite3_reset
	ldr	r2, [r5]
	cmp	r4, #0
	movle	r4, #0
	movgt	r4, #1
	cmp	r2, r10
	bne	.L8
	cmp	r10, r0
	bne	.L15
	ldr	r2, .L26+16
	mov	r3, #0
	ldr	r1, [r2]
	mov	r0, r8
	add	r2, sp, #16
	bl	fts3SqlStmt
	ldr	r2, [r5]
	mov	r10, r0
	cmp	r2, r0
	bne	.L8
	mov	r1, #2
	ldr	r2, [sp, #4]
	ldr	r0, [sp, #16]
	bl	sqlite3_bind_int64
	b	.L8
.L25:
	ldr	r3, .L26+20
	ldr	r10, [r3]
	b	.L5
.L24:
	bl	__stack_chk_fail
.L15:
	mov	r10, r0
	b	.L8
.L27:
	.align	2
.L26:
	.word	SQL_SELECT_INDEXES
	.word	.LC0
	.word	SQLITE_OK
	.word	SQLITE_ROW
	.word	SQL_SHIFT_SEGDIR_ENTRY
	.word	SQLITE_NOMEM
	.size	fts3RepackSegdirLevel, .-fts3RepackSegdirLevel
	.comm	SQL_SHIFT_SEGDIR_ENTRY,4,4
	.comm	SQL_SELECT_INDEXES,4,4
	.comm	SQLITE_ROW,4,4
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_NOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
