	.file	"extr_aacraid.c_aac_alloc_commands.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	""
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"Not enough contiguous memory available.\n"
	.section	.rodata.str1.1
.LC2:
	.string	"total_fibs= %d\n"
	.text
	.p2align 4
	.type	aac_alloc_commands, @function
aac_alloc_commands:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	lea	rdx, .LC0[rip]
	mov	r15, rdi
	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
	lea	r12, 40[r15]
	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	rsi, QWORD PTR HBA_FLAGS_DBG_FUNCTION_ENTRY_B[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	fwprintf@PLT
	mov	esi, DWORD PTR MA_OWNED[rip]
	mov	rdi, r12
	call	mtx_assert@PLT
	mov	eax, DWORD PTR 4[r15]
	add	eax, DWORD PTR [r15]
	cmp	eax, DWORD PTR 8[r15]
	jle	.L2
.L20:
	mov	eax, DWORD PTR ENOMEM[rip]
.L1:
	mov	rbx, QWORD PTR 24[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L22
	add	rsp, 40
	.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
.L2:
	.cfi_restore_state
	mov	esi, DWORD PTR M_AACRAIDBUF[rip]
	mov	edx, DWORD PTR M_NOWAIT[rip]
	mov	edi, 24
	or	edx, DWORD PTR M_ZERO[rip]
	call	malloc@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L20
	mov	rdi, r12
	call	mtx_unlock@PLT
	mov	edi, DWORD PTR 20[r15]
	lea	rsi, 8[rbp]
	mov	rcx, rbp
	mov	edx, DWORD PTR BUS_DMA_NOWAIT[rip]
	call	bus_dmamem_alloc@PLT
	test	rax, rax
	jne	.L23
	mov	eax, DWORD PTR 12[r15]
	mov	edx, DWORD PTR 16[r15]
	mov	ecx, DWORD PTR 4[r15]
	mov	r8d, DWORD PTR aac_map_command_helper[rip]
	lea	r14d, 31[rax]
	add	eax, 35
	test	DWORD PTR AAC_FLAGS_NEW_COMM_TYPE1[rip], edx
	mov	rdx, QWORD PTR 8[rbp]
	cmovne	r14d, eax
	sub	rsp, 8
	.cfi_def_cfa_offset 104
	mov	edi, DWORD PTR 20[r15]
	mov	DWORD PTR 12[rsp], r14d
	imul	ecx, r14d
	push	0
	.cfi_def_cfa_offset 112
	mov	esi, DWORD PTR 0[rbp]
	lea	r9, 36[rsp]
	call	bus_dmamap_load@PLT
	mov	rdi, r12
	call	mtx_lock@PLT
	mov	esi, DWORD PTR 4[r15]
	mov	rdi, QWORD PTR 8[rbp]
	imul	esi, r14d
	call	bzero@PLT
	mov	ecx, DWORD PTR 4[r15]
	pop	rax
	.cfi_def_cfa_offset 104
	pop	rdx
	.cfi_def_cfa_offset 96
	test	ecx, ecx
	jle	.L8
	movsx	rdx, r14d
	mov	eax, DWORD PTR [r15]
	xor	r13d, r13d
	xor	r12d, r12d
	lea	rbx, 0[0+rdx*4]
	mov	QWORD PTR 8[rsp], rbx
	xor	ebx, ebx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L24:
	lea	ecx, 35[rdx]
.L19:
	and	ecx, -32
	mov	DWORD PTR 4[r14], eax
	mov	edi, ecx
	mov	DWORD PTR [r14], ecx
	sub	edi, edx
	movsx	rdx, edi
	mov	edi, DWORD PTR 28[r15]
	lea	rdx, [rsi+rdx*4]
	xor	esi, esi
	mov	QWORD PTR 16[r14], rdx
	lea	rdx, 8[r14]
	call	bus_dmamap_create@PLT
	test	eax, eax
	jne	.L11
	mov	edx, DWORD PTR 8[r15]
	cmp	edx, 1
	jle	.L12
	mov	eax, DWORD PTR [r15]
	sub	edx, eax
	cmp	edx, 1
	jle	.L13
.L12:
	mov	rdi, r14
	call	aacraid_release_command@PLT
	mov	eax, DWORD PTR [r15]
.L13:
	add	eax, 1
	add	ebx, 1
	add	r12, QWORD PTR 8[rsp]
	add	r13d, DWORD PTR 4[rsp]
	mov	DWORD PTR [r15], eax
	cmp	DWORD PTR 4[r15], ebx
	jle	.L15
.L14:
	mov	edx, DWORD PTR 20[rsp]
	mov	rsi, QWORD PTR 8[rbp]
	movsx	r8, eax
	sal	r8, 5
	add	r8, QWORD PTR 32[r15]
	mov	ecx, DWORD PTR 16[r15]
	add	edx, r13d
	mov	QWORD PTR 16[rbp], r8
	mov	r14, r8
	add	rsi, r12
	mov	QWORD PTR 24[r8], r15
	mov	DWORD PTR [r8], edx
	test	DWORD PTR AAC_FLAGS_NEW_COMM_TYPE1[rip], ecx
	jne	.L24
	lea	ecx, 31[rdx]
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L11:
	test	ebx, ebx
	jne	.L15
.L8:
	mov	edi, DWORD PTR 20[r15]
	mov	esi, DWORD PTR 0[rbp]
	call	bus_dmamap_unload@PLT
	mov	rsi, QWORD PTR 8[rbp]
	mov	edi, DWORD PTR 20[r15]
	mov	edx, DWORD PTR 0[rbp]
	call	bus_dmamem_free@PLT
	mov	esi, DWORD PTR M_AACRAIDBUF[rip]
	mov	rdi, rbp
	call	free@PLT
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L15:
	mov	edx, DWORD PTR fm_link[rip]
	lea	rdi, 24[r15]
	mov	rsi, rbp
	call	TAILQ_INSERT_TAIL@PLT
	mov	ecx, DWORD PTR [r15]
	mov	rdi, r15
	xor	eax, eax
	mov	rsi, QWORD PTR HBA_FLAGS_DBG_COMM_B[rip]
	lea	rdx, .LC2[rip]
	call	fwprintf@PLT
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L23:
	mov	edi, DWORD PTR 44[r15]
	lea	rsi, .LC1[rip]
	call	device_printf@PLT
	mov	esi, DWORD PTR M_AACRAIDBUF[rip]
	mov	rdi, rbp
	call	free@PLT
	mov	rdi, r12
	call	mtx_lock@PLT
	mov	eax, DWORD PTR ENOMEM[rip]
	jmp	.L1
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	aac_alloc_commands, .-aac_alloc_commands
	.comm	fm_link,4,4
	.comm	aac_map_command_helper,4,4
	.comm	M_ZERO,4,4
	.comm	M_NOWAIT,4,4
	.comm	M_AACRAIDBUF,4,4
	.comm	MA_OWNED,4,4
	.comm	HBA_FLAGS_DBG_FUNCTION_ENTRY_B,8,8
	.comm	HBA_FLAGS_DBG_COMM_B,8,8
	.comm	ENOMEM,4,4
	.comm	BUS_DMA_NOWAIT,4,4
	.comm	AAC_FLAGS_NEW_COMM_TYPE1,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_aacraid.c_aac_alloc_commands.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"\000"
	.align	2
.LC1:
	.ascii	"Not enough contiguous memory available.\012\000"
	.align	2
.LC2:
	.ascii	"total_fibs= %d\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	aac_alloc_commands, %function
aac_alloc_commands:
	@ 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, r0
	ldr	r3, .L25
	ldr	r2, .L25+4
	ldr	r1, [r3]
	ldr	r3, .L25+8
	sub	sp, sp, #36
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	fwprintf
	ldr	r3, .L25+12
	add	r5, r4, #36
	ldr	r1, [r3]
	mov	r0, r5
	bl	mtx_assert
	ldmib	r4, {r1, r2}
	ldr	r3, [r4]
	add	r3, r3, r1
	cmp	r3, r2
	ble	.L2
.L19:
	ldr	r3, .L25+16
	ldr	r9, [r3]
.L1:
	ldr	r3, .L25+8
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	mov	r0, r9
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r2, .L25+20
	ldr	r3, .L25+24
	ldr	r2, [r2]
	ldr	r3, [r3]
	mov	r0, #12
	orr	r2, r2, r3
	ldr	r3, .L25+28
	ldr	r1, [r3]
	bl	malloc
	subs	r6, r0, #0
	beq	.L19
	mov	r0, r5
	bl	mtx_unlock
	ldr	r2, .L25+32
	mov	r3, r6
	ldr	r2, [r2]
	ldr	r0, [r4, #20]
	add	r1, r6, #4
	bl	bus_dmamem_alloc
	subs	r9, r0, #0
	bne	.L22
	mov	r7, #0
	ldr	r10, .L25+36
	ldr	r2, [r4, #16]
	ldr	r3, [r10]
	ldr	r8, [r4, #12]
	tst	r2, r3
	ldr	r3, .L25+40
	add	r0, sp, #24
	ldr	ip, [r3]
	ldr	r3, [r4, #4]
	ldr	r2, [r6, #4]
	ldr	r1, [r6]
	addeq	r8, r8, #31
	addne	r8, r8, #35
	str	ip, [sp]
	str	r7, [sp, #8]
	str	r0, [sp, #4]
	mul	r3, r8, r3
	ldr	r0, [r4, #20]
	bl	bus_dmamap_load
	mov	r0, r5
	bl	mtx_lock
	ldr	r1, [r4, #4]
	ldr	r0, [r6, #4]
	mul	r1, r8, r1
	bl	bzero
	ldr	r3, [r4, #4]
	cmp	r3, r7
	ble	.L8
	mov	fp, r7
	ldr	r2, [r4]
	str	r9, [sp, #20]
	b	.L14
.L24:
	ldr	r3, [r4, #8]
	cmp	r3, #1
	ble	.L12
	ldr	r2, [r4]
	sub	r3, r3, r2
	cmp	r3, #1
	ble	.L13
.L12:
	mov	r0, r5
	bl	aacraid_release_command
	ldr	r2, [r4]
.L13:
	ldr	r3, [r4, #4]
	add	r7, r7, #1
	add	r2, r2, #1
	cmp	r3, r7
	str	r2, [r4]
	add	fp, fp, r8
	ble	.L23
.L14:
	ldr	lr, [r4, #16]
	ldr	r3, [sp, #24]
	ldr	r9, [r10]
	ldr	r1, [r4, #32]
	tst	lr, r9
	add	r3, fp, r3
	ldr	ip, [r6, #4]
	addeq	lr, r3, #31
	add	r0, r2, r2, lsl #2
	addne	lr, r3, #35
	add	r5, r1, r0, lsl #2
	bicne	lr, lr, #31
	biceq	lr, lr, #31
	str	r5, [r6, #8]
	add	ip, ip, fp, lsl #2
	str	r4, [r5, #16]
	str	r3, [r1, r0, lsl #2]
	subeq	r3, lr, r3
	subne	r3, lr, r3
	addne	ip, ip, r3, lsl #2
	addeq	r3, ip, r3, lsl #2
	strne	ip, [r5, #12]
	streq	r3, [r5, #12]
	str	lr, [r1, r0, lsl #2]
	str	r2, [r5, #4]
	mov	r1, #0
	ldr	r0, [r4, #28]
	add	r2, r5, #8
	bl	bus_dmamap_create
	cmp	r0, #0
	beq	.L24
	cmp	r7, #0
	ldr	r9, [sp, #20]
	bne	.L15
.L8:
	ldr	r1, [r6]
	ldr	r0, [r4, #20]
	bl	bus_dmamap_unload
	ldr	r1, [r6, #4]
	ldr	r0, [r4, #20]
	ldr	r2, [r6]
	bl	bus_dmamem_free
	ldr	r3, .L25+28
	mov	r0, r6
	ldr	r1, [r3]
	bl	free
	b	.L19
.L23:
	ldr	r9, [sp, #20]
.L15:
	ldr	r3, .L25+44
	mov	r1, r6
	ldr	r2, [r3]
	add	r0, r4, #24
	bl	TAILQ_INSERT_TAIL
	ldr	r2, .L25+48
	mov	r0, r4
	ldr	r1, [r2]
	ldr	r3, [r4]
	ldr	r2, .L25+52
	bl	fwprintf
	b	.L1
.L22:
	ldr	r1, .L25+56
	ldr	r0, [r4, #40]
	bl	device_printf
	ldr	r3, .L25+28
	mov	r0, r6
	ldr	r1, [r3]
	bl	free
	mov	r0, r5
	bl	mtx_lock
	ldr	r3, .L25+16
	ldr	r9, [r3]
	b	.L1
.L21:
	bl	__stack_chk_fail
.L26:
	.align	2
.L25:
	.word	HBA_FLAGS_DBG_FUNCTION_ENTRY_B
	.word	.LC0
	.word	.LC3
	.word	MA_OWNED
	.word	ENOMEM
	.word	M_NOWAIT
	.word	M_ZERO
	.word	M_AACRAIDBUF
	.word	BUS_DMA_NOWAIT
	.word	AAC_FLAGS_NEW_COMM_TYPE1
	.word	aac_map_command_helper
	.word	fm_link
	.word	HBA_FLAGS_DBG_COMM_B
	.word	.LC2
	.word	.LC1
	.size	aac_alloc_commands, .-aac_alloc_commands
	.comm	fm_link,4,4
	.comm	aac_map_command_helper,4,4
	.comm	M_ZERO,4,4
	.comm	M_NOWAIT,4,4
	.comm	M_AACRAIDBUF,4,4
	.comm	MA_OWNED,4,4
	.comm	HBA_FLAGS_DBG_FUNCTION_ENTRY_B,4,4
	.comm	HBA_FLAGS_DBG_COMM_B,4,4
	.comm	ENOMEM,4,4
	.comm	BUS_DMA_NOWAIT,4,4
	.comm	AAC_FLAGS_NEW_COMM_TYPE1,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
