	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smu7_check_mc_firmware
_smu7_check_mc_firmware:                ## @smu7_check_mc_firmware
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %r14
	callq	_smu7_get_mc_microcode_version
	movl	$0, (%r14)
	movl	8(%rbx), %edi
	movq	_mmMC_SEQ_IO_DEBUG_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ixMC_IO_DEBUG_UP_13@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_cgs_write_register
	movl	8(%rbx), %edi
	movq	_mmMC_SEQ_IO_DEBUG_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_cgs_read_register
	testl	$8388608, %eax                  ## imm = 0x800000
	jne	LBB0_1
## %bb.2:
	movabsq	$1417339208010, %rax            ## imm = 0x14A0000014A
	movq	%rax, 4(%r14)
	movq	(%rbx), %rcx
	movq	_CHIP_POLARIS10@GOTPCREL(%rip), %rdx
	movq	_PPSMC_MSG_DisableFFC@GOTPCREL(%rip), %rax
	cmpq	(%rdx), %rcx
	jne	LBB0_4
	jmp	LBB0_6
LBB0_1:
	movq	_MEM_LATENCY_HIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
	movq	_MEM_LATENCY_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movq	(%rbx), %rcx
	movq	_CHIP_POLARIS10@GOTPCREL(%rip), %rdx
	movq	_PPSMC_MSG_EnableFFC@GOTPCREL(%rip), %rax
	cmpq	(%rdx), %rcx
	je	LBB0_6
LBB0_4:
	movq	_CHIP_POLARIS11@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_6
## %bb.5:
	movq	_CHIP_POLARIS12@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_7
LBB0_6:
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_smum_send_msg_to_smc
LBB0_7:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mmMC_SEQ_IO_DEBUG_INDEX,4,2    ## @mmMC_SEQ_IO_DEBUG_INDEX
	.comm	_ixMC_IO_DEBUG_UP_13,4,2        ## @ixMC_IO_DEBUG_UP_13
	.comm	_mmMC_SEQ_IO_DEBUG_DATA,4,2     ## @mmMC_SEQ_IO_DEBUG_DATA
	.comm	_MEM_LATENCY_HIGH,4,2           ## @MEM_LATENCY_HIGH
	.comm	_MEM_LATENCY_LOW,4,2            ## @MEM_LATENCY_LOW
	.comm	_CHIP_POLARIS10,8,3             ## @CHIP_POLARIS10
	.comm	_CHIP_POLARIS11,8,3             ## @CHIP_POLARIS11
	.comm	_CHIP_POLARIS12,8,3             ## @CHIP_POLARIS12
	.comm	_PPSMC_MSG_EnableFFC,4,2        ## @PPSMC_MSG_EnableFFC
	.comm	_PPSMC_MSG_DisableFFC,4,2       ## @PPSMC_MSG_DisableFFC
	.no_dead_strip	_smu7_check_mc_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smu7_check_mc_firmware
_smu7_check_mc_firmware:                ; @smu7_check_mc_firmware
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x20, [x0, #16]
	bl	_smu7_get_mc_microcode_version
	str	wzr, [x20]
	ldr	w0, [x19, #8]
Lloh0:
	adrp	x8, _mmMC_SEQ_IO_DEBUG_INDEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mmMC_SEQ_IO_DEBUG_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _ixMC_IO_DEBUG_UP_13@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ixMC_IO_DEBUG_UP_13@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_cgs_write_register
	ldr	w0, [x19, #8]
Lloh6:
	adrp	x8, _mmMC_SEQ_IO_DEBUG_DATA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _mmMC_SEQ_IO_DEBUG_DATA@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_cgs_read_register
	tbnz	w0, #23, LBB0_3
; %bb.1:
	mov	w8, #330
	dup.2s	v0, w8
	stur	d0, [x20, #4]
	ldr	x8, [x19]
Lloh9:
	adrp	x9, _CHIP_POLARIS10@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CHIP_POLARIS10@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
Lloh12:
	adrp	x10, _CHIP_POLARIS11@GOTPAGE
Lloh13:
	ldr	x10, [x10, _CHIP_POLARIS11@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x10]
Lloh15:
	adrp	x11, _CHIP_POLARIS12@GOTPAGE
Lloh16:
	ldr	x11, [x11, _CHIP_POLARIS12@GOTPAGEOFF]
Lloh17:
	ldr	x11, [x11]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	ccmp	x8, x11, #4, ne
	b.ne	LBB0_7
; %bb.2:
Lloh18:
	adrp	x8, _PPSMC_MSG_DisableFFC@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PPSMC_MSG_DisableFFC@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:
Lloh20:
	adrp	x8, _MEM_LATENCY_HIGH@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MEM_LATENCY_HIGH@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
Lloh23:
	adrp	x9, _MEM_LATENCY_LOW@GOTPAGE
Lloh24:
	ldr	x9, [x9, _MEM_LATENCY_LOW@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	stp	w8, w9, [x20, #4]
	ldr	x9, [x19]
Lloh26:
	adrp	x8, _CHIP_POLARIS10@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CHIP_POLARIS10@GOTPAGEOFF]
Lloh28:
	ldr	x10, [x8]
Lloh29:
	adrp	x8, _PPSMC_MSG_EnableFFC@GOTPAGE
Lloh30:
	ldr	x8, [x8, _PPSMC_MSG_EnableFFC@GOTPAGEOFF]
	cmp	x9, x10
	b.eq	LBB0_6
; %bb.4:
Lloh31:
	adrp	x10, _CHIP_POLARIS11@GOTPAGE
Lloh32:
	ldr	x10, [x10, _CHIP_POLARIS11@GOTPAGEOFF]
Lloh33:
	ldr	x10, [x10]
	cmp	x9, x10
	b.eq	LBB0_6
; %bb.5:
Lloh34:
	adrp	x10, _CHIP_POLARIS12@GOTPAGE
Lloh35:
	ldr	x10, [x10, _CHIP_POLARIS12@GOTPAGEOFF]
Lloh36:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_7
LBB0_6:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_smum_send_msg_to_smc
LBB0_7:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_mmMC_SEQ_IO_DEBUG_INDEX,4,2    ; @mmMC_SEQ_IO_DEBUG_INDEX
	.comm	_ixMC_IO_DEBUG_UP_13,4,2        ; @ixMC_IO_DEBUG_UP_13
	.comm	_mmMC_SEQ_IO_DEBUG_DATA,4,2     ; @mmMC_SEQ_IO_DEBUG_DATA
	.comm	_MEM_LATENCY_HIGH,4,2           ; @MEM_LATENCY_HIGH
	.comm	_MEM_LATENCY_LOW,4,2            ; @MEM_LATENCY_LOW
	.comm	_CHIP_POLARIS10,8,3             ; @CHIP_POLARIS10
	.comm	_CHIP_POLARIS11,8,3             ; @CHIP_POLARIS11
	.comm	_CHIP_POLARIS12,8,3             ; @CHIP_POLARIS12
	.comm	_PPSMC_MSG_EnableFFC,4,2        ; @PPSMC_MSG_EnableFFC
	.comm	_PPSMC_MSG_DisableFFC,4,2       ; @PPSMC_MSG_DisableFFC
	.no_dead_strip	_smu7_check_mc_firmware
.subsections_via_symbols
