	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmap_flush_cache_phys_range    ## -- Begin function pmap_flush_cache_phys_range
	.p2align	4, 0x90
_pmap_flush_cache_phys_range:           ## @pmap_flush_cache_phys_range
	.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
	movl	%edx, %r15d
	movl	%esi, %r14d
	movl	%edi, %ebx
	movq	_PAGE_MASK@GOTPCREL(%rip), %r12
	xorl	%edi, %edi
	movl	(%r12), %eax
	andl	%ebx, %eax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	xorl	%edi, %edi
	movl	(%r12), %eax
	andl	%r14d, %eax
	sete	%dil
	leaq	L_.str.1(%rip), %rsi
	callq	_KASSERT
	movq	_dmaplimit@GOTPCREL(%rip), %r12
	cmpl	%ebx, (%r12)
	jle	LBB0_2
## %bb.1:
	movl	%ebx, %edi
	callq	_PHYS_TO_DMAP
	movq	%rax, %rbx
	movl	(%r12), %edi
	movl	%r14d, %esi
	callq	_MIN
	movl	%eax, %edi
	callq	_PHYS_TO_DMAP
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_pmap_flush_cache_range
	movl	(%r12), %ebx
	cmpl	%r14d, %ebx
	jge	LBB0_6
LBB0_2:
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	xorl	%edx, %edx
	callq	_pmap_cache_bits
	movl	%eax, %r15d
	movq	_X86_PG_RW@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	_X86_PG_V@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	_kernel_arena@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	movq	_M_BESTFIT@GOTPCREL(%rip), %rax
	movq	_M_WAITOK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	leaq	-48(%rbp), %rcx
	callq	_vmem_alloc
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	movslq	%eax, %rsi
	callq	_KASSERT
	movq	-48(%rbp), %rdi
	callq	_vtopte
	cmpl	%r14d, %ebx
	jge	LBB0_7
## %bb.3:
	movq	%rax, %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_sched_pin
	movl	%r15d, %esi
	orl	%ebx, %esi
	movq	%r12, %rdi
	callq	_pte_store
	movq	-48(%rbp), %rdi
	callq	_invlpg
	movq	-48(%rbp), %rdi
	movq	(%r13), %rsi
	addq	%rdi, %rsi
	callq	_pmap_flush_cache_range
	xorl	%eax, %eax
	callq	_sched_unpin
	movq	(%r13), %rdx
	addl	%edx, %ebx
	cmpl	%r14d, %ebx
	jl	LBB0_4
	jmp	LBB0_5
LBB0_7:
	movq	(%r13), %rdx
LBB0_5:
	movq	_kernel_arena@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rsi
	callq	_vmem_free
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pmap_flush_cache_phys_range: spa not page-aligned"

L_.str.1:                               ## @.str.1
	.asciz	"pmap_flush_cache_phys_range: epa not page-aligned"

	.comm	_dmaplimit,4,2                  ## @dmaplimit
	.comm	_kernel_pmap,4,2                ## @kernel_pmap
	.comm	_X86_PG_RW,4,2                  ## @X86_PG_RW
	.comm	_X86_PG_V,4,2                   ## @X86_PG_V
	.comm	_kernel_arena,4,2               ## @kernel_arena
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_M_BESTFIT,4,2                  ## @M_BESTFIT
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmap_flush_cache_phys_range    ; -- Begin function pmap_flush_cache_phys_range
	.p2align	2
_pmap_flush_cache_phys_range:           ; @pmap_flush_cache_phys_range
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _PAGE_MASK@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PAGE_MASK@GOTPAGEOFF]
	ldr	w8, [x22]
	tst	w8, w0
	cset	w0, eq
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	ldr	w8, [x22]
	tst	w8, w19
	cset	w0, eq
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
Lloh6:
	adrp	x22, _dmaplimit@GOTPAGE
Lloh7:
	ldr	x22, [x22, _dmaplimit@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, w20
	b.le	LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_PHYS_TO_DMAP
	mov	x20, x0
	ldr	w0, [x22]
	mov	x1, x19
	bl	_MIN
	bl	_PHYS_TO_DMAP
	mov	x1, x0
	mov	x0, x20
	bl	_pmap_flush_cache_range
	ldr	w20, [x22]
	cmp	w20, w19
	b.ge	LBB0_7
LBB0_2:
Lloh8:
	adrp	x8, _kernel_pmap@GOTPAGE
Lloh9:
	ldr	x8, [x8, _kernel_pmap@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x21
	mov	w2, #0
	bl	_pmap_cache_bits
	mov	x22, x0
Lloh11:
	adrp	x8, _X86_PG_RW@GOTPAGE
Lloh12:
	ldr	x8, [x8, _X86_PG_RW@GOTPAGEOFF]
Lloh13:
	ldr	w25, [x8]
Lloh14:
	adrp	x8, _X86_PG_V@GOTPAGE
Lloh15:
	ldr	x8, [x8, _X86_PG_V@GOTPAGEOFF]
Lloh16:
	adrp	x23, _kernel_arena@GOTPAGE
Lloh17:
	ldr	x23, [x23, _kernel_arena@GOTPAGEOFF]
Lloh18:
	ldr	w26, [x8]
	ldr	w0, [x23]
Lloh19:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh20:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
Lloh21:
	adrp	x8, _M_BESTFIT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _M_BESTFIT@GOTPAGEOFF]
	ldr	x1, [x24]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _M_WAITOK@GOTPAGE
Lloh25:
	ldr	x9, [x9, _M_WAITOK@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w2, w9, w8
	add	x3, sp, #8
	bl	_vmem_alloc
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, #0
	cset	w8, eq
	sxtw	x1, w0
	mov	x0, x8
	bl	_KASSERT
	ldr	x0, [sp, #8]
	bl	_vtopte
	cmp	w20, w19
	b.ge	LBB0_5
; %bb.3:
	mov	x21, x0
	orr	w8, w25, w22
	orr	w22, w8, w26
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	bl	_sched_pin
	orr	w1, w22, w20
	mov	x0, x21
	bl	_pte_store
	ldr	x0, [sp, #8]
	bl	_invlpg
	ldr	x0, [sp, #8]
	ldr	x8, [x24]
	add	x1, x8, x0
	bl	_pmap_flush_cache_range
	bl	_sched_unpin
	ldr	x2, [x24]
	add	w20, w20, w2
	cmp	w20, w19
	b.lt	LBB0_4
	b	LBB0_6
LBB0_5:
	ldr	x2, [x24]
LBB0_6:
	ldr	w0, [x23]
	ldr	x1, [sp, #8]
	bl	_vmem_free
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh18
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pmap_flush_cache_phys_range: spa not page-aligned"

l_.str.1:                               ; @.str.1
	.asciz	"pmap_flush_cache_phys_range: epa not page-aligned"

	.comm	_dmaplimit,4,2                  ; @dmaplimit
	.comm	_kernel_pmap,4,2                ; @kernel_pmap
	.comm	_X86_PG_RW,4,2                  ; @X86_PG_RW
	.comm	_X86_PG_V,4,2                   ; @X86_PG_V
	.comm	_kernel_arena,4,2               ; @kernel_arena
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_M_BESTFIT,4,2                  ; @M_BESTFIT
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
.subsections_via_symbols
