	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmap_large_unmap               ## -- Begin function pmap_large_unmap
	.p2align	4, 0x90
_pmap_large_unmap:                      ## @pmap_large_unmap
	.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
	movq	%rsi, %rax
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	testq	%rsi, %rsi
	je	LBB0_20
## %bb.1:
	js	LBB0_20
## %bb.2:
	movq	%rdi, %r15
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rdi,%rax), %r14
	movq	_DMAP_MIN_ADDRESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rdi, %rax
	jg	LBB0_4
## %bb.3:
	movq	_dmaplimit@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	cmpq	%rax, %r14
	jle	LBB0_20
LBB0_4:
	leaq	-48(%rbp), %rdi
	callq	_SLIST_INIT
	movq	%r15, %rdi
	callq	_PMAP_ADDRESS_IN_LARGEMAP
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	leaq	-1(%r14), %rdi
	callq	_PMAP_ADDRESS_IN_LARGEMAP
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	jmp	LBB0_7
LBB0_5:
	xorl	%edi, %edi
LBB0_7:
	movq	%r14, %rsi
	callq	_KASSERT
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PMAP_LOCK
	movq	_X86_PG_V@GOTPCREL(%rip), %r13
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_8 Depth=1
	movq	_AMDID_PAGE1GB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	movq	_amd_feature@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	setne	%dil
	movq	%rbx, %rsi
	callq	_KASSERT
	xorl	%edi, %edi
	movq	_PDPMASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	andq	%r15, %rax
	sete	%dil
	movq	%rbx, %rsi
	callq	_KASSERT
	movq	_NBPDP@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	addq	%r15, %rax
	xorl	%edi, %edi
	cmpq	%r14, %rax
	setle	%dil
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_KASSERT
	movl	$0, (%r12)
	movq	(%rbx), %r13
LBB0_18:                                ##   in Loop: Header=BB0_8 Depth=1
	addq	%r13, %r15
	cmpq	%r14, %r15
	movq	_X86_PG_V@GOTPCREL(%rip), %r13
	jge	LBB0_19
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_pmap_large_map_pdpe
	movq	%rax, %r12
	movslq	(%rax), %rbx
	xorl	%edi, %edi
	movl	(%r13), %eax
	andl	%ebx, %eax
	setne	%dil
	movq	%rbx, %rsi
	callq	_KASSERT
	movq	_X86_PG_PS@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_pmap_pdpe_to_pde
	movq	%rax, %r14
	movslq	(%rax), %rbx
	xorl	%edi, %edi
	movl	(%r13), %eax
	andl	%ebx, %eax
	setne	%dil
	movq	%rbx, %rsi
	callq	_KASSERT
	movq	_X86_PG_PS@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	xorl	%edi, %edi
	movq	_PDRMASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	andq	%r15, %rax
	sete	%dil
	movq	%rbx, %rsi
	callq	_KASSERT
	movq	_NBPDR@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	addq	%r15, %rax
	xorl	%edi, %edi
	cmpq	-56(%rbp), %rax                 ## 8-byte Folded Reload
	setle	%dil
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_KASSERT
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_pde_store
	movq	(%rbx), %r13
	movq	%r14, %rdi
	callq	_DMAP_TO_PHYS
	movl	%eax, %edi
	callq	_PHYS_TO_VM_PAGE
	decq	(%rax)
	jne	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	$0, (%r12)
	movq	_plinks@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	-48(%rbp), %rdi
LBB0_16:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%rax, %rsi
	callq	_SLIST_INSERT_HEAD
	jmp	LBB0_17
LBB0_13:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_pmap_pde_to_pte
	movq	%rax, %rbx
	movslq	(%rax), %rsi
	xorl	%edi, %edi
	movl	(%r13), %eax
	andl	%esi, %eax
	setne	%dil
	callq	_KASSERT
	movq	%rbx, %rdi
	callq	_pte_clear
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	%rbx, %rdi
	callq	_DMAP_TO_PHYS
	movl	%eax, %edi
	callq	_PHYS_TO_VM_PAGE
	decq	(%rax)
	jne	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	$0, (%r14)
	movq	_plinks@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_SLIST_INSERT_HEAD
	movq	%r14, %rdi
	callq	_DMAP_TO_PHYS
	movl	%eax, %edi
	callq	_PHYS_TO_VM_PAGE
	decq	(%rax)
	je	LBB0_15
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_15:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	$0, (%r12)
	movq	_plinks@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rbx, %rdi
	jmp	LBB0_16
LBB0_19:
	movq	_kernel_pmap@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_pmap_invalidate_range
	movl	(%r15), %edi
	callq	_PMAP_UNLOCK
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_vm_page_free_pages_toq
	movq	_large_vmem@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_vmem_free
LBB0_20:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMAP_MIN_ADDRESS,8,3           ## @DMAP_MIN_ADDRESS
	.comm	_dmaplimit,8,3                  ## @dmaplimit
	.comm	_kernel_pmap,4,2                ## @kernel_pmap
	.comm	_X86_PG_V,4,2                   ## @X86_PG_V
	.comm	_X86_PG_PS,4,2                  ## @X86_PG_PS
	.comm	_amd_feature,4,2                ## @amd_feature
	.comm	_AMDID_PAGE1GB,4,2              ## @AMDID_PAGE1GB
	.comm	_PDPMASK,8,3                    ## @PDPMASK
	.comm	_NBPDP,8,3                      ## @NBPDP
	.comm	_PDRMASK,8,3                    ## @PDRMASK
	.comm	_NBPDR,8,3                      ## @NBPDR
	.comm	_plinks,4,2                     ## @plinks
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_large_vmem,4,2                 ## @large_vmem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmap_large_unmap               ; -- Begin function pmap_large_unmap
	.p2align	2
_pmap_large_unmap:                      ; @pmap_large_unmap
	.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
	cbz	x1, LBB0_17
; %bb.1:
	mov	x19, x1
	tbnz	x1, #63, LBB0_17
; %bb.2:
	mov	x22, x0
	add	x21, x0, x19
Lloh0:
	adrp	x8, _DMAP_MIN_ADDRESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMAP_MIN_ADDRESS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x0
	b.gt	LBB0_4
; %bb.3:
Lloh3:
	adrp	x9, _dmaplimit@GOTPAGE
Lloh4:
	ldr	x9, [x9, _dmaplimit@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x8, x9, x8
	cmp	x21, x8
	b.le	LBB0_17
LBB0_4:
	add	x0, sp, #8
	bl	_SLIST_INIT
	mov	x0, x22
	bl	_PMAP_ADDRESS_IN_LARGEMAP
	cbz	x0, LBB0_6
; %bb.5:
	sub	x0, x21, #1
	bl	_PMAP_ADDRESS_IN_LARGEMAP
	cmp	x0, #0
	cset	w0, ne
LBB0_6:
	mov	x1, x21
	bl	_KASSERT
Lloh6:
	adrp	x8, _kernel_pmap@GOTPAGE
Lloh7:
	ldr	x8, [x8, _kernel_pmap@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_PMAP_LOCK
Lloh9:
	adrp	x27, _X86_PG_V@GOTPAGE
Lloh10:
	ldr	x27, [x27, _X86_PG_V@GOTPAGEOFF]
Lloh11:
	adrp	x28, _X86_PG_PS@GOTPAGE
Lloh12:
	ldr	x28, [x28, _X86_PG_PS@GOTPAGEOFF]
Lloh13:
	adrp	x26, _plinks@GOTPAGE
Lloh14:
	ldr	x26, [x26, _plinks@GOTPAGEOFF]
	str	x22, [sp]                       ; 8-byte Folded Spill
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
Lloh15:
	adrp	x8, _amd_feature@GOTPAGE
Lloh16:
	ldr	x8, [x8, _amd_feature@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _AMDID_PAGE1GB@GOTPAGE
Lloh19:
	ldr	x9, [x9, _AMDID_PAGE1GB@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w0, ne
	mov	x1, x24
	bl	_KASSERT
Lloh21:
	adrp	x8, _PDPMASK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PDPMASK@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	tst	x8, x22
	cset	w0, eq
	mov	x1, x24
	bl	_KASSERT
Lloh24:
	adrp	x20, _NBPDP@GOTPAGE
Lloh25:
	ldr	x20, [x20, _NBPDP@GOTPAGEOFF]
	ldr	x8, [x20]
	add	x8, x8, x22
	cmp	x8, x21
	cset	w0, le
	mov	x1, x19
	bl	_KASSERT
	str	wzr, [x23]
	ldr	x20, [x20]
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x22, x20, x22
	cmp	x22, x21
	b.ge	LBB0_16
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_pmap_large_map_pdpe
	mov	x23, x0
	ldrsw	x24, [x0]
	ldr	w8, [x27]
	tst	w8, w24
	cset	w0, ne
	mov	x1, x24
	bl	_KASSERT
	ldr	w8, [x28]
	tst	w8, w24
	b.ne	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x23
	mov	x1, x22
	bl	_pmap_pdpe_to_pde
	mov	x24, x0
	ldrsw	x25, [x0]
	ldr	w8, [x27]
	tst	w8, w25
	cset	w0, ne
	mov	x1, x25
	bl	_KASSERT
	ldr	w8, [x28]
	tst	w8, w25
	b.eq	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh26:
	adrp	x8, _PDRMASK@GOTPAGE
Lloh27:
	ldr	x8, [x8, _PDRMASK@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	tst	x8, x22
	cset	w0, eq
	mov	x1, x25
	bl	_KASSERT
Lloh29:
	adrp	x20, _NBPDR@GOTPAGE
Lloh30:
	ldr	x20, [x20, _NBPDR@GOTPAGEOFF]
	ldr	x8, [x20]
	add	x8, x8, x22
	cmp	x8, x21
	cset	w0, le
	mov	x1, x19
	bl	_KASSERT
	mov	x0, x24
	mov	w1, #0
	bl	_pde_store
	ldr	x20, [x20]
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x24
	bl	_DMAP_TO_PHYS
	bl	_PHYS_TO_VM_PAGE
	ldr	x8, [x0]
	subs	x8, x8, #1
	str	x8, [x0]
	b.ne	LBB0_8
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x1, x0
	str	wzr, [x23]
	ldr	w2, [x26]
	add	x0, sp, #8
	bl	_SLIST_INSERT_HEAD
	b	LBB0_8
LBB0_14:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x24
	mov	x1, x22
	bl	_pmap_pde_to_pte
	mov	x25, x0
	ldrsw	x1, [x0]
	ldr	w8, [x27]
	tst	w8, w1
	cset	w0, ne
	bl	_KASSERT
	mov	x0, x25
	bl	_pte_clear
Lloh31:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh33:
	ldr	x20, [x8]
	mov	x0, x25
	bl	_DMAP_TO_PHYS
	bl	_PHYS_TO_VM_PAGE
	ldr	x8, [x0]
	subs	x8, x8, #1
	str	x8, [x0]
	b.ne	LBB0_8
; %bb.15:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x1, x0
	str	wzr, [x24]
	ldr	w2, [x26]
	add	x0, sp, #8
	bl	_SLIST_INSERT_HEAD
	b	LBB0_12
LBB0_16:
Lloh34:
	adrp	x22, _kernel_pmap@GOTPAGE
Lloh35:
	ldr	x22, [x22, _kernel_pmap@GOTPAGEOFF]
	ldr	w0, [x22]
	ldr	x20, [sp]                       ; 8-byte Folded Reload
	mov	x1, x20
	mov	x2, x21
	bl	_pmap_invalidate_range
	ldr	w0, [x22]
	bl	_PMAP_UNLOCK
	add	x0, sp, #8
	mov	w1, #0
	bl	_vm_page_free_pages_toq
Lloh36:
	adrp	x8, _large_vmem@GOTPAGE
Lloh37:
	ldr	x8, [x8, _large_vmem@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
	mov	x1, x20
	mov	x2, x19
	bl	_vmem_free
LBB0_17:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_DMAP_MIN_ADDRESS,8,3           ; @DMAP_MIN_ADDRESS
	.comm	_dmaplimit,8,3                  ; @dmaplimit
	.comm	_kernel_pmap,4,2                ; @kernel_pmap
	.comm	_X86_PG_V,4,2                   ; @X86_PG_V
	.comm	_X86_PG_PS,4,2                  ; @X86_PG_PS
	.comm	_amd_feature,4,2                ; @amd_feature
	.comm	_AMDID_PAGE1GB,4,2              ; @AMDID_PAGE1GB
	.comm	_PDPMASK,8,3                    ; @PDPMASK
	.comm	_NBPDP,8,3                      ; @NBPDP
	.comm	_PDRMASK,8,3                    ; @PDRMASK
	.comm	_NBPDR,8,3                      ; @NBPDR
	.comm	_plinks,4,2                     ; @plinks
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_large_vmem,4,2                 ; @large_vmem
.subsections_via_symbols
