	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ci_upload_firmware
_ci_upload_firmware:                    ## @ci_upload_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
	callq	_ci_is_smc_ram_running
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_2:
	movq	_SMC_IND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RCU_UC_EVENTS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_boot_seq_done@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	$1, %r8d
	callq	_PHM_WAIT_INDIRECT_FIELD
	movl	(%rbx), %edi
	movq	_CGS_IND_REG__SMC@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_SMC_SYSCON_MISC_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_pre_fetcher_en@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %r8d
	callq	_PHM_WRITE_INDIRECT_FIELD
	movl	(%rbx), %edi
	movl	(%r14), %esi
	movq	_SMC_SYSCON_CLOCK_CNTL_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ck_disable@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %r8d
	callq	_PHM_WRITE_INDIRECT_FIELD
	movl	(%rbx), %edi
	movl	(%r14), %esi
	movq	_SMC_SYSCON_RESET_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_rst_reg@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %r8d
	callq	_PHM_WRITE_INDIRECT_FIELD
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_ci_load_smc_ucode              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"smc is running, no need to load smc firmware\n"

	.comm	_SMC_IND,4,2                    ## @SMC_IND
	.comm	_RCU_UC_EVENTS,4,2              ## @RCU_UC_EVENTS
	.comm	_boot_seq_done,4,2              ## @boot_seq_done
	.comm	_CGS_IND_REG__SMC,4,2           ## @CGS_IND_REG__SMC
	.comm	_SMC_SYSCON_MISC_CNTL,4,2       ## @SMC_SYSCON_MISC_CNTL
	.comm	_pre_fetcher_en,4,2             ## @pre_fetcher_en
	.comm	_SMC_SYSCON_CLOCK_CNTL_0,4,2    ## @SMC_SYSCON_CLOCK_CNTL_0
	.comm	_ck_disable,4,2                 ## @ck_disable
	.comm	_SMC_SYSCON_RESET_CNTL,4,2      ## @SMC_SYSCON_RESET_CNTL
	.comm	_rst_reg,4,2                    ## @rst_reg
	.no_dead_strip	_ci_upload_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ci_upload_firmware
_ci_upload_firmware:                    ; @ci_upload_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
	bl	_ci_is_smc_ram_running
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_2:
Lloh2:
	adrp	x8, _SMC_IND@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SMC_IND@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x8, _RCU_UC_EVENTS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RCU_UC_EVENTS@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x8, _boot_seq_done@GOTPAGE
Lloh9:
	ldr	x8, [x8, _boot_seq_done@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w4, #1
	bl	_PHM_WAIT_INDIRECT_FIELD
	ldr	w0, [x19]
Lloh11:
	adrp	x20, _CGS_IND_REG__SMC@GOTPAGE
Lloh12:
	ldr	x20, [x20, _CGS_IND_REG__SMC@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh13:
	adrp	x8, _SMC_SYSCON_MISC_CNTL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SMC_SYSCON_MISC_CNTL@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
Lloh16:
	adrp	x8, _pre_fetcher_en@GOTPAGE
Lloh17:
	ldr	x8, [x8, _pre_fetcher_en@GOTPAGEOFF]
Lloh18:
	ldr	w3, [x8]
	mov	w4, #1
	bl	_PHM_WRITE_INDIRECT_FIELD
	ldr	w0, [x19]
	ldr	w1, [x20]
Lloh19:
	adrp	x8, _SMC_SYSCON_CLOCK_CNTL_0@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SMC_SYSCON_CLOCK_CNTL_0@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
Lloh22:
	adrp	x8, _ck_disable@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ck_disable@GOTPAGEOFF]
Lloh24:
	ldr	w3, [x8]
	mov	w4, #1
	bl	_PHM_WRITE_INDIRECT_FIELD
	ldr	w0, [x19]
	ldr	w1, [x20]
Lloh25:
	adrp	x8, _SMC_SYSCON_RESET_CNTL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SMC_SYSCON_RESET_CNTL@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
Lloh28:
	adrp	x8, _rst_reg@GOTPAGE
Lloh29:
	ldr	x8, [x8, _rst_reg@GOTPAGEOFF]
Lloh30:
	ldr	w3, [x8]
	mov	w4, #1
	bl	_PHM_WRITE_INDIRECT_FIELD
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_ci_load_smc_ucode
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"smc is running, no need to load smc firmware\n"

	.comm	_SMC_IND,4,2                    ; @SMC_IND
	.comm	_RCU_UC_EVENTS,4,2              ; @RCU_UC_EVENTS
	.comm	_boot_seq_done,4,2              ; @boot_seq_done
	.comm	_CGS_IND_REG__SMC,4,2           ; @CGS_IND_REG__SMC
	.comm	_SMC_SYSCON_MISC_CNTL,4,2       ; @SMC_SYSCON_MISC_CNTL
	.comm	_pre_fetcher_en,4,2             ; @pre_fetcher_en
	.comm	_SMC_SYSCON_CLOCK_CNTL_0,4,2    ; @SMC_SYSCON_CLOCK_CNTL_0
	.comm	_ck_disable,4,2                 ; @ck_disable
	.comm	_SMC_SYSCON_RESET_CNTL,4,2      ; @SMC_SYSCON_RESET_CNTL
	.comm	_rst_reg,4,2                    ; @rst_reg
	.no_dead_strip	_ci_upload_firmware
.subsections_via_symbols
