	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_v7_0_cp_compute_load_microcode
_gfx_v7_0_cp_compute_load_microcode:    ## @gfx_v7_0_cp_compute_load_microcode
	.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	32(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r15
	movq	(%rax), %r12
	movq	%r12, %rdi
	callq	_amdgpu_ucode_print_gfx_hdr
	movl	8(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, 8(%r15)
	movl	12(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, 12(%r15)
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_gfx_v7_0_cp_compute_enable
	movq	32(%r15), %rax
	movq	(%rax), %r13
	movl	4(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, %ebx
	movl	(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, %r12d
	movq	_mmCP_MEC_ME1_UCODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	leal	3(%r12), %eax
	cmpl	$7, %eax
	jb	LBB0_5
## %bb.3:
	testl	%r12d, %r12d
	cmovnsl	%r12d, %eax
	sarl	$2, %eax
	addl	%ebx, %r13d
	cmpl	$2, %eax
	movl	$1, %ebx
	cmovael	%eax, %ebx
	movq	_mmCP_MEC_ME1_UCODE_DATA@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %r12d
	movl	%r13d, %edi
	callq	_le32_to_cpup
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_WREG32
	addl	$4, %r13d
	decl	%ebx
	jne	LBB0_4
LBB0_5:
	movq	_mmCP_MEC_ME1_UCODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	movq	(%r15), %rax
	movq	_CHIP_KAVERI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movl	$0, %eax
	jne	LBB0_11
## %bb.6:
	movq	24(%r15), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.7:
	movq	(%rax), %r14
	movq	%r14, %rdi
	callq	_amdgpu_ucode_print_gfx_hdr
	movl	8(%r14), %edi
	callq	_le32_to_cpu
	movl	%eax, 16(%r15)
	movl	12(%r14), %edi
	callq	_le32_to_cpu
	movl	%eax, 20(%r15)
	movq	24(%r15), %rax
	movq	(%rax), %r13
	movl	4(%r14), %edi
	callq	_le32_to_cpu
	movl	%eax, %r15d
	movl	(%r14), %edi
	callq	_le32_to_cpu
	movl	%eax, %r12d
	movq	_mmCP_MEC_ME2_UCODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	leal	3(%r12), %eax
	cmpl	$7, %eax
	jb	LBB0_10
## %bb.8:
	testl	%r12d, %r12d
	cmovnsl	%r12d, %eax
	sarl	$2, %eax
	addl	%r15d, %r13d
	cmpl	$2, %eax
	movl	$1, %ebx
	cmovael	%eax, %ebx
	movq	_mmCP_MEC_ME2_UCODE_DATA@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %r15d
	movl	%r13d, %edi
	callq	_le32_to_cpup
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_WREG32
	addl	$4, %r13d
	decl	%ebx
	jne	LBB0_9
LBB0_10:
	movq	_mmCP_MEC_ME2_UCODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	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	_mmCP_MEC_ME1_UCODE_ADDR,4,2    ## @mmCP_MEC_ME1_UCODE_ADDR
	.comm	_mmCP_MEC_ME1_UCODE_DATA,4,2    ## @mmCP_MEC_ME1_UCODE_DATA
	.comm	_CHIP_KAVERI,8,3                ## @CHIP_KAVERI
	.comm	_mmCP_MEC_ME2_UCODE_ADDR,4,2    ## @mmCP_MEC_ME2_UCODE_ADDR
	.comm	_mmCP_MEC_ME2_UCODE_DATA,4,2    ## @mmCP_MEC_ME2_UCODE_DATA
	.no_dead_strip	_gfx_v7_0_cp_compute_load_microcode
.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_cp_compute_load_microcode
_gfx_v7_0_cp_compute_load_microcode:    ; @gfx_v7_0_cp_compute_load_microcode
	.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, #32]
	cbz	x8, LBB0_10
; %bb.1:
	mov	x19, x0
	ldr	x21, [x8]
	mov	x0, x21
	bl	_amdgpu_ucode_print_gfx_hdr
	ldr	w0, [x21, #8]
	bl	_le32_to_cpu
	str	w0, [x19, #8]
	ldr	w0, [x21, #12]
	bl	_le32_to_cpu
	str	w0, [x19, #12]
	mov	x0, x19
	mov	w1, #0
	bl	_gfx_v7_0_cp_compute_enable
	ldr	x8, [x19, #32]
	ldr	x23, [x8]
	ldr	w0, [x21, #4]
	bl	_le32_to_cpu
	mov	x20, x0
	ldr	w0, [x21]
	bl	_le32_to_cpu
	mov	x21, x0
Lloh0:
	adrp	x22, _mmCP_MEC_ME1_UCODE_ADDR@GOTPAGE
Lloh1:
	ldr	x22, [x22, _mmCP_MEC_ME1_UCODE_ADDR@GOTPAGEOFF]
	ldr	w0, [x22]
	mov	w1, #0
	bl	_WREG32
	add	w8, w21, #3
	cmp	w8, #7
	b.lo	LBB0_4
; %bb.2:
	cmp	w21, #0
	csel	w8, w8, w21, lt
	asr	w8, w8, #2
	add	w20, w23, w20
	cmp	w8, #1
	csinc	w23, w8, wzr, hi
Lloh2:
	adrp	x24, _mmCP_MEC_ME1_UCODE_DATA@GOTPAGE
Lloh3:
	ldr	x24, [x24, _mmCP_MEC_ME1_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]
	mov	w1, #0
	bl	_WREG32
	mov	w0, #0
	ldr	x8, [x19]
Lloh4:
	adrp	x9, _CHIP_KAVERI@GOTPAGE
Lloh5:
	ldr	x9, [x9, _CHIP_KAVERI@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.5:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_10
; %bb.6:
	ldr	x20, [x8]
	mov	x0, x20
	bl	_amdgpu_ucode_print_gfx_hdr
	ldr	w0, [x20, #8]
	bl	_le32_to_cpu
	str	w0, [x19, #16]
	ldr	w0, [x20, #12]
	bl	_le32_to_cpu
	str	w0, [x19, #20]
	ldr	x8, [x19, #24]
	ldr	x22, [x8]
	ldr	w0, [x20, #4]
	bl	_le32_to_cpu
	mov	x19, x0
	ldr	w0, [x20]
	bl	_le32_to_cpu
	mov	x20, x0
Lloh7:
	adrp	x21, _mmCP_MEC_ME2_UCODE_ADDR@GOTPAGE
Lloh8:
	ldr	x21, [x21, _mmCP_MEC_ME2_UCODE_ADDR@GOTPAGEOFF]
	ldr	w0, [x21]
	mov	w1, #0
	bl	_WREG32
	add	w8, w20, #3
	cmp	w8, #7
	b.lo	LBB0_9
; %bb.7:
	cmp	w20, #0
	csel	w8, w8, w20, lt
	asr	w8, w8, #2
	add	w19, w22, w19
	cmp	w8, #1
	csinc	w22, w8, wzr, hi
Lloh9:
	adrp	x23, _mmCP_MEC_ME2_UCODE_DATA@GOTPAGE
Lloh10:
	ldr	x23, [x23, _mmCP_MEC_ME2_UCODE_DATA@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w20, [x23]
	mov	x0, x19
	bl	_le32_to_cpup
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
	add	w19, w19, #4
	subs	w22, w22, #1
	b.ne	LBB0_8
LBB0_9:
	ldr	w0, [x21]
	mov	w1, #0
	bl	_WREG32
	mov	w0, #0
	b	LBB0_11
LBB0_10:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_mmCP_MEC_ME1_UCODE_ADDR,4,2    ; @mmCP_MEC_ME1_UCODE_ADDR
	.comm	_mmCP_MEC_ME1_UCODE_DATA,4,2    ; @mmCP_MEC_ME1_UCODE_DATA
	.comm	_CHIP_KAVERI,8,3                ; @CHIP_KAVERI
	.comm	_mmCP_MEC_ME2_UCODE_ADDR,4,2    ; @mmCP_MEC_ME2_UCODE_ADDR
	.comm	_mmCP_MEC_ME2_UCODE_DATA,4,2    ; @mmCP_MEC_ME2_UCODE_DATA
	.no_dead_strip	_gfx_v7_0_cp_compute_load_microcode
.subsections_via_symbols
