	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ctx_id_entry_init
_ctx_id_entry_init:                     ## @ctx_id_entry_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	%rsi, %r13
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	movl	$1, %r12d
	testl	%edx, %edx
	jne	LBB0_3
## %bb.1:
	xorl	%r12d, %r12d
	cmpq	$0, (%r13)
	jne	LBB0_3
## %bb.2:
	xorl	%r12d, %r12d
	cmpq	$0, 8(%r13)
	sete	%r12b
LBB0_3:
	movq	24(%r14), %r15
	movl	(%rbx), %edi
	callq	_pci_get_bus
	movl	(%rbx), %edi
	callq	_pci_get_slot
	movl	(%rbx), %edi
	callq	_pci_get_function
	movq	%r13, %rax
	addq	$8, %r13
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %rsi
	movl	%r12d, %edi
	callq	_KASSERT
	movl	16(%r14), %edi
	callq	_DMAR_CTX2_DID
	orl	(%r14), %eax
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_dmar_pte_store1
	movq	_DMAR_DOMAIN_IDMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r14)
	je	LBB0_6
## %bb.4:
	movq	_DMAR_ECAP_PT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_6
## %bb.5:
	xorl	%edi, %edi
	cmpq	$0, 8(%r14)
	sete	%dil
	movq	%rbx, %rsi
	callq	_KASSERT
	movq	_DMAR_CTX1_P@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DMAR_CTX1_T_PASS@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	movq	8(%r14), %rdi
	movq	_DMAR_PGF_NOALLOC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_dmar_pgalloc
	movq	_DMAR_CTX1_T_UNTR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	movq	_DMAR_CTX1_ASR_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movl	%eax, %edi
	callq	_VM_PAGE_TO_PHYS
	movl	%eax, %esi
	andl	%ebx, %esi
	orl	%r14d, %esi
	movq	_DMAR_CTX1_P@GOTPCREL(%rip), %rax
LBB0_7:
	orl	(%rax), %esi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_dmar_pte_store1
	movq	%r15, %rdi
	movq	%rbx, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dmar_flush_ctx_to_ram          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DMAR_DOMAIN_IDMAP,4,2          ## @DMAR_DOMAIN_IDMAP
	.comm	_DMAR_ECAP_PT,4,2               ## @DMAR_ECAP_PT
	.comm	_DMAR_CTX1_T_PASS,4,2           ## @DMAR_CTX1_T_PASS
	.comm	_DMAR_CTX1_P,4,2                ## @DMAR_CTX1_P
	.comm	_DMAR_PGF_NOALLOC,4,2           ## @DMAR_PGF_NOALLOC
	.comm	_DMAR_CTX1_T_UNTR,4,2           ## @DMAR_CTX1_T_UNTR
	.comm	_DMAR_CTX1_ASR_MASK,4,2         ## @DMAR_CTX1_ASR_MASK
	.no_dead_strip	_ctx_id_entry_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ctx_id_entry_init
_ctx_id_entry_init:                     ; @ctx_id_entry_init
	.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	x19, x1
	mov	x21, x0
	ldr	x24, [x0, #8]
	ldr	x20, [x24, #24]
	cbz	w2, LBB0_2
; %bb.1:
	mov	w22, #1
	b	LBB0_5
LBB0_2:
	ldr	x8, [x19]
	cbz	x8, LBB0_4
; %bb.3:
	mov	w22, #0
	b	LBB0_5
LBB0_4:
	ldr	x8, [x19, #8]
	cmp	x8, #0
	cset	w22, eq
LBB0_5:
	ldr	w0, [x21]
	bl	_pci_get_bus
	ldr	w0, [x21]
	bl	_pci_get_slot
	ldr	w0, [x21]
	bl	_pci_get_function
	mov	x23, x19
	ldr	x1, [x23, #8]!
	mov	x0, x22
	bl	_KASSERT
	ldr	w0, [x24, #16]
	bl	_DMAR_CTX2_DID
	ldr	w8, [x24]
	orr	w1, w8, w0
	mov	x0, x23
	bl	_dmar_pte_store1
	ldr	w8, [x24, #4]
Lloh0:
	adrp	x9, _DMAR_DOMAIN_IDMAP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMAR_DOMAIN_IDMAP@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.6:
	ldr	w8, [x20]
Lloh3:
	adrp	x9, _DMAR_ECAP_PT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DMAR_ECAP_PT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
	ldr	x8, [x24, #8]
	cmp	x8, #0
	cset	w0, eq
	mov	x1, x21
	bl	_KASSERT
Lloh6:
	adrp	x8, _DMAR_CTX1_P@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DMAR_CTX1_P@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _DMAR_CTX1_T_PASS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _DMAR_CTX1_T_PASS@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
	ldr	x0, [x24, #8]
Lloh11:
	adrp	x8, _DMAR_PGF_NOALLOC@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DMAR_PGF_NOALLOC@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_dmar_pgalloc
Lloh14:
	adrp	x8, _DMAR_CTX1_T_UNTR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DMAR_CTX1_T_UNTR@GOTPAGEOFF]
Lloh16:
	ldr	w21, [x8]
Lloh17:
	adrp	x8, _DMAR_CTX1_ASR_MASK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DMAR_CTX1_ASR_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w22, [x8]
	bl	_VM_PAGE_TO_PHYS
	and	w8, w0, w22
	orr	w8, w8, w21
Lloh20:
	adrp	x9, _DMAR_CTX1_P@GOTPAGE
Lloh21:
	ldr	x9, [x9, _DMAR_CTX1_P@GOTPAGEOFF]
LBB0_9:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	x0, x19
	bl	_dmar_pte_store1
	mov	x0, x20
	mov	x1, x19
	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
	b	_dmar_flush_ctx_to_ram
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_DMAR_DOMAIN_IDMAP,4,2          ; @DMAR_DOMAIN_IDMAP
	.comm	_DMAR_ECAP_PT,4,2               ; @DMAR_ECAP_PT
	.comm	_DMAR_CTX1_T_PASS,4,2           ; @DMAR_CTX1_T_PASS
	.comm	_DMAR_CTX1_P,4,2                ; @DMAR_CTX1_P
	.comm	_DMAR_PGF_NOALLOC,4,2           ; @DMAR_PGF_NOALLOC
	.comm	_DMAR_CTX1_T_UNTR,4,2           ; @DMAR_CTX1_T_UNTR
	.comm	_DMAR_CTX1_ASR_MASK,4,2         ; @DMAR_CTX1_ASR_MASK
	.no_dead_strip	_ctx_id_entry_init
.subsections_via_symbols
