	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dmar_fini_qi                   ## -- Begin function dmar_fini_qi
	.p2align	4, 0x90
_dmar_fini_qi:                          ## @dmar_fini_qi
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, 8(%rdi)
	je	LBB0_2
## %bb.1:
	movq	%rdi, %rbx
	leaq	8(%rdi), %r15
	movq	40(%rdi), %rdi
	leaq	48(%rbx), %rsi
	callq	_taskqueue_drain
	movq	40(%rbx), %rdi
	callq	_taskqueue_free
	movq	$0, 40(%rbx)
	movq	%rbx, %rdi
	callq	_DMAR_LOCK
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_dmar_qi_ensure
	leaq	-32(%rbp), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$1, %edx
	callq	_dmar_qi_emit_wait_seq
	movq	%rbx, %rdi
	callq	_dmar_qi_advance_tail
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_dmar_qi_wait_for_seq
	movq	%rbx, %rdi
	callq	_dmar_disable_qi_intr
	movq	%rbx, %rdi
	callq	_dmar_disable_qi
	xorl	%edi, %edi
	cmpq	$0, (%rbx)
	sete	%dil
	movslq	32(%rbx), %rsi
	callq	_KASSERT
	movq	%rbx, %rdi
	callq	_DMAR_UNLOCK
	movq	16(%rbx), %rsi
	movq	24(%rbx), %rdi
	callq	_kmem_free
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r15)
	movq	$0, 16(%r15)
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dmar_fini_qi                   ; -- Begin function dmar_fini_qi
	.p2align	2
_dmar_fini_qi:                          ; @dmar_fini_qi
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x0
	ldr	x8, [x20, #8]!
	cbz	x8, LBB0_2
; %bb.1:
	mov	x19, x0
	ldr	x0, [x0, #40]
	add	x1, x19, #48
	bl	_taskqueue_drain
	ldr	x0, [x19, #40]
	bl	_taskqueue_free
	str	xzr, [x19, #40]
	mov	x0, x19
	bl	_DMAR_LOCK
	mov	x0, x19
	mov	w1, #1
	bl	_dmar_qi_ensure
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #1
	bl	_dmar_qi_emit_wait_seq
	mov	x0, x19
	bl	_dmar_qi_advance_tail
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #0
	bl	_dmar_qi_wait_for_seq
	mov	x0, x19
	bl	_dmar_disable_qi_intr
	mov	x0, x19
	bl	_dmar_disable_qi
	ldr	x8, [x19]
	cmp	x8, #0
	cset	w0, eq
	ldrsw	x1, [x19, #32]
	bl	_KASSERT
	mov	x0, x19
	bl	_DMAR_UNLOCK
	ldp	x1, x0, [x19, #16]
	bl	_kmem_free
	stp	xzr, xzr, [x20, #8]
	str	xzr, [x20]
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
