	.file	"extr_btree.c_btree_get_prev.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	btree_get_prev
	.type	btree_get_prev, @function
btree_get_prev:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	.cfi_offset 15, -24
	mov	r15, rsi
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 56
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	QWORD PTR -96[rbp], rdx
	mov	QWORD PTR -88[rbp], rdi
	mov	rcx, rsp
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR MAX_KEYLEN[rip]
	lea	rdx, 15[0+rax*8]
	mov	rax, rdx
	and	rdx, -4096
	sub	rcx, rdx
	and	rax, -16
	mov	rdx, rcx
	cmp	rsp, rdx
	je	.L3
.L46:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rdx
	jne	.L46
.L3:
	and	eax, 4095
	sub	rsp, rax
	test	rax, rax
	jne	.L47
.L4:
	mov	r14, QWORD PTR -96[rbp]
	mov	rdi, r15
	mov	rbx, rsp
	mov	rsi, r14
	call	keyzero@PLT
	test	rax, rax
	jne	.L5
	mov	rax, QWORD PTR -88[rbp]
	mov	ecx, DWORD PTR [rax]
	test	ecx, ecx
	je	.L5
	mov	edx, DWORD PTR 4[r15]
	mov	rsi, r14
	mov	rdi, rbx
	call	longcpy@PLT
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rsi, rbx
	mov	rdi, r15
	call	dec_key@PLT
	mov	rax, QWORD PTR -88[rbp]
	mov	QWORD PTR -80[rbp], 0
	mov	r12, QWORD PTR 8[rax]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -68[rbp], eax
	cmp	eax, 1
	jle	.L48
	.p2align 4,,10
	.p2align 3
.L7:
	mov	eax, DWORD PTR [r15]
	xor	r13d, r13d
	test	eax, eax
	jg	.L10
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L49:
	mov	eax, DWORD PTR [r15]
	add	r13d, 1
	cmp	eax, r13d
	jle	.L11
.L10:
	mov	rcx, rbx
	mov	edx, r13d
	mov	rsi, r12
	mov	rdi, r15
	call	keycmp@PLT
	test	rax, rax
	jg	.L49
	mov	eax, DWORD PTR [r15]
.L11:
	cmp	eax, r13d
	je	.L12
	mov	edx, r13d
	mov	rsi, r12
	mov	rdi, r15
	call	bval@PLT
	mov	r14, rax
	test	rax, rax
	je	.L12
	mov	edx, r13d
	mov	rsi, r12
	mov	rdi, r15
	call	bkey@PLT
	sub	DWORD PTR -68[rbp], 1
	mov	QWORD PTR -80[rbp], rax
	mov	eax, DWORD PTR -68[rbp]
	cmp	eax, 1
	je	.L13
	mov	r12, r14
	jmp	.L7
.L13:
	mov	edx, DWORD PTR [r15]
	test	edx, edx
	jle	.L12
.L18:
	xor	r13d, r13d
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L15:
	add	r13d, 1
	cmp	DWORD PTR [r15], r13d
	jle	.L12
.L17:
	mov	rcx, rbx
	mov	edx, r13d
	mov	rsi, r14
	mov	rdi, r15
	call	keycmp@PLT
	test	rax, rax
	jg	.L15
	mov	edx, r13d
	mov	rsi, r14
	mov	rdi, r15
	call	bval@PLT
	test	rax, rax
	jne	.L50
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rsi, QWORD PTR -80[rbp]
	test	rsi, rsi
	je	.L5
	mov	edx, DWORD PTR 4[r15]
	mov	rdi, rbx
	call	longcpy@PLT
	jmp	.L6
.L5:
	xor	eax, eax
.L1:
	mov	rcx, QWORD PTR -56[rbp]
	xor	rcx, QWORD PTR fs:40
	jne	.L51
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L48:
	.cfi_restore_state
	test	r12, r12
	je	.L5
	mov	eax, DWORD PTR [r15]
	test	eax, eax
	jle	.L5
	mov	r14, r12
	jmp	.L18
.L47:
	or	QWORD PTR -8[rsp+rax], 0
	jmp	.L4
.L50:
	mov	r12d, DWORD PTR 4[r15]
	mov	edx, r13d
	mov	rsi, r14
	mov	rdi, r15
	call	bkey@PLT
	mov	rdi, QWORD PTR -96[rbp]
	mov	edx, r12d
	mov	rsi, rax
	call	longcpy@PLT
	mov	edx, r13d
	mov	rsi, r14
	mov	rdi, r15
	call	bval@PLT
	jmp	.L1
.L51:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	btree_get_prev, .-btree_get_prev
	.comm	MAX_KEYLEN,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_btree.c_btree_get_prev.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	btree_get_prev
	.syntax unified
	.arm
	.fpu softvfp
	.type	btree_get_prev, %function
btree_get_prev:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #20
	mov	r4, r1
	mov	r9, r0
	ldr	r3, .L45
	str	r2, [fp, #-52]
	ldr	r3, [r3]
	str	r9, [fp, #-48]
	lsl	r3, r3, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	ldr	r3, .L45+4
	mov	r1, r2
	mov	r0, r4
	mov	r6, r2
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	bl	keyzero
	cmp	r0, #0
	bne	.L2
	ldr	r3, [r9]
	cmp	r3, #0
	beq	.L2
	mov	r5, sp
	mov	r1, r6
	mov	r0, r5
	ldr	r2, [r4, #4]
	bl	longcpy
.L3:
	mov	r1, r5
	mov	r0, r4
	bl	dec_key
	ldr	r3, [fp, #-48]
	ldm	r3, {r8, r10}
	cmp	r8, #1
	movgt	r7, #0
	ble	.L41
.L4:
	ldr	r3, [r4]
	mov	r9, #0
	cmp	r3, #0
	bgt	.L7
	b	.L8
.L42:
	add	r9, r9, #1
	cmp	r3, r9
	ble	.L8
.L7:
	mov	r3, r5
	mov	r2, r9
	mov	r1, r10
	mov	r0, r4
	bl	keycmp
	cmp	r0, #0
	ldr	r3, [r4]
	bgt	.L42
.L8:
	cmp	r3, r9
	beq	.L9
	mov	r2, r9
	mov	r1, r10
	mov	r0, r4
	bl	bval
	subs	r6, r0, #0
	beq	.L9
	mov	r2, r9
	mov	r1, r10
	mov	r0, r4
	bl	bkey
	sub	r8, r8, #1
	cmp	r8, #1
	mov	r7, r0
	movne	r10, r6
	bne	.L4
.L10:
	ldr	r3, [r4]
	cmp	r3, #0
	ble	.L9
.L15:
	mov	r8, #0
	b	.L14
.L12:
	ldr	r3, [r4]
	add	r8, r8, #1
	cmp	r3, r8
	ble	.L9
.L14:
	mov	r3, r5
	mov	r2, r8
	mov	r1, r6
	mov	r0, r4
	bl	keycmp
	cmp	r0, #0
	bgt	.L12
	mov	r2, r8
	mov	r1, r6
	mov	r0, r4
	bl	bval
	cmp	r0, #0
	bne	.L43
.L9:
	cmp	r7, #0
	beq	.L2
	mov	r1, r7
	mov	r0, r5
	ldr	r2, [r4, #4]
	bl	longcpy
	b	.L3
.L2:
	mov	r0, #0
.L1:
	ldr	r3, .L45+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L44
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L41:
	cmp	r10, #0
	beq	.L2
	ldr	r3, [r4]
	cmp	r3, #0
	ble	.L2
	mov	r6, r10
	mov	r7, #0
	b	.L15
.L43:
	mov	r2, r8
	mov	r1, r6
	mov	r0, r4
	bl	bkey
	ldr	r2, [r4, #4]
	mov	r1, r0
	ldr	r0, [fp, #-52]
	bl	longcpy
	mov	r2, r8
	mov	r1, r6
	mov	r0, r4
	bl	bval
	b	.L1
.L44:
	bl	__stack_chk_fail
.L46:
	.align	2
.L45:
	.word	MAX_KEYLEN
	.word	.LC0
	.size	btree_get_prev, .-btree_get_prev
	.comm	MAX_KEYLEN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
