	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_gpuobj_create_         ## -- Begin function nouveau_gpuobj_create_
	.p2align	4, 0x90
_nouveau_gpuobj_create_:                ## @nouveau_gpuobj_create_
	.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	%r9d, %r14d
	movq	%r8, %rbx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	40(%rbp), %r13
	movq	%rdi, -56(%rbp)
	callq	_nouveau_instmem
	movq	%rax, %r12
	movq	%r15, %rdi
	callq	_nouveau_bar
	movq	$0, (%r13)
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.1:
	movl	%r14d, %r12d
	movl	16(%rbp), %r13d
	movq	_NV_GPUOBJ_CLASS@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_nv_pclass
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	%rax, %rbx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_nv_gpuobj
	cmpq	$0, (%rax)
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%rbx), %rdi
	movl	(%r14), %esi
	callq	_nv_pclass
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_3
LBB0_5:
	xorl	%ebx, %ebx
LBB0_6:
	movq	%rbx, -80(%rbp)
	xorl	%edi, %edi
	testq	%rbx, %rbx
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_nv_error
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_25
LBB0_9:
	movq	%rax, %rbx
	leaq	-56(%rbp), %r8
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	movl	16(%rbp), %r13d
	movl	%r13d, %ecx
	callq	*(%r12)
	movl	%eax, %r12d
	movq	-56(%rbp), %r15
	movq	%r15, -80(%rbp)
	testl	%eax, %eax
	jne	LBB0_25
## %bb.10:
	movq	%r15, %rdi
	callq	_nv_memobj
	movl	4(%rax), %r14d
	movq	%r15, %rdi
	callq	_nv_memobj
	movl	(%rax), %r15d
	testq	%rbx, %rbx
	je	LBB0_11
## %bb.12:
	movq	%rbx, %rdi
	movq	(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_11
## %bb.13:
	movq	-56(%rbp), %rsi
	movq	4(%rsi), %rdx
	leaq	-80(%rbp), %rcx
	callq	*%rbx
	testl	%eax, %eax
	je	LBB0_14
LBB0_11:
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_8:
	movq	%rbx, %rdi
	callq	_nv_gpuobj
	movl	8(%rax), %r14d
	movq	%rbx, %rdi
	callq	_nv_gpuobj
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_atomic_inc
	movl	%r12d, %r15d
LBB0_15:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	32(%rbp), %r8d
	movq	-56(%rbp), %rdi
	movq	_NV_GPUOBJ_CLASS@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	40(%rbp), %r9
	callq	_nouveau_object_create_
	movl	%eax, %r12d
	leaq	-56(%rbp), %rsi
	xorl	%edi, %edi
	callq	_nouveau_object_ref
	testl	%r12d, %r12d
	je	LBB0_16
LBB0_25:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movl	%r13d, %edi
	movl	24(%rbp), %r13d
	movq	40(%rbp), %rax
	movl	%r14d, %ecx
	movq	(%rax), %r14
	movq	-80(%rbp), %rax
	movq	%rax, 32(%r14)
	movl	%r13d, (%r14)
	movl	%ecx, 24(%r14)
	movl	%r15d, 4(%r14)
	movl	%r13d, %eax
	testq	%rbx, %rbx
	je	LBB0_19
## %bb.17:
	movl	$1, %esi
	callq	_max
	leaq	16(%r14), %r9
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	%r15d, %edx
	movl	%r15d, %ecx
	movl	%eax, %r8d
	callq	_nouveau_mm_head
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_25
## %bb.18:
	movq	16(%r14), %rax
	movl	(%rax), %eax
	addl	%eax, 24(%r14)
	movl	(%r14), %eax
LBB0_19:
	movq	_NVOBJ_FLAG_HEAP@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_21
## %bb.20:
	leaq	8(%r14), %rdi
	movl	4(%r14), %edx
	xorl	%esi, %esi
	movl	$1, %ecx
	callq	_nouveau_mm_init
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_25
LBB0_21:
	movq	_NVOBJ_FLAG_ZERO_ALLOC@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	testl	%r13d, (%rax)
	je	LBB0_25
## %bb.22:
	cmpl	$0, 4(%r14)
	jle	LBB0_25
## %bb.23:
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_nv_wo32
	addl	$4, %ebx
	cmpl	4(%r14), %ebx
	jl	LBB0_24
	jmp	LBB0_25
LBB0_14:
	xorl	%ebx, %ebx
	leaq	-56(%rbp), %rsi
	xorl	%edi, %edi
	callq	_nouveau_object_ref
	movq	-80(%rbp), %rax
	movq	%rax, -56(%rbp)
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_NV_GPUOBJ_CLASS,4,2            ## @NV_GPUOBJ_CLASS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no gpuobj heap\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NVOBJ_FLAG_HEAP,4,2            ## @NVOBJ_FLAG_HEAP
	.comm	_NVOBJ_FLAG_ZERO_ALLOC,4,2      ## @NVOBJ_FLAG_ZERO_ALLOC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_gpuobj_create_         ; -- Begin function nouveau_gpuobj_create_
	.p2align	2
_nouveau_gpuobj_create_:                ; @nouveau_gpuobj_create_
	.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
	stp	w7, w3, [sp, #8]                ; 8-byte Folded Spill
	mov	x23, x6
	mov	x21, x5
	mov	x28, x4
	mov	x24, x2
	mov	x25, x1
	mov	x26, x0
	ldr	x22, [x29, #24]
	str	x0, [sp, #24]
	bl	_nouveau_instmem
	mov	x19, x0
	mov	x0, x26
	bl	_nouveau_bar
	str	xzr, [x22]
Lloh0:
	adrp	x20, _NV_GPUOBJ_CLASS@GOTPAGE
Lloh1:
	ldr	x20, [x20, _NV_GPUOBJ_CLASS@GOTPAGEOFF]
	str	w23, [sp, #4]                   ; 4-byte Folded Spill
	cbz	x28, LBB0_7
; %bb.1:
	ldr	w1, [x20]
	mov	x0, x28
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	bl	_nv_pclass
	mov	x27, x0
	cbz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x27
	bl	_nv_gpuobj
	ldr	x8, [x0]
	cbnz	x8, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x0, [x27, #8]
	ldr	w1, [x20]
	b	LBB0_2
LBB0_5:
	str	x27, [sp, #16]
	cmp	x27, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_12
; %bb.6:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x26
	bl	_nv_error
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_14
LBB0_7:
	mov	x27, x0
	ldr	x8, [x19]
	add	x4, sp, #24
	mov	x0, x19
	mov	x1, x26
	mov	x2, x21
	mov	x3, x23
	blr	x8
	mov	x26, x0
	ldr	x19, [sp, #24]
	str	x19, [sp, #16]
	cbnz	w0, LBB0_14
; %bb.8:
	mov	x0, x19
	bl	_nv_memobj
	ldr	w28, [x0, #4]
	mov	x0, x19
	bl	_nv_memobj
	ldr	w21, [x0]
	cbz	x27, LBB0_13
; %bb.9:
	ldr	x8, [x27]
	cbz	x8, LBB0_11
; %bb.10:
	ldr	x1, [sp, #24]
	ldur	x2, [x1, #4]
	add	x3, sp, #16
	mov	x0, x27
	blr	x8
	cbz	w0, LBB0_25
LBB0_11:
	mov	x27, #0
	b	LBB0_13
LBB0_12:
	mov	x0, x27
	bl	_nv_gpuobj
	ldr	w28, [x0, #8]
	mov	x0, x27
	bl	_nv_gpuobj
	mov	x27, x0
	mov	x0, x26
	bl	_atomic_inc
LBB0_13:
	mov	x2, x24
	mov	x1, x25
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	ldr	w4, [x29, #16]
	ldr	x0, [sp, #24]
	ldr	w8, [x20]
	orr	w3, w8, w9
	mov	x5, x22
	bl	_nouveau_object_create_
	mov	x26, x0
	add	x1, sp, #24
	mov	x0, #0
	bl	_nouveau_object_ref
	cbz	w26, LBB0_15
LBB0_14:
	mov	x0, x26
	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_15:
	ldr	x22, [x22]
	ldr	x8, [sp, #16]
	str	x8, [x22, #32]
	str	w28, [x22, #24]
	ldr	w8, [sp, #8]                    ; 4-byte Folded Reload
	stp	w8, w21, [x22]
	cbz	x27, LBB0_18
; %bb.16:
	ldr	w0, [sp, #4]                    ; 4-byte Folded Reload
	mov	w1, #1
	bl	_max
	mov	x4, x0
	add	x5, x22, #16
	mov	x0, x27
	mov	w1, #1
	mov	x2, x21
	mov	x3, x21
	bl	_nouveau_mm_head
	mov	x26, x0
	cbnz	w0, LBB0_14
; %bb.17:
	ldr	x8, [x22, #16]
	ldr	w8, [x8]
	ldr	w9, [x22, #24]
	add	w8, w9, w8
	str	w8, [x22, #24]
	ldr	w8, [x22]
LBB0_18:
Lloh7:
	adrp	x9, _NVOBJ_FLAG_HEAP@GOTPAGE
Lloh8:
	ldr	x9, [x9, _NVOBJ_FLAG_HEAP@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.19:
	add	x0, x22, #8
	ldr	w2, [x22, #4]
	mov	w1, #0
	mov	w3, #1
	bl	_nouveau_mm_init
	mov	x26, x0
	cbnz	w0, LBB0_14
LBB0_20:
Lloh10:
	adrp	x8, _NVOBJ_FLAG_ZERO_ALLOC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _NVOBJ_FLAG_ZERO_ALLOC@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	w9, [sp, #8]                    ; 4-byte Folded Reload
	tst	w8, w9
	b.eq	LBB0_24
; %bb.21:
	ldr	w8, [x22, #4]
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.22:
	mov	w19, #0
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x19
	mov	w2, #0
	bl	_nv_wo32
	mov	w26, #0
	add	w19, w19, #4
	ldr	w8, [x22, #4]
	cmp	w19, w8
	b.lt	LBB0_23
	b	LBB0_14
LBB0_24:
	mov	w26, #0
	b	LBB0_14
LBB0_25:
	add	x1, sp, #24
	mov	x0, #0
	bl	_nouveau_object_ref
	mov	x27, #0
	ldr	x8, [sp, #16]
	str	x8, [sp, #24]
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_NV_GPUOBJ_CLASS,4,2            ; @NV_GPUOBJ_CLASS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no gpuobj heap\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NVOBJ_FLAG_HEAP,4,2            ; @NVOBJ_FLAG_HEAP
	.comm	_NVOBJ_FLAG_ZERO_ALLOC,4,2      ; @NVOBJ_FLAG_ZERO_ALLOC
.subsections_via_symbols
