	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function soc15_asic_mode1_reset
_soc15_asic_mode1_reset:                ## @soc15_asic_mode1_reset
	.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, %r15
	movl	$1, %esi
	callq	_amdgpu_atombios_scratch_regs_engine_hung
	movl	20(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	movl	16(%r15), %edi
	callq	_pci_clear_master
	movl	16(%r15), %edi
	callq	_pci_save_state
	movq	%r15, %rdi
	callq	_psp_gpu_reset
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	20(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
LBB0_2:
	movl	16(%r15), %edi
	callq	_pci_restore_state
	cmpq	$0, (%r15)
	jle	LBB0_6
## %bb.3:
	xorl	%ebx, %ebx
	movl	$4294967295, %r12d              ## imm = 0xFFFFFFFF
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movq	%r15, %rdi
	callq	*(%rax)
	cmpq	%r12, %rax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$1, %edi
	callq	_udelay
	incq	%rbx
	cmpq	(%r15), %rbx
	jl	LBB0_4
LBB0_6:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_atombios_scratch_regs_engine_hung
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GPU mode1 reset\n"

L_.str.1:                               ## @.str.1
	.asciz	"GPU mode1 reset failed\n"

	.no_dead_strip	_soc15_asic_mode1_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function soc15_asic_mode1_reset
_soc15_asic_mode1_reset:                ; @soc15_asic_mode1_reset
	.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
	mov	w1, #1
	bl	_amdgpu_atombios_scratch_regs_engine_hung
	ldr	w0, [x19, #20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	ldr	w0, [x19, #16]
	bl	_pci_clear_master
	ldr	w0, [x19, #16]
	bl	_pci_save_state
	mov	x0, x19
	bl	_psp_gpu_reset
	mov	x20, x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #20]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_2:
	ldr	w0, [x19, #16]
	bl	_pci_restore_state
	ldr	x8, [x19]
	cmp	x8, #1
	b.lt	LBB0_6
; %bb.3:
	mov	x21, #0
	mov	w22, #-1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	cmp	x0, x22
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
	bl	_udelay
	add	x21, x21, #1
	ldr	x8, [x19]
	cmp	x21, x8
	b.lt	LBB0_4
LBB0_6:
	mov	x0, x19
	mov	w1, #0
	bl	_amdgpu_atombios_scratch_regs_engine_hung
	mov	x0, x20
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GPU mode1 reset\n"

l_.str.1:                               ; @.str.1
	.asciz	"GPU mode1 reset failed\n"

	.no_dead_strip	_soc15_asic_mode1_reset
.subsections_via_symbols
