	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_amdkfd_remove_gws_from_process ## -- Begin function amdgpu_amdkfd_remove_gws_from_process
	.p2align	4, 0x90
_amdgpu_amdkfd_remove_gws_from_process: ## @amdgpu_amdkfd_remove_gws_from_process
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	8(%rsi), %r13
	movq	%r13, -48(%rbp)
	movq	%rsi, %rdi
	movq	%r12, %rsi
	callq	_remove_kgd_mem_from_kfd_bo_list
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_bo_reserve
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_pr_err
	movl	%ebx, %r14d
	jmp	LBB0_3
LBB0_2:
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_amdgpu_amdkfd_remove_eviction_fence
	movq	%r13, %rdi
	callq	_amdgpu_bo_unreserve
	leaq	4(%r15), %rdi
	callq	_amdgpu_sync_free
	leaq	-48(%rbp), %rdi
	callq	_amdgpu_bo_unref
	movq	%r15, %rdi
	callq	_mutex_destroy
	movq	%r15, %rdi
	callq	_kfree
LBB0_3:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reserve gws bo failed %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_amdkfd_remove_gws_from_process ; -- Begin function amdgpu_amdkfd_remove_gws_from_process
	.p2align	2
_amdgpu_amdkfd_remove_gws_from_process: ; @amdgpu_amdkfd_remove_gws_from_process
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x21, x0
	ldr	x20, [x1, #8]
	str	x20, [sp, #8]
	mov	x0, x1
	mov	x1, x21
	bl	_remove_kgd_mem_from_kfd_bo_list
	mov	x0, x20
	mov	w1, #0
	bl	_amdgpu_bo_reserve
	mov	x22, x0
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_pr_err
	b	LBB0_3
LBB0_2:
	ldr	w1, [x21]
	mov	x0, x20
	bl	_amdgpu_amdkfd_remove_eviction_fence
	mov	x0, x20
	bl	_amdgpu_bo_unreserve
	add	x0, x19, #4
	bl	_amdgpu_sync_free
	add	x0, sp, #8
	bl	_amdgpu_bo_unref
	mov	x0, x19
	bl	_mutex_destroy
	mov	x0, x19
	bl	_kfree
	mov	w22, #0
LBB0_3:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reserve gws bo failed %d\n"

.subsections_via_symbols
