	.file	"extr_busdma_bounce.c_alloc_bounce_pages.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	alloc_bounce_pages, @function
alloc_bounce_pages:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, QWORD PTR [rdi]
	test	rsi, rsi
	jle	.L5
	mov	r12, rsi
	xor	r13d, r13d
	lea	r14, 8[rbx]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L13:
	sub	rsp, 8
	.cfi_def_cfa_offset 56
	mov	edi, DWORD PTR PAGE_SIZE[rip]
	mov	r8d, DWORD PTR 12[rbx]
	xor	ecx, ecx
	mov	edx, DWORD PTR M_NOWAIT[rip]
	mov	esi, DWORD PTR M_DEVBUF[rip]
	push	0
	.cfi_def_cfa_offset 64
	mov	r9d, edi
	call	contigmalloc@PLT
	mov	rdi, rax
	mov	QWORD PTR 0[rbp], rax
	pop	rax
	.cfi_def_cfa_offset 56
	pop	rdx
	.cfi_def_cfa_offset 48
	test	rdi, rdi
	je	.L12
	call	pmap_kextract@PLT
	lea	rdi, bounce_lock[rip]
	add	r13d, 1
	mov	DWORD PTR 8[rbp], eax
	call	mtx_lock@PLT
	mov	edx, DWORD PTR links[rip]
	mov	rsi, rbp
	mov	rdi, r14
	call	STAILQ_INSERT_TAIL@PLT
	add	DWORD PTR 4[rbx], 1
	lea	rdi, bounce_lock[rip]
	add	DWORD PTR total_bpages[rip], 1
	add	DWORD PTR [rbx], 1
	call	mtx_unlock@PLT
	sub	r12, 1
	je	.L1
.L4:
	mov	esi, DWORD PTR M_DEVBUF[rip]
	mov	edx, DWORD PTR M_NOWAIT[rip]
	mov	edi, 16
	or	edx, DWORD PTR M_ZERO[rip]
	call	malloc@PLT
	mov	rbp, rax
	test	rax, rax
	jne	.L13
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	esi, DWORD PTR M_DEVBUF[rip]
	mov	rdi, rbp
	call	free@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	xor	r13d, r13d
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	alloc_bounce_pages, .-alloc_bounce_pages
	.comm	total_bpages,4,4
	.comm	links,4,4
	.comm	bounce_lock,4,4
	.comm	PAGE_SIZE,4,4
	.comm	M_ZERO,4,4
	.comm	M_NOWAIT,4,4
	.comm	M_DEVBUF,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_busdma_bounce.c_alloc_bounce_pages.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	alloc_bounce_pages, %function
alloc_bounce_pages:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	subs	r3, r1, #0
	sub	sp, sp, #28
	mov	r6, #0
	ldr	r5, [r0]
	str	r3, [sp, #20]
	ble	.L1
	ldr	r8, .L15
	ldr	fp, .L15+4
	ldr	r7, .L15+8
	ldr	r10, .L15+12
	ldr	r9, .L15+16
	b	.L4
.L14:
	ldr	r3, .L15+20
	ldr	r2, [r8]
	ldr	r0, [r3]
	mov	r3, #0
	stmib	sp, {r0, r3}
	ldr	r3, [r5, #12]
	ldr	r1, [r7]
	str	r3, [sp]
	mov	r3, #0
	bl	contigmalloc
	cmp	r0, #0
	str	r0, [r4]
	beq	.L13
	bl	pmap_kextract
	mov	r3, r0
	mov	r0, r10
	str	r3, [r4, #4]
	bl	mtx_lock
	ldr	r3, .L15+24
	mov	r1, r4
	ldr	r2, [r3]
	add	r0, r5, #8
	bl	STAILQ_INSERT_TAIL
	ldr	r1, [r9]
	ldr	r3, [r5]
	ldr	r2, [r5, #4]
	add	r3, r3, #1
	add	r1, r1, #1
	add	r2, r2, #1
	str	r1, [r9]
	mov	r0, r10
	str	r3, [r5]
	str	r2, [r5, #4]
	bl	mtx_unlock
	ldr	r3, [sp, #20]
	add	r6, r6, #1
	cmp	r3, r6
	beq	.L1
.L4:
	ldr	r2, [r8]
	ldr	r3, [fp]
	mov	r0, #8
	ldr	r1, [r7]
	orr	r2, r2, r3
	bl	malloc
	subs	r4, r0, #0
	bne	.L14
.L1:
	mov	r0, r6
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L13:
	mov	r0, r4
	ldr	r1, [r7]
	bl	free
	mov	r0, r6
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	.align	2
.L15:
	.word	M_NOWAIT
	.word	M_ZERO
	.word	M_DEVBUF
	.word	bounce_lock
	.word	total_bpages
	.word	PAGE_SIZE
	.word	links
	.size	alloc_bounce_pages, .-alloc_bounce_pages
	.comm	total_bpages,4,4
	.comm	links,4,4
	.comm	bounce_lock,4,4
	.comm	PAGE_SIZE,4,4
	.comm	M_ZERO,4,4
	.comm	M_NOWAIT,4,4
	.comm	M_DEVBUF,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
