	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_v7_0_rlc_resume
_gfx_v7_0_rlc_resume:                   ## @gfx_v7_0_rlc_resume
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	24(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r15
	movq	(%rax), %r14
	movq	%r14, %rdi
	callq	_amdgpu_ucode_print_rlc_hdr
	movl	8(%r14), %edi
	callq	_le32_to_cpu
	movl	%eax, 8(%r15)
	movl	12(%r14), %edi
	callq	_le32_to_cpu
	movl	%eax, 12(%r15)
	movq	16(%r15), %rax
	movq	%r15, %rdi
	callq	*16(%rax)
	movq	_mmRLC_CGCG_CGLS_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_RREG32
	andl	$-4, %eax
	movl	(%rbx), %edi
	movl	%eax, %esi
	callq	_WREG32
	movq	16(%r15), %rax
	movq	%r15, %rdi
	callq	*8(%rax)
	movq	%r15, %rdi
	callq	_gfx_v7_0_init_pg
	movq	_mmRLC_LB_CNTR_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	movq	_mmRLC_LB_CNTR_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$32768, %esi                    ## imm = 0x8000
	callq	_WREG32
	leaq	32(%r15), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	movl	$-1, %esi
	movl	$-1, %edx
	movl	$-1, %ecx
	callq	_gfx_v7_0_select_se_sh
	movq	_mmRLC_LB_INIT_CU_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$-1, %esi
	callq	_WREG32
	movq	_mmRLC_LB_PARAMS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$6292488, %esi                  ## imm = 0x600408
	callq	_WREG32
	movq	_mmRLC_LB_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$-2147483644, %esi              ## imm = 0x80000004
	callq	_WREG32
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	_mmRLC_MC_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	movq	_mmRLC_UCODE_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	movq	24(%r15), %rax
	movq	(%rax), %r13
	movl	4(%r14), %edi
	callq	_le32_to_cpu
	movl	%eax, %r12d
	movl	(%r14), %edi
	callq	_le32_to_cpu
	movl	%eax, %r14d
	movq	_mmRLC_GPM_UCODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	leal	3(%r14), %eax
	cmpl	$7, %eax
	jb	LBB0_5
## %bb.3:
	testl	%r14d, %r14d
	cmovnsl	%r14d, %eax
	sarl	$2, %eax
	addl	%r12d, %r13d
	cmpl	$2, %eax
	movl	$1, %ebx
	cmovael	%eax, %ebx
	movq	_mmRLC_GPM_UCODE_DATA@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %r14d
	movl	%r13d, %edi
	callq	_le32_to_cpup
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_WREG32
	addl	$4, %r13d
	decl	%ebx
	jne	LBB0_4
LBB0_5:
	movq	_mmRLC_GPM_UCODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r15), %esi
	callq	_WREG32
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_gfx_v7_0_enable_lbpw
	movq	(%r15), %rax
	movq	_CHIP_BONAIRE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	movq	_mmRLC_DRIVER_CPDMA_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
LBB0_7:
	movq	16(%r15), %rax
	movq	%r15, %rdi
	callq	*(%rax)
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_mmRLC_CGCG_CGLS_CTRL,4,2       ## @mmRLC_CGCG_CGLS_CTRL
	.comm	_mmRLC_LB_CNTR_INIT,4,2         ## @mmRLC_LB_CNTR_INIT
	.comm	_mmRLC_LB_CNTR_MAX,4,2          ## @mmRLC_LB_CNTR_MAX
	.comm	_mmRLC_LB_INIT_CU_MASK,4,2      ## @mmRLC_LB_INIT_CU_MASK
	.comm	_mmRLC_LB_PARAMS,4,2            ## @mmRLC_LB_PARAMS
	.comm	_mmRLC_LB_CNTL,4,2              ## @mmRLC_LB_CNTL
	.comm	_mmRLC_MC_CNTL,4,2              ## @mmRLC_MC_CNTL
	.comm	_mmRLC_UCODE_CNTL,4,2           ## @mmRLC_UCODE_CNTL
	.comm	_mmRLC_GPM_UCODE_ADDR,4,2       ## @mmRLC_GPM_UCODE_ADDR
	.comm	_mmRLC_GPM_UCODE_DATA,4,2       ## @mmRLC_GPM_UCODE_DATA
	.comm	_CHIP_BONAIRE,8,3               ## @CHIP_BONAIRE
	.comm	_mmRLC_DRIVER_CPDMA_STATUS,4,2  ## @mmRLC_DRIVER_CPDMA_STATUS
	.no_dead_strip	_gfx_v7_0_rlc_resume
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_v7_0_rlc_resume
_gfx_v7_0_rlc_resume:                   ; @gfx_v7_0_rlc_resume
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_7
; %bb.1:
	mov	x19, x0
	ldr	x20, [x8]
	mov	x0, x20
	bl	_amdgpu_ucode_print_rlc_hdr
	ldr	w0, [x20, #8]
	bl	_le32_to_cpu
	str	w0, [x19, #8]
	ldr	w0, [x20, #12]
	bl	_le32_to_cpu
	str	w0, [x19, #12]
	ldr	x8, [x19, #16]
	ldr	x8, [x8, #16]
	mov	x0, x19
	blr	x8
Lloh0:
	adrp	x21, _mmRLC_CGCG_CGLS_CTRL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _mmRLC_CGCG_CGLS_CTRL@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_RREG32
	and	w1, w0, #0xfffffffc
	ldr	w0, [x21]
	bl	_WREG32
	ldr	x8, [x19, #16]
	ldr	x8, [x8, #8]
	mov	x0, x19
	blr	x8
	mov	x0, x19
	bl	_gfx_v7_0_init_pg
Lloh2:
	adrp	x8, _mmRLC_LB_CNTR_INIT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _mmRLC_LB_CNTR_INIT@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_WREG32
Lloh5:
	adrp	x8, _mmRLC_LB_CNTR_MAX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _mmRLC_LB_CNTR_MAX@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	w1, #32768
	bl	_WREG32
	add	x21, x19, #32
	mov	x0, x21
	bl	_mutex_lock
	mov	x0, x19
	mov	w1, #-1
	mov	w2, #-1
	mov	w3, #-1
	bl	_gfx_v7_0_select_se_sh
Lloh8:
	adrp	x8, _mmRLC_LB_INIT_CU_MASK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _mmRLC_LB_INIT_CU_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	w1, #-1
	bl	_WREG32
Lloh11:
	adrp	x8, _mmRLC_LB_PARAMS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _mmRLC_LB_PARAMS@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	mov	w1, #1032
	movk	w1, #96, lsl #16
	bl	_WREG32
Lloh14:
	adrp	x8, _mmRLC_LB_CNTL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _mmRLC_LB_CNTL@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	mov	w1, #4
	movk	w1, #32768, lsl #16
	bl	_WREG32
	mov	x0, x21
	bl	_mutex_unlock
Lloh17:
	adrp	x8, _mmRLC_MC_CNTL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _mmRLC_MC_CNTL@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_WREG32
Lloh20:
	adrp	x8, _mmRLC_UCODE_CNTL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _mmRLC_UCODE_CNTL@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_WREG32
	ldr	x8, [x19, #24]
	ldr	x23, [x8]
	ldr	w0, [x20, #4]
	bl	_le32_to_cpu
	mov	x21, x0
	ldr	w0, [x20]
	bl	_le32_to_cpu
	mov	x20, x0
Lloh23:
	adrp	x22, _mmRLC_GPM_UCODE_ADDR@GOTPAGE
Lloh24:
	ldr	x22, [x22, _mmRLC_GPM_UCODE_ADDR@GOTPAGEOFF]
	ldr	w0, [x22]
	mov	w1, #0
	bl	_WREG32
	add	w8, w20, #3
	cmp	w8, #7
	b.lo	LBB0_4
; %bb.2:
	cmp	w20, #0
	csel	w8, w8, w20, lt
	asr	w8, w8, #2
	add	w20, w23, w21
	cmp	w8, #1
	csinc	w23, w8, wzr, hi
Lloh25:
	adrp	x24, _mmRLC_GPM_UCODE_DATA@GOTPAGE
Lloh26:
	ldr	x24, [x24, _mmRLC_GPM_UCODE_DATA@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w21, [x24]
	mov	x0, x20
	bl	_le32_to_cpup
	mov	x1, x0
	mov	x0, x21
	bl	_WREG32
	add	w20, w20, #4
	subs	w23, w23, #1
	b.ne	LBB0_3
LBB0_4:
	ldr	w0, [x22]
	ldr	w1, [x19, #8]
	bl	_WREG32
	mov	x0, x19
	mov	w1, #0
	bl	_gfx_v7_0_enable_lbpw
	ldr	x8, [x19]
Lloh27:
	adrp	x9, _CHIP_BONAIRE@GOTPAGE
Lloh28:
	ldr	x9, [x9, _CHIP_BONAIRE@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
Lloh30:
	adrp	x8, _mmRLC_DRIVER_CPDMA_STATUS@GOTPAGE
Lloh31:
	ldr	x8, [x8, _mmRLC_DRIVER_CPDMA_STATUS@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_WREG32
LBB0_6:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	mov	w0, #0
	b	LBB0_8
LBB0_7:
Lloh33:
	adrp	x8, _EINVAL@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_mmRLC_CGCG_CGLS_CTRL,4,2       ; @mmRLC_CGCG_CGLS_CTRL
	.comm	_mmRLC_LB_CNTR_INIT,4,2         ; @mmRLC_LB_CNTR_INIT
	.comm	_mmRLC_LB_CNTR_MAX,4,2          ; @mmRLC_LB_CNTR_MAX
	.comm	_mmRLC_LB_INIT_CU_MASK,4,2      ; @mmRLC_LB_INIT_CU_MASK
	.comm	_mmRLC_LB_PARAMS,4,2            ; @mmRLC_LB_PARAMS
	.comm	_mmRLC_LB_CNTL,4,2              ; @mmRLC_LB_CNTL
	.comm	_mmRLC_MC_CNTL,4,2              ; @mmRLC_MC_CNTL
	.comm	_mmRLC_UCODE_CNTL,4,2           ; @mmRLC_UCODE_CNTL
	.comm	_mmRLC_GPM_UCODE_ADDR,4,2       ; @mmRLC_GPM_UCODE_ADDR
	.comm	_mmRLC_GPM_UCODE_DATA,4,2       ; @mmRLC_GPM_UCODE_DATA
	.comm	_CHIP_BONAIRE,8,3               ; @CHIP_BONAIRE
	.comm	_mmRLC_DRIVER_CPDMA_STATUS,4,2  ; @mmRLC_DRIVER_CPDMA_STATUS
	.no_dead_strip	_gfx_v7_0_rlc_resume
.subsections_via_symbols
