	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_device_reset_sriov
_amdgpu_device_reset_sriov:             ## @amdgpu_device_reset_sriov
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	testl	%esi, %esi
	je	LBB0_2
## %bb.1:
	movl	$1, %esi
	callq	_amdgpu_virt_request_full_gpu
	jmp	LBB0_3
LBB0_2:
	callq	_amdgpu_virt_reset_gpu
LBB0_3:
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.4:
	movq	%r14, %rdi
	callq	_amdgpu_amdkfd_pre_reset
	movq	%r14, %rdi
	callq	_amdgpu_device_ip_reinit_early_sriov
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_5
LBB0_8:
	movq	%r14, %rdi
	callq	_amdgpu_virt_init_data_exchange
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_amdgpu_virt_release_full_gpu
	testl	%ebx, %ebx
	jne	LBB0_11
## %bb.9:
	movq	_AMDGIM_FEATURE_GIM_FLR_VRAMLOST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_10
## %bb.12:
	movq	%r14, %rdi
	callq	_amdgpu_inc_vram_lost
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_amdgpu_device_recover_vram     ## TAILCALL
LBB0_5:
	movq	_TTM_PL_TT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	shlq	$2, %rdi
	addq	8(%r14), %rdi
	callq	_amdgpu_gtt_mgr_recover
	movq	%r14, %rdi
	callq	_amdgpu_device_fw_loading
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:
	movq	%r14, %rdi
	callq	_amdgpu_device_ip_reinit_late_sriov
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	callq	_amdgpu_irq_gpu_reset_resume_helper
	movq	%r14, %rdi
	callq	_amdgpu_ib_ring_tests
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_amdgpu_amdkfd_post_reset
	jmp	LBB0_8
LBB0_10:
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TTM_PL_TT,8,3                  ## @TTM_PL_TT
	.comm	_AMDGIM_FEATURE_GIM_FLR_VRAMLOST,4,2 ## @AMDGIM_FEATURE_GIM_FLR_VRAMLOST
	.no_dead_strip	_amdgpu_device_reset_sriov
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_device_reset_sriov
_amdgpu_device_reset_sriov:             ; @amdgpu_device_reset_sriov
	.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
	cbz	w1, LBB0_2
; %bb.1:
	mov	w1, #1
	bl	_amdgpu_virt_request_full_gpu
	mov	x20, x0
	cbnz	w0, LBB0_11
	b	LBB0_3
LBB0_2:
	bl	_amdgpu_virt_reset_gpu
	mov	x20, x0
	cbnz	w0, LBB0_11
LBB0_3:
	mov	x0, x19
	bl	_amdgpu_amdkfd_pre_reset
	mov	x0, x19
	bl	_amdgpu_device_ip_reinit_early_sriov
	mov	x20, x0
	cbz	w0, LBB0_7
LBB0_4:
	mov	x0, x19
	bl	_amdgpu_virt_init_data_exchange
	mov	x0, x19
	mov	w1, #1
	bl	_amdgpu_virt_release_full_gpu
	cbnz	w20, LBB0_11
; %bb.5:
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _AMDGIM_FEATURE_GIM_FLR_VRAMLOST@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AMDGIM_FEATURE_GIM_FLR_VRAMLOST@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.6:
	mov	x0, x19
	bl	_amdgpu_inc_vram_lost
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_amdgpu_device_recover_vram
LBB0_7:
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _TTM_PL_TT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TTM_PL_TT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x0, x8, x9, lsl #2
	bl	_amdgpu_gtt_mgr_recover
	mov	x0, x19
	bl	_amdgpu_device_fw_loading
	mov	x20, x0
	cbnz	w0, LBB0_11
; %bb.8:
	mov	x0, x19
	bl	_amdgpu_device_ip_reinit_late_sriov
	mov	x20, x0
	cbnz	w0, LBB0_4
; %bb.9:
	mov	x0, x19
	bl	_amdgpu_irq_gpu_reset_resume_helper
	mov	x0, x19
	bl	_amdgpu_ib_ring_tests
	mov	x20, x0
	mov	x0, x19
	bl	_amdgpu_amdkfd_post_reset
	b	LBB0_4
LBB0_10:
	mov	w20, #0
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_TTM_PL_TT,8,3                  ; @TTM_PL_TT
	.comm	_AMDGIM_FEATURE_GIM_FLR_VRAMLOST,4,2 ; @AMDGIM_FEATURE_GIM_FLR_VRAMLOST
	.no_dead_strip	_amdgpu_device_reset_sriov
.subsections_via_symbols
