	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dmar_move_ctx_to_domain        ## -- Begin function dmar_move_ctx_to_domain
	.p2align	4, 0x90
_dmar_move_ctx_to_domain:               ## @dmar_move_ctx_to_domain
	.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	8(%rsi), %r14
	cmpq	%rdi, %r14
	je	LBB0_1
## %bb.2:
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	8(%rdi), %r15
	xorl	%edi, %edi
	cmpq	%r15, 8(%r14)
	sete	%dil
	movslq	(%r15), %rsi
	callq	_KASSERT
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_dmar_map_ctx_entry
	movq	%rax, %r13
	movq	%r15, %rdi
	callq	_DMAR_LOCK
	movq	%rbx, %rdi
	callq	_dmar_ctx_unlink
	movq	%r12, 8(%rbx)
	movq	%rbx, %rdi
	callq	_dmar_ctx_link
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movl	$1, %edx
	callq	_ctx_id_entry_init
	movq	-48(%rbp), %rdi
	callq	_dmar_unmap_pgtbl
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_dmar_flush_for_ctx_entry
	movl	%eax, %r13d
	movl	(%r15), %esi
	movl	(%rbx), %edx
	movl	(%r14), %ecx
	movl	(%r12), %r8d
	movq	_DMAR_DOMAIN_IDMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	4(%r12), %eax
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.2(%rip), %r9
	cmoveq	%rax, %r9
	leaq	L_.str.1(%rip), %rdi
	callq	_printf
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_dmar_unref_domain_locked
	jmp	LBB0_3
LBB0_1:
	xorl	%r13d, %r13d
LBB0_3:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TD_PREP_PINNED_ASSERT,4,2      ## @TD_PREP_PINNED_ASSERT
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"dmar%d rid %x domain %d->%d %s-mapped\n"

	.comm	_DMAR_DOMAIN_IDMAP,4,2          ## @DMAR_DOMAIN_IDMAP
L_.str.2:                               ## @.str.2
	.asciz	"id"

L_.str.3:                               ## @.str.3
	.asciz	"re"

	.comm	_TD_PINNED_ASSERT,4,2           ## @TD_PINNED_ASSERT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dmar_move_ctx_to_domain        ; -- Begin function dmar_move_ctx_to_domain
	.p2align	2
_dmar_move_ctx_to_domain:               ; @dmar_move_ctx_to_domain
	.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
	ldr	x19, [x1, #8]
	cmp	x19, x0
	b.eq	LBB0_2
; %bb.1:
	mov	x22, x1
	mov	x21, x0
	ldr	x20, [x0, #8]
	ldr	x8, [x19, #8]
	cmp	x8, x20
	cset	w0, eq
	ldrsw	x1, [x20]
	bl	_KASSERT
	add	x1, sp, #8
	mov	x0, x22
	bl	_dmar_map_ctx_entry
	mov	x23, x0
	mov	x0, x20
	bl	_DMAR_LOCK
	mov	x0, x22
	bl	_dmar_ctx_unlink
	str	x21, [x22, #8]
	mov	x0, x22
	bl	_dmar_ctx_link
	mov	x0, x22
	mov	x1, x23
	mov	w2, #1
	bl	_ctx_id_entry_init
	ldr	x0, [sp, #8]
	bl	_dmar_unmap_pgtbl
	mov	x0, x20
	mov	w1, #1
	bl	_dmar_flush_for_ctx_entry
	mov	x23, x0
	ldr	w1, [x20]
	ldr	w2, [x22]
	ldr	w3, [x19]
	ldp	w4, w8, [x21]
Lloh0:
	adrp	x9, _DMAR_DOMAIN_IDMAP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMAR_DOMAIN_IDMAP@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, l_.str.2@PAGE
Lloh4:
	add	x10, x10, l_.str.2@PAGEOFF
Lloh5:
	adrp	x11, l_.str.3@PAGE
Lloh6:
	add	x11, x11, l_.str.3@PAGEOFF
	tst	w9, w8
	csel	x5, x11, x10, eq
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	mov	x0, x20
	mov	x1, x19
	bl	_dmar_unref_domain_locked
	b	LBB0_3
LBB0_2:
	mov	w23, #0
LBB0_3:
	mov	x0, x23
	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 AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_TD_PREP_PINNED_ASSERT,4,2      ; @TD_PREP_PINNED_ASSERT
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"dmar%d rid %x domain %d->%d %s-mapped\n"

	.comm	_DMAR_DOMAIN_IDMAP,4,2          ; @DMAR_DOMAIN_IDMAP
l_.str.2:                               ; @.str.2
	.asciz	"id"

l_.str.3:                               ; @.str.3
	.asciz	"re"

	.comm	_TD_PINNED_ASSERT,4,2           ; @TD_PINNED_ASSERT
.subsections_via_symbols
