	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iommu_init_device
_iommu_init_device:                     ## @iommu_init_device
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	cmpq	$0, (%rdi)
	je	LBB0_1
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %rbx
	callq	_get_device_id
	testl	%eax, %eax
	js	LBB0_10
## %bb.2:
	movq	_amd_iommu_rlookup_table@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movl	%eax, %edx
	movq	(%rcx,%rdx,8), %r14
	movl	%eax, %edi
	callq	_find_dev_data
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_get_alias
	movl	%eax, 12(%r15)
	xorl	%eax, %eax
	callq	_iommu_default_passthrough
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movq	_amd_iommu_force_isolation@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_9
LBB0_6:
	movq	%rbx, %rdi
	callq	_dev_is_pci
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	%rbx, %rdi
	callq	_to_pci_dev
	movl	%eax, %edi
	callq	_pci_iommuv2_capable
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	(%r12), %rax
	movq	(%r15), %rcx
	movq	(%rax,%rcx,8), %rax
	movl	4(%rax), %eax
	movl	%eax, 8(%r15)
LBB0_9:
	movq	%r15, (%rbx)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_iommu_device_link
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_amd_iommu_rlookup_table,8,3    ## @amd_iommu_rlookup_table
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_amd_iommu_force_isolation,4,2  ## @amd_iommu_force_isolation
	.no_dead_strip	_iommu_init_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iommu_init_device
_iommu_init_device:                     ; @iommu_init_device
	.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
	ldr	x8, [x0]
	cbz	x8, LBB0_3
LBB0_1:
	mov	w0, #0
LBB0_2:
	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
LBB0_3:
	mov	x19, x0
	bl	_get_device_id
	tbnz	w0, #31, LBB0_2
; %bb.4:
Lloh0:
	adrp	x22, _amd_iommu_rlookup_table@GOTPAGE
Lloh1:
	ldr	x22, [x22, _amd_iommu_rlookup_table@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x20, [x8, w0, uxtw #3]
	bl	_find_dev_data
	cbz	x0, LBB0_11
; %bb.5:
	mov	x21, x0
	mov	x0, x19
	bl	_get_alias
	str	w0, [x21, #12]
	bl	_iommu_default_passthrough
	cbnz	x0, LBB0_7
; %bb.6:
Lloh2:
	adrp	x8, _amd_iommu_force_isolation@GOTPAGE
Lloh3:
	ldr	x8, [x8, _amd_iommu_force_isolation@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cbnz	w8, LBB0_10
LBB0_7:
	mov	x0, x19
	bl	_dev_is_pci
	cbz	x0, LBB0_10
; %bb.8:
	mov	x0, x19
	bl	_to_pci_dev
	bl	_pci_iommuv2_capable
	cbz	x0, LBB0_10
; %bb.9:
	ldr	x8, [x22]
	ldr	x9, [x21]
	ldr	x8, [x8, x9, lsl #3]
	ldr	w8, [x8, #4]
	str	w8, [x21, #8]
LBB0_10:
	str	x21, [x19]
	mov	x0, x20
	mov	x1, x19
	bl	_iommu_device_link
	b	LBB0_1
LBB0_11:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_amd_iommu_rlookup_table,8,3    ; @amd_iommu_rlookup_table
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_amd_iommu_force_isolation,4,2  ; @amd_iommu_force_isolation
	.no_dead_strip	_iommu_init_device
.subsections_via_symbols
