	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_gem_new                ## -- Begin function nouveau_gem_new
	.p2align	4, 0x90
_nouveau_gem_new:                       ## @nouveau_gem_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movl	%esi, -44(%rbp)
	movl	%edx, -48(%rbp)
	movq	_NOUVEAU_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	%r14d, %ecx
	je	LBB0_2
## %bb.1:
	movq	_TTM_PL_FLAG_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_2:
	movq	_NOUVEAU_GEM_DOMAIN_GART@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r14d, %eax
	je	LBB0_4
## %bb.3:
	movq	_TTM_PL_FLAG_TT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_4:
	orl	%ecx, %eax
	je	LBB0_6
## %bb.5:
	movq	_NOUVEAU_GEM_DOMAIN_CPU@GOTPCREL(%rip), %rcx
	testl	%r14d, (%rcx)
	je	LBB0_7
LBB0_6:
	movq	_TTM_PL_FLAG_SYSTEM@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
LBB0_7:
	movq	_NOUVEAU_GEM_DOMAIN_COHERENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	andl	%r14d, %ebx
	je	LBB0_9
## %bb.8:
	movq	_TTM_PL_FLAG_UNCACHED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
LBB0_9:
	orl	%eax, %ebx
	movq	(%rdi), %r13
	leaq	-44(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	movl	%ebx, %ecx
	callq	_nouveau_bo_alloc
	movq	%rax, %r15
	movq	%rax, -56(%rbp)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %r12d
	jmp	LBB0_17
LBB0_11:
	movl	8(%r13), %edi
	movq	%r15, %rsi
	addq	$4, %rsi
	movl	-44(%rbp), %edx
	callq	_drm_gem_object_init
	testl	%eax, %eax
	jne	LBB0_12
## %bb.13:
	movl	-44(%rbp), %esi
	movl	-48(%rbp), %edx
	movq	%r15, %rdi
	movl	%ebx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_nouveau_bo_init
	testl	%eax, %eax
	je	LBB0_14
LBB0_12:
	movl	%eax, %r12d
	leaq	-56(%rbp), %rsi
	xorl	%edi, %edi
	callq	_nouveau_bo_ref
LBB0_17:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	16(%rbp), %rax
	movq	_NOUVEAU_GEM_DOMAIN_GART@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_NOUVEAU_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	%ecx, (%r15)
	movq	(%r13), %rdx
	movq	_NV_DEVICE_INFO_V0_TESLA@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jl	LBB0_16
## %bb.15:
	andl	%r14d, %ecx
	movl	%ecx, (%r15)
LBB0_16:
	movl	4(%r15), %ecx
	movl	%ecx, 8(%r15)
	movq	%r15, (%rax)
	xorl	%r12d, %r12d
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_NOUVEAU_GEM_DOMAIN_VRAM,4,2    ## @NOUVEAU_GEM_DOMAIN_VRAM
	.comm	_TTM_PL_FLAG_VRAM,4,2           ## @TTM_PL_FLAG_VRAM
	.comm	_NOUVEAU_GEM_DOMAIN_GART,4,2    ## @NOUVEAU_GEM_DOMAIN_GART
	.comm	_TTM_PL_FLAG_TT,4,2             ## @TTM_PL_FLAG_TT
	.comm	_NOUVEAU_GEM_DOMAIN_CPU,4,2     ## @NOUVEAU_GEM_DOMAIN_CPU
	.comm	_TTM_PL_FLAG_SYSTEM,4,2         ## @TTM_PL_FLAG_SYSTEM
	.comm	_NOUVEAU_GEM_DOMAIN_COHERENT,4,2 ## @NOUVEAU_GEM_DOMAIN_COHERENT
	.comm	_TTM_PL_FLAG_UNCACHED,4,2       ## @TTM_PL_FLAG_UNCACHED
	.comm	_NV_DEVICE_INFO_V0_TESLA,8,3    ## @NV_DEVICE_INFO_V0_TESLA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_gem_new                ; -- Begin function nouveau_gem_new
	.p2align	2
_nouveau_gem_new:                       ; @nouveau_gem_new
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x6
	mov	x20, x3
	stp	w2, w1, [sp, #8]
Lloh0:
	adrp	x24, _NOUVEAU_GEM_DOMAIN_VRAM@GOTPAGE
Lloh1:
	ldr	x24, [x24, _NOUVEAU_GEM_DOMAIN_VRAM@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh2:
	adrp	x9, _TTM_PL_FLAG_VRAM@GOTPAGE
Lloh3:
	ldr	x9, [x9, _TTM_PL_FLAG_VRAM@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w8, w3
	csel	w8, wzr, w9, eq
Lloh5:
	adrp	x25, _NOUVEAU_GEM_DOMAIN_GART@GOTPAGE
Lloh6:
	ldr	x25, [x25, _NOUVEAU_GEM_DOMAIN_GART@GOTPAGEOFF]
	ldr	w9, [x25]
Lloh7:
	adrp	x10, _TTM_PL_FLAG_TT@GOTPAGE
Lloh8:
	ldr	x10, [x10, _TTM_PL_FLAG_TT@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	tst	w9, w3
	csel	w9, wzr, w10, eq
	orr	w8, w9, w8
	cbz	w8, LBB0_2
; %bb.1:
Lloh10:
	adrp	x9, _NOUVEAU_GEM_DOMAIN_CPU@GOTPAGE
Lloh11:
	ldr	x9, [x9, _NOUVEAU_GEM_DOMAIN_CPU@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w20
	b.eq	LBB0_3
LBB0_2:
Lloh13:
	adrp	x9, _TTM_PL_FLAG_SYSTEM@GOTPAGE
Lloh14:
	ldr	x9, [x9, _TTM_PL_FLAG_SYSTEM@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w8, w9, w8
LBB0_3:
	ldr	x26, [x0]
Lloh16:
	adrp	x9, _NOUVEAU_GEM_DOMAIN_COHERENT@GOTPAGE
Lloh17:
	ldr	x9, [x9, _NOUVEAU_GEM_DOMAIN_COHERENT@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x10, _TTM_PL_FLAG_UNCACHED@GOTPAGE
Lloh20:
	ldr	x10, [x10, _TTM_PL_FLAG_UNCACHED@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	tst	w9, w20
	csel	w9, wzr, w10, eq
	orr	w22, w9, w8
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x3, x22
	bl	_nouveau_bo_alloc
	mov	x21, x0
	str	x0, [sp]
	bl	_IS_ERR
	cbz	x0, LBB0_5
; %bb.4:
	mov	x0, x21
	bl	_PTR_ERR
	mov	x23, x0
	b	LBB0_8
LBB0_5:
	ldr	w0, [x26, #8]
	add	x1, x21, #4
	ldr	w2, [sp, #12]
	bl	_drm_gem_object_init
	cbnz	w0, LBB0_7
; %bb.6:
	ldp	w2, w1, [sp, #8]
	mov	x0, x21
	mov	x3, x22
	mov	x4, #0
	mov	x5, #0
	bl	_nouveau_bo_init
	cbz	w0, LBB0_9
LBB0_7:
	mov	x23, x0
	mov	x1, sp
	mov	x0, #0
	bl	_nouveau_bo_ref
LBB0_8:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_9:
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w8, w9, w8
	str	w8, [x21]
	ldr	x9, [x26]
Lloh22:
	adrp	x10, _NV_DEVICE_INFO_V0_TESLA@GOTPAGE
Lloh23:
	ldr	x10, [x10, _NV_DEVICE_INFO_V0_TESLA@GOTPAGEOFF]
Lloh24:
	ldr	x10, [x10]
	cmp	x9, x10
	b.lt	LBB0_11
; %bb.10:
	and	w8, w8, w20
	str	w8, [x21]
LBB0_11:
	mov	w23, #0
	ldr	w8, [x21, #4]
	str	w8, [x21, #8]
	str	x21, [x19]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_NOUVEAU_GEM_DOMAIN_VRAM,4,2    ; @NOUVEAU_GEM_DOMAIN_VRAM
	.comm	_TTM_PL_FLAG_VRAM,4,2           ; @TTM_PL_FLAG_VRAM
	.comm	_NOUVEAU_GEM_DOMAIN_GART,4,2    ; @NOUVEAU_GEM_DOMAIN_GART
	.comm	_TTM_PL_FLAG_TT,4,2             ; @TTM_PL_FLAG_TT
	.comm	_NOUVEAU_GEM_DOMAIN_CPU,4,2     ; @NOUVEAU_GEM_DOMAIN_CPU
	.comm	_TTM_PL_FLAG_SYSTEM,4,2         ; @TTM_PL_FLAG_SYSTEM
	.comm	_NOUVEAU_GEM_DOMAIN_COHERENT,4,2 ; @NOUVEAU_GEM_DOMAIN_COHERENT
	.comm	_TTM_PL_FLAG_UNCACHED,4,2       ; @TTM_PL_FLAG_UNCACHED
	.comm	_NV_DEVICE_INFO_V0_TESLA,8,3    ; @NV_DEVICE_INFO_V0_TESLA
.subsections_via_symbols
