	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv50_fifo_context_detach
_nv50_fifo_context_detach:              ## @nv50_fifo_context_detach
	.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	%rdx, %rbx
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	callq	_nouveau_bar
	movq	%rax, %r13
	movq	(%r14), %r12
	movq	8(%r14), %r15
	movq	(%rbx), %rdi
	callq	_nv_engidx
	xorl	%ebx, %ebx
	cmpl	$128, %eax
	je	LBB0_10
## %bb.1:
	cmpl	$130, %eax
	je	LBB0_4
## %bb.2:
	cmpl	$129, %eax
	jne	LBB0_11
## %bb.3:
	movl	$96, %ebx
LBB0_4:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movl	$47200, %esi                    ## imm = 0xB860
	movl	$1, %edx
	movl	$1, %ecx
	callq	_nv_mask
	movl	%eax, %r13d
	movq	%r15, %rdi
	callq	_nv_gpuobj
	movl	(%rax), %edx
	sarl	$12, %edx
	movq	%r12, %rdi
	movl	$13052, %esi                    ## imm = 0x32FC
	callq	_nv_wr32
	movq	%r12, %rdi
	movl	$13052, %esi                    ## imm = 0x32FC
	movl	$-1, %edx
	movl	$-1, %ecx
	callq	_nv_wait_ne
	testl	%eax, %eax
	je	LBB0_5
LBB0_6:
	movq	%r12, %rdi
	movl	$47200, %esi                    ## imm = 0xB860
	movl	%r13d, %edx
	callq	_nv_wr32
LBB0_7:
	movl	(%r15), %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_nv_wo32
	movl	(%r15), %edi
	movl	%ebx, %esi
	orl	$4, %esi
	xorl	%edx, %edx
	callq	_nv_wo32
	movl	(%r15), %edi
	movl	%ebx, %esi
	orl	$8, %esi
	xorl	%edx, %edx
	callq	_nv_wo32
	movl	(%r15), %edi
	movl	%ebx, %esi
	orl	$12, %esi
	xorl	%edx, %edx
	callq	_nv_wo32
	movl	(%r15), %edi
	movl	%ebx, %esi
	orl	$16, %esi
	xorl	%edx, %edx
	callq	_nv_wo32
	movl	(%r15), %edi
	orl	$20, %ebx
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_nv_wo32
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	*(%rdi)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_5:
	movl	(%r14), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_nouveau_client_name
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%eax, %ecx
	callq	_nv_error
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_6
## %bb.8:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r12, %rdi
	movl	$47200, %esi                    ## imm = 0xB860
	movl	%r13d, %edx
	callq	_nv_wr32
	testl	%r14d, %r14d
	je	LBB0_7
## %bb.9:
	negl	%r14d
	movl	%r14d, %ebx
LBB0_10:
	movl	%ebx, %eax
	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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"channel %d [%s] unload timeout\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv50_fifo_context_detach
_nv50_fifo_context_detach:              ; @nv50_fifo_context_detach
	.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, x2
	mov	x23, x1
	mov	x24, x0
	bl	_nouveau_bar
	mov	x19, x0
	ldp	x22, x21, [x24]
	ldr	x0, [x20]
	bl	_nv_engidx
	mov	w20, #0
	cmp	w0, #128
	b.eq	LBB0_11
; %bb.1:
	cmp	w0, #130
	b.eq	LBB0_4
; %bb.2:
	cmp	w0, #129
	b.ne	LBB0_7
; %bb.3:
	mov	w20, #96
LBB0_4:
	mov	x0, x22
	mov	w1, #47200
	mov	w2, #1
	mov	w3, #1
	bl	_nv_mask
	mov	x25, x0
	mov	x0, x21
	bl	_nv_gpuobj
	ldr	w8, [x0]
	asr	w2, w8, #12
	mov	x0, x22
	mov	w1, #13052
	bl	_nv_wr32
	mov	x0, x22
	mov	w1, #13052
	mov	w2, #-1
	mov	w3, #-1
	bl	_nv_wait_ne
	cbz	w0, LBB0_8
LBB0_5:
	mov	x0, x22
	mov	w1, #47200
	mov	x2, x25
	bl	_nv_wr32
LBB0_6:
	ldr	w0, [x21]
	mov	x1, x20
	mov	w2, #0
	bl	_nv_wo32
	ldr	w0, [x21]
	orr	w1, w20, #0x4
	mov	w2, #0
	bl	_nv_wo32
	ldr	w0, [x21]
	orr	w1, w20, #0x8
	mov	w2, #0
	bl	_nv_wo32
	ldr	w0, [x21]
	orr	w1, w20, #0xc
	mov	w2, #0
	bl	_nv_wo32
	ldr	w0, [x21]
	orr	w1, w20, #0x10
	mov	w2, #0
	bl	_nv_wo32
	ldr	w0, [x21]
	mov	w8, #20
	orr	w1, w20, w8
	mov	w2, #0
	bl	_nv_wo32
	ldr	x8, [x19]
	mov	x0, x19
	blr	x8
	mov	w20, #0
	b	LBB0_11
LBB0_7:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_8:
	ldr	w26, [x24]
	mov	x0, x24
	bl	_nouveau_client_name
	mov	x3, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x26
	bl	_nv_error
	cbz	w23, LBB0_5
; %bb.9:
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh7:
	ldr	w23, [x8]
	mov	x0, x22
	mov	w1, #47200
	mov	x2, x25
	bl	_nv_wr32
	cbz	w23, LBB0_6
; %bb.10:
	neg	w20, w23
LBB0_11:
	mov	x0, x20
	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
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"channel %d [%s] unload timeout\n"

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