	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdvi_set_dte
_amdvi_set_dte:                         ## @amdvi_set_dte
	.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
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	%rdi, %r15
	callq	_KASSERT
	movq	%r12, %rdi
	callq	_amdvi_find_iommu
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_KASSERT
	movq	_amdvi_dte@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	leaq	(%r12,%r12,4), %rbx
	movl	$1, 4(%r13,%rbx,8)
	movq	_amdvi_disable_io_fault@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r13,%rbx,8)
	movl	$1, 8(%r13,%rbx,8)
	movl	8(%r15), %eax
	movl	%eax, 32(%r13,%rbx,8)
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.1:
	movq	(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.2:
	callq	_vtophys
	sarl	$12, %eax
	movl	%eax, 12(%r13,%rbx,8)
	movq	_amdvi_ptp_level@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r13,%rbx,8)
LBB0_3:
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 16(%r13,%rbx,8)
	movl	$1, 24(%r13,%rbx,8)
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_amdvi_dte,8,3                  ## @amdvi_dte
	.comm	_amdvi_disable_io_fault,4,2     ## @amdvi_disable_io_fault
	.comm	_amdvi_ptp_level,4,2            ## @amdvi_ptp_level
	.no_dead_strip	_amdvi_set_dte
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdvi_set_dte
_amdvi_set_dte:                         ; @amdvi_set_dte
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	bl	_KASSERT
	mov	x0, x19
	bl	_amdvi_find_iommu
	mov	x1, x19
	bl	_KASSERT
Lloh0:
	adrp	x8, _amdvi_dte@GOTPAGE
Lloh1:
	ldr	x8, [x8, _amdvi_dte@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
	mov	w8, #40
	madd	x8, x19, x8, x22
	mov	w9, #1
Lloh3:
	adrp	x10, _amdvi_disable_io_fault@GOTPAGE
Lloh4:
	ldr	x10, [x10, _amdvi_disable_io_fault@GOTPAGEOFF]
	str	w9, [x8, #4]
Lloh5:
	ldr	w10, [x10]
	str	w9, [x8, #8]
	ldr	w9, [x20, #8]
	stp	w9, w10, [x8, #32]
	cbz	w21, LBB0_4
; %bb.1:
	ldr	x0, [x20]
	cbz	x0, LBB0_3
; %bb.2:
	bl	_vtophys
	asr	w8, w0, #12
	mov	w9, #40
	madd	x9, x19, x9, x22
	str	w8, [x9, #12]
Lloh6:
	adrp	x8, _amdvi_ptp_level@GOTPAGE
Lloh7:
	ldr	x8, [x8, _amdvi_ptp_level@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x9, #28]
LBB0_3:
	mov	w8, #40
	madd	x8, x19, x8, x22
	movi.2s	v0, #1
	str	d0, [x8, #16]
	mov	w9, #1
	str	w9, [x8, #24]
LBB0_4:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_amdvi_dte,8,3                  ; @amdvi_dte
	.comm	_amdvi_disable_io_fault,4,2     ; @amdvi_disable_io_fault
	.comm	_amdvi_ptp_level,4,2            ; @amdvi_ptp_level
	.no_dead_strip	_amdvi_set_dte
.subsections_via_symbols
