	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv40_fifo_context_attach
_nv40_fifo_context_attach:              ## @nv40_fifo_context_attach
	.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
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	(%rdi), %r12
	movq	(%rsi), %rdi
	callq	_nv_engidx
	cmpl	$128, %eax
	je	LBB0_8
## %bb.1:
	cmpl	$130, %eax
	je	LBB0_2
## %bb.3:
	cmpl	$129, %eax
	jne	LBB0_10
## %bb.4:
	movl	$84, -44(%rbp)                  ## 4-byte Folded Spill
	movl	$13068, %r13d                   ## imm = 0x330C
	jmp	LBB0_5
LBB0_2:
	movl	$56, -44(%rbp)                  ## 4-byte Folded Spill
	movl	$13024, %r13d                   ## imm = 0x32E0
LBB0_5:
	leaq	4(%r12), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	callq	_nv_gpuobj
	movl	(%rax), %ebx
	sarl	$4, %ebx
	movq	%r14, %rdi
	callq	_nv_engctx
	movl	%ebx, (%rax)
	movq	%r12, %rdi
	movl	$9472, %esi                     ## imm = 0x2500
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_nv_mask
	movq	%r12, %rdi
	movl	$12804, %esi                    ## imm = 0x3204
	callq	_nv_rd32
	andl	(%r12), %eax
	cmpl	4(%r15), %eax
	jne	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	callq	_nv_engctx
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_nv_wr32
LBB0_7:
	movl	8(%r12), %r13d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	addl	(%r15), %ebx
	movq	%r14, %rdi
	callq	_nv_engctx
	movl	(%rax), %edx
	movl	%r13d, %edi
	movl	%ebx, %esi
	callq	_nv_wo32
	movq	%r12, %rdi
	movl	$9472, %esi                     ## imm = 0x2500
	movl	$1, %edx
	movl	$1, %ecx
	callq	_nv_mask
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_nv40_fifo_context_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv40_fifo_context_attach
_nv40_fifo_context_attach:              ; @nv40_fifo_context_attach
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x1
	mov	x21, x0
	ldr	x19, [x0]
	ldr	x0, [x1]
	bl	_nv_engidx
	cmp	w0, #128
	b.eq	LBB0_8
; %bb.1:
	cmp	w0, #130
	b.eq	LBB0_4
; %bb.2:
	cmp	w0, #129
	b.ne	LBB0_9
; %bb.3:
	mov	w24, #84
	mov	w23, #13068
	b	LBB0_5
LBB0_4:
	mov	w24, #56
	mov	w23, #13024
LBB0_5:
	add	x22, x19, #4
	mov	x0, x22
	bl	_spin_lock_irqsave
	mov	x0, x20
	bl	_nv_gpuobj
	ldr	w8, [x0]
	asr	w25, w8, #4
	mov	x0, x20
	bl	_nv_engctx
	str	w25, [x0]
	mov	x0, x19
	mov	w1, #9472
	mov	w2, #1
	mov	w3, #0
	bl	_nv_mask
	mov	x0, x19
	mov	w1, #12804
	bl	_nv_rd32
	ldr	w8, [x19]
	and	w8, w8, w0
	ldr	w9, [x21, #4]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x20
	bl	_nv_engctx
	ldr	w2, [x0]
	mov	x0, x19
	mov	x1, x23
	bl	_nv_wr32
LBB0_7:
	ldr	w23, [x19, #8]
	ldr	w8, [x21]
	add	w21, w8, w24
	mov	x0, x20
	bl	_nv_engctx
	ldr	w2, [x0]
	mov	x0, x23
	mov	x1, x21
	bl	_nv_wo32
	mov	x0, x19
	mov	w1, #9472
	mov	w2, #1
	mov	w3, #1
	bl	_nv_mask
	mov	x0, x22
	bl	_spin_unlock_irqrestore
LBB0_8:
	mov	w0, #0
	b	LBB0_10
LBB0_9:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_nv40_fifo_context_attach
.subsections_via_symbols
