	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kgd2kfd_device_exit            ## -- Begin function kgd2kfd_device_exit
	.p2align	4, 0x90
_kgd2kfd_device_exit:                   ## @kgd2kfd_device_exit
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	cmpq	$0, 16(%rdi)
	je	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_kgd2kfd_suspend
	movl	12(%rbx), %edi
	callq	_device_queue_manager_uninit
	movq	%rbx, %rdi
	callq	_kfd_interrupt_exit
	movq	%rbx, %rdi
	callq	_kfd_topology_remove_device
	movq	%rbx, %rdi
	callq	_kfd_doorbell_fini
	movq	%rbx, %rdi
	callq	_kfd_gtt_sa_fini
	movl	4(%rbx), %edi
	movl	8(%rbx), %esi
	callq	_amdgpu_amdkfd_free_gtt_mem
	movq	_hws_gws_support@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.2:
	movl	(%rbx), %esi
	movl	4(%rbx), %edi
	callq	_amdgpu_amdkfd_free_gws
LBB0_3:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_hws_gws_support,8,3            ## @hws_gws_support
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kgd2kfd_device_exit            ; -- Begin function kgd2kfd_device_exit
	.p2align	2
_kgd2kfd_device_exit:                   ; @kgd2kfd_device_exit
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_kgd2kfd_suspend
	ldr	w0, [x19, #12]
	bl	_device_queue_manager_uninit
	mov	x0, x19
	bl	_kfd_interrupt_exit
	mov	x0, x19
	bl	_kfd_topology_remove_device
	mov	x0, x19
	bl	_kfd_doorbell_fini
	mov	x0, x19
	bl	_kfd_gtt_sa_fini
	ldp	w0, w1, [x19, #4]
	bl	_amdgpu_amdkfd_free_gtt_mem
Lloh0:
	adrp	x8, _hws_gws_support@GOTPAGE
Lloh1:
	ldr	x8, [x8, _hws_gws_support@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.2:
	ldp	w1, w0, [x19]
	bl	_amdgpu_amdkfd_free_gws
LBB0_3:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_kfree
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_hws_gws_support,8,3            ; @hws_gws_support
.subsections_via_symbols
