	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iommu_init
_iommu_init:                            ## @iommu_init
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_iommu_enable@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_8
## %bb.1:
	xorl	%eax, %eax
	callq	_vmm_is_intel
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_iommu_ops_intel@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	xorl	%eax, %eax
	callq	_vmm_is_amd
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_iommu_ops_amd@GOTPCREL(%rip), %rax
LBB0_5:
	movq	_ops@GOTPCREL(%rip), %r14
	movq	%rax, (%r14)
	xorl	%eax, %eax
	callq	_IOMMU_INIT
	testl	%eax, %eax
	je	LBB0_6
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_iommu_avail@GOTPCREL(%rip), %r15
	movl	$1, (%r15)
	xorl	%eax, %eax
	callq	_vmm_mem_maxaddr
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_IOMMU_CREATE_DOMAIN
	movq	_host_domain@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_7
## %bb.9:
	xorl	%r14d, %r14d
	movq	%rax, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	%ebx, %ecx
	callq	_iommu_create_mapping
	movq	_pci_add_device@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_iommu_pci_add@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_EVENTHANDLER_REGISTER
	movq	_add_tag@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_pci_delete_device@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_iommu_pci_delete@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_EVENTHANDLER_REGISTER
	movq	_delete_tag@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	leaq	L_.str.1(%rip), %rdi
	callq	_devclass_find
	movq	%rax, %r15
	movq	_PCI_BUSMAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	js	LBB0_24
## %bb.10:
	movq	_PCI_SLOTMAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_PCI_FUNCMAX@GOTPCREL(%rip), %r12
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	_PCI_BUSMAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_23:                                ##   in Loop: Header=BB0_11 Depth=1
	leal	1(%r14), %edx
	cmpl	%ecx, %r14d
	movl	%edx, %r14d
	jge	LBB0_24
LBB0_11:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_13 Depth 2
                                        ##       Child Loop BB0_15 Depth 3
	testl	%eax, %eax
	js	LBB0_23
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	(%r12), %ecx
	xorl	%edx, %edx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_13 Depth=2
	movq	_PCI_SLOTMAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_21:                                ##   in Loop: Header=BB0_13 Depth=2
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	leal	1(%rsi), %edx
	cmpl	%eax, %esi
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	jge	LBB0_22
LBB0_13:                                ##   Parent Loop BB0_11 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_15 Depth 3
	testl	%ecx, %ecx
	js	LBB0_21
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=2
	movl	$-1, %r13d
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_15 Depth=3
	movq	_host_domain@GOTPCREL(%rip), %rax
	movq	%r15, %r12
	movq	%r14, %r15
	movq	(%rax), %r14
	movq	%rbx, %rdi
	callq	_pci_get_rid
	movq	%r14, %rdi
	movq	%r15, %r14
	movq	%r12, %r15
	movq	_PCI_FUNCMAX@GOTPCREL(%rip), %r12
	movl	%eax, %esi
	callq	_iommu_add_device
LBB0_19:                                ##   in Loop: Header=BB0_15 Depth=3
	movl	(%r12), %ecx
	cmpl	%ecx, %r13d
	jge	LBB0_20
LBB0_15:                                ##   Parent Loop BB0_11 Depth=1
                                        ##     Parent Loop BB0_13 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	incl	%r13d
	xorl	%edi, %edi
	movl	%r14d, %esi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movl	%r13d, %ecx
	callq	_pci_find_dbsf
	testq	%rax, %rax
	je	LBB0_19
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=3
	movq	%rax, %rbx
	testq	%r15, %r15
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=3
	movq	%rbx, %rdi
	callq	_device_get_devclass
	cmpq	%r15, %rax
	jne	LBB0_18
	jmp	LBB0_19
LBB0_24:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_IOMMU_ENABLE                   ## TAILCALL
LBB0_7:
	leaq	L_.str(%rip), %rdi
	callq	_printf
	xorl	%eax, %eax
	callq	_IOMMU_CLEANUP
	movq	$0, (%r14)
	movl	$0, (%r15)
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_iommu_enable,4,2               ## @iommu_enable
	.comm	_iommu_ops_intel,4,2            ## @iommu_ops_intel
	.comm	_ops,8,3                        ## @ops
	.comm	_iommu_ops_amd,4,2              ## @iommu_ops_amd
	.comm	_iommu_avail,4,2                ## @iommu_avail
	.comm	_host_domain,8,3                ## @host_domain
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"iommu_init: unable to create a host domain"

	.comm	_pci_add_device,4,2             ## @pci_add_device
	.comm	_iommu_pci_add,4,2              ## @iommu_pci_add
	.comm	_add_tag,8,3                    ## @add_tag
	.comm	_pci_delete_device,4,2          ## @pci_delete_device
	.comm	_iommu_pci_delete,4,2           ## @iommu_pci_delete
	.comm	_delete_tag,8,3                 ## @delete_tag
L_.str.1:                               ## @.str.1
	.asciz	"ppt"

	.comm	_PCI_BUSMAX,4,2                 ## @PCI_BUSMAX
	.comm	_PCI_SLOTMAX,4,2                ## @PCI_SLOTMAX
	.comm	_PCI_FUNCMAX,4,2                ## @PCI_FUNCMAX
	.no_dead_strip	_iommu_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iommu_init
_iommu_init:                            ; @iommu_init
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x8, _iommu_enable@GOTPAGE
Lloh1:
	ldr	x8, [x8, _iommu_enable@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_5
; %bb.1:
	bl	_vmm_is_intel
	cbz	x0, LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _iommu_ops_intel@GOTPAGE
Lloh4:
	ldr	x8, [x8, _iommu_ops_intel@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
	bl	_vmm_is_amd
Lloh5:
	adrp	x8, _iommu_ops_amd@GOTPAGE
Lloh6:
	ldr	x8, [x8, _iommu_ops_amd@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, xzr, x8, eq
LBB0_4:
Lloh7:
	adrp	x20, _ops@GOTPAGE
Lloh8:
	ldr	x20, [x20, _ops@GOTPAGEOFF]
	str	x8, [x20]
	bl	_IOMMU_INIT
	cbz	w0, LBB0_6
LBB0_5:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh9:
	adrp	x21, _iommu_avail@GOTPAGE
Lloh10:
	ldr	x21, [x21, _iommu_avail@GOTPAGEOFF]
	mov	w8, #1
	str	w8, [x21]
	bl	_vmm_mem_maxaddr
	mov	x19, x0
	bl	_IOMMU_CREATE_DOMAIN
Lloh11:
	adrp	x25, _host_domain@GOTPAGE
Lloh12:
	ldr	x25, [x25, _host_domain@GOTPAGEOFF]
	str	x0, [x25]
	cbz	x0, LBB0_23
; %bb.7:
	mov	w1, #0
	mov	w2, #0
	mov	x3, x19
	bl	_iommu_create_mapping
Lloh13:
	adrp	x8, _pci_add_device@GOTPAGE
Lloh14:
	ldr	x8, [x8, _pci_add_device@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x8, _iommu_pci_add@GOTPAGE
Lloh17:
	ldr	x8, [x8, _iommu_pci_add@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x2, #0
	mov	w3, #0
	bl	_EVENTHANDLER_REGISTER
Lloh19:
	adrp	x8, _add_tag@GOTPAGE
Lloh20:
	ldr	x8, [x8, _add_tag@GOTPAGEOFF]
Lloh21:
	str	x0, [x8]
Lloh22:
	adrp	x8, _pci_delete_device@GOTPAGE
Lloh23:
	ldr	x8, [x8, _pci_delete_device@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
Lloh25:
	adrp	x8, _iommu_pci_delete@GOTPAGE
Lloh26:
	ldr	x8, [x8, _iommu_pci_delete@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x2, #0
	mov	w3, #0
	bl	_EVENTHANDLER_REGISTER
Lloh28:
	adrp	x8, _delete_tag@GOTPAGE
Lloh29:
	ldr	x8, [x8, _delete_tag@GOTPAGEOFF]
Lloh30:
	str	x0, [x8]
Lloh31:
	adrp	x0, l_.str.1@PAGE
Lloh32:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_devclass_find
Lloh33:
	adrp	x26, _PCI_BUSMAX@GOTPAGE
Lloh34:
	ldr	x26, [x26, _PCI_BUSMAX@GOTPAGEOFF]
	ldr	w9, [x26]
	tbnz	w9, #31, LBB0_22
; %bb.8:
	mov	x19, x0
	mov	w20, #0
Lloh35:
	adrp	x27, _PCI_SLOTMAX@GOTPAGE
Lloh36:
	ldr	x27, [x27, _PCI_SLOTMAX@GOTPAGEOFF]
	ldr	w8, [x27]
Lloh37:
	adrp	x28, _PCI_FUNCMAX@GOTPAGE
Lloh38:
	ldr	x28, [x28, _PCI_FUNCMAX@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	ldr	w9, [x26]
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	w10, w20, #1
	cmp	w20, w9
	mov	x20, x10
	b.ge	LBB0_22
LBB0_11:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
                                        ;       Child Loop BB0_19 Depth 3
	tbnz	w8, #31, LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	w21, #0
	ldr	w9, [x28]
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=2
	ldr	w8, [x27]
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=2
	add	w10, w21, #1
	cmp	w21, w8
	mov	x21, x10
	b.ge	LBB0_9
LBB0_15:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_19 Depth 3
	tbnz	w9, #31, LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=2
	mov	w22, #-1
	b	LBB0_19
LBB0_17:                                ;   in Loop: Header=BB0_19 Depth=3
	ldr	x24, [x25]
	mov	x0, x23
	bl	_pci_get_rid
	mov	x1, x0
	mov	x0, x24
	bl	_iommu_add_device
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=3
	ldr	w9, [x28]
	cmp	w22, w9
	b.ge	LBB0_13
LBB0_19:                                ;   Parent Loop BB0_11 Depth=1
                                        ;     Parent Loop BB0_15 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	add	w22, w22, #1
	mov	w0, #0
	mov	x1, x20
	mov	x2, x21
	mov	x3, x22
	bl	_pci_find_dbsf
	cbz	x0, LBB0_18
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=3
	mov	x23, x0
	cbz	x19, LBB0_17
; %bb.21:                               ;   in Loop: Header=BB0_19 Depth=3
	mov	x0, x23
	bl	_device_get_devclass
	cmp	x0, x19
	b.ne	LBB0_17
	b	LBB0_18
LBB0_22:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_IOMMU_ENABLE
LBB0_23:
Lloh39:
	adrp	x0, l_.str@PAGE
Lloh40:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	bl	_IOMMU_CLEANUP
	str	xzr, [x20]
	str	wzr, [x21]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotStr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotStr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpAdd	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_iommu_enable,4,2               ; @iommu_enable
	.comm	_iommu_ops_intel,4,2            ; @iommu_ops_intel
	.comm	_ops,8,3                        ; @ops
	.comm	_iommu_ops_amd,4,2              ; @iommu_ops_amd
	.comm	_iommu_avail,4,2                ; @iommu_avail
	.comm	_host_domain,8,3                ; @host_domain
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"iommu_init: unable to create a host domain"

	.comm	_pci_add_device,4,2             ; @pci_add_device
	.comm	_iommu_pci_add,4,2              ; @iommu_pci_add
	.comm	_add_tag,8,3                    ; @add_tag
	.comm	_pci_delete_device,4,2          ; @pci_delete_device
	.comm	_iommu_pci_delete,4,2           ; @iommu_pci_delete
	.comm	_delete_tag,8,3                 ; @delete_tag
l_.str.1:                               ; @.str.1
	.asciz	"ppt"

	.comm	_PCI_BUSMAX,4,2                 ; @PCI_BUSMAX
	.comm	_PCI_SLOTMAX,4,2                ; @PCI_SLOTMAX
	.comm	_PCI_FUNCMAX,4,2                ; @PCI_FUNCMAX
	.no_dead_strip	_iommu_init
.subsections_via_symbols
