	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iommu_context_addr             ## -- Begin function iommu_context_addr
	.p2align	4, 0x90
_iommu_context_addr:                    ## @iommu_context_addr
	.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	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	8(%rdi), %r12
	leaq	(%r12,%rsi,8), %r15
	callq	_sm_supported
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r13, %rax
	addq	%r13, %rax
	cmpq	$127, %r13
	leaq	4(%r12,%rbx,8), %rcx
	cmovaq	%rcx, %r15
	leaq	-256(%r13,%r13), %r13
	cmovbeq	%rax, %r13
LBB0_2:
	movl	(%r15), %edi
	testb	$1, %dil
	jne	LBB0_6
## %bb.3:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_9
## %bb.4:
	movl	(%r14), %edi
	callq	_alloc_pgtable_page
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	movq	%rax, %r12
	movq	_CONTEXT_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	___iommu_flush_cache
	movq	%r12, %rdi
	callq	_virt_to_phys
	orl	$1, %eax
	movl	%eax, (%r15)
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	$4, %edx
	callq	___iommu_flush_cache
	jmp	LBB0_7
LBB0_6:
	movq	_VTD_PAGE_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %edi
	callq	_phys_to_virt
	movq	%rax, %r12
LBB0_7:
	leaq	(%r12,%r13,4), %rax
	jmp	LBB0_10
LBB0_9:
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VTD_PAGE_MASK,4,2              ## @VTD_PAGE_MASK
	.comm	_CONTEXT_SIZE,4,2               ## @CONTEXT_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iommu_context_addr             ; -- Begin function iommu_context_addr
	.p2align	2
_iommu_context_addr:                    ; @iommu_context_addr
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x3
	mov	x20, x2
	mov	x19, x0
	ldr	x8, [x0, #8]
	add	x23, x8, x1, lsl #3
	bl	_sm_supported
	add	x8, x23, #4
	lsl	x9, x20, #1
	sub	x10, x9, #256
	cmp	x20, #127
	csel	x8, x8, x23, hi
	csel	x9, x10, x9, hi
	cmp	x0, #0
	csel	x22, x20, x9, eq
	csel	x20, x23, x8, eq
	ldr	w8, [x20]
	tbnz	w8, #0, LBB0_4
; %bb.1:
	cbz	w21, LBB0_6
; %bb.2:
	ldr	w0, [x19]
	bl	_alloc_pgtable_page
	cbz	x0, LBB0_7
; %bb.3:
	mov	x21, x0
Lloh0:
	adrp	x8, _CONTEXT_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CONTEXT_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	___iommu_flush_cache
	mov	x0, x21
	bl	_virt_to_phys
	orr	w8, w0, #0x1
	str	w8, [x20]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #4
	bl	___iommu_flush_cache
	b	LBB0_5
LBB0_4:
Lloh3:
	adrp	x9, _VTD_PAGE_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VTD_PAGE_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w0, w9, w8
	bl	_phys_to_virt
	mov	x21, x0
LBB0_5:
	add	x0, x21, x22, lsl #2
	b	LBB0_7
LBB0_6:
	mov	x0, #0
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_VTD_PAGE_MASK,4,2              ; @VTD_PAGE_MASK
	.comm	_CONTEXT_SIZE,4,2               ; @CONTEXT_SIZE
.subsections_via_symbols
