	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_domain_flush_iotlb_sync        ## -- Begin function domain_flush_iotlb_sync
	.p2align	4, 0x90
_domain_flush_iotlb_sync:               ## @domain_flush_iotlb_sync
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rbx
	xorl	%edi, %edi
	cmpl	$0, 12(%rbx)
	sete	%dil
	movslq	4(%rbx), %rsi
	callq	_KASSERT
	movl	8(%rbx), %edi
	callq	_DMAR_ECAP_IRO
	shll	$4, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_DMAR_LOCK
	cmpl	$2097152, %r12d                 ## imm = 0x200000
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	jg	LBB0_6
## %bb.1:
	movq	_DMAR_CAP_PSI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rbx), %eax
	je	LBB0_6
## %bb.2:
	testl	%r12d, %r12d
	jle	LBB0_5
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
	leaq	-64(%rbp), %rcx
	callq	_calc_am
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%eax, %edx
	orl	%r15d, %edx
	movq	%rbx, %rdi
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %esi
	callq	_dmar_write8
	movq	_DMAR_IOTLB_IIRG_PAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_DMAR_IOTLB_DID
	orl	%eax, %r13d
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%r14d, %edx
	callq	_domain_wait_iotlb_flush
	movl	%eax, %ebx
	movq	_DMAR_IOTLB_IAIG_MASK@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	andl	%ebx, %eax
	xorl	%edi, %edi
	movq	_DMAR_IOTLB_IAIG_INVLD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	setne	%dil
	movslq	-60(%rbp), %rsi                 ## 4-byte Folded Reload
	callq	_KASSERT
	andl	(%r14), %ebx
	movq	_DMAR_IOTLB_IAIG_PAGE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-64(%rbp), %eax
	addl	%eax, %r15d
	subl	%eax, %r12d
	jg	LBB0_3
	jmp	LBB0_5
LBB0_6:
	movq	_DMAR_IOTLB_IIRG_DOM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_DMAR_IOTLB_DID
	orl	%eax, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_domain_wait_iotlb_flush
	movq	_DMAR_IOTLB_IAIG_MASK@GOTPCREL(%rip), %rcx
	movslq	%eax, %rsi
	andl	(%rcx), %eax
	movq	_DMAR_IOTLB_IAIG_INVLD@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpl	(%rcx), %eax
	setne	%dil
	callq	_KASSERT
LBB0_5:
	movq	%rbx, %rdi
	callq	_DMAR_UNLOCK
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMAR_CAP_PSI,4,2               ## @DMAR_CAP_PSI
	.comm	_DMAR_IOTLB_IIRG_DOM,4,2        ## @DMAR_IOTLB_IIRG_DOM
	.comm	_DMAR_IOTLB_IAIG_MASK,4,2       ## @DMAR_IOTLB_IAIG_MASK
	.comm	_DMAR_IOTLB_IAIG_INVLD,4,2      ## @DMAR_IOTLB_IAIG_INVLD
	.comm	_DMAR_IOTLB_IIRG_PAGE,4,2       ## @DMAR_IOTLB_IIRG_PAGE
	.comm	_DMAR_IOTLB_IAIG_PAGE,4,2       ## @DMAR_IOTLB_IAIG_PAGE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_domain_flush_iotlb_sync        ; -- Begin function domain_flush_iotlb_sync
	.p2align	2
_domain_flush_iotlb_sync:               ; @domain_flush_iotlb_sync
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	ldr	x19, [x0, #8]
	ldr	w8, [x19, #12]
	cmp	w8, #0
	cset	w0, eq
	ldrsw	x1, [x19, #4]
	bl	_KASSERT
	ldr	w0, [x19, #8]
	bl	_DMAR_ECAP_IRO
	lsl	w23, w0, #4
	mov	x0, x19
	bl	_DMAR_LOCK
	cmp	w21, #512, lsl #12              ; =2097152
	b.gt	LBB0_6
; %bb.1:
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _DMAR_CAP_PSI@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMAR_CAP_PSI@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w8, w9, w8
	cbz	w8, LBB0_6
; %bb.2:
	cmp	w21, #1
	b.lt	LBB0_7
; %bb.3:
Lloh3:
	adrp	x27, _DMAR_IOTLB_IAIG_MASK@GOTPAGE
Lloh4:
	ldr	x27, [x27, _DMAR_IOTLB_IAIG_MASK@GOTPAGEOFF]
Lloh5:
	adrp	x28, _DMAR_IOTLB_IAIG_INVLD@GOTPAGE
Lloh6:
	ldr	x28, [x28, _DMAR_IOTLB_IAIG_INVLD@GOTPAGEOFF]
Lloh7:
	adrp	x26, _DMAR_IOTLB_IAIG_PAGE@GOTPAGE
Lloh8:
	ldr	x26, [x26, _DMAR_IOTLB_IAIG_PAGE@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x3, sp, #12
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_calc_am
	mov	x24, x0
	orr	w2, w0, w22
	mov	x0, x19
	mov	x1, x23
	bl	_dmar_write8
Lloh9:
	adrp	x8, _DMAR_IOTLB_IIRG_PAGE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DMAR_IOTLB_IIRG_PAGE@GOTPAGEOFF]
Lloh11:
	ldr	w25, [x8]
	ldr	w0, [x20]
	bl	_DMAR_IOTLB_DID
	orr	w1, w0, w25
	mov	x0, x19
	mov	x2, x23
	bl	_domain_wait_iotlb_flush
	mov	x25, x0
	ldr	w8, [x27]
	and	w8, w8, w0
	ldr	w9, [x28]
	cmp	w8, w9
	cset	w0, ne
	sxtw	x1, w24
	bl	_KASSERT
	ldr	w8, [x27]
	and	w8, w8, w25
	ldr	w9, [x26]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #12]
	add	w22, w8, w22
	sub	w21, w21, w8
	cmp	w21, #0
	b.gt	LBB0_4
	b	LBB0_7
LBB0_6:
Lloh12:
	adrp	x8, _DMAR_IOTLB_IIRG_DOM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DMAR_IOTLB_IIRG_DOM@GOTPAGEOFF]
Lloh14:
	ldr	w21, [x8]
	ldr	w0, [x20]
	bl	_DMAR_IOTLB_DID
	orr	w1, w0, w21
	mov	x0, x19
	mov	x2, x23
	bl	_domain_wait_iotlb_flush
                                        ; kill: def $w0 killed $w0 def $x0
Lloh15:
	adrp	x8, _DMAR_IOTLB_IAIG_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DMAR_IOTLB_IAIG_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh18:
	adrp	x9, _DMAR_IOTLB_IAIG_INVLD@GOTPAGE
Lloh19:
	ldr	x9, [x9, _DMAR_IOTLB_IAIG_INVLD@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w8, ne
	sxtw	x1, w0
	mov	x0, x8
	bl	_KASSERT
LBB0_7:
	mov	x0, x19
	bl	_DMAR_UNLOCK
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_DMAR_CAP_PSI,4,2               ; @DMAR_CAP_PSI
	.comm	_DMAR_IOTLB_IIRG_DOM,4,2        ; @DMAR_IOTLB_IIRG_DOM
	.comm	_DMAR_IOTLB_IAIG_MASK,4,2       ; @DMAR_IOTLB_IAIG_MASK
	.comm	_DMAR_IOTLB_IAIG_INVLD,4,2      ; @DMAR_IOTLB_IAIG_INVLD
	.comm	_DMAR_IOTLB_IIRG_PAGE,4,2       ; @DMAR_IOTLB_IIRG_PAGE
	.comm	_DMAR_IOTLB_IAIG_PAGE,4,2       ; @DMAR_IOTLB_IAIG_PAGE
.subsections_via_symbols
