	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_amdkfd_gpuvm_destroy_cb ## -- Begin function amdgpu_amdkfd_gpuvm_destroy_cb
	.p2align	4, 0x90
_amdgpu_amdkfd_gpuvm_destroy_cb:        ## @amdgpu_amdkfd_gpuvm_destroy_cb
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	16(%rsi), %r14
	testq	%r14, %r14
	je	LBB0_2
## %bb.1:
	movq	%rsi, %r15
	movq	8(%rsi), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_bo_reserve
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_amdgpu_bo_fence
	movq	%rbx, %rdi
	callq	_amdgpu_bo_unreserve
	movq	%r14, %rdi
	callq	_mutex_lock
	decl	36(%r14)
	movq	%r15, %rdi
	callq	_list_del
	movq	%r14, %rdi
	callq	_mutex_unlock
	cmpl	$0, 36(%r14)
	je	LBB0_3
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	32(%r14), %rdi
	callq	_list_empty
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_WARN_ON
	leaq	28(%r14), %rdi
	callq	_list_empty
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_WARN_ON
	leaq	24(%r14), %rdi
	callq	_list_empty
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_WARN_ON
	movq	16(%r14), %rdi
	callq	_dma_fence_put
	leaq	8(%r14), %rdi
	callq	_cancel_delayed_work_sync
	movl	4(%r14), %edi
	callq	_put_pid
	movq	%r14, %rdi
	callq	_mutex_destroy
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_amdkfd_gpuvm_destroy_cb ; -- Begin function amdgpu_amdkfd_gpuvm_destroy_cb
	.p2align	2
_amdgpu_amdkfd_gpuvm_destroy_cb:        ; @amdgpu_amdkfd_gpuvm_destroy_cb
	.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
	ldr	x19, [x1, #16]
	cbz	x19, LBB0_2
; %bb.1:
	mov	x20, x1
	ldr	x21, [x1, #8]
	mov	x0, x21
	mov	w1, #0
	bl	_amdgpu_bo_reserve
	mov	x0, x21
	mov	x1, #0
	mov	w2, #0
	bl	_amdgpu_bo_fence
	mov	x0, x21
	bl	_amdgpu_bo_unreserve
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x19, #36]
	sub	w8, w8, #1
	str	w8, [x19, #36]
	mov	x0, x20
	bl	_list_del
	mov	x0, x19
	bl	_mutex_unlock
	ldr	w8, [x19, #36]
	cbz	w8, LBB0_3
LBB0_2:
	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
LBB0_3:
	add	x0, x19, #32
	bl	_list_empty
	cmp	w0, #0
	cset	w0, eq
	bl	_WARN_ON
	add	x0, x19, #28
	bl	_list_empty
	cmp	w0, #0
	cset	w0, eq
	bl	_WARN_ON
	add	x0, x19, #24
	bl	_list_empty
	cmp	w0, #0
	cset	w0, eq
	bl	_WARN_ON
	ldr	x0, [x19, #16]
	bl	_dma_fence_put
	add	x0, x19, #8
	bl	_cancel_delayed_work_sync
	ldr	w0, [x19, #4]
	bl	_put_pid
	mov	x0, x19
	bl	_mutex_destroy
	mov	x0, 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
	b	_kfree
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
