	.file	"extr_intel_qi.c_dmar_qi_ensure.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	dmar_qi_ensure, @function
dmar_qi_ensure:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	DMAR_ASSERT_LOCKED@PLT
	mov	ecx, DWORD PTR DMAR_IQ_DESCR_SZ_SHIFT[rip]
	mov	edx, DWORD PTR [rbx]
	sal	ebp, cl
	cmp	ebp, edx
	jg	.L4
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, rbx
	call	dmar_qi_advance_tail@PLT
	add	DWORD PTR 8[rbx], 1
	xor	eax, eax
	call	cpu_spinwait@PLT
	mov	edx, DWORD PTR [rbx]
	cmp	edx, ebp
	jge	.L2
.L4:
	mov	esi, DWORD PTR DMAR_IQH_REG[rip]
	mov	rdi, rbx
	call	dmar_read4@PLT
	mov	ecx, DWORD PTR 4[rbx]
	and	eax, DWORD PTR DMAR_IQH_MASK[rip]
	mov	edx, eax
	sub	edx, ecx
	sub	edx, DWORD PTR DMAR_IQ_DESCR_SZ[rip]
	mov	DWORD PTR [rbx], edx
	cmp	ecx, eax
	jl	.L3
	add	edx, DWORD PTR 16[rbx]
	mov	DWORD PTR [rbx], edx
.L3:
	cmp	edx, ebp
	jl	.L8
.L2:
	sub	edx, ebp
	mov	DWORD PTR [rbx], edx
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	dmar_qi_ensure, .-dmar_qi_ensure
	.comm	DMAR_IQ_DESCR_SZ_SHIFT,4,4
	.comm	DMAR_IQ_DESCR_SZ,4,4
	.comm	DMAR_IQH_REG,4,4
	.comm	DMAR_IQH_MASK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_intel_qi.c_dmar_qi_ensure.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	dmar_qi_ensure, %function
dmar_qi_ensure:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	mov	r5, r1
	bl	DMAR_ASSERT_LOCKED
	ldr	r2, .L9
	ldr	r3, [r4]
	ldr	r1, [r2]
	cmp	r3, r5, lsl r1
	lsl	r5, r5, r1
	bge	.L2
	ldr	r8, .L9+4
	ldr	r7, .L9+8
	ldr	r6, .L9+12
	b	.L4
.L8:
	mov	r0, r4
	bl	dmar_qi_advance_tail
	ldr	r3, [r4, #8]
	add	r3, r3, #1
	str	r3, [r4, #8]
	bl	cpu_spinwait
	ldr	r3, [r4]
	cmp	r3, r5
	bge	.L2
.L4:
	ldr	r1, [r8]
	mov	r0, r4
	bl	dmar_read4
	ldr	r3, [r7]
	ldr	r2, [r4, #4]
	and	r0, r0, r3
	cmp	r2, r0
	ldr	r1, [r6]
	sub	r3, r0, r2
	ldrge	r2, [r4, #12]
	sub	r3, r3, r1
	str	r3, [r4]
	addge	r3, r3, r2
	strge	r3, [r4]
	cmp	r3, r5
	blt	.L8
.L2:
	sub	r3, r3, r5
	str	r3, [r4]
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	.align	2
.L9:
	.word	DMAR_IQ_DESCR_SZ_SHIFT
	.word	DMAR_IQH_REG
	.word	DMAR_IQH_MASK
	.word	DMAR_IQ_DESCR_SZ
	.size	dmar_qi_ensure, .-dmar_qi_ensure
	.comm	DMAR_IQ_DESCR_SZ_SHIFT,4,4
	.comm	DMAR_IQ_DESCR_SZ,4,4
	.comm	DMAR_IQH_REG,4,4
	.comm	DMAR_IQH_MASK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
