	.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	$56, %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, -88(%rbp)                 ## 8-byte Spill
	shlq	$3, %rbx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	leaq	8(%r14), %rbx
	movq	%rbx, %rdi
	callq	_down_write
	cmpl	$0, (%r14)
	je	LBB0_1
## %bb.2:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	leaq	64(%r14), %rdi
	callq	_atomic_inc
	movq	%r14, %rdi
	callq	_radeon_save_bios_scratch_regs
	leaq	36(%r14), %rdi
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	callq	_ttm_bo_lock_delayed_workqueue
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_radeon_suspend
	movq	%r14, %rdi
	callq	_radeon_hpd_fini
	movq	%r15, %r13
	cmpl	$0, (%r15)
	jle	LBB0_3
## %bb.4:
	xorl	%ebx, %ebx
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	xorl	%r15d, %r15d
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%r15
	movslq	(%r13), %rax
	addq	$8, %r12
	addq	$4, %rbx
	cmpq	%rax, %r15
	jge	LBB0_8
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	56(%r14), %rsi
	addq	%rbx, %rsi
	movq	%r14, %rdi
	movq	%r12, %rdx
	callq	_radeon_ring_backup
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx,%r15,4)
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	12(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_dev_info
	movl	$1, -52(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_7
LBB0_1:
	movq	%rbx, %rdi
	callq	_up_write
	xorl	%r15d, %r15d
	jmp	LBB0_35
LBB0_3:
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
LBB0_8:
	movq	%r14, %rdi
	callq	_radeon_asic_reset
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movl	12(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
	movq	%r14, %rdi
	callq	_radeon_resume
LBB0_10:
	movq	%r14, %rdi
	callq	_radeon_restore_bios_scratch_regs
	cmpl	$0, (%r13)
	jle	LBB0_17
## %bb.11:
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_radeon_fence_driver_force_completion
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%r12,2), %rdi
	callq	_kfree
LBB0_16:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%rbx
	movslq	(%r13), %rax
	addq	$4, %r12
	cmpq	%rax, %rbx
	jge	LBB0_17
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	testl	%r15d, %r15d
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%r12,2), %rcx
	testq	%rcx, %rcx
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	56(%r14), %rsi
	addq	%r12, %rsi
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%r12), %edx
	movq	%r14, %rdi
	callq	_radeon_ring_restore
	jmp	LBB0_16
LBB0_17:
	movq	16(%r14), %rax
	movq	_PM_METHOD_DPM@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_22
## %bb.18:
	cmpl	$0, 24(%r14)
	je	LBB0_22
## %bb.19:
	movq	%r14, %rdi
	callq	_radeon_pm_late_init
	testl	%eax, %eax
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_20
## %bb.21:
	movl	%eax, %r15d
	movl	$0, 24(%r14)
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_ERROR
	cmpq	$0, 48(%r14)
	jne	LBB0_24
	jmp	LBB0_26
LBB0_22:
	movq	%r14, %rdi
	callq	_radeon_pm_resume
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	cmpq	$0, 48(%r14)
	je	LBB0_26
LBB0_24:
	movq	%r14, %rdi
	callq	_radeon_atom_encoder_init
	movq	%r14, %rdi
	callq	_radeon_atom_disp_eng_pll_init
	movq	40(%r14), %rsi
	testq	%rsi, %rsi
	je	LBB0_26
## %bb.25:
	movq	%r14, %rdi
	callq	_radeon_get_backlight_level
	movq	40(%r14), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_radeon_set_backlight_level
LBB0_26:
	movq	%r14, %rdi
	callq	_radeon_hpd_init
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	movl	-68(%rbp), %esi                 ## 4-byte Reload
	callq	_ttm_bo_unlock_delayed_workqueue
	movabsq	$4294967296, %rax               ## imm = 0x100000000
	movq	%rax, (%r14)
	movq	%rbx, %rdi
	callq	_downgrade_write
	movl	32(%r14), %edi
	callq	_drm_helper_resume_force_mode
	movq	16(%r14), %rax
	cmpq	(%r12), %rax
	jne	LBB0_29
## %bb.27:
	cmpl	$0, 24(%r14)
	je	LBB0_29
## %bb.28:
	movq	%r14, %rdi
	callq	_radeon_pm_compute_clocks
LBB0_29:
	testl	%r15d, %r15d
	je	LBB0_30
## %bb.33:
	movl	12(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
	jmp	LBB0_34
LBB0_30:
	movq	%r14, %rdi
	callq	_radeon_ib_ring_tests
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_34
## %bb.31:
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_34
## %bb.32:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_34:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	(%rax), %eax
	addl	%r15d, %eax
	sete	%cl
	movl	%ecx, (%r14)
	movl	$0, 4(%r14)
	movq	%rbx, %rdi
	callq	_up_read
LBB0_35:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_37
## %bb.36:
	movl	%r15d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	xorl	%r15d, %r15d
	cmpq	$0, 48(%r14)
	jne	LBB0_24
	jmp	LBB0_26
LBB0_37:
	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"

	.comm	_PM_METHOD_DPM,8,3              ## @PM_METHOD_DPM
L_.str.2:                               ## @.str.2
	.asciz	"radeon_pm_late_init failed, disabling dpm\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
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
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function radeon_gpu_reset
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_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	x26, _RADEON_NUM_RINGS@GOTPAGE
Lloh4:
	ldr	x26, [x26, _RADEON_NUM_RINGS@GOTPAGEOFF]
	ldr	w12, [x26]
	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	x28, x9, x8
	mov	sp, x28
	add	x20, x0, #8
	mov	x0, x20
	bl	_down_write
	ldr	w8, [x19]
	cbz	w8, LBB0_6
; %bb.1:
	add	x0, x19, #64
	bl	_atomic_inc
	mov	x0, x19
	bl	_radeon_save_bios_scratch_regs
	add	x0, x19, #36
	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
	mov	x0, x19
	bl	_radeon_hpd_fini
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.2:
	mov	x22, #0
	mov	x21, #0
	mov	w25, #0
	mov	x23, x28
Lloh9:
	adrp	x24, l_.str@PAGE
Lloh10:
	add	x24, x24, l_.str@PAGEOFF
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x26]
	add	x23, x23, #8
	add	x22, x22, #4
	cmp	x21, x8
	b.ge	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #56]
	add	x1, x8, x22
	mov	x0, x19
	mov	x2, x23
	bl	_radeon_ring_backup
                                        ; kill: def $w0 killed $w0 def $x0
	str	w0, [x27, x21, lsl #2]
	cbz	w0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19, #12]
	stp	x0, x21, [sp, #-16]!
	mov	x0, x8
	mov	x1, x24
	bl	_dev_info
	add	sp, sp, #16
	mov	w25, #1
	b	LBB0_3
LBB0_6:
	mov	x0, x20
	bl	_up_write
	mov	w23, #0
	b	LBB0_34
LBB0_7:
	mov	w25, #0
LBB0_8:
	mov	x0, x19
	bl	_radeon_asic_reset
	mov	x23, x0
	cbnz	w0, LBB0_10
; %bb.9:
	ldr	w0, [x19, #12]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
	mov	x0, x19
	bl	_radeon_resume
LBB0_10:
	mov	x0, x19
	bl	_radeon_restore_bios_scratch_regs
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.11:
	mov	x21, #0
	mov	x24, #0
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x19
	mov	x1, x24
	bl	_radeon_fence_driver_force_completion
	ldr	x0, [x28, x24, lsl #3]
	bl	_kfree
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x26]
	add	x21, x21, #4
	cmp	x24, x8
	b.ge	LBB0_17
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	cbnz	w23, LBB0_12
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x3, [x28, x24, lsl #3]
	cbz	x3, LBB0_12
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x8, [x19, #56]
	add	x1, x8, x21
	ldr	w2, [x27, x24, lsl #2]
	mov	x0, x19
	bl	_radeon_ring_restore
	b	LBB0_13
LBB0_17:
	ldr	x8, [x19, #16]
Lloh13:
	adrp	x24, _PM_METHOD_DPM@GOTPAGE
Lloh14:
	ldr	x24, [x24, _PM_METHOD_DPM@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_21
; %bb.18:
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_21
; %bb.19:
	mov	x0, x19
	bl	_radeon_pm_late_init
	mov	x23, x0
	cbz	w0, LBB0_22
; %bb.20:
	str	wzr, [x19, #24]
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_22
LBB0_21:
	mov	x0, x19
	bl	_radeon_pm_resume
LBB0_22:
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_25
; %bb.23:
	mov	x0, x19
	bl	_radeon_atom_encoder_init
	mov	x0, x19
	bl	_radeon_atom_disp_eng_pll_init
	ldr	x1, [x19, #40]
	cbz	x1, LBB0_25
; %bb.24:
	mov	x0, x19
	bl	_radeon_get_backlight_level
	mov	x2, x0
	ldr	x1, [x19, #40]
	mov	x0, x19
	bl	_radeon_set_backlight_level
LBB0_25:
	mov	x0, x19
	bl	_radeon_hpd_init
	ldur	x0, [x29, #-96]                 ; 8-byte Folded Reload
	ldur	w1, [x29, #-100]                ; 4-byte Folded Reload
	bl	_ttm_bo_unlock_delayed_workqueue
Lloh17:
	adrp	x8, lCPI0_0@PAGE
Lloh18:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19]
	mov	x0, x20
	bl	_downgrade_write
	ldr	w0, [x19, #32]
	bl	_drm_helper_resume_force_mode
	ldr	x8, [x19, #16]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_28
; %bb.26:
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_28
; %bb.27:
	mov	x0, x19
	bl	_radeon_pm_compute_clocks
LBB0_28:
Lloh19:
	adrp	x21, _EAGAIN@GOTPAGE
Lloh20:
	ldr	x21, [x21, _EAGAIN@GOTPAGEOFF]
	cbz	w23, LBB0_30
; %bb.29:
	ldr	w0, [x19, #12]
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_info
	b	LBB0_33
LBB0_30:
	mov	x0, x19
	bl	_radeon_ib_ring_tests
	mov	x23, x0
	cbz	w0, LBB0_33
; %bb.31:
	cbz	w25, LBB0_33
; %bb.32:
	ldr	w8, [x21]
	neg	w23, w8
LBB0_33:
	ldr	w8, [x21]
	cmn	w23, w8
	cset	w8, eq
	stp	w8, wzr, [x19]
	mov	x0, x20
	bl	_up_read
LBB0_34:
	ldur	x8, [x29, #-88]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_36
; %bb.35:
	mov	x0, x23
	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_36:
	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 AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdr	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.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"

	.comm	_PM_METHOD_DPM,8,3              ; @PM_METHOD_DPM
l_.str.2:                               ; @.str.2
	.asciz	"radeon_pm_late_init failed, disabling dpm\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
l_.str.3:                               ; @.str.3
	.asciz	"GPU reset failed\n"

.subsections_via_symbols
