	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dmar_ensure_ctx_page
_dmar_ensure_ctx_page:                  ## @dmar_ensure_ctx_page
	.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	%esi, %r14d
	movq	%rdi, %r15
	movl	(%rdi), %edi
	leal	1(%r14), %ebx
	movq	_DMAR_PGF_NOALLOC@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movl	%ebx, %esi
	callq	_dmar_pgalloc
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movl	(%r15), %edi
	movq	_DMAR_PGF_ZERO@GOTPCREL(%rip), %rax
	movq	_DMAR_PGF_WAITOK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	%ebx, %esi
	callq	_dmar_pgalloc
	movq	%rax, %r12
	movl	(%r15), %edi
	movl	(%r13), %edx
	leaq	-48(%rbp), %rcx
	xorl	%esi, %esi
	callq	_dmar_map_pgtbl
	movslq	%r14d, %rcx
	leaq	(%rax,%rcx,4), %r14
	movq	_DMAR_ROOT_R1_P@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_DMAR_ROOT_R1_CTP_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_VM_PAGE_TO_PHYS
	andl	%eax, %ebx
	orl	%r13d, %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_dmar_pte_store
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_dmar_flush_root_to_ram
	movq	-48(%rbp), %rdi
	callq	_dmar_unmap_pgtbl
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMAR_PGF_NOALLOC,4,2           ## @DMAR_PGF_NOALLOC
	.comm	_TD_PREP_PINNED_ASSERT,4,2      ## @TD_PREP_PINNED_ASSERT
	.comm	_DMAR_PGF_ZERO,4,2              ## @DMAR_PGF_ZERO
	.comm	_DMAR_PGF_WAITOK,4,2            ## @DMAR_PGF_WAITOK
	.comm	_DMAR_ROOT_R1_P,4,2             ## @DMAR_ROOT_R1_P
	.comm	_DMAR_ROOT_R1_CTP_MASK,4,2      ## @DMAR_ROOT_R1_CTP_MASK
	.comm	_TD_PINNED_ASSERT,4,2           ## @TD_PINNED_ASSERT
	.no_dead_strip	_dmar_ensure_ctx_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dmar_ensure_ctx_page
_dmar_ensure_ctx_page:                  ; @dmar_ensure_ctx_page
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x1
	mov	x19, x0
	ldr	w0, [x0]
	add	w21, w1, #1
Lloh0:
	adrp	x22, _DMAR_PGF_NOALLOC@GOTPAGE
Lloh1:
	ldr	x22, [x22, _DMAR_PGF_NOALLOC@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x1, x21
	bl	_dmar_pgalloc
	cbnz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _DMAR_PGF_ZERO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DMAR_PGF_ZERO@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _DMAR_PGF_WAITOK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DMAR_PGF_WAITOK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x1, x21
	bl	_dmar_pgalloc
	mov	x21, x0
	ldr	w0, [x19]
	ldr	w2, [x22]
	add	x3, sp, #8
	mov	w1, #0
	bl	_dmar_map_pgtbl
	add	x20, x0, w20, sxtw #2
Lloh8:
	adrp	x8, _DMAR_ROOT_R1_P@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DMAR_ROOT_R1_P@GOTPAGEOFF]
Lloh10:
	ldr	w22, [x8]
Lloh11:
	adrp	x8, _DMAR_ROOT_R1_CTP_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DMAR_ROOT_R1_CTP_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w23, [x8]
	mov	x0, x21
	bl	_VM_PAGE_TO_PHYS
	and	w8, w0, w23
	orr	w1, w8, w22
	mov	x0, x20
	bl	_dmar_pte_store
	mov	x0, x19
	mov	x1, x20
	bl	_dmar_flush_root_to_ram
	ldr	x0, [sp, #8]
	bl	_dmar_unmap_pgtbl
LBB0_2:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DMAR_PGF_NOALLOC,4,2           ; @DMAR_PGF_NOALLOC
	.comm	_TD_PREP_PINNED_ASSERT,4,2      ; @TD_PREP_PINNED_ASSERT
	.comm	_DMAR_PGF_ZERO,4,2              ; @DMAR_PGF_ZERO
	.comm	_DMAR_PGF_WAITOK,4,2            ; @DMAR_PGF_WAITOK
	.comm	_DMAR_ROOT_R1_P,4,2             ; @DMAR_ROOT_R1_P
	.comm	_DMAR_ROOT_R1_CTP_MASK,4,2      ; @DMAR_ROOT_R1_CTP_MASK
	.comm	_TD_PINNED_ASSERT,4,2           ; @TD_PINNED_ASSERT
	.no_dead_strip	_dmar_ensure_ctx_page
.subsections_via_symbols
