	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iommu_flush_write_buffer       ## -- Begin function iommu_flush_write_buffer
	.p2align	4, 0x90
_iommu_flush_write_buffer:              ## @iommu_flush_write_buffer
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_rwbf_quirk@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_3
## %bb.1:
	movl	16(%rbx), %edi
	callq	_cap_rwbf
	testl	%eax, %eax
	je	LBB0_2
LBB0_3:
	leaq	4(%rbx), %r14
	movq	%r14, %rdi
	callq	_raw_spin_lock_irqsave
	movq	_DMA_GCMD_WBF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	(%rbx), %edi
	movq	_DMAR_GCMD_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	callq	_writel
	movq	_DMAR_GSTS_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_readl@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_IOMMU_WAIT_OP
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_raw_spin_unlock_irqrestore     ## TAILCALL
LBB0_2:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_rwbf_quirk,4,2                 ## @rwbf_quirk
	.comm	_DMA_GCMD_WBF,4,2               ## @DMA_GCMD_WBF
	.comm	_DMAR_GCMD_REG,8,3              ## @DMAR_GCMD_REG
	.comm	_DMAR_GSTS_REG,4,2              ## @DMAR_GSTS_REG
	.comm	_readl,4,2                      ## @readl
	.comm	_DMA_GSTS_WBFS,4,2              ## @DMA_GSTS_WBFS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iommu_flush_write_buffer       ; -- Begin function iommu_flush_write_buffer
	.p2align	2
_iommu_flush_write_buffer:              ; @iommu_flush_write_buffer
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _rwbf_quirk@GOTPAGE
Lloh1:
	ldr	x8, [x8, _rwbf_quirk@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbnz	w8, LBB0_2
; %bb.1:
	ldr	w0, [x19, #16]
	bl	_cap_rwbf
	cbz	w0, LBB0_3
LBB0_2:
	add	x20, x19, #4
	mov	x0, x20
	bl	_raw_spin_lock_irqsave
	ldr	w8, [x19]
Lloh3:
	adrp	x9, _DMA_GCMD_WBF@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DMA_GCMD_WBF@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w0, w9, w8
	ldr	x8, [x19, #8]
Lloh6:
	adrp	x9, _DMAR_GCMD_REG@GOTPAGE
Lloh7:
	ldr	x9, [x9, _DMAR_GCMD_REG@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
Lloh9:
	adrp	x8, _DMAR_GSTS_REG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DMAR_GSTS_REG@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _readl@GOTPAGE
Lloh13:
	ldr	x8, [x8, _readl@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #1
	bl	_IOMMU_WAIT_OP
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_raw_spin_unlock_irqrestore
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_rwbf_quirk,4,2                 ; @rwbf_quirk
	.comm	_DMA_GCMD_WBF,4,2               ; @DMA_GCMD_WBF
	.comm	_DMAR_GCMD_REG,8,3              ; @DMAR_GCMD_REG
	.comm	_DMAR_GSTS_REG,4,2              ; @DMAR_GSTS_REG
	.comm	_readl,4,2                      ; @readl
	.comm	_DMA_GSTS_WBFS,4,2              ; @DMA_GSTS_WBFS
.subsections_via_symbols
