	.file	"extr_lsm_sorted.c_btreeCursorFirst.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	btreeCursorFirst, @function
btreeCursorFirst:
.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
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	rsi, QWORD PTR 16[rdi]
	mov	rbx, QWORD PTR 24[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	lea	r12, 32[rsp]
	lea	r13, 28[rsp]
	mov	QWORD PTR 32[rsp], 0
	mov	edx, DWORD PTR [rsi]
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rcx, r12
	mov	rdi, rbx
	call	lsmFsDbPageGet@PLT
	cmp	DWORD PTR LSM_OK[rip], eax
	setne	dil
	cmp	QWORD PTR 32[rsp], 0
	mov	DWORD PTR 24[rsp], eax
	setne	al
	xor	edi, eax
	movzx	edi, dil
	call	assert@PLT
	mov	eax, DWORD PTR LSM_OK[rip]
	cmp	DWORD PTR 24[rsp], eax
	je	.L22
.L3:
	mov	rdi, QWORD PTR 32[rsp]
	call	lsmFsPageRelease@PLT
	mov	ecx, DWORD PTR 0[rbp]
	mov	eax, DWORD PTR 24[rsp]
	cmp	DWORD PTR LSM_OK[rip], eax
	lea	edx, -1[rcx]
	mov	DWORD PTR 4[rbp], edx
	jne	.L1
	test	ecx, ecx
	jne	.L23
.L1:
	mov	rbx, QWORD PTR 40[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L24
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L22:
	.cfi_restore_state
	mov	rdi, QWORD PTR 32[rsp]
	mov	rsi, r13
	call	fsPageData@PLT
	mov	esi, DWORD PTR 28[rsp]
	mov	rdi, rax
	mov	r14, rax
	call	pageGetFlags@PLT
	test	DWORD PTR SEGMENT_BTREE_FLAG[rip], eax
	je	.L3
	mov	r15d, DWORD PTR 0[rbp]
	test	r15b, 7
	je	.L25
.L5:
	mov	eax, DWORD PTR LSM_OK[rip]
	cmp	DWORD PTR 24[rsp], eax
	jne	.L3
	movsx	rax, DWORD PTR 0[rbp]
	xor	edi, edi
	sal	rax, 4
	add	rax, QWORD PTR 8[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	sete	dil
	call	assert@PLT
	movsx	rax, DWORD PTR 0[rbp]
	mov	esi, DWORD PTR 28[rsp]
	mov	rdi, r14
	mov	rcx, QWORD PTR 32[rsp]
	mov	rdx, rax
	sal	rax, 4
	add	rax, QWORD PTR 8[rbp]
	add	edx, 1
	mov	QWORD PTR 8[rax], rcx
	mov	DWORD PTR 0[rbp], edx
	xor	edx, edx
	call	pageGetRecordPtr@PLT
	mov	edx, eax
	mov	eax, DWORD PTR LSM_OK[rip]
	cmp	DWORD PTR 24[rsp], eax
	jne	.L3
	mov	rsi, QWORD PTR 16[rbp]
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L25:
	mov	rsi, QWORD PTR 8[rbp]
	mov	rdi, rbx
	mov	QWORD PTR 8[rsp], rsi
	call	lsmFsEnv@PLT
	mov	rsi, QWORD PTR 8[rsp]
	lea	edx, 8[r15]
	lea	rcx, 24[rsp]
	mov	edi, eax
	sal	edx, 4
	call	lsmReallocOrFreeRc@PLT
	mov	ecx, DWORD PTR LSM_OK[rip]
	mov	QWORD PTR 8[rbp], rax
	cmp	DWORD PTR 24[rsp], ecx
	jne	.L3
	movsx	rdi, DWORD PTR 0[rbp]
	mov	edx, 128
	xor	esi, esi
	sal	rdi, 4
	add	rdi, rax
	call	memset@PLT
	jmp	.L5
.L23:
	mov	rax, QWORD PTR 8[rbp]
	movsx	rdx, edx
	mov	rdi, rbp
	sal	rdx, 4
	add	rax, rdx
	mov	DWORD PTR [rax], -1
	call	btreeCursorNext@PLT
	jmp	.L1
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	btreeCursorFirst, .-btreeCursorFirst
	.comm	SEGMENT_BTREE_FLAG,4,4
	.comm	LSM_OK,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_lsm_sorted.c_btreeCursorFirst.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	btreeCursorFirst, %function
btreeCursorFirst:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, #0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r0
	ldr	r2, .L23
	ldr	r1, [r0, #12]
	sub	sp, sp, #16
	ldr	r6, [r0, #16]
	ldr	r5, .L23+4
	ldr	r7, .L23+8
	ldr	r2, [r2]
	str	r2, [sp, #12]
	mov	r2,#0
	ldr	r2, [r1]
	str	r3, [sp, #4]
.L8:
	add	r3, sp, #4
	mov	r0, r6
	bl	lsmFsDbPageGet
	ldr	r3, [sp, #4]
	ldr	r2, [r5]
	subs	r3, r3, #0
	movne	r3, #1
	str	r0, [sp]
	cmp	r2, r0
	moveq	r0, r3
	eorne	r0, r3, #1
	bl	assert
	ldr	r2, [sp]
	ldr	r3, [r5]
	cmp	r2, r3
	beq	.L19
.L3:
	ldr	r0, [sp, #4]
	bl	lsmFsPageRelease
	ldr	r3, [r5]
	ldr	r0, [sp]
	ldr	r2, [r4]
	sub	r3, r3, r0
	clz	r3, r3
	cmp	r2, #0
	lsr	r3, r3, #5
	moveq	r3, #0
	sub	r1, r2, #1
	cmp	r3, #0
	str	r1, [r4, #4]
	bne	.L20
.L1:
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L19:
	add	r1, sp, #8
	ldr	r0, [sp, #4]
	bl	fsPageData
	ldr	r1, [sp, #8]
	mov	r8, r0
	bl	pageGetFlags
	ldr	r3, [r7]
	tst	r0, r3
	beq	.L3
	ldr	r9, [r4]
	ands	r10, r9, #7
	beq	.L22
.L5:
	ldr	r2, [sp]
	ldr	r3, [r5]
	cmp	r2, r3
	bne	.L3
	ldr	r2, [r4]
	ldr	r3, [r4, #8]
	ldr	r0, [r3, r2, lsl #3]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	ldr	r3, [r4]
	ldr	r2, [r4, #8]
	ldr	r1, [sp, #4]
	add	r2, r2, r3, lsl #3
	add	r3, r3, #1
	str	r1, [r2, #4]
	mov	r0, r8
	mov	r2, #0
	ldr	r1, [sp, #8]
	str	r3, [r4]
	bl	pageGetRecordPtr
	ldr	r1, [sp]
	ldr	r3, [r5]
	mov	r2, r0
	cmp	r1, r3
	bne	.L3
	ldr	r1, [r4, #12]
	b	.L8
.L22:
	mov	r0, r6
	bl	lsmFsEnv
	add	r2, r9, #8
	mov	r3, sp
	lsl	r2, r2, #3
	ldr	r1, [r4, #8]
	bl	lsmReallocOrFreeRc
	ldr	r2, [sp]
	ldr	r3, [r5]
	str	r0, [r4, #8]
	cmp	r2, r3
	bne	.L3
	ldr	r3, [r4]
	mov	r1, r10
	mov	r2, #64
	add	r0, r0, r3, lsl #3
	bl	memset
	b	.L5
.L20:
	mvn	r2, #0
	ldr	r3, [r4, #8]
	mov	r0, r4
	str	r2, [r3, r1, lsl #3]
	bl	btreeCursorNext
	b	.L1
.L21:
	bl	__stack_chk_fail
.L24:
	.align	2
.L23:
	.word	.LC0
	.word	LSM_OK
	.word	SEGMENT_BTREE_FLAG
	.size	btreeCursorFirst, .-btreeCursorFirst
	.comm	SEGMENT_BTREE_FLAG,4,4
	.comm	LSM_OK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
