	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vtd_init
_vtd_init:                              ## @vtd_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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_DRHD_MAX_UNITS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	leaq	L_.str(%rip), %r14
	leaq	-80(%rbp), %r15
	leaq	-96(%rbp), %r12
	movq	_vtdmaps@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	$32, %esi
	movq	%r14, %rdx
	movl	%ebx, %ecx
	callq	_snprintf
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_getenv_ulong
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-96(%rbp), %rdi
	callq	_PHYS_TO_DMAP
	movq	(%r13), %rcx
	movq	%rax, (%rcx,%rbx,8)
	incq	%rbx
	movq	_DRHD_MAX_UNITS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_4:
	testl	%ebx, %ebx
	je	LBB0_5
LBB0_16:
	movq	_drhd_num@GOTPCREL(%rip), %r15
	movl	%ebx, (%r15)
	movq	_max_domains@GOTPCREL(%rip), %r12
	movl	$65536, (%r12)                  ## imm = 0x10000
	testl	%ebx, %ebx
	jle	LBB0_23
## %bb.17:
	movq	_vtdmaps@GOTPCREL(%rip), %r13
	xorl	%r14d, %r14d
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_18 Depth=1
	incq	%r14
	movslq	(%r15), %rax
	cmpq	%rax, %r14
	jge	LBB0_23
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movq	(%rax,%r14,8), %rbx
	movl	(%rbx), %edi
	callq	_VTD_CAP_CM
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_panic
LBB0_20:                                ##   in Loop: Header=BB0_18 Depth=1
	movq	%rbx, %rdi
	callq	_vtd_max_domains
	cmpl	(%r12), %eax
	jge	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_18 Depth=1
	movl	%eax, (%r12)
	jmp	LBB0_22
LBB0_5:
	movq	_ACPI_SIG_DMAR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-88(%rbp), %rdx
	xorl	%esi, %esi
	callq	_AcpiGetTable
	movl	%eax, %edi
	callq	_ACPI_FAILURE
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:
	movq	-88(%rbp), %r14
	movslq	(%r14), %rax
	leal	-4(%rax), %r12d
	cmpl	$17, %r12d
	jb	LBB0_6
## %bb.8:
	addq	%rax, %r14
	movl	$1, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%r12d, %rax
	movq	%r14, %r13
	subq	%rax, %r13
	cmpl	%eax, (%r13)
	jg	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	8(%r13), %rax
	movq	_ACPI_DMAR_TYPE_HARDWARE_UNIT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_drhds@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%r13, -8(%rax,%r15,8)
	movq	(%r13), %rdi
	callq	_PHYS_TO_DMAP
	movq	_vtdmaps@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, -8(%rcx,%r15,8)
	movq	_DRHD_MAX_UNITS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r15
	jge	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	subl	(%r13), %r12d
	incq	%r15
	incq	%rbx
	cmpl	$16, %r12d
	ja	LBB0_9
LBB0_13:
	decq	%r15
	movq	%r15, %rbx
LBB0_14:
	testl	%ebx, %ebx
	jne	LBB0_16
LBB0_6:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_28
LBB0_23:
	movq	_PAGE_MASK@GOTPCREL(%rip), %r12
	movq	_VTD_ROOT_PRESENT@GOTPCREL(%rip), %r13
	movq	_root_table@GOTPCREL(%rip), %r14
	xorl	%r15d, %r15d
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_24 Depth=1
	movl	(%r13), %eax
	orl	%ebx, %eax
	movq	(%r14), %rcx
	movl	%eax, (%rcx,%r15,8)
	incq	%r15
	cmpq	$256, %r15                      ## imm = 0x100
	je	LBB0_27
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movq	_ctx_tables@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r15,4), %edi
	callq	_vtophys
	movl	%eax, %ebx
	testl	%eax, (%r12)
	je	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=1
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_panic
	jmp	LBB0_26
LBB0_27:
	xorl	%eax, %eax
LBB0_28:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_30
## %bb.29:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movl	%r15d, %ebx
	jmp	LBB0_16
LBB0_30:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_DRHD_MAX_UNITS,4,2             ## @DRHD_MAX_UNITS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vtd.regmap.%d.addr"

	.comm	_vtdmaps,8,3                    ## @vtdmaps
	.comm	_ACPI_SIG_DMAR,4,2              ## @ACPI_SIG_DMAR
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_ACPI_DMAR_TYPE_HARDWARE_UNIT,8,3 ## @ACPI_DMAR_TYPE_HARDWARE_UNIT
	.comm	_drhds,8,3                      ## @drhds
	.comm	_drhd_num,4,2                   ## @drhd_num
	.comm	_max_domains,4,2                ## @max_domains
L_.str.1:                               ## @.str.1
	.asciz	"vtd_init: invalid caching mode"

	.comm	_ctx_tables,8,3                 ## @ctx_tables
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
L_.str.2:                               ## @.str.2
	.asciz	"ctx table (0x%0lx) not page aligned"

	.comm	_VTD_ROOT_PRESENT,4,2           ## @VTD_ROOT_PRESENT
	.comm	_root_table,8,3                 ## @root_table
	.no_dead_strip	_vtd_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vtd_init
_vtd_init:                              ; @vtd_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
Lloh3:
	adrp	x21, _DRHD_MAX_UNITS@GOTPAGE
Lloh4:
	ldr	x21, [x21, _DRHD_MAX_UNITS@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.1:
	mov	x19, #0
Lloh5:
	adrp	x20, l_.str@PAGE
Lloh6:
	add	x20, x20, l_.str@PAGEOFF
Lloh7:
	adrp	x22, _vtdmaps@GOTPAGE
Lloh8:
	ldr	x22, [x22, _vtdmaps@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #24
	mov	w1, #32
	mov	x2, x20
	mov	x3, x19
	bl	_snprintf
	add	x0, sp, #24
	add	x1, sp, #16
	bl	_getenv_ulong
	cbz	x0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x0, [sp, #16]
	bl	_PHYS_TO_DMAP
	ldr	x8, [x22]
	str	x0, [x8, x19, lsl #3]
	add	x19, x19, #1
	ldrsw	x8, [x21]
	cmp	x19, x8
	b.lt	LBB0_2
LBB0_4:
	mov	x8, x19
	cbz	w19, LBB0_12
LBB0_5:
Lloh9:
	adrp	x21, _drhd_num@GOTPAGE
Lloh10:
	ldr	x21, [x21, _drhd_num@GOTPAGEOFF]
	str	w8, [x21]
Lloh11:
	adrp	x22, _max_domains@GOTPAGE
Lloh12:
	ldr	x22, [x22, _max_domains@GOTPAGEOFF]
	mov	w9, #65536
	str	w9, [x22]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.6:
	mov	x23, #0
Lloh13:
	adrp	x24, _vtdmaps@GOTPAGE
Lloh14:
	ldr	x24, [x24, _vtdmaps@GOTPAGEOFF]
Lloh15:
	adrp	x19, l_.str.1@PAGE
Lloh16:
	add	x19, x19, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x21]
	cmp	x23, x8
	b.ge	LBB0_20
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	ldr	x20, [x8, x23, lsl #3]
	ldr	w0, [x20]
	bl	_VTD_CAP_CM
	cbz	x0, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x19
	bl	_panic
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x20
	bl	_vtd_max_domains
	ldr	w8, [x22]
	cmp	w0, w8
	b.ge	LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	str	w0, [x22]
	b	LBB0_7
LBB0_12:
Lloh17:
	adrp	x8, _ACPI_SIG_DMAR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ACPI_SIG_DMAR@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	add	x2, sp, #8
	mov	w1, #0
	bl	_AcpiGetTable
	bl	_ACPI_FAILURE
	cbnz	x0, LBB0_26
; %bb.13:
	ldr	x8, [sp, #8]
	ldrsw	x9, [x8]
	sub	w19, w9, #4
	cmp	w19, #17
	b.lo	LBB0_26
; %bb.14:
	mov	x22, #0
	add	x20, x8, x9
Lloh20:
	adrp	x23, _ACPI_DMAR_TYPE_HARDWARE_UNIT@GOTPAGE
Lloh21:
	ldr	x23, [x23, _ACPI_DMAR_TYPE_HARDWARE_UNIT@GOTPAGEOFF]
Lloh22:
	adrp	x24, _drhds@GOTPAGE
Lloh23:
	ldr	x24, [x24, _drhds@GOTPAGEOFF]
Lloh24:
	adrp	x25, _vtdmaps@GOTPAGE
Lloh25:
	ldr	x25, [x25, _vtdmaps@GOTPAGEOFF]
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	sub	x26, x20, w19, sxtw
	ldr	w8, [x26]
	cmp	w8, w19
	b.gt	LBB0_25
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [x26, #8]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_25
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [x24]
	lsl	x27, x22, #3
	str	x26, [x8, x27]
	ldr	x0, [x26]
	bl	_PHYS_TO_DMAP
	ldr	x8, [x25]
	str	x0, [x8, x27]
	add	x8, x22, #1
	ldrsw	x9, [x21]
	cmp	x8, x9
	b.ge	LBB0_29
; %bb.18:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w9, [x26]
	sub	w19, w19, w9
	mov	x22, x8
	cmp	w19, #16
	b.hi	LBB0_15
; %bb.19:
	cbnz	w8, LBB0_5
	b	LBB0_26
LBB0_20:
	mov	x21, #0
	mov	x22, #0
Lloh26:
	adrp	x23, _ctx_tables@GOTPAGE
Lloh27:
	ldr	x23, [x23, _ctx_tables@GOTPAGEOFF]
Lloh28:
	adrp	x24, _PAGE_MASK@GOTPAGE
Lloh29:
	ldr	x24, [x24, _PAGE_MASK@GOTPAGEOFF]
Lloh30:
	adrp	x25, _VTD_ROOT_PRESENT@GOTPAGE
Lloh31:
	ldr	x25, [x25, _VTD_ROOT_PRESENT@GOTPAGEOFF]
Lloh32:
	adrp	x26, _root_table@GOTPAGE
Lloh33:
	ldr	x26, [x26, _root_table@GOTPAGEOFF]
Lloh34:
	adrp	x19, l_.str.2@PAGE
Lloh35:
	add	x19, x19, l_.str.2@PAGEOFF
	b	LBB0_22
LBB0_21:                                ;   in Loop: Header=BB0_22 Depth=1
	ldr	w8, [x25]
	orr	w8, w8, w20
	ldr	x9, [x26]
	str	w8, [x9, x21]
	add	x22, x22, #4
	add	x21, x21, #8
	cmp	x22, #1024
	b.eq	LBB0_24
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23]
	ldr	w0, [x8, x22]
	bl	_vtophys
	mov	x20, x0
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_21
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	str	x20, [sp]
	mov	x0, x19
	bl	_panic
	b	LBB0_21
LBB0_24:
	mov	w0, #0
	b	LBB0_27
LBB0_25:
	mov	x8, x22
	cbnz	w8, LBB0_5
LBB0_26:
Lloh36:
	adrp	x8, _ENXIO@GOTPAGE
Lloh37:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
LBB0_27:
	ldr	x8, [sp, #56]
Lloh39:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh40:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_30
; %bb.28:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_29:
	add	w8, w22, #1
	b	LBB0_5
LBB0_30:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_DRHD_MAX_UNITS,4,2             ; @DRHD_MAX_UNITS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vtd.regmap.%d.addr"

	.comm	_vtdmaps,8,3                    ; @vtdmaps
	.comm	_ACPI_SIG_DMAR,4,2              ; @ACPI_SIG_DMAR
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_ACPI_DMAR_TYPE_HARDWARE_UNIT,8,3 ; @ACPI_DMAR_TYPE_HARDWARE_UNIT
	.comm	_drhds,8,3                      ; @drhds
	.comm	_drhd_num,4,2                   ; @drhd_num
	.comm	_max_domains,4,2                ; @max_domains
l_.str.1:                               ; @.str.1
	.asciz	"vtd_init: invalid caching mode"

	.comm	_ctx_tables,8,3                 ; @ctx_tables
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
l_.str.2:                               ; @.str.2
	.asciz	"ctx table (0x%0lx) not page aligned"

	.comm	_VTD_ROOT_PRESENT,4,2           ; @VTD_ROOT_PRESENT
	.comm	_root_table,8,3                 ; @root_table
	.no_dead_strip	_vtd_init
.subsections_via_symbols
