	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dmar_insert_one_dev_info
_dmar_insert_one_dev_info:              ## @dmar_insert_one_dev_info
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r15
	movq	%rcx, %r12
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_alloc_devinfo_mem
	testq	%rax, %rax
	je	LBB0_38
## %bb.1:
	movq	%rax, %r13
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movl	%ebx, (%rax)
	movl	%r14d, %ebx
	movl	%r14d, 4(%rax)
	movl	$0, 16(%rax)
	movq	$0, 8(%rax)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 80(%rax)
	movups	%xmm0, 96(%rax)
	movq	%r12, 32(%rax)
	movq	%r15, 40(%rax)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 72(%r13)
	leaq	48(%r13), %rdi
	movups	%xmm0, 56(%r13)
	callq	_INIT_LIST_HEAD
	testq	%r12, %r12
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_40
## %bb.2:
	movq	%r12, %rdi
	callq	_dev_is_pci
	testq	%rax, %rax
	movl	%ebx, %r14d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_17
## %bb.3:
	movq	32(%r13), %rdi
	callq	_to_pci_dev
	movq	%rax, %rbx
	cmpl	$0, (%rax)
	jne	LBB0_9
## %bb.4:
	xorl	%eax, %eax
	callq	_pci_ats_disabled
	testl	%eax, %eax
	je	LBB0_5
LBB0_9:
	movq	%r15, %rdi
	callq	_sm_supported
	testq	%rax, %rax
	je	LBB0_17
## %bb.10:
	movq	%r15, %rdi
	callq	_pasid_supported
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movq	%rbx, %rdi
	callq	_pci_pasid_features
	testl	%eax, %eax
	js	LBB0_13
## %bb.12:
	orl	$1, %eax
	movl	%eax, 12(%r13)
LBB0_13:
	cmpl	$0, 8(%r13)
	je	LBB0_17
## %bb.14:
	movl	8(%r15), %edi
	callq	_ecap_prs
	testq	%rax, %rax
	je	LBB0_17
## %bb.15:
	movq	_PCI_EXT_CAP_ID_PRI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_pci_find_ext_capability
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movl	$1, 16(%r13)
LBB0_17:
	movq	_device_domain_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movq	%r12, %rdi
	callq	_find_domain
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_20
	jmp	LBB0_18
LBB0_40:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	_device_domain_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movl	%ebx, %r14d
LBB0_18:
	movl	4(%r15), %edi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movl	%r14d, %edx
	callq	_dmar_search_domain_by_dev_info
	testq	%rax, %rax
	je	LBB0_21
## %bb.19:
	movq	40(%rax), %r12
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, 32(%rax)
	testq	%r12, %r12
	je	LBB0_21
LBB0_20:
	movq	_device_domain_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	movq	%r13, %rdi
	callq	_free_devinfo_mem
	jmp	LBB0_39
LBB0_21:
	movq	%r15, %rdi
	callq	_spin_lock
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_domain_attach_iommu
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_spin_unlock
	testl	%r14d, %r14d
	je	LBB0_23
## %bb.22:
	movq	_device_domain_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	movq	%r13, %rdi
	callq	_free_devinfo_mem
	jmp	LBB0_38
LBB0_23:
	leaq	24(%r13), %rdi
	movq	%rbx, %rsi
	callq	_list_add
	movq	%r13, %rdi
	addq	$20, %rdi
	movq	_device_domain_list@GOTPCREL(%rip), %rsi
	callq	_list_add
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	testq	%r14, %r14
	je	LBB0_34
## %bb.24:
	movq	%r13, (%r14)
	movq	_device_domain_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	movq	%r14, %rdi
	callq	_dev_is_pci
	testq	%rax, %rax
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	je	LBB0_35
## %bb.25:
	movq	%r15, %rbx
	movq	%r15, %rdi
	callq	_sm_supported
	testq	%rax, %rax
	je	LBB0_35
## %bb.26:
	movq	%r14, %rdi
	callq	_intel_pasid_alloc_table
	testl	%eax, %eax
	je	LBB0_28
## %bb.27:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_37
LBB0_5:
	movl	8(%r15), %edi
	callq	_ecap_dev_iotlb_support
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:
	movq	_PCI_EXT_CAP_ID_ATS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_pci_find_ext_capability
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	%rbx, %rdi
	callq	_dmar_find_matched_atsr_unit
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movl	$1, 8(%r13)
	jmp	LBB0_9
LBB0_34:
	movq	_device_domain_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_39
LBB0_28:
	movq	%rbx, %rdi
	callq	_spin_lock
	movq	_hw_pass_through@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_31
## %bb.29:
	movq	%r12, %rdi
	callq	_domain_type_is_si
	testq	%rax, %rax
	je	LBB0_31
## %bb.30:
	movq	_PASID_RID2PASID@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	_intel_pasid_setup_pass_through
	jmp	LBB0_32
LBB0_31:
	movq	_PASID_RID2PASID@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	_intel_pasid_setup_second_level
LBB0_32:
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_spin_unlock
	testl	%r15d, %r15d
	je	LBB0_35
## %bb.33:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_37
LBB0_35:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_domain_context_mapping
	testq	%rax, %rax
	je	LBB0_39
## %bb.36:
	leaq	L_.str.2(%rip), %rsi
LBB0_37:
	movq	%r14, %rdi
	callq	_dev_err
	movq	%r14, %rdi
	callq	_dmar_remove_one_dev_info
LBB0_38:
	xorl	%r12d, %r12d
LBB0_39:
	movq	%r12, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_EXT_CAP_ID_ATS,4,2         ## @PCI_EXT_CAP_ID_ATS
	.comm	_PCI_EXT_CAP_ID_PRI,4,2         ## @PCI_EXT_CAP_ID_PRI
	.comm	_device_domain_lock,4,2         ## @device_domain_lock
	.comm	_device_domain_list,4,2         ## @device_domain_list
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PASID table allocation failed\n"

	.comm	_hw_pass_through,8,3            ## @hw_pass_through
	.comm	_PASID_RID2PASID,4,2            ## @PASID_RID2PASID
L_.str.1:                               ## @.str.1
	.asciz	"Setup RID2PASID failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"Domain context map failed\n"

	.no_dead_strip	_dmar_insert_one_dev_info
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dmar_insert_one_dev_info
_dmar_insert_one_dev_info:              ; @dmar_insert_one_dev_info
	.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	x20, x4
	mov	x19, x3
	mov	x23, x2
	mov	x24, x1
	mov	x21, x0
	bl	_alloc_devinfo_mem
	cbz	x0, LBB0_39
; %bb.1:
	mov	x22, x0
	stp	w24, w23, [x0]
	str	wzr, [x0, #16]
	str	xzr, [x0, #8]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x0, #80]
	stp	x19, x20, [x0, #32]
	str	x21, [x0, #72]
	add	x0, x0, #48
	stp	xzr, xzr, [x22, #56]
	bl	_INIT_LIST_HEAD
	cbz	x19, LBB0_14
; %bb.2:
	mov	x0, x19
	bl	_dev_is_pci
	cbz	x0, LBB0_13
; %bb.3:
	ldr	x0, [x22, #32]
	bl	_to_pci_dev
	mov	x25, x0
	ldr	w8, [x0]
	cbnz	w8, LBB0_5
; %bb.4:
	bl	_pci_ats_disabled
	cbz	w0, LBB0_25
LBB0_5:
	mov	x0, x21
	bl	_sm_supported
	cbz	x0, LBB0_13
; %bb.6:
	mov	x0, x21
	bl	_pasid_supported
	cbz	x0, LBB0_9
; %bb.7:
	mov	x0, x25
	bl	_pci_pasid_features
	tbnz	w0, #31, LBB0_9
; %bb.8:
	orr	w8, w0, #0x1
	str	w8, [x22, #12]
LBB0_9:
	ldr	w8, [x22, #8]
	cbz	w8, LBB0_13
; %bb.10:
	ldr	w0, [x21, #8]
	bl	_ecap_prs
	cbz	x0, LBB0_13
; %bb.11:
Lloh0:
	adrp	x8, _PCI_EXT_CAP_ID_PRI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_EXT_CAP_ID_PRI@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x25
	bl	_pci_find_ext_capability
	cbz	x0, LBB0_13
; %bb.12:
	mov	w8, #1
	str	w8, [x22, #16]
LBB0_13:
Lloh3:
	adrp	x0, _device_domain_lock@GOTPAGE
Lloh4:
	ldr	x0, [x0, _device_domain_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
	mov	x0, x19
	bl	_find_domain
	mov	x25, x0
	cbnz	x0, LBB0_17
	b	LBB0_15
LBB0_14:
Lloh5:
	adrp	x0, _device_domain_lock@GOTPAGE
Lloh6:
	ldr	x0, [x0, _device_domain_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
LBB0_15:
	ldr	w0, [x21, #4]
	mov	x1, x24
	mov	x2, x23
	bl	_dmar_search_domain_by_dev_info
	cbz	x0, LBB0_18
; %bb.16:
	ldr	x25, [x0, #40]
	str	x19, [x0, #32]
	cbz	x25, LBB0_18
LBB0_17:
Lloh7:
	adrp	x0, _device_domain_lock@GOTPAGE
Lloh8:
	ldr	x0, [x0, _device_domain_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	mov	x0, x22
	bl	_free_devinfo_mem
	mov	x20, x25
	b	LBB0_40
LBB0_18:
	mov	x0, x21
	bl	_spin_lock
	mov	x0, x20
	mov	x1, x21
	bl	_domain_attach_iommu
	mov	x23, x0
	mov	x0, x21
	bl	_spin_unlock
	cbz	w23, LBB0_20
; %bb.19:
Lloh9:
	adrp	x0, _device_domain_lock@GOTPAGE
Lloh10:
	ldr	x0, [x0, _device_domain_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	mov	x0, x22
	bl	_free_devinfo_mem
	b	LBB0_39
LBB0_20:
	add	x0, x22, #24
	mov	x1, x20
	bl	_list_add
	add	x0, x22, #20
Lloh11:
	adrp	x1, _device_domain_list@GOTPAGE
Lloh12:
	ldr	x1, [x1, _device_domain_list@GOTPAGEOFF]
	bl	_list_add
	cbz	x19, LBB0_29
; %bb.21:
	str	x22, [x19]
Lloh13:
	adrp	x0, _device_domain_lock@GOTPAGE
Lloh14:
	ldr	x0, [x0, _device_domain_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	bl	_dev_is_pci
	cbz	x0, LBB0_36
; %bb.22:
	mov	x0, x21
	bl	_sm_supported
	cbz	x0, LBB0_36
; %bb.23:
	mov	x0, x19
	bl	_intel_pasid_alloc_table
	cbz	w0, LBB0_30
; %bb.24:
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_38
LBB0_25:
	ldr	w0, [x21, #8]
	bl	_ecap_dev_iotlb_support
	cbz	x0, LBB0_5
; %bb.26:
Lloh17:
	adrp	x8, _PCI_EXT_CAP_ID_ATS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PCI_EXT_CAP_ID_ATS@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x25
	bl	_pci_find_ext_capability
	cbz	x0, LBB0_5
; %bb.27:
	mov	x0, x25
	bl	_dmar_find_matched_atsr_unit
	cbz	x0, LBB0_5
; %bb.28:
	mov	w8, #1
	str	w8, [x22, #8]
	b	LBB0_5
LBB0_29:
Lloh20:
	adrp	x0, _device_domain_lock@GOTPAGE
Lloh21:
	ldr	x0, [x0, _device_domain_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	b	LBB0_40
LBB0_30:
	mov	x0, x21
	bl	_spin_lock
Lloh22:
	adrp	x8, _hw_pass_through@GOTPAGE
Lloh23:
	ldr	x8, [x8, _hw_pass_through@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cbz	x8, LBB0_33
; %bb.31:
	mov	x0, x20
	bl	_domain_type_is_si
	cbz	x0, LBB0_33
; %bb.32:
Lloh25:
	adrp	x8, _PASID_RID2PASID@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PASID_RID2PASID@GOTPAGEOFF]
Lloh27:
	ldr	w3, [x8]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_intel_pasid_setup_pass_through
	b	LBB0_34
LBB0_33:
Lloh28:
	adrp	x8, _PASID_RID2PASID@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PASID_RID2PASID@GOTPAGEOFF]
Lloh30:
	ldr	w3, [x8]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_intel_pasid_setup_second_level
LBB0_34:
	mov	x22, x0
	mov	x0, x21
	bl	_spin_unlock
	cbz	w22, LBB0_36
; %bb.35:
Lloh31:
	adrp	x1, l_.str.1@PAGE
Lloh32:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_38
LBB0_36:
	mov	x0, x20
	mov	x1, x19
	bl	_domain_context_mapping
	cbz	x0, LBB0_40
; %bb.37:
Lloh33:
	adrp	x1, l_.str.2@PAGE
Lloh34:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_38:
	mov	x0, x19
	bl	_dev_err
	mov	x0, x19
	bl	_dmar_remove_one_dev_info
LBB0_39:
	mov	x20, #0
LBB0_40:
	mov	x0, x20
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_EXT_CAP_ID_ATS,4,2         ; @PCI_EXT_CAP_ID_ATS
	.comm	_PCI_EXT_CAP_ID_PRI,4,2         ; @PCI_EXT_CAP_ID_PRI
	.comm	_device_domain_lock,4,2         ; @device_domain_lock
	.comm	_device_domain_list,4,2         ; @device_domain_list
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PASID table allocation failed\n"

	.comm	_hw_pass_through,8,3            ; @hw_pass_through
	.comm	_PASID_RID2PASID,4,2            ; @PASID_RID2PASID
l_.str.1:                               ; @.str.1
	.asciz	"Setup RID2PASID failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"Domain context map failed\n"

	.no_dead_strip	_dmar_insert_one_dev_info
.subsections_via_symbols
