	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tonga_start_in_protection_mode
_tonga_start_in_protection_mode:        ## @tonga_start_in_protection_mode
	.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	%rdi, %rbx
	movl	(%rdi), %edi
	movq	_CGS_IND_REG__SMC@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_SMC_SYSCON_RESET_CNTL@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	_rst_reg@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movl	$1, %r8d
	callq	_PHM_WRITE_VFPF_INDIRECT_FIELD
	movq	%rbx, %rdi
	callq	_smu7_upload_smu_firmware_image
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_4
## %bb.1:
	movl	(%rbx), %edi
	movl	(%r15), %esi
	movq	_ixSMU_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r14d, %r14d
	xorl	%ecx, %ecx
	callq	_cgs_write_ind_register
	movl	(%rbx), %edi
	movl	(%r15), %esi
	movq	_SMC_SYSCON_CLOCK_CNTL_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ck_disable@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%r8d, %r8d
	callq	_PHM_WRITE_VFPF_INDIRECT_FIELD
	movl	(%rbx), %edi
	movl	(%r15), %esi
	movl	(%r12), %edx
	movl	(%r13), %ecx
	xorl	%r8d, %r8d
	callq	_PHM_WRITE_VFPF_INDIRECT_FIELD
	movl	(%rbx), %edi
	movl	(%r15), %esi
	movq	_SMU_INPUT_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_AUTO_START@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %r8d
	callq	_PHM_WRITE_VFPF_INDIRECT_FIELD
	movl	(%rbx), %edi
	movl	(%r15), %esi
	movq	_ixFIRMWARE_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	callq	_cgs_write_ind_register
	movq	_SMC_IND@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_RCU_UC_EVENTS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_INTERRUPTS_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	$1, %r8d
	callq	_PHM_WAIT_VFPF_INDIRECT_FIELD
	movq	%rbx, %rdi
	callq	_smu7_send_msg_to_smc_offset
	movl	(%r12), %esi
	movq	_SMU_STATUS@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	_SMU_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	_PHM_WAIT_VFPF_INDIRECT_FIELD_UNEQUAL
	movl	(%rbx), %edi
	movl	(%r15), %esi
	movl	(%r13), %edx
	movq	_SMU_PASS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_PHM_READ_VFPF_INDIRECT_FIELD
	cmpl	$1, %eax
	jne	LBB0_2
## %bb.3:
	movl	(%r12), %esi
	movq	_FIRMWARE_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_INTERRUPTS_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	$1, %r8d
	callq	_PHM_WAIT_VFPF_INDIRECT_FIELD
	jmp	LBB0_4
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_4:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CGS_IND_REG__SMC,4,2           ## @CGS_IND_REG__SMC
	.comm	_SMC_SYSCON_RESET_CNTL,4,2      ## @SMC_SYSCON_RESET_CNTL
	.comm	_rst_reg,4,2                    ## @rst_reg
	.comm	_ixSMU_STATUS,4,2               ## @ixSMU_STATUS
	.comm	_SMC_SYSCON_CLOCK_CNTL_0,4,2    ## @SMC_SYSCON_CLOCK_CNTL_0
	.comm	_ck_disable,4,2                 ## @ck_disable
	.comm	_SMU_INPUT_DATA,4,2             ## @SMU_INPUT_DATA
	.comm	_AUTO_START,4,2                 ## @AUTO_START
	.comm	_ixFIRMWARE_FLAGS,4,2           ## @ixFIRMWARE_FLAGS
	.comm	_SMC_IND,4,2                    ## @SMC_IND
	.comm	_RCU_UC_EVENTS,4,2              ## @RCU_UC_EVENTS
	.comm	_INTERRUPTS_ENABLED,4,2         ## @INTERRUPTS_ENABLED
	.comm	_SMU_STATUS,4,2                 ## @SMU_STATUS
	.comm	_SMU_DONE,4,2                   ## @SMU_DONE
	.comm	_SMU_PASS,4,2                   ## @SMU_PASS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SMU Firmware start failed\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FIRMWARE_FLAGS,4,2             ## @FIRMWARE_FLAGS
	.no_dead_strip	_tonga_start_in_protection_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tonga_start_in_protection_mode
_tonga_start_in_protection_mode:        ; @tonga_start_in_protection_mode
	.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
	mov	x19, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x20, _CGS_IND_REG__SMC@GOTPAGE
Lloh1:
	ldr	x20, [x20, _CGS_IND_REG__SMC@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh2:
	adrp	x21, _SMC_SYSCON_RESET_CNTL@GOTPAGE
Lloh3:
	ldr	x21, [x21, _SMC_SYSCON_RESET_CNTL@GOTPAGEOFF]
	ldr	w2, [x21]
Lloh4:
	adrp	x22, _rst_reg@GOTPAGE
Lloh5:
	ldr	x22, [x22, _rst_reg@GOTPAGEOFF]
	ldr	w3, [x22]
	mov	w4, #1
	bl	_PHM_WRITE_VFPF_INDIRECT_FIELD
	mov	x0, x19
	bl	_smu7_upload_smu_firmware_image
	cbnz	w0, LBB0_4
; %bb.1:
	ldr	w0, [x19]
	ldr	w1, [x20]
Lloh6:
	adrp	x8, _ixSMU_STATUS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ixSMU_STATUS@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	w3, #0
	bl	_cgs_write_ind_register
	ldr	w0, [x19]
	ldr	w1, [x20]
Lloh9:
	adrp	x8, _SMC_SYSCON_CLOCK_CNTL_0@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SMC_SYSCON_CLOCK_CNTL_0@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
Lloh12:
	adrp	x8, _ck_disable@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ck_disable@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
	mov	w4, #0
	bl	_PHM_WRITE_VFPF_INDIRECT_FIELD
	ldr	w0, [x19]
	ldr	w1, [x20]
	ldr	w2, [x21]
	ldr	w3, [x22]
	mov	w4, #0
	bl	_PHM_WRITE_VFPF_INDIRECT_FIELD
	ldr	w0, [x19]
	ldr	w1, [x20]
Lloh15:
	adrp	x8, _SMU_INPUT_DATA@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SMU_INPUT_DATA@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
Lloh18:
	adrp	x8, _AUTO_START@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AUTO_START@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x8]
	mov	w4, #1
	bl	_PHM_WRITE_VFPF_INDIRECT_FIELD
	ldr	w0, [x19]
	ldr	w1, [x20]
Lloh21:
	adrp	x8, _ixFIRMWARE_FLAGS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ixFIRMWARE_FLAGS@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	w3, #0
	bl	_cgs_write_ind_register
Lloh24:
	adrp	x21, _SMC_IND@GOTPAGE
Lloh25:
	ldr	x21, [x21, _SMC_IND@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh26:
	adrp	x8, _RCU_UC_EVENTS@GOTPAGE
Lloh27:
	ldr	x8, [x8, _RCU_UC_EVENTS@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
Lloh29:
	adrp	x22, _INTERRUPTS_ENABLED@GOTPAGE
Lloh30:
	ldr	x22, [x22, _INTERRUPTS_ENABLED@GOTPAGEOFF]
	ldr	w3, [x22]
	mov	x0, x19
	mov	w4, #1
	bl	_PHM_WAIT_VFPF_INDIRECT_FIELD
	mov	x0, x19
	bl	_smu7_send_msg_to_smc_offset
	ldr	w1, [x21]
Lloh31:
	adrp	x23, _SMU_STATUS@GOTPAGE
Lloh32:
	ldr	x23, [x23, _SMU_STATUS@GOTPAGEOFF]
	ldr	w2, [x23]
Lloh33:
	adrp	x8, _SMU_DONE@GOTPAGE
Lloh34:
	ldr	x8, [x8, _SMU_DONE@GOTPAGEOFF]
Lloh35:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w4, #0
	bl	_PHM_WAIT_VFPF_INDIRECT_FIELD_UNEQUAL
	ldr	w0, [x19]
	ldr	w1, [x20]
	ldr	w2, [x23]
Lloh36:
	adrp	x8, _SMU_PASS@GOTPAGE
Lloh37:
	ldr	x8, [x8, _SMU_PASS@GOTPAGEOFF]
Lloh38:
	ldr	w3, [x8]
	bl	_PHM_READ_VFPF_INDIRECT_FIELD
	cmp	w0, #1
	b.ne	LBB0_3
; %bb.2:
	ldr	w1, [x21]
Lloh39:
	adrp	x8, _FIRMWARE_FLAGS@GOTPAGE
Lloh40:
	ldr	x8, [x8, _FIRMWARE_FLAGS@GOTPAGEOFF]
Lloh41:
	ldr	w2, [x8]
	ldr	w3, [x22]
	mov	x0, x19
	mov	w4, #1
	bl	_PHM_WAIT_VFPF_INDIRECT_FIELD
	mov	w0, #0
	b	LBB0_4
LBB0_3:
Lloh42:
	adrp	x0, l_.str@PAGE
Lloh43:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh44:
	adrp	x8, _EINVAL@GOTPAGE
Lloh45:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	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	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_CGS_IND_REG__SMC,4,2           ; @CGS_IND_REG__SMC
	.comm	_SMC_SYSCON_RESET_CNTL,4,2      ; @SMC_SYSCON_RESET_CNTL
	.comm	_rst_reg,4,2                    ; @rst_reg
	.comm	_ixSMU_STATUS,4,2               ; @ixSMU_STATUS
	.comm	_SMC_SYSCON_CLOCK_CNTL_0,4,2    ; @SMC_SYSCON_CLOCK_CNTL_0
	.comm	_ck_disable,4,2                 ; @ck_disable
	.comm	_SMU_INPUT_DATA,4,2             ; @SMU_INPUT_DATA
	.comm	_AUTO_START,4,2                 ; @AUTO_START
	.comm	_ixFIRMWARE_FLAGS,4,2           ; @ixFIRMWARE_FLAGS
	.comm	_SMC_IND,4,2                    ; @SMC_IND
	.comm	_RCU_UC_EVENTS,4,2              ; @RCU_UC_EVENTS
	.comm	_INTERRUPTS_ENABLED,4,2         ; @INTERRUPTS_ENABLED
	.comm	_SMU_STATUS,4,2                 ; @SMU_STATUS
	.comm	_SMU_DONE,4,2                   ; @SMU_DONE
	.comm	_SMU_PASS,4,2                   ; @SMU_PASS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SMU Firmware start failed\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FIRMWARE_FLAGS,4,2             ; @FIRMWARE_FLAGS
	.no_dead_strip	_tonga_start_in_protection_mode
.subsections_via_symbols
