	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dmar_bus_dmamem_alloc
_dmar_bus_dmamem_alloc:                 ## @dmar_bus_dmamem_alloc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	%rdi, %r12
	movl	%edx, %esi
	movq	%rcx, %rdx
	callq	_dmar_bus_dmamap_create
	movl	%eax, %ecx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.1:
	movq	_BUS_DMA_NOWAIT@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	jne	LBB0_2
## %bb.3:
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_M_NOWAIT@GOTPCREL(%rip), %rax
LBB0_4:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	_BUS_DMA_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	andl	%ebx, %r13d
	je	LBB0_6
## %bb.5:
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
LBB0_6:
	movq	_BUS_DMA_NOCACHE@GOTPCREL(%rip), %rdx
	movq	_VM_MEMATTR_DEFAULT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, %r15
	testl	%ebx, (%rdx)
	je	LBB0_8
## %bb.7:
	movq	_VM_MEMATTR_UNCACHEABLE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %r15
LBB0_8:
	orl	(%rax), %r13d
	movq	(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%r12), %rbx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jge	LBB0_12
## %bb.9:
	cmpq	%rbx, 8(%r12)
	jg	LBB0_12
## %bb.10:
	cmpq	%rcx, %r15
	jne	LBB0_12
## %bb.11:
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	16(%r12), %edi
	callq	_DOMAINSET_PREF
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	movl	%r13d, %ecx
	callq	_malloc_domainset
	movq	_BUS_DMAMAP_DMAR_MALLOC@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
LBB0_12:
	movl	16(%r12), %edi
	callq	_DOMAINSET_PREF
	movq	(%r12), %rsi
	movq	_BUS_SPACE_MAXADDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movl	%eax, %edi
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	movq	%r15, %r9
	callq	_kmem_alloc_attr_domainset
	movq	_BUS_DMAMAP_DMAR_KMEM_ALLOC@GOTPCREL(%rip), %rcx
LBB0_13:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%rax, (%rdx)
	movl	(%rcx), %ecx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	orl	%ecx, (%rdx)
	xorl	%ecx, %ecx
	testq	%rax, %rax
	jne	LBB0_15
## %bb.14:
	movq	(%r14), %rsi
	movq	%r12, %rdi
	callq	_dmar_bus_dmamap_destroy
	movq	$0, (%r14)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_15:
	movl	%ecx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BUS_DMA_NOWAIT,4,2             ## @BUS_DMA_NOWAIT
	.comm	_M_NOWAIT,4,2                   ## @M_NOWAIT
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_BUS_DMA_ZERO,4,2               ## @BUS_DMA_ZERO
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_BUS_DMA_NOCACHE,4,2            ## @BUS_DMA_NOCACHE
	.comm	_VM_MEMATTR_UNCACHEABLE,8,3     ## @VM_MEMATTR_UNCACHEABLE
	.comm	_VM_MEMATTR_DEFAULT,8,3         ## @VM_MEMATTR_DEFAULT
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_M_DEVBUF,4,2                   ## @M_DEVBUF
	.comm	_BUS_DMAMAP_DMAR_MALLOC,4,2     ## @BUS_DMAMAP_DMAR_MALLOC
	.comm	_BUS_SPACE_MAXADDR,4,2          ## @BUS_SPACE_MAXADDR
	.comm	_BUS_DMAMAP_DMAR_KMEM_ALLOC,4,2 ## @BUS_DMAMAP_DMAR_KMEM_ALLOC
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_dmar_bus_dmamem_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dmar_bus_dmamem_alloc
_dmar_bus_dmamem_alloc:                 ; @dmar_bus_dmamem_alloc
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x3
	mov	x23, x2
	mov	x21, x1
	mov	x20, x0
	mov	x1, x2
	mov	x2, x3
	bl	_dmar_bus_dmamap_create
	cbnz	w0, LBB0_9
; %bb.1:
Lloh0:
	adrp	x8, _BUS_DMA_NOWAIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BUS_DMA_NOWAIT@GOTPAGEOFF]
Lloh2:
	adrp	x9, _M_NOWAIT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _M_NOWAIT@GOTPAGEOFF]
Lloh4:
	adrp	x10, _M_WAITOK@GOTPAGE
Lloh5:
	ldr	x10, [x10, _M_WAITOK@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	tst	w8, w23
	csel	x8, x10, x9, eq
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _BUS_DMA_ZERO@GOTPAGE
Lloh8:
	ldr	x9, [x9, _BUS_DMA_ZERO@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _M_ZERO@GOTPAGE
Lloh11:
	ldr	x10, [x10, _M_ZERO@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	tst	w9, w23
	csel	w9, wzr, w10, eq
	orr	w22, w9, w8
Lloh13:
	adrp	x8, _BUS_DMA_NOCACHE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BUS_DMA_NOCACHE@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x8]
Lloh16:
	adrp	x8, _VM_MEMATTR_UNCACHEABLE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _VM_MEMATTR_UNCACHEABLE@GOTPAGEOFF]
Lloh18:
	ldr	x10, [x8]
Lloh19:
	adrp	x8, _VM_MEMATTR_DEFAULT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _VM_MEMATTR_DEFAULT@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	tst	w9, w23
	csel	x23, x8, x10, eq
	ldr	x25, [x19]
	ldr	x24, [x20]
Lloh22:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh23:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x24, x9
	b.ge	LBB0_5
; %bb.2:
	ldr	x9, [x20, #8]
	cmp	x9, x24
	b.gt	LBB0_5
; %bb.3:
	cmp	x23, x8
	b.ne	LBB0_5
; %bb.4:
Lloh25:
	adrp	x8, _M_DEVBUF@GOTPAGE
Lloh26:
	ldr	x8, [x8, _M_DEVBUF@GOTPAGEOFF]
Lloh27:
	ldr	w23, [x8]
	ldr	w0, [x20, #16]
	bl	_DOMAINSET_PREF
	mov	x2, x0
	mov	x0, x24
	mov	x1, x23
	mov	x3, x22
	bl	_malloc_domainset
Lloh28:
	adrp	x8, _BUS_DMAMAP_DMAR_MALLOC@GOTPAGE
Lloh29:
	ldr	x8, [x8, _BUS_DMAMAP_DMAR_MALLOC@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
	ldr	w0, [x20, #16]
	bl	_DOMAINSET_PREF
	ldr	x1, [x20]
Lloh30:
	adrp	x8, _BUS_SPACE_MAXADDR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _BUS_SPACE_MAXADDR@GOTPAGEOFF]
Lloh32:
	ldr	w4, [x8]
	mov	x2, x22
	mov	x3, #0
	mov	x5, x23
	bl	_kmem_alloc_attr_domainset
Lloh33:
	adrp	x8, _BUS_DMAMAP_DMAR_KMEM_ALLOC@GOTPAGE
Lloh34:
	ldr	x8, [x8, _BUS_DMAMAP_DMAR_KMEM_ALLOC@GOTPAGEOFF]
LBB0_6:
	str	x0, [x21]
	ldr	w8, [x8]
	ldr	w9, [x25]
	orr	w8, w9, w8
	str	w8, [x25]
	cbz	x0, LBB0_8
; %bb.7:
	mov	w0, #0
	b	LBB0_9
LBB0_8:
	ldr	x1, [x19]
	mov	x0, x20
	bl	_dmar_bus_dmamap_destroy
	str	xzr, [x19]
Lloh35:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh37:
	ldr	w0, [x8]
LBB0_9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh6
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_BUS_DMA_NOWAIT,4,2             ; @BUS_DMA_NOWAIT
	.comm	_M_NOWAIT,4,2                   ; @M_NOWAIT
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_BUS_DMA_ZERO,4,2               ; @BUS_DMA_ZERO
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_BUS_DMA_NOCACHE,4,2            ; @BUS_DMA_NOCACHE
	.comm	_VM_MEMATTR_UNCACHEABLE,8,3     ; @VM_MEMATTR_UNCACHEABLE
	.comm	_VM_MEMATTR_DEFAULT,8,3         ; @VM_MEMATTR_DEFAULT
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_M_DEVBUF,4,2                   ; @M_DEVBUF
	.comm	_BUS_DMAMAP_DMAR_MALLOC,4,2     ; @BUS_DMAMAP_DMAR_MALLOC
	.comm	_BUS_SPACE_MAXADDR,4,2          ; @BUS_SPACE_MAXADDR
	.comm	_BUS_DMAMAP_DMAR_KMEM_ALLOC,4,2 ; @BUS_DMAMAP_DMAR_KMEM_ALLOC
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_dmar_bus_dmamem_alloc
.subsections_via_symbols
