	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dmar_init_qi                   ## -- Begin function dmar_init_qi
	.p2align	4, 0x90
_dmar_init_qi:                          ## @dmar_init_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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_DMAR_HAS_QI
	testl	%eax, %eax
	je	LBB0_8
## %bb.1:
	movq	_DMAR_CAP_CM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	jne	LBB0_8
## %bb.2:
	leaq	4(%rbx), %rsi
	movl	$1, 4(%rbx)
	leaq	L_.str(%rip), %rdi
	callq	_TUNABLE_INT_FETCH
	cmpl	$0, 4(%rbx)
	je	LBB0_8
## %bb.3:
	leaq	68(%rbx), %rdi
	callq	_TAILQ_INIT
	leaq	64(%rbx), %rdi
	movq	_dmar_qi_task@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	movq	%rbx, %rcx
	callq	_TASK_INIT
	movq	_M_WAITOK@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_taskqueue_thread_enqueue@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	60(%rbx), %r14
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rcx
	callq	_taskqueue_create_fast
	movl	%eax, 60(%rbx)
	movq	_PI_AV@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	56(%rbx), %r8d
	leaq	L_.str.2(%rip), %rcx
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_taskqueue_start_threads
	movq	$0, 48(%rbx)
	movl	$1, 8(%rbx)
	movq	_DMAR_IQA_QS_DEF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	leaq	L_.str.3(%rip), %rdi
	leaq	-28(%rbp), %rsi
	callq	_TUNABLE_INT_FETCH
	movl	-28(%rbp), %ecx
	movq	_DMAR_IQA_QS_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jle	LBB0_5
## %bb.4:
	movl	%eax, -28(%rbp)
	movl	%eax, %ecx
LBB0_5:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movq	%r8, %rdi
                                        ## kill: def $cl killed $cl killed $ecx
	shlq	%cl, %rdi
	movq	%rdi, 16(%rbx)
	movq	_DMAR_IQ_DESCR_SZ@GOTPCREL(%rip), %rax
	movq	%rdi, %rcx
	subq	(%rax), %rcx
	movq	%rcx, 40(%rbx)
	movq	_M_ZERO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%r15), %esi
	movq	_dmar_high@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_VM_MEMATTR_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	callq	_kmem_alloc_contig
	movl	%eax, 24(%rbx)
	leal	28(%rbx), %edi
	callq	_pmap_kextract
	movq	%rax, 32(%rbx)
	movq	%rbx, %rdi
	callq	_DMAR_LOCK
	movq	_DMAR_IQT_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_dmar_write8
	movl	24(%rbx), %edi
	callq	_pmap_kextract
	orl	-28(%rbp), %eax
	movq	_DMAR_IQA_REG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_dmar_write8
	movq	%rbx, %rdi
	callq	_dmar_enable_qi
	movq	_DMAR_ICS_REG@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_dmar_read4
	movq	_DMAR_ICS_IWC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_7
## %bb.6:
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_dmar_write4
LBB0_7:
	movq	%rbx, %rdi
	callq	_dmar_enable_qi_intr
	movq	%rbx, %rdi
	callq	_DMAR_UNLOCK
LBB0_8:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMAR_CAP_CM,4,2                ## @DMAR_CAP_CM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hw.dmar.qi"

	.comm	_dmar_qi_task,4,2               ## @dmar_qi_task
L_.str.1:                               ## @.str.1
	.asciz	"dmarqf"

	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_taskqueue_thread_enqueue,4,2   ## @taskqueue_thread_enqueue
	.comm	_PI_AV,4,2                      ## @PI_AV
L_.str.2:                               ## @.str.2
	.asciz	"dmar%d qi taskq"

	.comm	_DMAR_IQA_QS_DEF,4,2            ## @DMAR_IQA_QS_DEF
L_.str.3:                               ## @.str.3
	.asciz	"hw.dmar.qi_size"

	.comm	_DMAR_IQA_QS_MAX,4,2            ## @DMAR_IQA_QS_MAX
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_DMAR_IQ_DESCR_SZ,8,3           ## @DMAR_IQ_DESCR_SZ
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_dmar_high,4,2                  ## @dmar_high
	.comm	_VM_MEMATTR_DEFAULT,4,2         ## @VM_MEMATTR_DEFAULT
	.comm	_DMAR_IQT_REG,4,2               ## @DMAR_IQT_REG
	.comm	_DMAR_IQA_REG,4,2               ## @DMAR_IQA_REG
	.comm	_DMAR_ICS_REG,4,2               ## @DMAR_ICS_REG
	.comm	_DMAR_ICS_IWC,4,2               ## @DMAR_ICS_IWC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dmar_init_qi                   ; -- Begin function dmar_init_qi
	.p2align	2
_dmar_init_qi:                          ; @dmar_init_qi
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	bl	_DMAR_HAS_QI
	cbz	w0, LBB0_8
; %bb.1:
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _DMAR_CAP_CM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMAR_CAP_CM@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_8
; %bb.2:
	mov	w22, #1
	mov	x20, x19
	str	w22, [x20, #4]!
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_TUNABLE_INT_FETCH
	ldr	w8, [x20]
	cbz	w8, LBB0_8
; %bb.3:
	add	x0, x19, #68
	bl	_TAILQ_INIT
	add	x0, x19, #64
Lloh5:
	adrp	x8, _dmar_qi_task@GOTPAGE
Lloh6:
	ldr	x8, [x8, _dmar_qi_task@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	w1, #0
	mov	x3, x19
	bl	_TASK_INIT
Lloh8:
	adrp	x21, _M_WAITOK@GOTPAGE
Lloh9:
	ldr	x21, [x21, _M_WAITOK@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh10:
	adrp	x8, _taskqueue_thread_enqueue@GOTPAGE
Lloh11:
	ldr	x8, [x8, _taskqueue_thread_enqueue@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	add	x20, x19, #60
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x3, x20
	bl	_taskqueue_create_fast
	str	w0, [x19, #60]
Lloh15:
	adrp	x8, _PI_AV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PI_AV@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	ldr	w4, [x19, #56]
Lloh18:
	adrp	x3, l_.str.2@PAGE
Lloh19:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	w1, #1
	bl	_taskqueue_start_threads
	str	xzr, [x19, #48]
	str	w22, [x19, #8]
Lloh20:
	adrp	x8, _DMAR_IQA_QS_DEF@GOTPAGE
Lloh21:
	ldr	x8, [x8, _DMAR_IQA_QS_DEF@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	str	w8, [sp, #12]
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	add	x1, sp, #12
	bl	_TUNABLE_INT_FETCH
	ldr	w8, [sp, #12]
Lloh25:
	adrp	x9, _DMAR_IQA_QS_MAX@GOTPAGE
Lloh26:
	ldr	x9, [x9, _DMAR_IQA_QS_MAX@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_5
; %bb.4:
	str	w9, [sp, #12]
	mov	x8, x9
LBB0_5:
Lloh28:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh29:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh30:
	ldr	x4, [x9]
	lsl	x0, x4, x8
	str	x0, [x19, #16]
Lloh31:
	adrp	x8, _DMAR_IQ_DESCR_SZ@GOTPAGE
Lloh32:
	ldr	x8, [x8, _DMAR_IQ_DESCR_SZ@GOTPAGEOFF]
Lloh33:
	ldr	x8, [x8]
	sub	x8, x0, x8
	str	x8, [x19, #40]
	ldr	w8, [x21]
Lloh34:
	adrp	x9, _M_ZERO@GOTPAGE
Lloh35:
	ldr	x9, [x9, _M_ZERO@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh37:
	adrp	x8, _dmar_high@GOTPAGE
Lloh38:
	ldr	x8, [x8, _dmar_high@GOTPAGEOFF]
Lloh39:
	ldr	w3, [x8]
Lloh40:
	adrp	x8, _VM_MEMATTR_DEFAULT@GOTPAGE
Lloh41:
	ldr	x8, [x8, _VM_MEMATTR_DEFAULT@GOTPAGEOFF]
Lloh42:
	ldr	w6, [x8]
	mov	w2, #0
	mov	w5, #0
	bl	_kmem_alloc_contig
	str	w0, [x19, #24]
	add	w0, w19, #28
	bl	_pmap_kextract
	str	x0, [x19, #32]
	mov	x0, x19
	bl	_DMAR_LOCK
Lloh43:
	adrp	x8, _DMAR_IQT_REG@GOTPAGE
Lloh44:
	ldr	x8, [x8, _DMAR_IQT_REG@GOTPAGEOFF]
Lloh45:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_dmar_write8
	ldr	w0, [x19, #24]
	bl	_pmap_kextract
	ldr	w8, [sp, #12]
	orr	w2, w8, w0
Lloh46:
	adrp	x8, _DMAR_IQA_REG@GOTPAGE
Lloh47:
	ldr	x8, [x8, _DMAR_IQA_REG@GOTPAGEOFF]
Lloh48:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dmar_write8
	mov	x0, x19
	bl	_dmar_enable_qi
Lloh49:
	adrp	x20, _DMAR_ICS_REG@GOTPAGE
Lloh50:
	ldr	x20, [x20, _DMAR_ICS_REG@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_dmar_read4
Lloh51:
	adrp	x8, _DMAR_ICS_IWC@GOTPAGE
Lloh52:
	ldr	x8, [x8, _DMAR_ICS_IWC@GOTPAGEOFF]
Lloh53:
	ldr	w2, [x8]
	tst	w2, w0
	b.eq	LBB0_7
; %bb.6:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_dmar_write4
LBB0_7:
	mov	x0, x19
	bl	_dmar_enable_qi_intr
	mov	x0, x19
	bl	_DMAR_UNLOCK
LBB0_8:
	mov	w0, #0
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_DMAR_CAP_CM,4,2                ; @DMAR_CAP_CM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hw.dmar.qi"

	.comm	_dmar_qi_task,4,2               ; @dmar_qi_task
l_.str.1:                               ; @.str.1
	.asciz	"dmarqf"

	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_taskqueue_thread_enqueue,4,2   ; @taskqueue_thread_enqueue
	.comm	_PI_AV,4,2                      ; @PI_AV
l_.str.2:                               ; @.str.2
	.asciz	"dmar%d qi taskq"

	.comm	_DMAR_IQA_QS_DEF,4,2            ; @DMAR_IQA_QS_DEF
l_.str.3:                               ; @.str.3
	.asciz	"hw.dmar.qi_size"

	.comm	_DMAR_IQA_QS_MAX,4,2            ; @DMAR_IQA_QS_MAX
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_DMAR_IQ_DESCR_SZ,8,3           ; @DMAR_IQ_DESCR_SZ
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_dmar_high,4,2                  ; @dmar_high
	.comm	_VM_MEMATTR_DEFAULT,4,2         ; @VM_MEMATTR_DEFAULT
	.comm	_DMAR_IQT_REG,4,2               ; @DMAR_IQT_REG
	.comm	_DMAR_IQA_REG,4,2               ; @DMAR_IQA_REG
	.comm	_DMAR_ICS_REG,4,2               ; @DMAR_ICS_REG
	.comm	_DMAR_ICS_IWC,4,2               ; @DMAR_ICS_IWC
.subsections_via_symbols
