	.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	%r9d, -48(%rbp)                 ## 4-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r15d
	movl	%edx, %r12d
	movl	%esi, %r13d
	movq	%rdi, %r14
	callq	_nouveau_drm
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_NOUVEAU_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r15d, %eax
	je	LBB0_2
## %bb.1:
	movq	_TTM_PL_FLAG_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_2:
	movq	_NOUVEAU_GEM_DOMAIN_GART@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%r15d, %ecx
	je	LBB0_4
## %bb.3:
	movq	_TTM_PL_FLAG_TT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_4:
	movq	16(%rbp), %rbx
	orl	%eax, %ecx
	je	LBB0_6
## %bb.5:
	movq	_NOUVEAU_GEM_DOMAIN_CPU@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_7
LBB0_6:
	movq	_TTM_PL_FLAG_SYSTEM@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
LBB0_7:
	movq	%r14, %rdi
	movl	%r13d, %esi
	movl	%r12d, %edx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	-48(%rbp), %r9d                 ## 4-byte Reload
	pushq	%rbx
	pushq	$0
	movq	%rbx, %r13
	callq	_nouveau_bo_new
	addq	$16, %rsp
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.8:
	movq	%r13, %r12
	movq	(%r13), %rbx
	movq	_NOUVEAU_GEM_DOMAIN_GART@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_NOUVEAU_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_nv_device
	movq	(%rax), %rax
	movq	_NV_50@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_10
## %bb.9:
	andl	%r15d, (%rbx)
LBB0_10:
	movl	20(%rbx), %esi
	movq	%r14, %rdi
	callq	_drm_gem_object_alloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	movl	8(%rax), %ecx
	movl	%ecx, 16(%rbx)
	movq	%rbx, (%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_11:
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	movq	%r12, %rsi
	callq	_nouveau_bo_ref
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.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	_NV_50,8,3                      ## @NV_50
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.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:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x6
	mov	x23, x5
	mov	x24, x4
	mov	x21, x3
	mov	x25, x2
	mov	x26, x1
	mov	x20, x0
	bl	_nouveau_drm
	mov	x22, x0
Lloh0:
	adrp	x27, _NOUVEAU_GEM_DOMAIN_VRAM@GOTPAGE
Lloh1:
	ldr	x27, [x27, _NOUVEAU_GEM_DOMAIN_VRAM@GOTPAGEOFF]
	ldr	w8, [x27]
Lloh2:
	adrp	x9, _TTM_PL_FLAG_VRAM@GOTPAGE
Lloh3:
	ldr	x9, [x9, _TTM_PL_FLAG_VRAM@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w8, w21
	csel	w8, wzr, w9, eq
Lloh5:
	adrp	x28, _NOUVEAU_GEM_DOMAIN_GART@GOTPAGE
Lloh6:
	ldr	x28, [x28, _NOUVEAU_GEM_DOMAIN_GART@GOTPAGEOFF]
	ldr	w9, [x28]
Lloh7:
	adrp	x10, _TTM_PL_FLAG_TT@GOTPAGE
Lloh8:
	ldr	x10, [x10, _TTM_PL_FLAG_TT@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	tst	w9, w21
	csel	w9, wzr, w10, eq
	orr	w3, w9, w8
	cbz	w3, LBB0_2
; %bb.1:
Lloh10:
	adrp	x8, _NOUVEAU_GEM_DOMAIN_CPU@GOTPAGE
Lloh11:
	ldr	x8, [x8, _NOUVEAU_GEM_DOMAIN_CPU@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_3
LBB0_2:
Lloh13:
	adrp	x8, _TTM_PL_FLAG_SYSTEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _TTM_PL_FLAG_SYSTEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	orr	w3, w8, w3
LBB0_3:
	mov	x0, x20
	mov	x1, x26
	mov	x2, x25
	mov	x4, x24
	mov	x5, x23
	mov	x6, #0
	mov	x7, x19
	bl	_nouveau_bo_new
	cbnz	w0, LBB0_9
; %bb.4:
	ldr	x23, [x19]
	ldr	w8, [x27]
	ldr	w9, [x28]
	orr	w8, w9, w8
	str	w8, [x23]
	ldr	w0, [x22]
	bl	_nv_device
	ldr	x8, [x0]
Lloh16:
	adrp	x9, _NV_50@GOTPAGE
Lloh17:
	ldr	x9, [x9, _NV_50@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_6
; %bb.5:
	ldr	w8, [x23]
	and	w8, w8, w21
	str	w8, [x23]
LBB0_6:
	ldr	w1, [x23, #20]
	mov	x0, x20
	bl	_drm_gem_object_alloc
	str	x0, [x23, #8]
	cbz	x0, LBB0_8
; %bb.7:
	mov	x8, x0
	mov	w0, #0
	ldr	w9, [x8, #8]
	str	w9, [x23, #16]
	str	x23, [x8]
	b	LBB0_9
LBB0_8:
	mov	x1, x19
	bl	_nouveau_bo_ref
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.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	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.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	_NV_50,8,3                      ; @NV_50
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
