	.file	"extr_jfs_dmap.c_dbAllocDmapBU.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	dbAllocDmapBU, @function
dbAllocDmapBU:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, ecx
	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
	mov	r12, rsi
	mov	esi, edx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR 16[r12]
	mov	DWORD PTR 20[rsp], edx
	mov	rdx, QWORD PTR ROOT[rip]
	mov	DWORD PTR 16[rsp], ecx
	mov	ecx, DWORD PTR L2DBWORD[rip]
	mov	rax, QWORD PTR [rax+rdx*8]
	mov	QWORD PTR 8[rsp], rdi
	xor	edi, edi
	mov	QWORD PTR 24[rsp], rax
	mov	eax, DWORD PTR BPERDMAP[rip]
	lea	ebx, -1[rax]
	and	ebx, esi
	mov	ebp, ebx
	lea	edx, [rbx+r15]
	sar	ebp, cl
	cmp	eax, edx
	setge	dil
	call	assert@PLT
	test	r15d, r15d
	jg	.L2
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	mov	edi, DWORD PTR ONES[rip]
	sub	ecx, eax
	mov	QWORD PTR [rsp], rsi
	sub	r15d, r14d
	add	ebp, 1
	add	ebx, r14d
	sal	edi, cl
	mov	ecx, r13d
	sar	edi, cl
	call	cpu_to_le32@PLT
	mov	rsi, QWORD PTR [rsp]
	add	rsi, QWORD PTR 8[r12]
	or	DWORD PTR [rsi], eax
	test	r15d, r15d
	jle	.L7
.L2:
	mov	esi, DWORD PTR DBWORD[rip]
	mov	edi, r15d
	lea	r9d, -1[rsi]
	and	r9d, ebx
	sub	esi, r9d
	mov	r13d, r9d
	call	min@PLT
	mov	ecx, DWORD PTR DBWORD[rip]
	movsx	rsi, ebp
	mov	r14d, eax
	sal	rsi, 2
	cmp	ecx, eax
	jg	.L18
	mov	ecx, DWORD PTR L2DBWORD[rip]
	mov	rdi, QWORD PTR 8[r12]
	mov	r9d, r15d
	sar	r9d, cl
	add	rdi, rsi
	mov	esi, DWORD PTR ONES[rip]
	lea	edx, 0[0+r9*4]
	mov	DWORD PTR [rsp], r9d
	call	memset@PLT
	mov	r9d, DWORD PTR [rsp]
	mov	ecx, DWORD PTR L2DBWORD[rip]
	mov	r14d, r9d
	add	ebp, r9d
	sal	r14d, cl
	sub	r15d, r14d
	add	ebx, r14d
	test	r15d, r15d
	jg	.L2
.L7:
	mov	esi, DWORD PTR 16[rsp]
	mov	rdi, r12
	neg	esi
	call	le32_add_cpu@PLT
	mov	rdi, r12
	call	dbInitDmapTree@PLT
	mov	rbx, QWORD PTR 8[rsp]
	mov	rdi, rbx
	call	BMAP_LOCK@PLT
	mov	ecx, DWORD PTR [rbx]
	mov	eax, DWORD PTR 20[rsp]
	sar	eax, cl
	cmp	DWORD PTR 4[rbx], eax
	jge	.L4
	mov	rdx, QWORD PTR 8[rsp]
	mov	DWORD PTR 4[rdx], eax
.L4:
	mov	r15, QWORD PTR 8[rsp]
	cdqe
	mov	ebx, DWORD PTR 16[rsp]
	mov	rdx, QWORD PTR 8[r15]
	mov	rdi, r15
	sub	DWORD PTR [rdx+rax*4], ebx
	sub	DWORD PTR 16[r15], ebx
	xor	ebx, ebx
	call	BMAP_UNLOCK@PLT
	mov	rax, QWORD PTR 16[r12]
	mov	rdx, QWORD PTR ROOT[rip]
	mov	rdx, QWORD PTR [rax+rdx*8]
	cmp	rdx, QWORD PTR 24[rsp]
	je	.L1
	mov	esi, DWORD PTR 20[rsp]
	xor	r8d, r8d
	mov	ecx, 1
	mov	rdi, r15
	call	dbAdjCtl@PLT
	mov	ebx, eax
	test	eax, eax
	jne	.L19
.L1:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, ebx
	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
.L19:
	.cfi_restore_state
	mov	ecx, DWORD PTR 16[rsp]
	mov	edx, DWORD PTR 20[rsp]
	mov	rsi, r12
	mov	rdi, QWORD PTR 8[rsp]
	call	dbFreeBits@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	dbAllocDmapBU, .-dbAllocDmapBU
	.comm	ROOT,8,8
	.comm	ONES,4,4
	.comm	LEAFIND,4,4
	.comm	L2DBWORD,4,4
	.comm	DBWORD,4,4
	.comm	BPERDMAP,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_jfs_dmap.c_dbAllocDmapBU.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	dbAllocDmapBU, %function
dbAllocDmapBU:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r3
	sub	sp, sp, #28
	str	r3, [sp, #8]
	ldr	r3, .L20
	str	r2, [sp, #12]
	ldr	r3, [r3]
	mov	r8, r1
	sub	r6, r3, #1
	and	r6, r6, r2
	ldr	r2, [r1, #8]
	ldr	r1, .L20+4
	mov	r9, r0
	ldr	r1, [r1]
	add	r0, r6, r4
	ldr	r10, .L20+8
	cmp	r3, r0
	ldr	r3, [r2, r1, lsl #2]
	movlt	r0, #0
	movge	r0, #1
	ldr	r5, [r10]
	str	r3, [sp, #16]
	bl	assert
	cmp	r4, #0
	asr	r5, r6, r5
	ble	.L7
	ldr	r4, [sp, #8]
	ldr	fp, .L20+12
	str	r9, [sp, #20]
	b	.L2
.L18:
	ldr	r3, .L20+16
	sub	r4, r4, r7
	ldr	r0, [r3]
	add	r6, r6, r7
	lsl	r0, r0, ip
	asr	r0, r0, r9
	bl	cpu_to_le32
	ldr	r2, [r8, #4]
	cmp	r4, #0
	ldr	r3, [r2, r5, lsl #2]
	orr	r3, r3, r0
	str	r3, [r2, r5, lsl #2]
	add	r5, r5, #1
	ble	.L17
.L2:
	ldr	r1, [fp]
	mov	r0, r4
	sub	r3, r1, #1
	and	r9, r3, r6
	sub	r1, r1, r9
	bl	min
	ldr	r2, [fp]
	mov	r7, r0
	cmp	r2, r0
	lsl	r1, r5, #2
	sub	ip, r2, r0
	bgt	.L18
	ldr	r7, [r10]
	ldr	r0, [r8, #4]
	ldr	r3, .L20+16
	asr	r7, r4, r7
	lsl	r2, r7, #2
	add	r0, r0, r1
	ldr	r1, [r3]
	bl	memset
	ldr	r0, [r10]
	add	r5, r5, r7
	lsl	r7, r7, r0
	sub	r4, r4, r7
	cmp	r4, #0
	add	r6, r6, r7
	bgt	.L2
.L17:
	ldr	r9, [sp, #20]
.L7:
	ldr	r3, [sp, #8]
	mov	r0, r8
	rsb	r1, r3, #0
	bl	le32_add_cpu
	mov	r0, r8
	bl	dbInitDmapTree
	mov	r0, r9
	bl	BMAP_LOCK
	ldr	r3, [r9]
	ldr	r1, [r9, #4]
	ldr	r0, [sp, #12]
	ldr	ip, [sp, #8]
	asr	r2, r0, r3
	cmp	r1, r0, asr r3
	ldr	r1, [r9, #8]
	strlt	r2, [r9, #4]
	ldr	r3, [r1, r2, lsl #2]
	mov	r0, r9
	sub	r3, r3, ip
	str	r3, [r1, r2, lsl #2]
	ldr	r3, [r9, #12]
	sub	r3, r3, ip
	str	r3, [r9, #12]
	bl	BMAP_UNLOCK
	ldr	r3, .L20+4
	ldr	r2, [r3]
	ldr	r3, [r8, #8]
	ldr	r2, [r3, r2, lsl #2]
	ldr	r3, [sp, #16]
	cmp	r2, r3
	moveq	r4, #0
	beq	.L1
	mov	r3, #0
	mov	r0, r9
	str	r3, [sp]
	ldr	r1, [sp, #12]
	mov	r3, #1
	bl	dbAdjCtl
	subs	r4, r0, #0
	bne	.L19
.L1:
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L19:
	mov	r1, r8
	mov	r0, r9
	ldr	r3, [sp, #8]
	ldr	r2, [sp, #12]
	bl	dbFreeBits
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L21:
	.align	2
.L20:
	.word	BPERDMAP
	.word	ROOT
	.word	L2DBWORD
	.word	DBWORD
	.word	ONES
	.size	dbAllocDmapBU, .-dbAllocDmapBU
	.comm	ROOT,4,4
	.comm	ONES,4,4
	.comm	LEAFIND,4,4
	.comm	L2DBWORD,4,4
	.comm	DBWORD,4,4
	.comm	BPERDMAP,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
