	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_vm_link
_nouveau_vm_link:                       ## @nouveau_vm_link
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	testq	%rsi, %rsi
	je	LBB0_8
## %bb.1:
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r12
	movq	%rax, %rsi
	addq	$4, %rsi
	movq	%r15, %rdi
	callq	_nouveau_gpuobj_ref
	leaq	8(%rbx), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movslq	(%rbx), %r13
	cmpl	4(%rbx), %r13d
	jle	LBB0_4
LBB0_7:
	addq	$12, %rbx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_list_add
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	16(%rbx), %rax
	movl	(%rax), %edx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	*(%r14)
	cmpl	4(%rbx), %r13d
	jge	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	movslq	(%rbx), %rax
	movq	16(%rbx), %rcx
	shlq	$2, %rax
	subq	%rax, %rcx
	movl	4(%rcx,%r13,4), %edx
	incq	%r13
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_nouveau_vm_link
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nouveau_vm_link
_nouveau_vm_link:                       ; @nouveau_vm_link
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cbz	x1, LBB0_6
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	ldr	x25, [x0, #24]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #8
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.2:
	mov	x21, x0
	add	x1, x0, #4
	mov	x0, x20
	bl	_nouveau_gpuobj_ref
	add	x22, x19, #8
	mov	x0, x22
	bl	_mutex_lock
	ldp	w23, w8, [x19]
                                        ; kill: def $w23 killed $w23 def $x23
	sxtw	x23, w23
	cmp	w23, w8
	b.gt	LBB0_5
; %bb.3:
	ldr	x8, [x25]
	ldr	x9, [x19, #16]
	ldr	w2, [x9]
	mov	x0, x20
	mov	x1, x23
	blr	x8
	ldr	w8, [x19, #4]
	cmp	w23, w8
	b.ge	LBB0_5
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x24, x23, #1
	ldrsw	x8, [x19]
	ldr	x9, [x25]
	ldr	x10, [x19, #16]
	sub	x8, x10, x8, lsl #2
	add	x8, x8, x23, lsl #2
	ldr	w2, [x8, #4]
	mov	x0, x20
	mov	x1, x24
	blr	x9
	ldr	w8, [x19, #4]
	mov	x23, x24
	cmp	w24, w8
	b.lt	LBB0_4
LBB0_5:
	add	x1, x19, #12
	mov	x0, x21
	bl	_list_add
	mov	x0, x22
	bl	_mutex_unlock
LBB0_6:
	mov	w0, #0
	b	LBB0_8
LBB0_7:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_nouveau_vm_link
.subsections_via_symbols
