	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __iommu_wait_for_completion
___iommu_wait_for_completion:           ## @__iommu_wait_for_completion
	.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	%rdi, %r15
	movq	_compl_wait@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_INC_STATS_COUNTER
	movq	_EXIT_LOOP_COUNT@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	movq	_MMIO_STATUS_OFFSET@GOTPCREL(%rip), %r12
	movq	_MMIO_STATUS_COM_WAIT_INT_MASK@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	incq	%rbx
	movq	(%r12), %rdi
	addq	8(%r15), %rdi
	callq	_readl
                                        ## kill: def $eax killed $eax def $rax
	movl	(%r13), %edi
	testl	%eax, %edi
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	(%r14), %rbx
	jb	LBB0_3
	jmp	LBB0_5
LBB0_1:
	movq	_MMIO_STATUS_COM_WAIT_INT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
LBB0_5:
	notl	%edi
	andl	%eax, %edi
	movq	_MMIO_STATUS_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	callq	_writel
	xorl	%edi, %edi
	cmpq	(%r14), %rbx
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%r15, %rdi
	callq	_spin_unlock
	movq	%r15, %rdi
	callq	_reset_iommu_command_buffer
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_lock                      ## TAILCALL
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_compl_wait,4,2                 ## @compl_wait
	.comm	_EXIT_LOOP_COUNT,8,3            ## @EXIT_LOOP_COUNT
	.comm	_MMIO_STATUS_OFFSET,8,3         ## @MMIO_STATUS_OFFSET
	.comm	_MMIO_STATUS_COM_WAIT_INT_MASK,4,2 ## @MMIO_STATUS_COM_WAIT_INT_MASK
	.no_dead_strip	___iommu_wait_for_completion
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __iommu_wait_for_completion
___iommu_wait_for_completion:           ; @__iommu_wait_for_completion
	.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	x19, x0
Lloh0:
	adrp	x8, _compl_wait@GOTPAGE
Lloh1:
	ldr	x8, [x8, _compl_wait@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_INC_STATS_COUNTER
Lloh3:
	adrp	x20, _EXIT_LOOP_COUNT@GOTPAGE
Lloh4:
	ldr	x20, [x20, _EXIT_LOOP_COUNT@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh5:
	adrp	x22, _MMIO_STATUS_OFFSET@GOTPAGE
Lloh6:
	ldr	x22, [x22, _MMIO_STATUS_OFFSET@GOTPAGEOFF]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x21, #0
Lloh7:
	adrp	x23, _MMIO_STATUS_COM_WAIT_INT_MASK@GOTPAGE
Lloh8:
	ldr	x23, [x23, _MMIO_STATUS_COM_WAIT_INT_MASK@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x21, x21, #1
	ldr	x8, [x19, #8]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x23]
	and	w9, w8, w0
	ldr	x10, [x20]
	cmp	w9, #0
	ccmp	x21, x10, #2, eq
	b.lo	LBB0_2
	b	LBB0_4
LBB0_3:
	mov	w0, #0
	mov	x21, #0
Lloh9:
	adrp	x8, _MMIO_STATUS_COM_WAIT_INT_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MMIO_STATUS_COM_WAIT_INT_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
LBB0_4:
	bic	w0, w0, w8
	ldr	x8, [x19, #8]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x20]
	cmp	x21, x8
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x19
	bl	_reset_iommu_command_buffer
	mov	x0, 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
	b	_spin_lock
LBB0_6:
	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 AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_compl_wait,4,2                 ; @compl_wait
	.comm	_EXIT_LOOP_COUNT,8,3            ; @EXIT_LOOP_COUNT
	.comm	_MMIO_STATUS_OFFSET,8,3         ; @MMIO_STATUS_OFFSET
	.comm	_MMIO_STATUS_COM_WAIT_INT_MASK,4,2 ; @MMIO_STATUS_COM_WAIT_INT_MASK
	.no_dead_strip	___iommu_wait_for_completion
.subsections_via_symbols
