	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_channel_del            ## -- Begin function nouveau_channel_del
	.p2align	4, 0x90
_nouveau_channel_del:                   ## @nouveau_channel_del
	.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
	movq	%rdi, %r14
	movq	(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.1:
	movl	32(%rbx), %edi
	callq	_nv_object
	movq	%rax, %r15
	cmpq	$0, 24(%rbx)
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_nouveau_channel_idle
	movl	20(%rbx), %edi
	callq	_nouveau_fence
	movq	%rbx, %rdi
	callq	*(%rax)
LBB0_3:
	movq	_NVDRM_DEVICE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	16(%rbx), %edx
	movq	%r15, %rdi
	callq	_nouveau_object_del
	movl	(%r12), %esi
	movl	12(%rbx), %edx
	movq	%r15, %rdi
	callq	_nouveau_object_del
	movq	(%rbx), %rdi
	leaq	8(%rbx), %rsi
	callq	_nouveau_bo_vma_del
	movq	(%rbx), %rdi
	callq	_nouveau_bo_unmap
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.4:
	cmpq	$0, (%rdi)
	je	LBB0_6
## %bb.5:
	callq	_nouveau_bo_unpin
LBB0_6:
	xorl	%edi, %edi
	movq	%rbx, %rsi
	callq	_nouveau_bo_ref
	movq	%rbx, %rdi
	callq	_kfree
LBB0_7:
	movq	$0, (%r14)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NVDRM_DEVICE,4,2               ## @NVDRM_DEVICE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_channel_del            ; -- Begin function nouveau_channel_del
	.p2align	2
_nouveau_channel_del:                   ; @nouveau_channel_del
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	x20, [x0]
	cbz	x20, LBB0_7
; %bb.1:
	ldr	w0, [x20, #32]
	bl	_nv_object
	mov	x21, x0
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x20
	bl	_nouveau_channel_idle
	ldr	w0, [x20, #20]
	bl	_nouveau_fence
	ldr	x8, [x0]
	mov	x0, x20
	blr	x8
LBB0_3:
Lloh0:
	adrp	x22, _NVDRM_DEVICE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _NVDRM_DEVICE@GOTPAGEOFF]
	ldr	w1, [x22]
	ldr	w2, [x20, #16]
	mov	x0, x21
	bl	_nouveau_object_del
	ldr	w1, [x22]
	ldr	w2, [x20, #12]
	mov	x0, x21
	bl	_nouveau_object_del
	ldr	x0, [x20]
	add	x1, x20, #8
	bl	_nouveau_bo_vma_del
	ldr	x0, [x20]
	bl	_nouveau_bo_unmap
	ldr	x0, [x20]
	cbz	x0, LBB0_6
; %bb.4:
	ldr	x8, [x0]
	cbz	x8, LBB0_6
; %bb.5:
	bl	_nouveau_bo_unpin
LBB0_6:
	mov	x0, #0
	mov	x1, x20
	bl	_nouveau_bo_ref
	mov	x0, x20
	bl	_kfree
LBB0_7:
	str	xzr, [x19]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_NVDRM_DEVICE,4,2               ; @NVDRM_DEVICE
.subsections_via_symbols
