	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function viommu_domain_alloc
_viommu_domain_alloc:                   ## @viommu_domain_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	movq	_IOMMU_DOMAIN_UNMANAGED@GOTPCREL(%rip), %rax
	movq	_IOMMU_DOMAIN_DMA@GOTPCREL(%rip), %r15
	cmpl	%edi, (%rax)
	je	LBB0_2
## %bb.1:
	cmpl	%r14d, (%r15)
	jne	LBB0_6
LBB0_2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%rax, %rbx
	leaq	12(%rax), %rdi
	callq	_mutex_init
	movq	%rbx, %rdi
	addq	$8, %rdi
	callq	_spin_lock_init
	movq	_RB_ROOT_CACHED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	cmpl	%r14d, (%r15)
	jne	LBB0_7
## %bb.4:
	movq	%rbx, %rdi
	callq	_iommu_get_dma_cookie
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_6:
	xorl	%ebx, %ebx
LBB0_7:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IOMMU_DOMAIN_UNMANAGED,4,2     ## @IOMMU_DOMAIN_UNMANAGED
	.comm	_IOMMU_DOMAIN_DMA,4,2           ## @IOMMU_DOMAIN_DMA
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_RB_ROOT_CACHED,4,2             ## @RB_ROOT_CACHED
	.no_dead_strip	_viommu_domain_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function viommu_domain_alloc
_viommu_domain_alloc:                   ; @viommu_domain_alloc
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x8, _IOMMU_DOMAIN_UNMANAGED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IOMMU_DOMAIN_UNMANAGED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x21, _IOMMU_DOMAIN_DMA@GOTPAGE
Lloh4:
	ldr	x21, [x21, _IOMMU_DOMAIN_DMA@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w8, w0
	ccmp	w9, w0, #4, ne
	b.ne	LBB0_5
; %bb.1:
	mov	x20, x0
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_6
; %bb.2:
	add	x0, x19, #12
	bl	_mutex_init
	add	x0, x19, #8
	bl	_spin_lock_init
Lloh8:
	adrp	x8, _RB_ROOT_CACHED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RB_ROOT_CACHED@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	ldr	w8, [x21]
	cmp	w8, w20
	b.ne	LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_iommu_get_dma_cookie
	cbz	x0, LBB0_6
; %bb.4:
	mov	x0, x19
	bl	_kfree
LBB0_5:
	mov	x19, #0
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_IOMMU_DOMAIN_UNMANAGED,4,2     ; @IOMMU_DOMAIN_UNMANAGED
	.comm	_IOMMU_DOMAIN_DMA,4,2           ; @IOMMU_DOMAIN_DMA
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_RB_ROOT_CACHED,4,2             ; @RB_ROOT_CACHED
	.no_dead_strip	_viommu_domain_alloc
.subsections_via_symbols
