	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gmc_v8_0_polaris_mc_load_microcode
_gmc_v8_0_polaris_mc_load_microcode:    ## @gmc_v8_0_polaris_mc_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	callq	_amdgpu_sriov_bios
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_1
LBB0_13:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	16(%r13), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	(%rax), %r14
	movq	%r14, %rdi
	callq	_amdgpu_ucode_print_mc_hdr
	movl	8(%r14), %edi
	callq	_le32_to_cpu
	movl	%eax, 8(%r13)
	movl	16(%r14), %edi
	callq	_le32_to_cpu
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leal	7(%rax), %r12d
	testl	%eax, %eax
	cmovnsl	%eax, %r12d
	movq	16(%r13), %rax
	movq	(%rax), %rbx
	movl	12(%r14), %edi
	callq	_le32_to_cpu
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	4(%r14), %edi
	callq	_le32_to_cpu
                                        ## kill: def $eax killed $eax def $rax
	leal	3(%rax), %r15d
	testl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	cmovnsl	%eax, %r15d
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	16(%r13), %rax
	movq	(%rax), %r13
	movl	(%r14), %edi
	callq	_le32_to_cpu
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_mmMC_SEQ_MISC0@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_RREG32
	andl	$-65, %eax
	movl	(%r14), %edi
	movl	%eax, %esi
	callq	_WREG32
	cmpl	$8, -56(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_6
## %bb.4:
	sarl	$3, %r12d
	addl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_mmMC_SEQ_IO_DEBUG_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%ebx, %edi
	callq	_le32_to_cpup
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_WREG32
	movq	_mmMC_SEQ_IO_DEBUG_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leal	4(%rbx), %edi
	callq	_le32_to_cpup
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_WREG32
	addl	$8, %ebx
	decl	%r12d
	jne	LBB0_5
LBB0_6:
	movq	_mmMC_SEQ_SUP_CNTL@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movl	$8, %esi
	callq	_WREG32
	movl	(%r14), %edi
	movl	$16, %esi
	callq	_WREG32
	cmpl	$4, -64(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_9
## %bb.7:
	movslq	-48(%rbp), %rax                 ## 4-byte Folded Reload
	addq	%rax, %r13
	sarl	$2, %r15d
	movq	_mmMC_SEQ_SUP_PGM@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %ebx
	movl	%r13d, %edi
	callq	_le32_to_cpup
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_WREG32
	addl	$4, %r13d
	decl	%r15d
	jne	LBB0_8
LBB0_9:
	movl	(%r14), %edi
	movl	$8, %esi
	callq	_WREG32
	movl	(%r14), %edi
	movl	$4, %esi
	callq	_WREG32
	movl	(%r14), %edi
	movl	$1, %esi
	callq	_WREG32
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	cmpl	$0, (%r15)
	movl	$0, %r14d
	jle	LBB0_13
## %bb.10:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	movq	_mmMC_SEQ_MISC0@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	callq	_RREG32
	testb	$-128, %al
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	$1, %edi
	callq	_udelay
	incl	%ebx
	cmpl	(%r15), %ebx
	jl	LBB0_11
	jmp	LBB0_13
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_mmMC_SEQ_MISC0,4,2             ## @mmMC_SEQ_MISC0
	.comm	_mmMC_SEQ_IO_DEBUG_INDEX,4,2    ## @mmMC_SEQ_IO_DEBUG_INDEX
	.comm	_mmMC_SEQ_IO_DEBUG_DATA,4,2     ## @mmMC_SEQ_IO_DEBUG_DATA
	.comm	_mmMC_SEQ_SUP_CNTL,4,2          ## @mmMC_SEQ_SUP_CNTL
	.comm	_mmMC_SEQ_SUP_PGM,4,2           ## @mmMC_SEQ_SUP_PGM
	.no_dead_strip	_gmc_v8_0_polaris_mc_load_microcode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gmc_v8_0_polaris_mc_load_microcode
_gmc_v8_0_polaris_mc_load_microcode:    ; @gmc_v8_0_polaris_mc_load_microcode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x0
	bl	_amdgpu_sriov_bios
	cbz	x0, LBB0_3
LBB0_1:
	mov	w0, #0
LBB0_2:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_3:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_14
; %bb.4:
	ldr	x21, [x8]
	mov	x0, x21
	bl	_amdgpu_ucode_print_mc_hdr
	ldr	w0, [x21, #8]
	bl	_le32_to_cpu
	str	w0, [x19, #8]
	ldr	w0, [x21, #16]
	bl	_le32_to_cpu
	mov	x23, x0
	add	w8, w0, #7
	cmp	w0, #0
	csel	w28, w8, w0, lt
	ldr	x8, [x19, #16]
	ldr	x27, [x8]
	ldr	w0, [x21, #12]
	bl	_le32_to_cpu
	mov	x22, x0
	ldr	w0, [x21, #4]
	bl	_le32_to_cpu
	mov	x20, x0
	add	w8, w0, #3
	cmp	w0, #0
	csel	w26, w8, w0, lt
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	ldr	w0, [x21]
	bl	_le32_to_cpu
	mov	x21, x0
Lloh0:
	adrp	x24, _mmMC_SEQ_MISC0@GOTPAGE
Lloh1:
	ldr	x24, [x24, _mmMC_SEQ_MISC0@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_RREG32
	and	w1, w0, #0xffffffbf
	ldr	w0, [x24]
	bl	_WREG32
	cmp	w23, #8
	b.lt	LBB0_7
; %bb.5:
	asr	w28, w28, #3
	add	w22, w27, w22
Lloh2:
	adrp	x27, _mmMC_SEQ_IO_DEBUG_INDEX@GOTPAGE
Lloh3:
	ldr	x27, [x27, _mmMC_SEQ_IO_DEBUG_INDEX@GOTPAGEOFF]
Lloh4:
	adrp	x25, _mmMC_SEQ_IO_DEBUG_DATA@GOTPAGE
Lloh5:
	ldr	x25, [x25, _mmMC_SEQ_IO_DEBUG_DATA@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w23, [x27]
	mov	x0, x22
	bl	_le32_to_cpup
	mov	x1, x0
	mov	x0, x23
	bl	_WREG32
	ldr	w23, [x25]
	add	w0, w22, #4
	bl	_le32_to_cpup
	mov	x1, x0
	mov	x0, x23
	bl	_WREG32
	add	w22, w22, #8
	subs	w28, w28, #1
	b.ne	LBB0_6
LBB0_7:
Lloh6:
	adrp	x22, _mmMC_SEQ_SUP_CNTL@GOTPAGE
Lloh7:
	ldr	x22, [x22, _mmMC_SEQ_SUP_CNTL@GOTPAGEOFF]
	ldr	w0, [x22]
	mov	w1, #8
	bl	_WREG32
	ldr	w0, [x22]
	mov	w1, #16
	bl	_WREG32
	cmp	w20, #4
	b.lt	LBB0_10
; %bb.8:
	asr	w23, w26, #2
Lloh8:
	adrp	x25, _mmMC_SEQ_SUP_PGM@GOTPAGE
Lloh9:
	ldr	x25, [x25, _mmMC_SEQ_SUP_PGM@GOTPAGEOFF]
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	add	x20, x8, w21, sxtw
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w21, [x25]
	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_9
LBB0_10:
	ldr	w0, [x22]
	mov	w1, #8
	bl	_WREG32
	ldr	w0, [x22]
	mov	w1, #4
	bl	_WREG32
	ldr	w0, [x22]
	mov	w1, #1
	bl	_WREG32
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_1
; %bb.11:
	mov	w20, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x24]
	bl	_RREG32
	tbnz	w0, #7, LBB0_1
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	w0, #1
	bl	_udelay
	add	w20, w20, #1
	ldr	w8, [x19]
	cmp	w20, w8
	b.lt	LBB0_12
	b	LBB0_1
LBB0_14:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_mmMC_SEQ_MISC0,4,2             ; @mmMC_SEQ_MISC0
	.comm	_mmMC_SEQ_IO_DEBUG_INDEX,4,2    ; @mmMC_SEQ_IO_DEBUG_INDEX
	.comm	_mmMC_SEQ_IO_DEBUG_DATA,4,2     ; @mmMC_SEQ_IO_DEBUG_DATA
	.comm	_mmMC_SEQ_SUP_CNTL,4,2          ; @mmMC_SEQ_SUP_CNTL
	.comm	_mmMC_SEQ_SUP_PGM,4,2           ; @mmMC_SEQ_SUP_PGM
	.no_dead_strip	_gmc_v8_0_polaris_mc_load_microcode
.subsections_via_symbols
