	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function find_or_alloc_domain
_find_or_alloc_domain:                  ## @find_or_alloc_domain
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	leaq	-36(%rbp), %rsi
	leaq	-32(%rbp), %rdx
	callq	_device_to_iommu
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_dev_is_pci
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	%rbx, %rdi
	callq	_to_pci_dev
	movq	%rax, %rbx
	movq	_get_last_alias@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_pci_for_each_dma_alias
	movq	_device_domain_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movl	(%rbx), %edi
	callq	_pci_domain_nr
	movl	%eax, %ebx
	movl	-28(%rbp), %edi
	callq	_PCI_BUS_NUM
	movzbl	-28(%rbp), %edx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_dmar_search_domain_by_dev_info
	testq	%rax, %rax
	je	LBB0_3
## %bb.9:
	movq	(%rax), %rbx
	movq	_device_domain_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_8
LBB0_3:
	movq	_device_domain_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
LBB0_4:
	xorl	%edi, %edi
	callq	_alloc_domain
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	%rax, %rbx
	movq	%rax, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_domain_init
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	%rbx, %rdi
	callq	_domain_exit
LBB0_7:
	xorl	%ebx, %ebx
LBB0_8:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_get_last_alias,4,2             ## @get_last_alias
	.comm	_device_domain_lock,4,2         ## @device_domain_lock
	.no_dead_strip	_find_or_alloc_domain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function find_or_alloc_domain
_find_or_alloc_domain:                  ; @find_or_alloc_domain
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x21, x0
	add	x1, sp, #8
	add	x2, sp, #4
	bl	_device_to_iommu
	cbz	x0, LBB0_8
; %bb.1:
	mov	x20, x0
	mov	x0, x21
	bl	_dev_is_pci
	cbz	x0, LBB0_5
; %bb.2:
	mov	x0, x21
	bl	_to_pci_dev
	mov	x21, x0
Lloh0:
	adrp	x8, _get_last_alias@GOTPAGE
Lloh1:
	ldr	x8, [x8, _get_last_alias@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_pci_for_each_dma_alias
Lloh3:
	adrp	x0, _device_domain_lock@GOTPAGE
Lloh4:
	ldr	x0, [x0, _device_domain_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
	ldr	w0, [x21]
	bl	_pci_domain_nr
	mov	x21, x0
	ldr	w0, [sp, #12]
	bl	_PCI_BUS_NUM
	mov	x1, x0
	ldrb	w2, [sp, #12]
	mov	x0, x21
	bl	_dmar_search_domain_by_dev_info
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x21, [x0]
Lloh5:
	adrp	x0, _device_domain_lock@GOTPAGE
Lloh6:
	ldr	x0, [x0, _device_domain_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	b	LBB0_9
LBB0_4:
Lloh7:
	adrp	x0, _device_domain_lock@GOTPAGE
Lloh8:
	ldr	x0, [x0, _device_domain_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
LBB0_5:
	mov	w0, #0
	bl	_alloc_domain
	mov	x21, x0
	cbz	x0, LBB0_9
; %bb.6:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_domain_init
	cbz	x0, LBB0_9
; %bb.7:
	mov	x0, x21
	bl	_domain_exit
LBB0_8:
	mov	x21, #0
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_get_last_alias,4,2             ; @get_last_alias
	.comm	_device_domain_lock,4,2         ; @device_domain_lock
	.no_dead_strip	_find_or_alloc_domain
.subsections_via_symbols
