	.file	"extr_busdma_dmar.c_dmar_bus_dmamem_alloc.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	dmar_bus_dmamem_alloc, @function
dmar_bus_dmamem_alloc:
.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, rsi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rcx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, edx
	mov	rdx, rcx
	mov	esi, ebx
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	call	dmar_bus_dmamap_create@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	r15d, DWORD PTR M_NOWAIT[rip]
	test	DWORD PTR BUS_DMA_NOWAIT[rip], ebx
	cmove	r15d, DWORD PTR M_WAITOK[rip]
	test	DWORD PTR BUS_DMA_ZERO[rip], ebx
	je	.L5
	or	r15d, DWORD PTR M_ZERO[rip]
.L5:
	test	DWORD PTR BUS_DMA_NOCACHE[rip], ebx
	mov	r9, QWORD PTR VM_MEMATTR_UNCACHEABLE[rip]
	mov	rsi, QWORD PTR 0[rbp]
	cmove	r9, QWORD PTR VM_MEMATTR_DEFAULT[rip]
	cmp	rsi, QWORD PTR PAGE_SIZE[rip]
	mov	rbx, QWORD PTR 0[r13]
	mov	edi, DWORD PTR 16[rbp]
	jge	.L8
	cmp	rsi, QWORD PTR 8[rbp]
	jl	.L8
	cmp	QWORD PTR VM_MEMATTR_DEFAULT[rip], r9
	je	.L15
.L8:
	mov	r8d, DWORD PTR BUS_SPACE_MAXADDR[rip]
	mov	QWORD PTR 24[rsp], r9
	mov	QWORD PTR 16[rsp], rsi
	mov	DWORD PTR 12[rsp], r8d
	call	DOMAINSET_PREF@PLT
	mov	r9, QWORD PTR 24[rsp]
	mov	edx, r15d
	xor	ecx, ecx
	mov	r8d, DWORD PTR 12[rsp]
	mov	rsi, QWORD PTR 16[rsp]
	mov	edi, eax
	call	kmem_alloc_attr_domainset@PLT
	mov	edx, DWORD PTR BUS_DMAMAP_DMAR_KMEM_ALLOC[rip]
	mov	QWORD PTR [r14], rax
	or	DWORD PTR [rbx], edx
.L9:
	test	rax, rax
	je	.L16
.L1:
	add	rsp, 40
	.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
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	rsi, QWORD PTR 0[r13]
	mov	rdi, rbp
	call	dmar_bus_dmamap_destroy@PLT
	mov	QWORD PTR 0[r13], 0
	mov	r12d, DWORD PTR ENOMEM[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L15:
	call	DOMAINSET_PREF@PLT
	mov	esi, DWORD PTR M_DEVBUF[rip]
	mov	rdi, QWORD PTR 0[rbp]
	mov	ecx, r15d
	mov	edx, eax
	call	malloc_domainset@PLT
	mov	edx, DWORD PTR BUS_DMAMAP_DMAR_MALLOC[rip]
	mov	QWORD PTR [r14], rax
	or	DWORD PTR [rbx], edx
	jmp	.L9
	.cfi_endproc
.LFE0:
	.size	dmar_bus_dmamem_alloc, .-dmar_bus_dmamem_alloc
	.comm	VM_MEMATTR_UNCACHEABLE,8,8
	.comm	VM_MEMATTR_DEFAULT,8,8
	.comm	PAGE_SIZE,8,8
	.comm	M_ZERO,4,4
	.comm	M_WAITOK,4,4
	.comm	M_NOWAIT,4,4
	.comm	M_DEVBUF,4,4
	.comm	ENOMEM,4,4
	.comm	BUS_SPACE_MAXADDR,4,4
	.comm	BUS_DMA_ZERO,4,4
	.comm	BUS_DMA_NOWAIT,4,4
	.comm	BUS_DMA_NOCACHE,4,4
	.comm	BUS_DMAMAP_DMAR_MALLOC,4,4
	.comm	BUS_DMAMAP_DMAR_KMEM_ALLOC,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_dmar.c_dmar_bus_dmamem_alloc.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	dmar_bus_dmamem_alloc, %function
dmar_bus_dmamem_alloc:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r2
	mov	r7, r1
	mov	r2, r3
	mov	r1, r4
	sub	sp, sp, #12
	mov	r5, r3
	mov	r6, r0
	bl	dmar_bus_dmamap_create
	subs	r8, r0, #0
	bne	.L1
	ldr	r3, .L17
	ldr	r9, [r5]
	ldr	r3, [r3]
	ldr	r0, [r6, #8]
	tst	r4, r3
	ldrne	r3, .L17+4
	ldreq	r3, .L17+8
	ldr	r10, [r3]
	ldr	r3, .L17+12
	ldr	r3, [r3]
	tst	r4, r3
	ldrne	r3, .L17+16
	ldrne	r3, [r3]
	orrne	r10, r10, r3
	ldr	r3, .L17+20
	ldr	r3, [r3]
	tst	r4, r3
	ldrne	r3, .L17+24
	ldreq	r3, .L17+28
	ldr	r4, [r6]
	ldr	fp, [r3]
	ldr	r3, .L17+32
	ldr	r3, [r3]
	cmp	r4, r3
	bge	.L8
	ldr	r3, [r6, #4]
	cmp	r4, r3
	blt	.L8
	ldr	r3, .L17+28
	ldr	r3, [r3]
	cmp	r3, fp
	beq	.L15
.L8:
	bl	DOMAINSET_PREF
	ldr	r3, .L17+36
	str	fp, [sp, #4]
	ldr	r3, [r3]
	mov	r2, r10
	str	r3, [sp]
	ldr	r1, [r6]
	mov	r3, #0
	bl	kmem_alloc_attr_domainset
	mov	r4, r0
	ldr	r3, .L17+40
	ldr	r2, [r9]
	ldr	r3, [r3]
	str	r0, [r7]
	orr	r2, r2, r3
	str	r2, [r9]
.L9:
	cmp	r4, #0
	beq	.L16
.L1:
	mov	r0, r8
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	mov	r0, r6
	ldr	r1, [r5]
	bl	dmar_bus_dmamap_destroy
	ldr	r3, .L17+44
	str	r4, [r5]
	ldr	r8, [r3]
	b	.L1
.L15:
	ldr	r3, .L17+48
	ldr	fp, [r3]
	bl	DOMAINSET_PREF
	mov	r3, r10
	mov	r2, r0
	mov	r1, fp
	mov	r0, r4
	bl	malloc_domainset
	ldr	r2, .L17+52
	ldr	r3, [r9]
	ldr	r2, [r2]
	mov	r4, r0
	orr	r3, r3, r2
	str	r0, [r7]
	str	r3, [r9]
	b	.L9
.L18:
	.align	2
.L17:
	.word	BUS_DMA_NOWAIT
	.word	M_NOWAIT
	.word	M_WAITOK
	.word	BUS_DMA_ZERO
	.word	M_ZERO
	.word	BUS_DMA_NOCACHE
	.word	VM_MEMATTR_UNCACHEABLE
	.word	VM_MEMATTR_DEFAULT
	.word	PAGE_SIZE
	.word	BUS_SPACE_MAXADDR
	.word	BUS_DMAMAP_DMAR_KMEM_ALLOC
	.word	ENOMEM
	.word	M_DEVBUF
	.word	BUS_DMAMAP_DMAR_MALLOC
	.size	dmar_bus_dmamem_alloc, .-dmar_bus_dmamem_alloc
	.comm	VM_MEMATTR_UNCACHEABLE,4,4
	.comm	VM_MEMATTR_DEFAULT,4,4
	.comm	PAGE_SIZE,4,4
	.comm	M_ZERO,4,4
	.comm	M_WAITOK,4,4
	.comm	M_NOWAIT,4,4
	.comm	M_DEVBUF,4,4
	.comm	ENOMEM,4,4
	.comm	BUS_SPACE_MAXADDR,4,4
	.comm	BUS_DMA_ZERO,4,4
	.comm	BUS_DMA_NOWAIT,4,4
	.comm	BUS_DMA_NOCACHE,4,4
	.comm	BUS_DMAMAP_DMAR_MALLOC,4,4
	.comm	BUS_DMAMAP_DMAR_KMEM_ALLOC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
