	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv40_graph_context_fini
_nv40_graph_context_fini:               ## @nv40_graph_context_fini
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	(%rdi), %r14
	callq	_nv_gpuobj
	movl	(%rax), %ebx
	sarl	$4, %ebx
	orl	$16777216, %ebx                 ## imm = 0x1000000
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	$4196128, %esi                  ## imm = 0x400720
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_nv_mask
	movq	%r14, %rdi
	movl	$4195116, %esi                  ## imm = 0x40032C
	callq	_nv_rd32
	cmpl	%ebx, %eax
	jne	LBB0_5
## %bb.1:
	xorl	%r15d, %r15d
	testl	%r12d, %r12d
	je	LBB0_4
## %bb.2:
	movq	%r14, %rdi
	movl	$4196128, %esi                  ## imm = 0x400720
	xorl	%edx, %edx
	callq	_nv_wr32
	movq	%r14, %rdi
	movl	$4196228, %esi                  ## imm = 0x400784
	movl	%ebx, %edx
	callq	_nv_wr32
	movq	%r14, %rdi
	movl	$4195088, %esi                  ## imm = 0x400310
	movl	$32, %edx
	movl	$32, %ecx
	callq	_nv_mask
	movq	%r14, %rdi
	movl	$4195076, %esi                  ## imm = 0x400304
	movl	$1, %edx
	movl	$1, %ecx
	callq	_nv_mask
	movq	%r14, %rdi
	movl	$4195072, %esi                  ## imm = 0x400300
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_nv_wait
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	movl	$4195080, %esi                  ## imm = 0x400308
	callq	_nv_rd32
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_nv_warn
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_4:
	movq	%r14, %rdi
	movl	$4195116, %esi                  ## imm = 0x40032C
	movl	$16777216, %edx                 ## imm = 0x1000000
	xorl	%ecx, %ecx
	callq	_nv_mask
LBB0_5:
	movq	%r14, %rdi
	movl	$4195120, %esi                  ## imm = 0x400330
	callq	_nv_rd32
	cmpl	%ebx, %eax
	jne	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	movl	$4195120, %esi                  ## imm = 0x400330
	movl	$16777216, %edx                 ## imm = 0x1000000
	xorl	%ecx, %ecx
	callq	_nv_mask
LBB0_7:
	movq	%r14, %rdi
	movl	$4196128, %esi                  ## imm = 0x400720
	movl	$1, %edx
	movl	$1, %ecx
	callq	_nv_mask
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ctxprog timeout 0x%08x\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_nv40_graph_context_fini
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv40_graph_context_fini
_nv40_graph_context_fini:               ; @nv40_graph_context_fini
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x23, x1
	mov	w24, #1824
	movk	w24, #64, lsl #16
	ldr	x19, [x0]
	bl	_nv_gpuobj
	ldr	w8, [x0]
	asr	w8, w8, #4
	orr	w20, w8, #0x1000000
	mov	x0, x19
	mov	w1, #1824
	movk	w1, #64, lsl #16
	mov	w2, #1
	mov	w3, #0
	bl	_nv_mask
	sub	w21, w24, #1012
	mov	x0, x19
	mov	x1, x21
	bl	_nv_rd32
	mov	w22, #0
	cmp	w0, w20
	b.ne	LBB0_6
; %bb.1:
	cbz	w23, LBB0_4
; %bb.2:
	mov	x0, x19
	mov	w1, #1824
	movk	w1, #64, lsl #16
	mov	w2, #0
	bl	_nv_wr32
	add	w1, w24, #100
	mov	x0, x19
	mov	x2, x20
	bl	_nv_wr32
	sub	w1, w24, #1040
	mov	x0, x19
	mov	w2, #32
	mov	w3, #32
	bl	_nv_mask
	sub	w1, w24, #1052
	mov	x0, x19
	mov	w2, #1
	mov	w3, #1
	bl	_nv_mask
	sub	w1, w24, #1056
	mov	x0, x19
	mov	w2, #1
	mov	w3, #0
	bl	_nv_wait
	mov	w22, #0
	cbnz	w0, LBB0_5
; %bb.3:
	sub	w1, w24, #1048
	mov	x0, x19
	bl	_nv_rd32
	mov	x2, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_nv_warn
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_5
LBB0_4:
	mov	w22, #0
LBB0_5:
	mov	x0, x19
	mov	x1, x21
	mov	w2, #16777216
	mov	w3, #0
	bl	_nv_mask
LBB0_6:
	sub	w21, w24, #1008
	mov	x0, x19
	mov	x1, x21
	bl	_nv_rd32
	cmp	w0, w20
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x19
	mov	x1, x21
	mov	w2, #16777216
	mov	w3, #0
	bl	_nv_mask
LBB0_8:
	mov	x0, x19
	mov	w1, #1824
	movk	w1, #64, lsl #16
	mov	w2, #1
	mov	w3, #1
	bl	_nv_mask
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ctxprog timeout 0x%08x\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_nv40_graph_context_fini
.subsections_via_symbols
