	.file	"extr_bt_delete.c___bt_pdelete.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	__bt_pdelete, @function
__bt_pdelete:
.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
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
.L2:
	mov	rdi, r12
	call	BT_POP@PLT
	mov	rbx, rax
	test	rax, rax
	je	.L17
	mov	esi, DWORD PTR 8[rbx]
	mov	edi, DWORD PTR 4[r12]
	xor	edx, edx
	call	mpool_get@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L31
	mov	r14, QWORD PTR [rbx]
	mov	rdi, rax
	mov	rsi, r14
	call	GETBINTERNAL@PLT
	mov	rbx, rax
	mov	eax, DWORD PTR [rax]
	test	DWORD PTR P_BIGKEY[rip], eax
	je	.L5
	mov	esi, DWORD PTR 8[rbx]
	mov	rdi, r12
	call	__ovfl_delete@PLT
	cmp	eax, DWORD PTR RET_ERROR[rip]
	je	.L33
.L5:
	mov	rdi, rbp
	call	NEXTINDEX@PLT
	cmp	rax, 1
	jne	.L6
	mov	rax, QWORD PTR P_ROOT[rip]
	cmp	QWORD PTR 0[rbp], rax
	je	.L34
	mov	rsi, rbp
	mov	rdi, r12
	call	__bt_relink@PLT
	test	rax, rax
	jne	.L31
	mov	rsi, rbp
	mov	rdi, r12
	call	__bt_free@PLT
	test	rax, rax
	je	.L2
.L31:
	mov	eax, DWORD PTR RET_ERROR[rip]
.L1:
	add	rsp, 24
	.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
.L20:
	.cfi_restore_state
	mov	rbx, rax
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rdi, rbp
	mov	QWORD PTR 8[rsp], rcx
	call	NEXTINDEX@PLT
	mov	rcx, QWORD PTR 8[rsp]
	mov	r8, rax
	mov	rax, r14
	not	rax
	add	rax, r8
	je	.L14
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rdx, QWORD PTR 8[rbx]
	cmp	rdx, rcx
	lea	rsi, [rdx+r15]
	cmovb	rdx, rsi
	add	rbx, 8
	mov	QWORD PTR -8[rbx], rdx
	sub	rax, 1
	jne	.L16
.L14:
	sub	DWORD PTR 8[rbp], 8
.L8:
	mov	edi, DWORD PTR 4[r12]
	mov	edx, DWORD PTR MPOOL_DIRTY[rip]
	mov	rsi, rbp
	call	mpool_put@PLT
.L17:
	mov	rax, QWORD PTR P_ROOT[rip]
	cmp	QWORD PTR 0[r13], rax
	je	.L35
	mov	rsi, r13
	mov	rdi, r12
	call	__bt_relink@PLT
	mov	r8, rax
	mov	eax, 1
	test	r8, r8
	jne	.L1
	mov	rsi, r13
	mov	rdi, r12
	call	__bt_free@PLT
	test	rax, rax
	setne	al
	movzx	eax, al
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	edi, DWORD PTR 4[rbx]
	call	NBINTERNAL@PLT
	movsx	rsi, DWORD PTR 12[rbp]
	mov	rdx, rbx
	movsx	r15, eax
	add	rsi, rbp
	mov	DWORD PTR 8[rsp], r15d
	sub	rdx, rsi
	lea	rdi, [rsi+r15]
	call	memmove@PLT
	mov	rax, QWORD PTR 16[rbp]
	mov	ecx, DWORD PTR 8[rsp]
	lea	rsi, -1[r14]
	add	DWORD PTR 12[rbp], ecx
	lea	rbx, [rax+r14*8]
	mov	rcx, QWORD PTR [rbx]
	test	r14, r14
	je	.L20
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rdx, QWORD PTR [rax]
	cmp	rdx, rcx
	jnb	.L12
	add	rdx, r15
	mov	QWORD PTR [rax], rdx
.L12:
	sub	rsi, 1
	add	rax, 8
	cmp	rsi, -1
	jne	.L13
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L34:
	mov	eax, DWORD PTR BTDATAOFF[rip]
	mov	DWORD PTR 8[rbp], eax
	mov	eax, DWORD PTR [r12]
	mov	DWORD PTR 12[rbp], eax
	mov	eax, DWORD PTR P_BLEAF[rip]
	mov	DWORD PTR 24[rbp], eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L35:
	mov	edi, DWORD PTR 4[r12]
	mov	edx, DWORD PTR MPOOL_DIRTY[rip]
	mov	rsi, r13
	call	mpool_put@PLT
	mov	eax, DWORD PTR RET_SUCCESS[rip]
	jmp	.L1
.L33:
	mov	edi, DWORD PTR 4[r12]
	xor	edx, edx
	mov	rsi, rbp
	call	mpool_put@PLT
	jmp	.L31
	.cfi_endproc
.LFE0:
	.size	__bt_pdelete, .-__bt_pdelete
	.comm	RET_SUCCESS,4,4
	.comm	RET_ERROR,4,4
	.comm	P_ROOT,8,8
	.comm	P_BLEAF,4,4
	.comm	P_BIGKEY,4,4
	.comm	MPOOL_DIRTY,4,4
	.comm	BTDATAOFF,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_bt_delete.c___bt_pdelete.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	__bt_pdelete, %function
__bt_pdelete:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r0
	mov	r8, r1
	ldr	r9, .L37
	ldr	r10, .L37+4
	ldr	r7, .L37+8
.L2:
	mov	r0, r5
	bl	BT_POP
	subs	r6, r0, #0
	beq	.L32
	mov	r2, #0
	ldr	r1, [r6, #4]
	ldr	r0, [r5, #4]
	bl	mpool_get
	subs	r4, r0, #0
	beq	.L10
	ldr	fp, [r6]
	mov	r1, fp
	bl	GETBINTERNAL
	ldr	r3, [r9]
	ldr	r2, [r0]
	mov	r6, r0
	tst	r2, r3
	beq	.L5
	ldr	r1, [r0, #8]
	mov	r0, r5
	bl	__ovfl_delete
	ldr	r3, [r10]
	cmp	r0, r3
	beq	.L33
.L5:
	mov	r0, r4
	bl	NEXTINDEX
	cmp	r0, #1
	bne	.L6
	ldr	r2, [r4]
	ldr	r3, [r7]
	mov	r6, r7
	cmp	r2, r3
	beq	.L34
	mov	r1, r4
	mov	r0, r5
	bl	__bt_relink
	cmp	r0, #0
	bne	.L10
	mov	r1, r4
	mov	r0, r5
	bl	__bt_free
	cmp	r0, #0
	beq	.L2
.L10:
	ldr	r3, .L37+4
	ldr	r0, [r3]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L32:
	ldr	r6, .L37+8
.L17:
	ldr	r3, [r6]
	ldr	r2, [r8]
	cmp	r2, r3
	beq	.L35
	mov	r1, r8
	mov	r0, r5
	bl	__bt_relink
	cmp	r0, #0
	beq	.L36
	mov	r0, #1
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L6:
	ldr	r0, [r6, #4]
	bl	NBINTERNAL
	mov	r7, r0
	ldr	r1, [r4, #8]
	add	r1, r4, r1
	sub	r2, r6, r1
	add	r0, r1, r0
	bl	memmove
	ldr	r3, [r4, #8]
	ldr	r1, [r4, #12]
	add	r3, r3, r7
	cmp	fp, #0
	ldr	r9, [r1, fp, lsl #2]
	str	r3, [r4, #8]
	add	r6, r1, fp, lsl #2
	sub	r2, fp, #1
	beq	.L20
	sub	r1, r1, #4
.L13:
	ldr	r3, [r1, #4]!
	sub	r2, r2, #1
	cmp	r3, r9
	addcc	r3, r7, r3
	strcc	r3, [r1]
	cmn	r2, #1
	bne	.L13
.L11:
	mov	r0, r4
	bl	NEXTINDEX
	mvn	fp, fp
	adds	fp, fp, r0
	beq	.L14
.L16:
	ldr	r3, [r6, #4]
	cmp	r3, r9
	addcc	r3, r3, r7
	subs	fp, fp, #1
	str	r3, [r6], #4
	bne	.L16
.L14:
	ldr	r3, [r4, #4]
	ldr	r6, .L37+8
	sub	r3, r3, #4
	str	r3, [r4, #4]
.L8:
	ldr	r3, .L37+12
	mov	r1, r4
	ldr	r2, [r3]
	ldr	r0, [r5, #4]
	bl	mpool_put
	b	.L17
.L34:
	ldr	r2, .L37+16
	ldr	r3, .L37+20
	ldr	r1, [r2]
	ldr	r2, [r3]
	ldr	r3, [r5]
	str	r1, [r4, #4]
	str	r2, [r4, #16]
	str	r3, [r4, #8]
	b	.L8
.L36:
	mov	r1, r8
	mov	r0, r5
	bl	__bt_free
	subs	r0, r0, #0
	movne	r0, #1
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L35:
	ldr	r3, .L37+12
	mov	r1, r8
	ldr	r2, [r3]
	ldr	r0, [r5, #4]
	bl	mpool_put
	ldr	r3, .L37+24
	ldr	r0, [r3]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L33:
	mov	r1, r4
	mov	r2, #0
	ldr	r0, [r5, #4]
	bl	mpool_put
	ldr	r0, [r10]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L20:
	mov	r6, r1
	b	.L11
.L38:
	.align	2
.L37:
	.word	P_BIGKEY
	.word	RET_ERROR
	.word	P_ROOT
	.word	MPOOL_DIRTY
	.word	BTDATAOFF
	.word	P_BLEAF
	.word	RET_SUCCESS
	.size	__bt_pdelete, .-__bt_pdelete
	.comm	RET_SUCCESS,4,4
	.comm	RET_ERROR,4,4
	.comm	P_ROOT,4,4
	.comm	P_BLEAF,4,4
	.comm	P_BIGKEY,4,4
	.comm	MPOOL_DIRTY,4,4
	.comm	BTDATAOFF,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
