	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_engctx_create_         ## -- Begin function nouveau_engctx_create_
	.p2align	4, 0x90
_nouveau_engctx_create_:                ## @nouveau_engctx_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	32(%rbp), %r14
	callq	_nouveau_client
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%r14, %rbx
	callq	_nv_engine
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_nouveau_engctx_exists
	movl	%eax, %r14d
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	testl	%r14d, %r14d
	jne	LBB0_10
## %bb.1:
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movq	%r12, %rdx
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movl	24(%rbp), %eax
	movq	_NV_ENGCTX_CLASS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	movq	%r15, %rdi
	testq	%r9, %r9
	je	LBB0_3
## %bb.2:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	pushq	%rbx
	pushq	%rax
	pushq	16(%rbp)
	pushq	%r12
	callq	_nouveau_gpuobj_create_
	addq	$32, %rsp
	jmp	LBB0_4
LBB0_3:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%eax, %r8d
	movq	%rbx, %r9
	callq	_nouveau_object_create_
LBB0_4:
	movl	%eax, %r14d
	movq	(%rbx), %r12
	movq	%r12, -88(%rbp)
	testl	%eax, %eax
	jne	LBB0_10
## %bb.5:
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_nouveau_engctx_exists
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r14d
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	leaq	-88(%rbp), %rsi
	xorl	%edi, %edi
	callq	_nouveau_object_ref
	jmp	LBB0_10
LBB0_7:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	(%rax), %r14
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_nv_engidx
	leaq	(%r14,%rax,4), %rdi
	callq	_atomic_inc
LBB0_9:
	movq	%r12, %rdi
	callq	_nv_engctx
	leaq	8(%rax), %rdi
	movq	%r13, %rsi
	addq	$4, %rsi
	callq	_list_add
	movq	%r12, %rdi
	callq	_nv_engctx
	movq	$-1, (%rax)
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%r14d, %r14d
LBB0_10:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NV_ENGCTX_CLASS,4,2            ## @NV_ENGCTX_CLASS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_engctx_create_         ; -- Begin function nouveau_engctx_create_
	.p2align	2
_nouveau_engctx_create_:                ; @nouveau_engctx_create_
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x28, x7
	mov	x26, x6
	mov	x21, x5
	mov	x27, x4
	mov	x25, x3
	mov	x20, x2
	mov	x19, x1
	mov	x23, x0
	ldr	x22, [x29, #16]
	bl	_nouveau_client
	stp	x0, x19, [sp, #24]              ; 16-byte Folded Spill
	mov	x0, x19
	bl	_nv_engine
	mov	x19, x0
	bl	_spin_lock_irqsave
	mov	x0, x23
	mov	x1, x19
	mov	x2, x22
	bl	_nouveau_engctx_exists
	mov	x24, x0
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	cbnz	w24, LBB0_10
; %bb.1:
Lloh0:
	adrp	x8, _NV_ENGCTX_CLASS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NV_ENGCTX_CLASS@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	cbz	x27, LBB0_3
; %bb.2:
	str	x22, [sp, #8]
	str	w28, [sp]
	mov	x0, x23
	ldr	x1, [sp, #32]                   ; 8-byte Folded Reload
	mov	x2, x20
	mov	x4, x25
	mov	x5, x27
	mov	x6, x21
	mov	x7, x26
	bl	_nouveau_gpuobj_create_
	b	LBB0_4
LBB0_3:
	mov	x0, x23
	ldr	x1, [sp, #32]                   ; 8-byte Folded Reload
	mov	x2, x20
	mov	x4, x28
	mov	x5, x22
	bl	_nouveau_object_create_
LBB0_4:
	mov	x24, x0
	ldr	x21, [x22]
	str	x21, [sp, #40]
	cbnz	w0, LBB0_10
; %bb.5:
	mov	x0, x19
	bl	_spin_lock_irqsave
	mov	x0, x23
	mov	x1, x19
	mov	x2, x22
	bl	_nouveau_engctx_exists
	cbz	w0, LBB0_7
; %bb.6:
	mov	x24, x0
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	add	x1, sp, #40
	mov	x0, #0
	bl	_nouveau_object_ref
	b	LBB0_10
LBB0_7:
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
	cbz	x8, LBB0_9
; %bb.8:
	ldr	x22, [x8]
	ldr	x0, [sp, #32]                   ; 8-byte Folded Reload
	bl	_nv_engidx
	add	x0, x22, x0, lsl #2
	bl	_atomic_inc
LBB0_9:
	mov	x0, x21
	bl	_nv_engctx
	add	x0, x0, #8
	add	x1, x19, #4
	bl	_list_add
	mov	x0, x21
	bl	_nv_engctx
	mov	x8, #-1
	str	x8, [x0]
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w24, #0
LBB0_10:
	mov	x0, x24
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NV_ENGCTX_CLASS,4,2            ; @NV_ENGCTX_CLASS
.subsections_via_symbols
