	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_gpu_reset               ## -- Begin function radeon_gpu_reset
	.p2align	4, 0x90
_radeon_gpu_reset:                      ## @radeon_gpu_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_RADEON_NUM_RINGS@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	leaq	(,%rbx,4), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	shlq	$3, %rbx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	%r14, %rdi
	callq	_down_write
	movq	%r14, %rdi
	callq	_radeon_save_bios_scratch_regs
	leaq	8(%r14), %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_ttm_bo_lock_delayed_workqueue
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_radeon_suspend
	cmpl	$0, (%r15)
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	jle	LBB0_1
## %bb.9:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	incq	%rbx
	movq	_RADEON_NUM_RINGS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$8, %r12
	addq	$4, %r15
	cmpq	%rax, %rbx
	jge	LBB0_2
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rsi
	addq	%r15, %rsi
	movq	%r14, %rdi
	movq	%r12, %rdx
	callq	_radeon_ring_backup
	movl	%eax, (%r13,%rbx,4)
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_info
	movl	$1, -52(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_12
LBB0_1:
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
LBB0_2:
	movq	%r14, %rdi
	callq	_radeon_asic_reset
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_3
LBB0_16:
	movq	%r14, %rdi
	callq	_radeon_restore_bios_scratch_regs
	movq	%r14, %rdi
	callq	_radeon_fence_driver_force_completion
	movq	_RADEON_NUM_RINGS@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_19
## %bb.17:
	xorl	%ebx, %ebx
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13,%rbx,8), %rdi
	callq	_kfree
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_18
LBB0_19:
	movl	12(%r14), %edi
	callq	_drm_helper_resume_force_mode
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	callq	_ttm_bo_unlock_delayed_workqueue
	testl	%r12d, %r12d
	je	LBB0_21
## %bb.20:
	movl	4(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
LBB0_21:
	movq	%r14, %rdi
	callq	_up_write
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_23
## %bb.22:
	movl	%r12d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movl	4(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
	movq	%r14, %rdi
	callq	_radeon_resume
	movq	%r14, %rdi
	callq	_radeon_restore_bios_scratch_regs
	movq	_RADEON_NUM_RINGS@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	jle	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	16(%r14), %rsi
	addq	%rbx, %rsi
	movl	(%r13,%rbx), %edx
	movq	%rcx, %r13
	movq	(%r15,%rbx,2), %rcx
	movq	%r14, %rdi
	callq	_radeon_ring_restore
	movq	%r13, %rcx
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movl	$0, (%r13,%rbx)
	movq	$0, (%r15,%rbx,2)
	incq	%r12
	movslq	(%rcx), %rax
	addq	$4, %rbx
	cmpq	%rax, %r12
	jl	LBB0_6
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	callq	_radeon_ib_ring_tests
	testl	%eax, %eax
	je	LBB0_8
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %r12d
	movl	4(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	callq	_radeon_suspend
	movq	%r14, %rdi
	callq	_radeon_asic_reset
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	testl	%eax, %eax
	je	LBB0_4
## %bb.15:
	movl	%eax, %r12d
	jmp	LBB0_16
LBB0_8:
	xorl	%r12d, %r12d
	jmp	LBB0_19
LBB0_23:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_NUM_RINGS,4,2           ## @RADEON_NUM_RINGS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Saved %d dwords of commands on ring %d.\n"

L_.str.1:                               ## @.str.1
	.asciz	"GPU reset succeeded, trying to resume\n"

L_.str.2:                               ## @.str.2
	.asciz	"ib ring test failed (%d).\n"

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

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_gpu_reset               ; -- Begin function radeon_gpu_reset
	.p2align	2
_radeon_gpu_reset:                      ; @radeon_gpu_reset
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #32
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x25, _RADEON_NUM_RINGS@GOTPAGE
Lloh4:
	ldr	x25, [x25, _RADEON_NUM_RINGS@GOTPAGEOFF]
	ldr	w12, [x25]
	lsl	x8, x12, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x27, x9, x8
	mov	sp, x27
	lsl	x8, x12, #3
	mov	x9, x8
Lloh7:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh8:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x26, x9, x8
	mov	sp, x26
	bl	_down_write
	mov	x0, x19
	bl	_radeon_save_bios_scratch_regs
	add	x0, x19, #8
	stur	x0, [x29, #-96]                 ; 8-byte Folded Spill
	bl	_ttm_bo_lock_delayed_workqueue
	stur	w0, [x29, #-100]                ; 4-byte Folded Spill
	mov	x0, x19
	bl	_radeon_suspend
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x24, #0
	mov	x21, #0
	mov	w28, #0
	mov	x22, x26
Lloh9:
	adrp	x23, l_.str@PAGE
Lloh10:
	add	x23, x23, l_.str@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x25]
	add	x22, x22, #8
	add	x24, x24, #4
	cmp	x21, x8
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	add	x1, x8, x24
	mov	x0, x19
	mov	x2, x22
	bl	_radeon_ring_backup
                                        ; kill: def $w0 killed $w0 def $x0
	str	w0, [x27, x21, lsl #2]
	cbz	w0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x19, #4]
	stp	x0, x21, [sp, #-16]!
	mov	x0, x8
	mov	x1, x23
	bl	_dev_info
	add	sp, sp, #16
	mov	w28, #1
	b	LBB0_2
LBB0_5:
	mov	w28, #0
LBB0_6:
	mov	x0, x19
	bl	_radeon_asic_reset
	mov	x22, x0
	cbz	w0, LBB0_14
LBB0_7:
	mov	x0, x19
	bl	_radeon_restore_bios_scratch_regs
	mov	x0, x19
	bl	_radeon_fence_driver_force_completion
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.8:
	mov	x21, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x26, x21, lsl #3]
	bl	_kfree
	add	x21, x21, #1
	ldrsw	x8, [x25]
	cmp	x21, x8
	b.lt	LBB0_9
LBB0_10:
	ldr	w0, [x19, #12]
	bl	_drm_helper_resume_force_mode
	ldur	x0, [x29, #-96]                 ; 8-byte Folded Reload
	ldur	w1, [x29, #-100]                ; 4-byte Folded Reload
	bl	_ttm_bo_unlock_delayed_workqueue
	cbz	w22, LBB0_12
; %bb.11:
	ldr	w0, [x19, #4]
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_info
LBB0_12:
	mov	x0, x19
	bl	_up_write
	ldur	x8, [x29, #-88]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.13:
	mov	x0, x22
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_14:
Lloh16:
	adrp	x23, l_.str.1@PAGE
Lloh17:
	add	x23, x23, l_.str.1@PAGEOFF
LBB0_15:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_17 Depth 2
	ldr	w0, [x19, #4]
	mov	x1, x23
	bl	_dev_info
	mov	x0, x19
	bl	_radeon_resume
	mov	x0, x19
	bl	_radeon_restore_bios_scratch_regs
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x21, #0
	mov	x22, #0
LBB0_17:                                ;   Parent Loop BB0_15 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x19, #16]
	add	x1, x8, x21
	lsl	x20, x22, #2
	ldr	w2, [x27, x20]
	lsl	x24, x22, #3
	ldr	x3, [x26, x24]
	mov	x0, x19
	bl	_radeon_ring_restore
	str	wzr, [x27, x20]
	str	xzr, [x26, x24]
	add	x22, x22, #1
	ldrsw	x8, [x25]
	add	x21, x21, #4
	cmp	x22, x8
	b.lt	LBB0_17
LBB0_18:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x19
	bl	_radeon_ib_ring_tests
	mov	x22, x0
	cbz	w0, LBB0_10
; %bb.19:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w0, [x19, #4]
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x22
	bl	_dev_err
	cbz	w28, LBB0_10
; %bb.20:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x19
	bl	_radeon_suspend
	mov	x0, x19
	bl	_radeon_asic_reset
	mov	w28, #0
	cbz	w0, LBB0_15
; %bb.21:
	mov	x22, x0
	b	LBB0_7
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_NUM_RINGS,4,2           ; @RADEON_NUM_RINGS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Saved %d dwords of commands on ring %d.\n"

l_.str.1:                               ; @.str.1
	.asciz	"GPU reset succeeded, trying to resume\n"

l_.str.2:                               ; @.str.2
	.asciz	"ib ring test failed (%d).\n"

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

.subsections_via_symbols
