	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dmar_qi_ensure
_dmar_qi_ensure:                        ## @dmar_qi_ensure
	.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, %rbx
	callq	_DMAR_ASSERT_LOCKED
	movq	_DMAR_IQ_DESCR_SZ_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r14d
	movl	(%rbx), %ecx
	cmpl	%ecx, %r14d
	jle	LBB0_6
## %bb.1:
	movq	_DMAR_IQH_REG@GOTPCREL(%rip), %r15
	movq	_DMAR_IQH_MASK@GOTPCREL(%rip), %r12
	movq	_DMAR_IQ_DESCR_SZ@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_dmar_read4
	andl	(%r12), %eax
	movl	4(%rbx), %edx
	movl	(%r13), %esi
	addl	%edx, %esi
	movl	%eax, %ecx
	subl	%esi, %ecx
	movl	%ecx, (%rbx)
	cmpl	%edx, %eax
	jg	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	addl	16(%rbx), %ecx
	movl	%ecx, (%rbx)
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%ecx, %r14d
	jle	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_dmar_qi_advance_tail
	incl	8(%rbx)
	xorl	%eax, %eax
	callq	_cpu_spinwait
	movl	(%rbx), %ecx
	cmpl	%ecx, %r14d
	jg	LBB0_2
LBB0_6:
	subl	%r14d, %ecx
	movl	%ecx, (%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMAR_IQ_DESCR_SZ_SHIFT,4,2     ## @DMAR_IQ_DESCR_SZ_SHIFT
	.comm	_DMAR_IQH_REG,4,2               ## @DMAR_IQH_REG
	.comm	_DMAR_IQH_MASK,4,2              ## @DMAR_IQH_MASK
	.comm	_DMAR_IQ_DESCR_SZ,4,2           ## @DMAR_IQ_DESCR_SZ
	.no_dead_strip	_dmar_qi_ensure
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dmar_qi_ensure
_dmar_qi_ensure:                        ; @dmar_qi_ensure
	.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	x20, x1
	mov	x19, x0
	bl	_DMAR_ASSERT_LOCKED
Lloh0:
	adrp	x8, _DMAR_IQ_DESCR_SZ_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMAR_IQ_DESCR_SZ_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	lsl	w20, w20, w8
	ldr	w8, [x19]
	cmp	w20, w8
	b.le	LBB0_6
; %bb.1:
Lloh3:
	adrp	x21, _DMAR_IQH_REG@GOTPAGE
Lloh4:
	ldr	x21, [x21, _DMAR_IQH_REG@GOTPAGEOFF]
Lloh5:
	adrp	x22, _DMAR_IQH_MASK@GOTPAGE
Lloh6:
	ldr	x22, [x22, _DMAR_IQH_MASK@GOTPAGEOFF]
Lloh7:
	adrp	x23, _DMAR_IQ_DESCR_SZ@GOTPAGE
Lloh8:
	ldr	x23, [x23, _DMAR_IQ_DESCR_SZ@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x19
	bl	_dmar_read4
	ldr	w8, [x22]
	and	w9, w8, w0
	ldr	w10, [x19, #4]
	ldr	w8, [x23]
	add	w8, w10, w8
	sub	w8, w9, w8
	str	w8, [x19]
	cmp	w9, w10
	b.gt	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w9, [x19, #16]
	add	w8, w8, w9
	str	w8, [x19]
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	cmp	w20, w8
	b.le	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x19
	bl	_dmar_qi_advance_tail
	ldr	w8, [x19, #8]
	add	w8, w8, #1
	str	w8, [x19, #8]
	bl	_cpu_spinwait
	ldr	w8, [x19]
	cmp	w20, w8
	b.gt	LBB0_2
LBB0_6:
	sub	w8, w8, w20
	str	w8, [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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DMAR_IQ_DESCR_SZ_SHIFT,4,2     ; @DMAR_IQ_DESCR_SZ_SHIFT
	.comm	_DMAR_IQH_REG,4,2               ; @DMAR_IQH_REG
	.comm	_DMAR_IQH_MASK,4,2              ; @DMAR_IQH_MASK
	.comm	_DMAR_IQ_DESCR_SZ,4,2           ; @DMAR_IQ_DESCR_SZ
	.no_dead_strip	_dmar_qi_ensure
.subsections_via_symbols
