	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_v7_0_cp_gfx_load_microcode
_gfx_v7_0_cp_gfx_load_microcode:        ## @gfx_v7_0_cp_gfx_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
	subq	$24, %rsp
	.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_3
## %bb.1:
	movq	%rdi, %r13
	movq	40(%rdi), %rcx
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.2:
	movq	32(%r13), %rdx
	testq	%rdx, %rdx
	je	LBB0_3
## %bb.4:
	movq	(%rcx), %r12
	movq	(%rdx), %r14
	movq	(%rax), %rbx
	movq	%r12, %rdi
	callq	_amdgpu_ucode_print_gfx_hdr
	movq	%r14, %rdi
	callq	_amdgpu_ucode_print_gfx_hdr
	movq	%rbx, %rdi
	callq	_amdgpu_ucode_print_gfx_hdr
	movl	8(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, (%r13)
	movl	8(%r14), %edi
	callq	_le32_to_cpu
	movl	%eax, 4(%r13)
	movl	8(%rbx), %edi
	callq	_le32_to_cpu
	movl	%eax, 8(%r13)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	12(%rbx), %edi
	callq	_le32_to_cpu
	movl	%eax, 12(%r13)
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	12(%r14), %edi
	callq	_le32_to_cpu
	movl	%eax, 16(%r13)
	movl	12(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, 20(%r13)
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_gfx_v7_0_cp_gfx_enable
	movq	40(%r13), %rax
	movq	(%rax), %r15
	movl	4(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, %r14d
	movl	(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, %r12d
	movq	_mmCP_PFP_UCODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	leal	3(%r12), %eax
	cmpl	$7, %eax
	jb	LBB0_7
## %bb.5:
	testl	%r12d, %r12d
	cmovnsl	%r12d, %eax
	sarl	$2, %eax
	addl	%r14d, %r15d
	cmpl	$2, %eax
	movl	$1, %ebx
	cmovael	%eax, %ebx
	movq	_mmCP_PFP_UCODE_DATA@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %r14d
	movl	%r15d, %edi
	callq	_le32_to_cpup
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_WREG32
	addl	$4, %r15d
	decl	%ebx
	jne	LBB0_6
LBB0_7:
	movq	_mmCP_PFP_UCODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r13), %esi
	callq	_WREG32
	movq	32(%r13), %rax
	movq	(%rax), %r15
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	4(%rbx), %edi
	callq	_le32_to_cpu
	movl	%eax, %r12d
	movl	(%rbx), %edi
	callq	_le32_to_cpu
	movl	%eax, %r14d
	movq	_mmCP_CE_UCODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	leal	3(%r14), %eax
	cmpl	$7, %eax
	jb	LBB0_10
## %bb.8:
	testl	%r14d, %r14d
	cmovnsl	%r14d, %eax
	sarl	$2, %eax
	addl	%r12d, %r15d
	cmpl	$2, %eax
	movl	$1, %ebx
	cmovael	%eax, %ebx
	movq	_mmCP_CE_UCODE_DATA@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %r14d
	movl	%r15d, %edi
	callq	_le32_to_cpup
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_WREG32
	addl	$4, %r15d
	decl	%ebx
	jne	LBB0_9
LBB0_10:
	movq	_mmCP_CE_UCODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%r13), %esi
	callq	_WREG32
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	24(%r13), %rax
	movq	(%rax), %r12
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	4(%rbx), %edi
	callq	_le32_to_cpu
	movl	%eax, %r15d
	movl	(%rbx), %edi
	callq	_le32_to_cpu
	movl	%eax, %ebx
	movq	_mmCP_ME_RAM_WADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_WREG32
	leal	3(%rbx), %eax
	cmpl	$7, %eax
	jb	LBB0_13
## %bb.11:
	testl	%ebx, %ebx
	cmovnsl	%ebx, %eax
	sarl	$2, %eax
	addl	%r15d, %r12d
	cmpl	$2, %eax
	movl	$1, %ebx
	cmovael	%eax, %ebx
	movq	_mmCP_ME_RAM_DATA@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %r15d
	movl	%r12d, %edi
	callq	_le32_to_cpup
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_WREG32
	addl	$4, %r12d
	decl	%ebx
	jne	LBB0_12
LBB0_13:
	movq	_mmCP_ME_RAM_WADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %esi
	callq	_WREG32
	jmp	LBB0_14
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_14:
	movl	%r14d, %eax
	addq	$24, %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_PFP_UCODE_ADDR,4,2        ## @mmCP_PFP_UCODE_ADDR
	.comm	_mmCP_PFP_UCODE_DATA,4,2        ## @mmCP_PFP_UCODE_DATA
	.comm	_mmCP_CE_UCODE_ADDR,4,2         ## @mmCP_CE_UCODE_ADDR
	.comm	_mmCP_CE_UCODE_DATA,4,2         ## @mmCP_CE_UCODE_DATA
	.comm	_mmCP_ME_RAM_WADDR,4,2          ## @mmCP_ME_RAM_WADDR
	.comm	_mmCP_ME_RAM_DATA,4,2           ## @mmCP_ME_RAM_DATA
	.no_dead_strip	_gfx_v7_0_cp_gfx_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_gfx_load_microcode
_gfx_v7_0_cp_gfx_load_microcode:        ; @gfx_v7_0_cp_gfx_load_microcode
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_13
; %bb.1:
	mov	x19, x0
	ldr	x9, [x0, #40]
	cbz	x9, LBB0_13
; %bb.2:
	ldr	x10, [x19, #32]
	cbz	x10, LBB0_13
; %bb.3:
	ldr	x22, [x9]
	ldr	x21, [x10]
	ldr	x20, [x8]
	mov	x0, x22
	bl	_amdgpu_ucode_print_gfx_hdr
	mov	x0, x21
	bl	_amdgpu_ucode_print_gfx_hdr
	mov	x0, x20
	bl	_amdgpu_ucode_print_gfx_hdr
	ldr	w0, [x22, #8]
	bl	_le32_to_cpu
	str	w0, [x19]
	ldr	w0, [x21, #8]
	bl	_le32_to_cpu
	str	w0, [x19, #4]
	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	w0, [x21, #12]
	bl	_le32_to_cpu
	str	w0, [x19, #16]
	ldr	w0, [x22, #12]
	bl	_le32_to_cpu
	str	w0, [x19, #20]
	mov	x0, x19
	mov	w1, #0
	bl	_gfx_v7_0_cp_gfx_enable
	ldr	x8, [x19, #40]
	ldr	x25, [x8]
	ldr	w0, [x22, #4]
	bl	_le32_to_cpu
	mov	x23, x0
	ldr	w0, [x22]
	bl	_le32_to_cpu
	mov	x22, x0
Lloh0:
	adrp	x24, _mmCP_PFP_UCODE_ADDR@GOTPAGE
Lloh1:
	ldr	x24, [x24, _mmCP_PFP_UCODE_ADDR@GOTPAGEOFF]
	ldr	w0, [x24]
	mov	w1, #0
	bl	_WREG32
	add	w8, w22, #3
	cmp	w8, #7
	b.lo	LBB0_6
; %bb.4:
	cmp	w22, #0
	csel	w8, w8, w22, lt
	asr	w8, w8, #2
	add	w22, w25, w23
	cmp	w8, #1
	csinc	w25, w8, wzr, hi
Lloh2:
	adrp	x26, _mmCP_PFP_UCODE_DATA@GOTPAGE
Lloh3:
	ldr	x26, [x26, _mmCP_PFP_UCODE_DATA@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w23, [x26]
	mov	x0, x22
	bl	_le32_to_cpup
	mov	x1, x0
	mov	x0, x23
	bl	_WREG32
	add	w22, w22, #4
	subs	w25, w25, #1
	b.ne	LBB0_5
LBB0_6:
	ldr	w0, [x24]
	ldr	w1, [x19]
	bl	_WREG32
	ldr	x8, [x19, #32]
	ldr	x24, [x8]
	ldr	w0, [x21, #4]
	bl	_le32_to_cpu
	mov	x22, x0
	ldr	w0, [x21]
	bl	_le32_to_cpu
	mov	x21, x0
Lloh4:
	adrp	x23, _mmCP_CE_UCODE_ADDR@GOTPAGE
Lloh5:
	ldr	x23, [x23, _mmCP_CE_UCODE_ADDR@GOTPAGEOFF]
	ldr	w0, [x23]
	mov	w1, #0
	bl	_WREG32
	add	w8, w21, #3
	cmp	w8, #7
	b.lo	LBB0_9
; %bb.7:
	cmp	w21, #0
	csel	w8, w8, w21, lt
	asr	w8, w8, #2
	add	w21, w24, w22
	cmp	w8, #1
	csinc	w24, w8, wzr, hi
Lloh6:
	adrp	x25, _mmCP_CE_UCODE_DATA@GOTPAGE
Lloh7:
	ldr	x25, [x25, _mmCP_CE_UCODE_DATA@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w22, [x25]
	mov	x0, x21
	bl	_le32_to_cpup
	mov	x1, x0
	mov	x0, x22
	bl	_WREG32
	add	w21, w21, #4
	subs	w24, w24, #1
	b.ne	LBB0_8
LBB0_9:
	ldr	w0, [x23]
	ldr	w1, [x19, #4]
	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
Lloh8:
	adrp	x22, _mmCP_ME_RAM_WADDR@GOTPAGE
Lloh9:
	ldr	x22, [x22, _mmCP_ME_RAM_WADDR@GOTPAGEOFF]
	ldr	w0, [x22]
	mov	w1, #0
	bl	_WREG32
	add	w8, w20, #3
	cmp	w8, #7
	b.lo	LBB0_12
; %bb.10:
	cmp	w20, #0
	csel	w8, w8, w20, lt
	asr	w8, w8, #2
	add	w20, w23, w21
	cmp	w8, #1
	csinc	w23, w8, wzr, hi
Lloh10:
	adrp	x24, _mmCP_ME_RAM_DATA@GOTPAGE
Lloh11:
	ldr	x24, [x24, _mmCP_ME_RAM_DATA@GOTPAGEOFF]
LBB0_11:                                ; =>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_11
LBB0_12:
	ldr	w0, [x22]
	ldr	w1, [x19, #8]
	bl	_WREG32
	mov	w0, #0
	b	LBB0_14
LBB0_13:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_mmCP_PFP_UCODE_ADDR,4,2        ; @mmCP_PFP_UCODE_ADDR
	.comm	_mmCP_PFP_UCODE_DATA,4,2        ; @mmCP_PFP_UCODE_DATA
	.comm	_mmCP_CE_UCODE_ADDR,4,2         ; @mmCP_CE_UCODE_ADDR
	.comm	_mmCP_CE_UCODE_DATA,4,2         ; @mmCP_CE_UCODE_DATA
	.comm	_mmCP_ME_RAM_WADDR,4,2          ; @mmCP_ME_RAM_WADDR
	.comm	_mmCP_ME_RAM_DATA,4,2           ; @mmCP_ME_RAM_DATA
	.no_dead_strip	_gfx_v7_0_cp_gfx_load_microcode
.subsections_via_symbols
