	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dma_pte_clear_level
_dma_pte_clear_level:                   ## @dma_pte_clear_level
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -80(%rbp)                  ## 8-byte Spill
	movq	%rdx, %rbx
	movl	%esi, %r13d
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	16(%rbp), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r8, -96(%rbp)                  ## 8-byte Spill
	movq	%r8, %rdi
	movq	%rcx, %rsi
	callq	_max
	movq	%rax, %r15
	movq	%rax, %rdi
	movl	%r13d, %esi
	callq	_pfn_level_offset
	leaq	(%rbx,%rax,4), %r14
	leal	-1(%r13), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_dma_pte_present
	testl	%eax, %eax
	je	LBB0_10
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%r13d, %edi
	callq	_level_mask
	movq	%rax, %r12
	andq	%r15, %r12
	cmpq	-96(%rbp), %r12                 ## 8-byte Folded Reload
	jb	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%r13d, %edi
	callq	_level_size
	addq	%r12, %rax
	decq	%rax
	cmpq	-80(%rbp), %rax                 ## 8-byte Folded Reload
	jbe	LBB0_4
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$2, %r13d
	jl	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	callq	_dma_pte_addr
	movl	%eax, %edi
	callq	_phys_to_virt
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%rsp)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movq	%rax, %rdx
	movq	%r12, %rcx
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	callq	_dma_pte_clear_level
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_10
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$2, %r13d
	jl	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	callq	_dma_pte_superpage
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movq	%r14, %rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	_dma_pte_list_pagetables
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	callq	_dma_clear_pte
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	cmoveq	%r14, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %rax
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%r13d, %edi
	callq	_level_size
	movq	%rax, %rbx
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_first_pte_in_page
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_1 Depth=1
	addq	%rbx, %r15
	cmpq	-80(%rbp), %r15                 ## 8-byte Folded Reload
	jbe	LBB0_1
LBB0_12:
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	testq	%rsi, %rsi
	je	LBB0_14
## %bb.13:
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	subl	%esi, %edx
	addl	$4, %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_domain_flush_cache
LBB0_14:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_dma_pte_clear_level
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dma_pte_clear_level
_dma_pte_clear_level:                   ; @dma_pte_clear_level
	.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	x19, x6
	mov	x21, x5
	mov	x22, x4
	mov	x26, x2
	mov	x23, x1
	mov	x20, x0
	mov	x0, x4
	mov	x1, x3
	bl	_max
	mov	x25, x0
	mov	x1, x23
	bl	_pfn_level_offset
	mov	x24, #0
	str	xzr, [sp, #8]                   ; 8-byte Folded Spill
	add	x26, x26, x0, lsl #2
	sub	w27, w23, #1
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x26
	bl	_dma_pte_present
	cbz	w0, LBB0_10
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x23
	bl	_level_mask
	and	x28, x0, x25
	cmp	x28, x22
	b.lo	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x23
	bl	_level_size
	add	x8, x28, x0
	sub	x8, x8, #1
	cmp	x8, x21
	b.ls	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_1 Depth=1
	cmp	w23, #2
	b.lt	LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x26
	bl	_dma_pte_addr
	bl	_phys_to_virt
	mov	x2, x0
	mov	x0, x20
	mov	x1, x27
	mov	x3, x28
	mov	x4, x22
	mov	x5, x21
	mov	x6, x19
	bl	_dma_pte_clear_level
	mov	x19, x0
	b	LBB0_10
LBB0_6:                                 ;   in Loop: Header=BB0_1 Depth=1
	cmp	w23, #2
	b.lt	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x26
	bl	_dma_pte_superpage
	cbnz	w0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x20
	mov	x1, x27
	mov	x2, x26
	mov	x3, x19
	bl	_dma_pte_list_pagetables
	mov	x19, x0
LBB0_9:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x26
	bl	_dma_clear_pte
	cmp	x24, #0
	csel	x24, x26, x24, eq
	str	x26, [sp, #8]                   ; 8-byte Folded Spill
LBB0_10:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x23
	bl	_level_size
	mov	x28, x0
	add	x26, x26, #4
	mov	x0, x26
	bl	_first_pte_in_page
	cbnz	w0, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_1 Depth=1
	add	x25, x28, x25
	cmp	x25, x21
	b.ls	LBB0_1
LBB0_12:
	cbz	x24, LBB0_14
; %bb.13:
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	sub	w8, w8, w24
	add	w2, w8, #4
	mov	x0, x20
	mov	x1, x24
	bl	_domain_flush_cache
LBB0_14:
	mov	x0, x19
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_dma_pte_clear_level
.subsections_via_symbols
