	.file	"extr_if_mge.c_mge_alloc_desc_dma.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"failed to allocate DMA memory\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"can't load descriptor\n"
	.section	.rodata.str1.8
	.align 8
.LC2:
	.string	"failed to create busdma tag for mbufs\n"
	.align 8
.LC3:
	.string	"failed to create map for mbuf\n"
	.text
	.p2align 4
	.type	mge_alloc_desc_dma, @function
mge_alloc_desc_dma:
.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
	mov	r14, rcx
	mov	ecx, edx
	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
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	sub	ecx, 1
	mov	DWORD PTR 8[rsp], edx
	mov	DWORD PTR 12[rsp], ecx
	js	.L12
	movsx	rax, ecx
	xor	ebp, ebp
	lea	rax, [rax+rax*4]
	sal	rax, 3
	lea	r12, -40[rsi+rax]
	lea	r15, [rsi+rax]
	mov	eax, ecx
	lea	rax, [rax+rax*4]
	sal	rax, 3
	sub	r12, rax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	mov	esi, DWORD PTR 32[r15]
	mov	rdx, QWORD PTR [r15]
	mov	ecx, 4
	mov	eax, DWORD PTR BUS_DMA_NOWAIT[rip]
	mov	edi, DWORD PTR 8[rbx]
	lea	r9, 24[r15]
	mov	r8d, DWORD PTR mge_get_dma_addr[rip]
	push	rax
	.cfi_def_cfa_offset 96
	call	bus_dmamap_load@PLT
	pop	rdx
	.cfi_def_cfa_offset 88
	pop	rcx
	.cfi_def_cfa_offset 80
	test	eax, eax
	jne	.L17
	mov	rax, QWORD PTR [r15]
	sub	r15, 40
	mov	QWORD PTR 8[rax], rbp
	mov	rbp, QWORD PTR 64[r15]
	cmp	r15, r12
	je	.L2
.L6:
	mov	edi, DWORD PTR 8[rbx]
	mov	edx, DWORD PTR BUS_DMA_NOWAIT[rip]
	lea	rcx, 32[r15]
	mov	rsi, r15
	or	edx, DWORD PTR BUS_DMA_ZERO[rip]
	or	edx, DWORD PTR BUS_DMA_COHERENT[rip]
	call	bus_dmamem_alloc@PLT
	test	eax, eax
	je	.L3
	mov	edi, DWORD PTR [rbx]
	lea	rsi, .LC0[rip]
	call	if_printf@PLT
	mov	QWORD PTR [r15], 0
	mov	r12d, DWORD PTR ENXIO[rip]
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L12:
	.cfi_restore_state
	xor	ebp, ebp
	.p2align 4,,10
	.p2align 3
.L2:
	movsx	rax, DWORD PTR 8[rsp]
	mov	r8d, DWORD PTR BUS_SPACE_MAXADDR[rip]
	mov	edi, DWORD PTR 4[rbx]
	mov	r12d, DWORD PTR BUS_SPACE_MAXADDR_32BIT[rip]
	mov	r15, rax
	lea	rax, [rax+rax*4]
	mov	DWORD PTR 8[rsp], r8d
	mov	rax, QWORD PTR -40[r13+rax*8]
	mov	QWORD PTR 8[rax], rbp
	mov	ebp, DWORD PTR MCLBYTES[rip]
	call	bus_get_dma_tag@PLT
	push	r14
	.cfi_def_cfa_offset 88
	mov	ecx, r12d
	xor	r9d, r9d
	push	0
	.cfi_def_cfa_offset 96
	mov	edi, eax
	xor	edx, edx
	mov	esi, 1
	push	0
	.cfi_def_cfa_offset 104
	push	0
	.cfi_def_cfa_offset 112
	push	rbp
	.cfi_def_cfa_offset 120
	push	1
	.cfi_def_cfa_offset 128
	push	rbp
	.cfi_def_cfa_offset 136
	push	0
	.cfi_def_cfa_offset 144
	mov	r8d, DWORD PTR 72[rsp]
	call	bus_dma_tag_create@PLT
	add	rsp, 64
	.cfi_def_cfa_offset 80
	mov	r12d, eax
	test	eax, eax
	jne	.L7
	test	r15d, r15d
	jle	.L1
	mov	r15d, DWORD PTR 12[rsp]
	lea	rbp, 16[r13]
	lea	rax, [r15+r15*4]
	lea	r13, 56[r13+rax*8]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR -8[rbp], 0
	add	rbp, 40
	mov	QWORD PTR [rax], 0
	cmp	r13, rbp
	je	.L1
.L11:
	mov	edi, DWORD PTR [r14]
	xor	esi, esi
	mov	rdx, rbp
	call	bus_dmamap_create@PLT
	test	eax, eax
	je	.L10
	mov	edi, DWORD PTR [rbx]
	lea	rsi, .LC3[rip]
	call	if_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	mov	edi, DWORD PTR [rbx]
	lea	rsi, .LC1[rip]
	call	if_printf@PLT
	mov	edx, DWORD PTR 32[r15]
	mov	edi, DWORD PTR 8[rbx]
	mov	rsi, QWORD PTR [r15]
	call	bus_dmamem_free@PLT
	mov	QWORD PTR [r15], 0
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
.L7:
	mov	edi, DWORD PTR [rbx]
	lea	rsi, .LC2[rip]
	call	if_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	mge_alloc_desc_dma, .-mge_alloc_desc_dma
	.comm	mge_get_dma_addr,4,4
	.comm	MCLBYTES,4,4
	.comm	ENXIO,4,4
	.comm	BUS_SPACE_MAXADDR_32BIT,4,4
	.comm	BUS_SPACE_MAXADDR,4,4
	.comm	BUS_DMA_ZERO,4,4
	.comm	BUS_DMA_NOWAIT,4,4
	.comm	BUS_DMA_COHERENT,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_if_mge.c_mge_alloc_desc_dma.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"failed to allocate DMA memory\012\000"
	.align	2
.LC1:
	.ascii	"can't load descriptor\012\000"
	.align	2
.LC2:
	.ascii	"failed to create busdma tag for mbufs\012\000"
	.align	2
.LC3:
	.ascii	"failed to create map for mbuf\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mge_alloc_desc_dma, %function
mge_alloc_desc_dma:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	subs	r5, r2, #1
	sub	sp, sp, #60
	mov	r8, #0
	mov	r6, r0
	str	r2, [sp, #48]
	str	r1, [sp, #44]
	str	r3, [sp, #52]
	bmi	.L2
	add	r4, r5, r5, lsl #2
	ldr	r7, .L18
	ldr	r10, .L18+4
	ldr	r9, .L18+8
	ldr	fp, .L18+12
	add	r4, r1, r4, lsl #2
	b	.L6
.L3:
	ldr	r0, [r7]
	ldr	r2, [fp]
	ldr	r1, [r4, #16]
	str	r3, [sp, #4]
	str	r0, [sp, #8]
	str	r2, [sp]
	mov	r3, #4
	ldr	r2, [r4]
	ldr	r0, [r6, #8]
	bl	bus_dmamap_load
	cmp	r0, #0
	bne	.L17
	ldr	r3, [r4]
	cmn	r5, #1
	str	r8, [r3, #4]
	ldr	r8, [r4, #12]
	sub	r4, r4, #20
	beq	.L2
.L6:
	ldr	r1, [r10]
	ldr	r3, [r7]
	ldr	r2, [r9]
	orr	r3, r3, r1
	orr	r2, r3, r2
	mov	r1, r4
	add	r3, r4, #16
	ldr	r0, [r6, #8]
	bl	bus_dmamem_alloc
	subs	r2, r0, #0
	add	r3, r4, #12
	sub	r5, r5, #1
	str	r2, [sp, #40]
	beq	.L3
	ldr	r0, [r6]
	ldr	r1, .L18+16
	bl	if_printf
	mov	r2, #0
	ldr	r3, .L18+20
	str	r2, [r4]
	ldr	r5, [r3]
.L1:
	mov	r0, r5
	add	sp, sp, #60
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r4, [sp, #48]
	ldr	r2, [sp, #44]
	add	r3, r4, r4, lsl #2
	add	r3, r2, r3, lsl #2
	ldr	r3, [r3, #-20]
	ldr	r0, [r6, #4]
	str	r8, [r3, #4]
	bl	bus_get_dma_tag
	mov	r2, #0
	mov	r1, #1
	ldr	ip, .L18+24
	ldr	r3, .L18+28
	ldr	lr, [ip]
	ldr	r3, [r3]
	ldr	r5, [sp, #52]
	ldr	ip, .L18+32
	str	r5, [sp, #36]
	str	r3, [sp, #20]
	str	r3, [sp, #12]
	str	lr, [sp]
	str	r2, [sp, #32]
	str	r2, [sp, #28]
	str	r2, [sp, #24]
	str	r2, [sp, #8]
	str	r2, [sp, #4]
	str	r1, [sp, #16]
	ldr	r3, [ip]
	bl	bus_dma_tag_create
	subs	r5, r0, #0
	bne	.L7
	cmp	r4, #0
	ble	.L1
	ldr	r3, [sp, #44]
	mov	r7, r5
	ldr	r9, [sp, #48]
	ldr	r8, [sp, #52]
	add	r4, r3, #8
	b	.L11
.L10:
	ldr	r3, [r4, #-8]
	cmp	r9, r7
	str	r0, [r4, #-4]
	str	r0, [r3]
	add	r4, r4, #20
	beq	.L1
.L11:
	mov	r2, r4
	mov	r1, #0
	ldr	r0, [r8]
	bl	bus_dmamap_create
	cmp	r0, #0
	add	r7, r7, #1
	beq	.L10
	ldr	r0, [r6]
	ldr	r1, .L18+36
	bl	if_printf
	ldr	r3, .L18+20
	ldr	r5, [r3]
	mov	r0, r5
	add	sp, sp, #60
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L17:
	ldr	r1, .L18+40
	ldr	r0, [r6]
	bl	if_printf
	ldr	r2, [r4, #16]
	ldr	r0, [r6, #8]
	ldr	r1, [r4]
	bl	bus_dmamem_free
	ldr	r3, .L18+20
	ldr	r2, [sp, #40]
	ldr	r5, [r3]
	str	r2, [r4]
	mov	r0, r5
	add	sp, sp, #60
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	ldr	r0, [r6]
	ldr	r1, .L18+44
	bl	if_printf
	ldr	r3, .L18+20
	ldr	r5, [r3]
	b	.L1
.L19:
	.align	2
.L18:
	.word	BUS_DMA_NOWAIT
	.word	BUS_DMA_ZERO
	.word	BUS_DMA_COHERENT
	.word	mge_get_dma_addr
	.word	.LC0
	.word	ENXIO
	.word	BUS_SPACE_MAXADDR
	.word	MCLBYTES
	.word	BUS_SPACE_MAXADDR_32BIT
	.word	.LC3
	.word	.LC1
	.word	.LC2
	.size	mge_alloc_desc_dma, .-mge_alloc_desc_dma
	.comm	mge_get_dma_addr,4,4
	.comm	MCLBYTES,4,4
	.comm	ENXIO,4,4
	.comm	BUS_SPACE_MAXADDR_32BIT,4,4
	.comm	BUS_SPACE_MAXADDR,4,4
	.comm	BUS_DMA_ZERO,4,4
	.comm	BUS_DMA_NOWAIT,4,4
	.comm	BUS_DMA_COHERENT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
