	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvkm_vmm_unref_pdes
_nvkm_vmm_unref_pdes:                   ## @nvkm_vmm_unref_pdes
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	32(%rdi), %rdi
	movq	(%rbx), %rdx
	movq	24(%rbx), %rsi
	movq	%rdx, %rax
	shlq	$4, %rax
	movl	8(%rdi,%rax), %r9d
	movq	_SPT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%r13d, %r13d
	cmpl	%ecx, %r9d
	sete	%r13b
	leaq	1(%rdx), %r8
	movq	8(%rsi,%rdx,8), %r15
	movq	(%rsi,%rdx,8), %r14
	movq	%r14, -64(%rbp)
	movq	16(%r14), %rsi
	movq	(%rsi,%r13,8), %rsi
	movq	%rsi, -88(%rbp)
	movq	8(%rbx), %rsi
	movq	16(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rsi,%rdx,8), %rax
	movq	%r8, (%rbx)
	movq	(%r15), %rdx
	decq	(%rdx)
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_10
## %bb.1:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	cmpl	%ecx, %r9d
	setne	%r12b
	movq	(%rbx), %rax
	shlq	$4, %rax
	movq	(%rdi,%rax), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	addq	%rax, %rdi
	addq	$-16, %rdi
	callq	_nvkm_vmm_desc_type
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_TRA
	movq	16(%r14), %rax
	movq	$0, (%rax,%r13,8)
	movq	-64(%rbp), %rax
	movq	(%rax), %rcx
	cmpq	$0, (%rcx,%r12,8)
	je	LBB0_2
## %bb.8:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	callq	*(%rax)
	jmp	LBB0_9
LBB0_10:
	xorl	%r12d, %r12d
	cmpl	%ecx, %r9d
	setne	%r12b
	movq	%rbx, %rdi
	callq	_nvkm_vmm_unref_pdes
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_11
LBB0_2:
	movq	-72(%rbp), %r8                  ## 8-byte Reload
	movq	16(%r15), %rcx
	movq	(%rcx), %rsi
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.3:
	cmpq	$0, 24(%rax)
	je	LBB0_5
## %bb.4:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	*16(%r8)
	movq	_NVKM_VMM_PDE_SPARSE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%r15), %rcx
	movq	%rax, (%rcx,%r14,8)
	jmp	LBB0_9
LBB0_7:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	*(%r8)
	jmp	LBB0_6
LBB0_5:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	*8(%r8)
LBB0_6:
	movq	8(%r15), %rax
	movq	$0, (%rax,%r14,8)
LBB0_9:
	movq	%rbx, %rdi
	callq	_nvkm_vmm_flush_mark
	movq	%rbx, %rdi
	callq	_nvkm_vmm_flush
	movq	-64(%rbp), %r14
LBB0_11:
	movq	(%rbx), %rax
	shlq	$4, %rax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx), %rdi
	addq	$-16, %rdi
	callq	_nvkm_vmm_desc_type
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_TRA
	movl	(%r13), %esi
	movl	4(%r13), %edi
	leaq	-88(%rbp), %rdx
	callq	_nvkm_mmu_ptc_put
	movq	(%r14), %rax
	cmpq	$0, (%rax,%r12,8)
	jne	LBB0_13
## %bb.12:
	leaq	-64(%rbp), %rdi
	callq	_nvkm_vmm_pt_del
LBB0_13:
	decq	(%rbx)
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPT,4,2                        ## @SPT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PDE unmap %s"

	.comm	_NVKM_VMM_PDE_SPARSE,8,3        ## @NVKM_VMM_PDE_SPARSE
L_.str.1:                               ## @.str.1
	.asciz	"PDE free %s"

	.no_dead_strip	_nvkm_vmm_unref_pdes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvkm_vmm_unref_pdes
_nvkm_vmm_unref_pdes:                   ; @nvkm_vmm_unref_pdes
	.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, x0
	ldp	x14, x23, [x0, #24]
	ldp	x10, x11, [x0]
	add	x8, x23, x10, lsl #4
	ldr	w8, [x8, #8]
Lloh0:
	adrp	x9, _SPT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SPT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w27, eq
	add	x12, x10, #1
	lsl	x13, x12, #3
	ldr	x20, [x0, #16]
	ldr	x22, [x14, x13]
	ldr	x25, [x14, x10, lsl #3]
	str	x25, [sp, #8]
	ldr	x10, [x25, #16]
	ldr	x10, [x10, w27, uxtw #3]
	str	x10, [sp]
	ldr	x21, [x11, x13]
	str	x12, [x0]
	ldr	x10, [x22]
	ldr	x11, [x10]
	subs	x11, x11, #1
	str	x11, [x10]
	b.eq	LBB0_3
; %bb.1:
	cmp	w8, w9
	cset	w24, ne
	ldr	x8, [x19]
	add	x0, x23, x8, lsl #4
	ldr	x26, [x0], #-16
	bl	_nvkm_vmm_desc_type
	mov	x2, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_TRA
	ldr	x8, [x25, #16]
	str	xzr, [x8, x27, lsl #3]
	ldr	x8, [sp, #8]
	ldr	x9, [x8]
	ldr	x9, [x9, w24, uxtw #3]
	cbz	x9, LBB0_4
; %bb.2:
	ldr	x8, [x26]
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	blr	x8
	b	LBB0_10
LBB0_3:
	cmp	w8, w9
	cset	w24, ne
	mov	x0, x19
	bl	_nvkm_vmm_unref_pdes
	b	LBB0_11
LBB0_4:
	ldr	x9, [x22, #16]
	ldr	x1, [x9]
	cbz	x1, LBB0_7
; %bb.5:
	ldr	x8, [x8, #24]
	cbz	x8, LBB0_8
; %bb.6:
	ldr	x8, [x26, #16]
	mov	x0, x20
	mov	x2, x21
	mov	w3, #1
	blr	x8
Lloh5:
	adrp	x8, _NVKM_VMM_PDE_SPARSE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NVKM_VMM_PDE_SPARSE@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldr	x9, [x22, #8]
	str	x8, [x9, x21, lsl #3]
	b	LBB0_10
LBB0_7:
	ldr	x8, [x26]
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	blr	x8
	b	LBB0_9
LBB0_8:
	ldr	x8, [x26, #8]
	mov	x0, x20
	mov	x2, x21
	mov	w3, #1
	blr	x8
LBB0_9:
	ldr	x8, [x22, #8]
	str	xzr, [x8, x21, lsl #3]
LBB0_10:
	mov	x0, x19
	bl	_nvkm_vmm_flush_mark
	mov	x0, x19
	bl	_nvkm_vmm_flush
	ldr	x25, [sp, #8]
LBB0_11:
	ldr	x8, [x19]
	add	x8, x23, x8, lsl #4
	sub	x0, x8, #16
	bl	_nvkm_vmm_desc_type
	mov	x2, x0
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_TRA
	ldp	w1, w0, [x20]
	mov	x2, sp
	bl	_nvkm_mmu_ptc_put
	ldr	x8, [x25]
	ldr	x8, [x8, x24, lsl #3]
	cbnz	x8, LBB0_13
; %bb.12:
	add	x0, sp, #8
	bl	_nvkm_vmm_pt_del
LBB0_13:
	ldr	x8, [x19]
	sub	x8, x8, #1
	str	x8, [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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_SPT,4,2                        ; @SPT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PDE unmap %s"

	.comm	_NVKM_VMM_PDE_SPARSE,8,3        ; @NVKM_VMM_PDE_SPARSE
l_.str.1:                               ; @.str.1
	.asciz	"PDE free %s"

	.no_dead_strip	_nvkm_vmm_unref_pdes
.subsections_via_symbols
