	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvkm_vmm_unref_sptes
_nvkm_vmm_unref_sptes:                  ## @nvkm_vmm_unref_sptes
	.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	%ecx, %eax
	movq	%rsi, %r12
	movq	8(%rdi), %rcx
	movq	-8(%rcx), %rsi
	movl	(%rdx), %ecx
	subl	(%rsi), %ecx
	movl	$1, %r13d
	shll	%cl, %r13d
	movl	%eax, %r15d
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %r15d
	testl	%r8d, %r8d
	je	LBB0_25
## %bb.1:
	movl	%r8d, %ebx
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	leal	-1(%r13), %ecx
	andl	%eax, %ecx
	movslq	%r15d, %r14
	movl	%r13d, %edi
	subl	%ecx, %edi
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %esi
	callq	_min
	movq	(%r12), %rcx
	subl	%eax, (%rcx,%r14,4)
	incq	%r14
	subl	%eax, %ebx
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r13d, %edi
	jmp	LBB0_3
LBB0_4:
	movq	16(%r12), %rax
	cmpl	$0, (%rax)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	je	LBB0_25
## %bb.5:
	cmpl	%r14d, %r15d
	jge	LBB0_25
## %bb.6:
	movslq	%r14d, %r13
	movq	_NVKM_VMM_PTE_SPTES@GOTPCREL(%rip), %r10
	movq	_NVKM_VMM_PTE_VALID@GOTPCREL(%rip), %r11
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
                                        ##     Child Loop BB0_13 Depth 2
	movq	(%r12), %r8
	movslq	%r15d, %rcx
	movl	(%r8,%rcx,4), %edx
	movl	(%r10), %esi
	testl	%edx, %esi
	je	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	incq	%rcx
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%r13, %rcx
	jge	LBB0_25
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=2
	incl	%r15d
	leaq	1(%rcx), %rdx
	testl	%esi, (%r8,%rcx,4)
	movq	%rdx, %rcx
	jne	LBB0_9
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r11), %esi
	notl	%esi
	andl	%esi, %edx
	movl	%edx, (%r8,%rcx,4)
	leal	1(%rcx), %esi
	movl	$1, %ebx
	cmpl	%r14d, %esi
	jge	LBB0_18
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	movslq	%esi, %rsi
	movl	%r14d, %eax
	subl	%r15d, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	$-1, %edx
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r8,%rsi,4), %eax
	testl	%eax, (%r10)
	jne	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=2
	movl	(%r11), %ebx
	notl	%ebx
	andl	%ebx, %eax
	movl	%eax, (%r8,%rsi,4)
	incq	%rsi
	decl	%edx
	cmpq	%rsi, %r13
	jne	LBB0_13
## %bb.15:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	%r14d, %esi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_17
LBB0_16:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	%r15d, %esi
	subl	%edx, %esi
	negl	%edx
	movl	%edx, %ebx
LBB0_17:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r8,%rcx,4), %edx
LBB0_18:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_NVKM_VMM_PTE_SPARSE@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	movl	%ebx, %ecx
	callq	_TRA
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	8(%r12), %rcx
	movl	(%rcx), %esi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	movl	%ebx, %ecx
	callq	*8(%rax)
	jmp	LBB0_23
LBB0_20:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	8(%r9), %rax
	cmpq	$0, (%rax)
	je	LBB0_21
## %bb.22:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edx
	movl	%ebx, %ecx
	callq	_TRA
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	8(%r12), %rcx
	movl	(%rcx), %esi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	movl	%ebx, %ecx
	callq	*(%rax)
LBB0_23:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_NVKM_VMM_PTE_VALID@GOTPCREL(%rip), %r11
	movq	_NVKM_VMM_PTE_SPTES@GOTPCREL(%rip), %r10
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %r15d                ## 4-byte Reload
LBB0_24:                                ##   in Loop: Header=BB0_7 Depth=1
	cmpl	%r14d, %r15d
	jl	LBB0_7
	jmp	LBB0_25
LBB0_21:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	%esi, %r15d
	cmpl	%r14d, %r15d
	jl	LBB0_7
LBB0_25:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NVKM_VMM_PTE_SPTES,4,2         ## @NVKM_VMM_PTE_SPTES
	.comm	_NVKM_VMM_PTE_VALID,4,2         ## @NVKM_VMM_PTE_VALID
	.comm	_NVKM_VMM_PTE_SPARSE,4,2        ## @NVKM_VMM_PTE_SPARSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LPTE %05x: U -> S %d PTEs"

L_.str.1:                               ## @.str.1
	.asciz	"LPTE %05x: U -> I %d PTEs"

	.no_dead_strip	_nvkm_vmm_unref_sptes
.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_sptes
_nvkm_vmm_unref_sptes:                  ; @nvkm_vmm_unref_sptes
	.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	w4, LBB0_4
; %bb.1:
	mov	x23, x4
	mov	x19, x1
	mov	x28, x0
	ldp	x9, x8, [x0]
	str	x9, [sp, #8]                    ; 8-byte Folded Spill
	ldur	x26, [x8, #-8]
	ldr	w8, [x2]
	ldr	w9, [x26]
	sub	w8, w8, w9
	mov	w9, #1
	lsl	w22, w9, w8
	asr	w24, w3, w8
	sub	w8, w22, #1
	and	w8, w8, w3
	sxtw	x21, w24
	sub	w0, w22, w8
	mov	x1, x4
	bl	_min
	ldr	x8, [x19]
	sbfiz	x9, x24, #2, #32
	ldr	w10, [x8, x9]
	sub	w10, w10, w0
	str	w10, [x8, x9]
	add	x27, x21, #1
	subs	w23, w23, w0
	b.eq	LBB0_3
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x23
	bl	_min
	ldr	x8, [x19]
	lsl	x9, x27, #2
	ldr	w10, [x8, x9]
	sub	w10, w10, w0
	str	w10, [x8, x9]
	add	x27, x27, #1
	subs	w23, w23, w0
	b.ne	LBB0_2
LBB0_3:
	ldr	x8, [x19, #16]
	ldr	w8, [x8]
	cmp	w8, #0
	ccmp	w24, w27, #0, ne
	b.lt	LBB0_5
LBB0_4:
	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
LBB0_5:
Lloh0:
	adrp	x17, _NVKM_VMM_PTE_SPTES@GOTPAGE
Lloh1:
	ldr	x17, [x17, _NVKM_VMM_PTE_SPTES@GOTPAGEOFF]
Lloh2:
	adrp	x16, _NVKM_VMM_PTE_VALID@GOTPAGE
Lloh3:
	ldr	x16, [x16, _NVKM_VMM_PTE_VALID@GOTPAGEOFF]
Lloh4:
	adrp	x15, _NVKM_VMM_PTE_SPARSE@GOTPAGE
Lloh5:
	ldr	x15, [x15, _NVKM_VMM_PTE_SPARSE@GOTPAGEOFF]
	sxtw	x23, w27
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
                                        ;     Child Loop BB0_13 Depth 2
	ldr	x8, [x19]
	sxtw	x9, w24
	ldr	w11, [x8, w24, sxtw #2]
	ldr	w10, [x17]
	tst	w10, w11
	b.eq	LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x9, x9, #1
LBB0_8:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x9, x23
	b.ge	LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	ldr	w11, [x8, x9, lsl #2]
	add	w24, w24, #1
	add	x9, x9, #1
	tst	w11, w10
	b.ne	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	w24, w27
	b.lt	LBB0_6
	b	LBB0_4
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w10, [x16]
	bic	w10, w11, w10
	str	w10, [x8, x9, lsl #2]
	add	w21, w24, #1
	cmp	w21, w27
	b.ge	LBB0_16
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x10, #0
	sub	w22, w27, w24
	add	x11, x8, w21, sxtw #2
	sub	x12, x23, w21, sxtw
LBB0_13:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w13, [x11, x10, lsl #2]
	ldr	w14, [x17]
	tst	w14, w13
	b.ne	LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=2
	ldr	w14, [x16]
	bic	w13, w13, w14
	str	w13, [x11, x10, lsl #2]
	add	x10, x10, #1
	cmp	x12, x10
	b.ne	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x21, x27
	b	LBB0_18
LBB0_16:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w22, #1
	b	LBB0_19
LBB0_17:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w21, w21, w10
	add	w22, w10, #1
LBB0_18:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w10, [x8, x9, lsl #2]
LBB0_19:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x15]
	tst	w8, w10
	b.eq	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x28
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x24
	mov	x3, x22
	mov	x20, x16
	mov	x25, x17
	bl	_TRA
	ldr	x8, [x26, #8]
	ldr	x8, [x8, #8]
	ldr	x9, [x19, #8]
	ldr	w1, [x9]
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x2, x24
	mov	x3, x22
	blr	x8
	mov	x17, x25
	mov	x16, x20
Lloh8:
	adrp	x15, _NVKM_VMM_PTE_SPARSE@GOTPAGE
Lloh9:
	ldr	x15, [x15, _NVKM_VMM_PTE_SPARSE@GOTPAGEOFF]
	b	LBB0_23
LBB0_21:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x26, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_23
; %bb.22:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x28
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x24
	mov	x3, x22
	mov	x25, x26
	mov	x20, x16
	mov	x26, x17
	bl	_TRA
	ldr	x8, [x25, #8]
	ldr	x8, [x8]
	ldr	x9, [x19, #8]
	ldr	w1, [x9]
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x2, x24
	mov	x3, x22
	blr	x8
	mov	x17, x26
	mov	x16, x20
Lloh12:
	adrp	x15, _NVKM_VMM_PTE_SPARSE@GOTPAGE
Lloh13:
	ldr	x15, [x15, _NVKM_VMM_PTE_SPARSE@GOTPAGEOFF]
	mov	x26, x25
LBB0_23:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x24, x21
	cmp	w24, w27
	b.lt	LBB0_6
	b	LBB0_4
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_NVKM_VMM_PTE_SPTES,4,2         ; @NVKM_VMM_PTE_SPTES
	.comm	_NVKM_VMM_PTE_VALID,4,2         ; @NVKM_VMM_PTE_VALID
	.comm	_NVKM_VMM_PTE_SPARSE,4,2        ; @NVKM_VMM_PTE_SPARSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LPTE %05x: U -> S %d PTEs"

l_.str.1:                               ; @.str.1
	.asciz	"LPTE %05x: U -> I %d PTEs"

	.no_dead_strip	_nvkm_vmm_unref_sptes
.subsections_via_symbols
