	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_vm_get                 ## -- Begin function nouveau_vm_get
	.p2align	4, 0x90
_nouveau_vm_get:                        ## @nouveau_vm_get
	.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
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movl	%edx, %r14d
	movl	$1, %ebx
	movl	%r14d, %ecx
	shll	%cl, %ebx
	movq	%r8, %r12
	movl	%esi, %r13d
	movq	%rdi, %r15
	movq	16(%rdi), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	sarl	$12, %ebx
	sarl	$12, %r13d
	callq	_mutex_lock
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	leaq	8(%r12), %rax
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%r13d, %edx
	movl	%r13d, %ecx
	movl	%ebx, %r8d
	movq	%rax, %rbx
	movq	%rax, %r9
	callq	_nouveau_mm_head
	movl	%eax, %r12d
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
LBB0_1:
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_13
LBB0_2:
	movq	(%rbx), %rax
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movb	(%rdi), %cl
	movl	(%rax), %edx
	movl	4(%rax), %esi
	addl	%edx, %esi
	decl	%esi
                                        ## kill: def $edx killed $edx killed $rdx
	sarl	%cl, %edx
	sarl	%cl, %esi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, -64(%rbp)                 ## 4-byte Spill
	cmpl	%esi, %edx
	jle	LBB0_3
LBB0_12:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movq	%r15, 16(%rcx)
	movq	8(%rcx), %rax
	movl	(%rax), %eax
	shll	$12, %eax
	movl	%eax, (%rcx)
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%rcx)
	xorl	%r12d, %r12d
LBB0_13:
	movl	%r12d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rdi, %rdx
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movl	$-1, -48(%rbp)                  ## 4-byte Folded Spill
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rsi
	movl	%r13d, %ecx
	subl	4(%r15), %ecx
	movslq	%ecx, %rbx
	movq	8(%rax), %r12
	movq	8(%rdx), %r14
	xorl	%r15d, %r15d
	cmpq	%r14, %r12
	setne	%r15b
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	(%rsi,%rbx,8), %rax
	movl	(%rax,%r15,4), %edi
	callq	_likely
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%rbx,8), %rax
	incl	(%rax,%r15,4)
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rax
	movq	8(%rax), %rdx
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_nouveau_vm_map_pgt
	testl	%eax, %eax
	jne	LBB0_9
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	cmpl	%r13d, -64(%rbp)                ## 4-byte Folded Reload
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	je	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	incl	%r13d
	movq	(%rbx), %rax
	incl	-48(%rbp)                       ## 4-byte Folded Spill
	jmp	LBB0_4
LBB0_9:
	movl	%eax, %r12d
	cmpl	$-1, -48(%rbp)                  ## 4-byte Folded Reload
	je	LBB0_11
## %bb.10:
	xorl	%esi, %esi
	cmpq	%r14, -56(%rbp)                 ## 8-byte Folded Reload
	setne	%sil
	decl	%r13d
	movq	%r15, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r13d, %ecx
	callq	_nouveau_vm_unmap_pgt
LBB0_11:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_nouveau_mm_free
	jmp	LBB0_1
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_vm_get                 ; -- Begin function nouveau_vm_get
	.p2align	2
_nouveau_vm_get:                        ; @nouveau_vm_get
	.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
	mov	x20, x4
	mov	x21, x3
	mov	x23, x2
	mov	x19, x0
	mov	w8, #1
	lsl	w8, w8, w2
	ldr	x26, [x0, #16]
	asr	w24, w8, #12
	asr	w25, w1, #12
	bl	_mutex_lock
	add	x22, x20, #8
	mov	x0, x19
	mov	x1, x23
	mov	x2, x25
	mov	x3, x25
	mov	x4, x24
	mov	x5, x22
	bl	_nouveau_mm_head
	mov	x24, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbz	x0, LBB0_2
LBB0_1:
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_4
LBB0_2:
	str	w21, [sp, #4]                   ; 4-byte Folded Spill
	stp	x20, x26, [sp, #8]              ; 16-byte Folded Spill
	ldr	x8, [x22]
	ldr	w9, [x26]
	ldp	w10, w11, [x8]
	asr	w12, w10, w9
	add	w10, w10, w11
	sub	w10, w10, #1
	asr	w9, w10, w9
	str	w12, [sp, #28]                  ; 4-byte Folded Spill
	cmp	w12, w9
	b.le	LBB0_5
LBB0_3:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w24, #0
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	str	x19, [x9, #16]
	ldr	x8, [x9, #8]
	ldr	w8, [x8]
	lsl	w10, w8, #12
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	stp	w10, w8, [x9]
LBB0_4:
	mov	x0, x24
	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
LBB0_5:
	mov	w25, #0
	ldr	w10, [sp, #28]                  ; 4-byte Folded Reload
	sub	w27, w9, w10
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x20, [x19, #8]
	ldr	w9, [x19, #4]
	ldr	w10, [sp, #28]                  ; 4-byte Folded Reload
	add	w24, w10, w25
	sub	w26, w24, w9
	ldr	x28, [x8, #8]
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	ldr	x21, [x8, #8]
	cmp	x28, x21
	cset	w23, ne
	ldr	x8, [x20, w26, sxtw #3]
	ldr	w0, [x8, w23, uxtw #2]
	bl	_likely
	cbz	x0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	sxtw	x8, w26
	ldr	x8, [x20, x8, lsl #3]
	lsl	x9, x23, #2
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x22]
	ldr	x2, [x8, #8]
	mov	x0, x19
	mov	x1, x24
	bl	_nouveau_vm_map_pgt
	cbnz	w0, LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	cmp	w27, w25
	b.eq	LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x22]
	add	w25, w25, #1
	b	LBB0_6
LBB0_11:
	mov	x24, x0
	cbz	w25, LBB0_13
; %bb.12:
	cmp	x28, x21
	cset	w1, ne
	ldr	w2, [sp, #28]                   ; 4-byte Folded Reload
	add	w8, w2, w25
	sub	w3, w8, #1
	mov	x0, x19
	bl	_nouveau_vm_unmap_pgt
LBB0_13:
	mov	x0, x19
	mov	x1, x22
	bl	_nouveau_mm_free
	b	LBB0_1
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
