	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvkm_vmm_ptes_sparse
_nvkm_vmm_ptes_sparse:                  ## @nvkm_vmm_ptes_sparse
	.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	%rdi, -72(%rbp)                 ## 8-byte Spill
	testl	%edx, %edx
	je	LBB0_1
## %bb.2:
	movl	%edx, %r14d
	movabsq	$4294967296, %r8                ## imm = 0x100000000
	testl	%ecx, %ecx
	sete	-41(%rbp)                       ## 1-byte Folded Spill
	xorl	%ecx, %ecx
                                        ## implicit-def: $eax
                                        ## kill: killed $eax
	movl	%esi, -76(%rbp)                 ## 4-byte Spill
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
                                        ##       Child Loop BB0_5 Depth 3
                                        ##       Child Loop BB0_7 Depth 3
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax), %rbx
	leaq	-8(%rbx), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movl	%esi, %r15d
	xorl	%r12d, %r12d
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	%r15d, %edx
	movl	%r8d, %ecx
	movl	%r8d, %ebx
	callq	_nvkm_vmm_ptes_sparse_put
LBB0_18:                                ##   in Loop: Header=BB0_4 Depth=2
	addl	%ebx, %r15d
	subl	%ebx, %r14d
	movq	%r13, %r8
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_19
LBB0_4:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_5 Depth 3
                                        ##       Child Loop BB0_7 Depth 3
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movl	%r14d, -56(%rbp)                ## 4-byte Spill
	movslq	%r14d, %rax
	movq	%r12, %rdx
	shlq	$32, %rdx
	movabsq	$-4294967296, %rcx              ## imm = 0xFFFFFFFF00000000
	addq	%rcx, %rdx
	movl	%r12d, %ecx
	movslq	%r12d, %r12
	decq	%r12
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_3 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	%ecx, %esi
	movzbl	8(%rbx,%r12,8), %ecx
	movq	%rax, %rdi
	shrq	%cl, %rdi
	addq	%r8, %rdx
	incq	%r12
	leal	1(%rsi), %ecx
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	movslq	%esi, %r14
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14,8), %rbx
	shlq	$32, %r14
	movabsq	$-8589934592, %rax              ## imm = 0xFFFFFFFE00000000
	addq	%rax, %r14
	movl	$1, %r15d
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_3 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movzbl	8(%rbx), %ecx
	addq	$8, %rbx
	movl	$1, %esi
	shlq	%cl, %rsi
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movq	%r8, %r13
	callq	_IS_ALIGNED
	movq	%r13, %r8
	addq	%r13, %r14
	decl	%r15d
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=2
	testl	%r15d, %r15d
	je	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=2
	sarq	$29, %r14
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movb	(%rax,%r14), %cl
	movl	$1, %esi
	shlq	%cl, %rsi
	movq	%rsi, -104(%rbp)                ## 8-byte Spill
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_ALIGN
	subl	%r15d, %eax
	movl	-56(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edx
	subl	%eax, %edx
	movb	(%rbx), %cl
	movl	$-1, %r8d
	shll	%cl, %r8d
	cmpl	-104(%rbp), %edx                ## 4-byte Folded Reload
	jge	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=2
	andl	%r14d, %r8d
	testb	$1, -41(%rbp)                   ## 1-byte Folded Reload
	jne	LBB0_17
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=2
	movb	(%rbx), %cl
	movl	-56(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %r8d
	shrl	%cl, %r8d
	shll	%cl, %r8d
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	testb	$1, -41(%rbp)                   ## 1-byte Folded Reload
	jne	LBB0_17
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=2
	andl	%eax, %r8d
	testb	$1, -41(%rbp)                   ## 1-byte Folded Reload
	jne	LBB0_17
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	%r15d, %edx
	movl	%r8d, %ecx
	movl	%r8d, %ebx
	callq	_nvkm_vmm_ptes_sparse_get
	testl	%eax, %eax
	je	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	-76(%rbp), %esi                 ## 4-byte Reload
	cmpl	%esi, %r15d
	je	LBB0_20
## %bb.16:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %r8
	testb	$1, -64(%rbp)                   ## 1-byte Folded Reload
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	cmovel	%eax, %ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movb	$1, %cl
	movb	$1, -41(%rbp)                   ## 1-byte Folded Spill
	subl	%esi, %r15d
	movl	%r15d, %r14d
	jne	LBB0_3
	jmp	LBB0_21
LBB0_19:
	xorl	%eax, %eax
LBB0_20:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	testb	$1, %cl
	je	LBB0_22
LBB0_21:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_22
LBB0_1:
	xorl	%eax, %eax
LBB0_22:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_nvkm_vmm_ptes_sparse
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvkm_vmm_ptes_sparse
_nvkm_vmm_ptes_sparse:                  ; @nvkm_vmm_ptes_sparse
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
                                        ; kill: def $w2 killed $w2 def $x2
	str	x0, [sp, #24]                   ; 8-byte Folded Spill
	cbz	w2, LBB0_18
; %bb.1:
	mov	w8, #0
	cmp	w3, #0
	cset	w9, eq
	str	w9, [sp, #20]                   ; 4-byte Folded Spill
	mov	x27, #4294967296
	mov	w25, #1
                                        ; implicit-def: $w9
                                        ; kill: killed $w9
	str	w1, [sp, #12]                   ; 4-byte Folded Spill
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
                                        ;       Child Loop BB0_6 Depth 3
                                        ;       Child Loop BB0_8 Depth 3
	str	w8, [sp, #16]                   ; 4-byte Folded Spill
	mov	x20, #0
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
	ldr	x26, [x8]
	sub	x28, x26, #8
	mov	x21, x1
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=2
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	mov	x1, x22
	mov	x2, x21
	mov	x3, x23
	bl	_nvkm_vmm_ptes_sparse_put
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=2
	add	w21, w23, w21
	subs	w2, w19, w23
	b.eq	LBB0_15
LBB0_5:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_6 Depth 3
                                        ;       Child Loop BB0_8 Depth 3
	sxtw	x19, w2
	sxtw	x8, w20
	mov	x9, #-4294967296
	add	x9, x9, x20, lsl #32
	sub	w11, w8, #1
LBB0_6:                                 ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_5 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x10, x8
	ldr	x8, [x26, x8, lsl #3]
	lsr	x12, x19, x8
	add	x8, x10, #1
	add	x9, x9, x27
	add	w11, w11, #1
	cbz	x12, LBB0_6
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	sxtw	x9, w10
	sub	x20, x8, #1
	mov	x8, #-8589934592
	add	x23, x8, x9, lsl #32
	mov	w24, #1
	add	x22, x28, w10, sxtw #3
LBB0_8:                                 ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_5 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x8, [x22, #8]!
	lsl	x1, x25, x8
	mov	x0, x21
	bl	_IS_ALIGNED
	add	x23, x23, x27
	sub	w24, w24, #1
	cbz	w0, LBB0_8
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=2
	cbz	w24, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=2
	asr	x8, x23, #29
	ldr	x8, [x26, x8]
	lsl	x23, x25, x8
	mov	x0, x21
	mov	x1, x23
	bl	_ALIGN
	sub	w8, w0, w21
	sub	w9, w19, w8
	ldr	w10, [x22]
	mov	w11, #-1
	lsl	w10, w11, w10
	and	w11, w10, w19
	and	w8, w10, w8
	cmp	w9, w23
	csel	w23, w11, w8, lt
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	tbnz	w8, #0, LBB0_3
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=2
	ldr	w8, [x22]
	mov	w9, #-1
	lsl	w8, w9, w8
	and	w23, w8, w19
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	tbnz	w8, #0, LBB0_3
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=2
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	mov	x1, x22
	mov	x2, x21
	mov	x3, x23
	bl	_nvkm_vmm_ptes_sparse_get
	cbz	w0, LBB0_4
; %bb.13:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [sp, #12]                   ; 4-byte Folded Reload
	subs	w2, w21, w1
	b.eq	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [sp, #16]                   ; 4-byte Folded Reload
	tst	w8, #0x1
	ldr	w8, [sp, #8]                    ; 4-byte Folded Reload
	csel	w8, w8, w0, ne
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
	mov	w8, #1
	mov	w9, #1
	str	w9, [sp, #20]                   ; 4-byte Folded Spill
	cbnz	w2, LBB0_2
	b	LBB0_17
LBB0_15:
	mov	w0, #0
LBB0_16:
	ldr	w8, [sp, #16]                   ; 4-byte Folded Reload
	tbz	w8, #0, LBB0_19
LBB0_17:
	ldr	w0, [sp, #8]                    ; 4-byte Folded Reload
	b	LBB0_19
LBB0_18:
	mov	w0, #0
LBB0_19:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_nvkm_vmm_ptes_sparse
.subsections_via_symbols
