	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_vram_manager_new
_nouveau_vram_manager_new:              ## @nouveau_vram_manager_new
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rsi, %rbx
	movq	%rsi, %rdi
	callq	_nouveau_bo
	movq	%rax, %r15
	movl	(%rbx), %edi
	callq	_nouveau_bdev
	cmpq	$0, 8(%rax)
	je	LBB0_1
## %bb.2:
	movl	8(%r15), %edx
	movl	12(%r15), %esi
	movq	%rax, %rdi
	movq	%r14, %rcx
	callq	_nouveau_mem_new
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_nouveau_mem
	testl	%ebx, %ebx
	jne	LBB0_6
## %bb.3:
	movl	(%r15), %edx
	movl	4(%r15), %esi
	movq	%r14, %rdi
	callq	_nouveau_mem_vram
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_nouveau_mem_del
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%r15d, %ebx
	addl	%r15d, %eax
	jne	LBB0_6
## %bb.5:
	movq	$0, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.no_dead_strip	_nouveau_vram_manager_new
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nouveau_vram_manager_new
_nouveau_vram_manager_new:              ; @nouveau_vram_manager_new
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x3
	mov	x20, x1
	mov	x0, x1
	bl	_nouveau_bo
	mov	x21, x0
	ldr	w0, [x20]
	bl	_nouveau_bdev
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_5
; %bb.1:
	ldp	w2, w1, [x21, #8]
	mov	x3, x19
	bl	_nouveau_mem_new
	mov	x20, x0
	mov	x0, x19
	bl	_nouveau_mem
	cbnz	w20, LBB0_6
; %bb.2:
	ldp	w2, w1, [x21]
	mov	x0, x19
	bl	_nouveau_mem_vram
	mov	x20, x0
	cbz	w0, LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_nouveau_mem_del
Lloh0:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmn	w20, w8
	b.ne	LBB0_6
; %bb.4:
	mov	w20, #0
	str	xzr, [x19]
	b	LBB0_6
LBB0_5:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.no_dead_strip	_nouveau_vram_manager_new
.subsections_via_symbols
