	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smu7_fan_ctrl_start_smc_fan_control ## -- Begin function smu7_fan_ctrl_start_smc_fan_control
	.p2align	4, 0x90
_smu7_fan_ctrl_start_smc_fan_control:   ## @smu7_fan_ctrl_start_smc_fan_control
	.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	_PHM_PlatformCaps_ODFuzzyFanControlSupport@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PP_CAP
	movl	24(%rbx), %edi
	movq	_mmSMC_MSG_ARG_0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	_FAN_CONTROL_FUZZY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_cgs_write_register
	movq	_PPSMC_StartFanControl@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_smum_send_msg_to_smc
	movl	%eax, %r14d
	movq	_PHM_PlatformCaps_FanSpeedInTableIsRPM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PP_CAP
	movq	32(%rbx), %rcx
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movl	20(%rbx), %esi
	movq	%rbx, %rdi
	callq	*8(%rcx)
	testl	%r14d, %r14d
	jne	LBB0_9
	jmp	LBB0_6
LBB0_4:
	movq	_FAN_CONTROL_TABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_cgs_write_register
	movq	_PPSMC_StartFanControl@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_smum_send_msg_to_smc
	movl	%eax, %r14d
	testl	%r14d, %r14d
	jne	LBB0_9
	jmp	LBB0_6
LBB0_3:
	movl	16(%rbx), %esi
	movq	%rbx, %rdi
	callq	*(%rcx)
	testl	%r14d, %r14d
	jne	LBB0_9
LBB0_6:
	movq	8(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_7
## %bb.8:
	movq	_PPSMC_MSG_SetFanTemperatureTarget@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_smum_send_msg_to_smc_with_parameter
	movl	%eax, %r14d
	jmp	LBB0_9
LBB0_7:
	xorl	%r14d, %r14d
LBB0_9:
	movl	$1, (%rbx)
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PHM_PlatformCaps_ODFuzzyFanControlSupport,4,2 ## @PHM_PlatformCaps_ODFuzzyFanControlSupport
	.comm	_mmSMC_MSG_ARG_0,4,2            ## @mmSMC_MSG_ARG_0
	.comm	_FAN_CONTROL_FUZZY,4,2          ## @FAN_CONTROL_FUZZY
	.comm	_PPSMC_StartFanControl,4,2      ## @PPSMC_StartFanControl
	.comm	_PHM_PlatformCaps_FanSpeedInTableIsRPM,4,2 ## @PHM_PlatformCaps_FanSpeedInTableIsRPM
	.comm	_FAN_CONTROL_TABLE,4,2          ## @FAN_CONTROL_TABLE
	.comm	_PPSMC_MSG_SetFanTemperatureTarget,4,2 ## @PPSMC_MSG_SetFanTemperatureTarget
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smu7_fan_ctrl_start_smc_fan_control ; -- Begin function smu7_fan_ctrl_start_smc_fan_control
	.p2align	2
_smu7_fan_ctrl_start_smc_fan_control:   ; @smu7_fan_ctrl_start_smc_fan_control
	.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
Lloh0:
	adrp	x8, _PHM_PlatformCaps_ODFuzzyFanControlSupport@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PHM_PlatformCaps_ODFuzzyFanControlSupport@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_PP_CAP
	mov	x8, x0
	ldr	w0, [x19, #24]
Lloh3:
	adrp	x9, _mmSMC_MSG_ARG_0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _mmSMC_MSG_ARG_0@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x9]
	cbz	x8, LBB0_3
; %bb.1:
Lloh6:
	adrp	x8, _FAN_CONTROL_FUZZY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FAN_CONTROL_FUZZY@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	bl	_cgs_write_register
Lloh9:
	adrp	x8, _PPSMC_StartFanControl@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PPSMC_StartFanControl@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_smum_send_msg_to_smc
	mov	x20, x0
Lloh12:
	adrp	x8, _PHM_PlatformCaps_FanSpeedInTableIsRPM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PHM_PlatformCaps_FanSpeedInTableIsRPM@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_PP_CAP
	ldr	x8, [x19, #32]
	cbz	x0, LBB0_4
; %bb.2:
	ldr	x8, [x8, #8]
	ldr	w1, [x19, #20]
	b	LBB0_5
LBB0_3:
Lloh15:
	adrp	x8, _FAN_CONTROL_TABLE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _FAN_CONTROL_TABLE@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	bl	_cgs_write_register
Lloh18:
	adrp	x8, _PPSMC_StartFanControl@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PPSMC_StartFanControl@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_smum_send_msg_to_smc
	mov	x20, x0
	cbnz	w20, LBB0_9
	b	LBB0_6
LBB0_4:
	ldr	x8, [x8]
	ldr	w1, [x19, #16]
LBB0_5:
	mov	x0, x19
	blr	x8
	cbnz	w20, LBB0_9
LBB0_6:
	ldr	x2, [x19, #8]
	cbz	x2, LBB0_8
; %bb.7:
Lloh21:
	adrp	x8, _PPSMC_MSG_SetFanTemperatureTarget@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PPSMC_MSG_SetFanTemperatureTarget@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_smum_send_msg_to_smc_with_parameter
	mov	x20, x0
	b	LBB0_9
LBB0_8:
	mov	w20, #0
LBB0_9:
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_PHM_PlatformCaps_ODFuzzyFanControlSupport,4,2 ; @PHM_PlatformCaps_ODFuzzyFanControlSupport
	.comm	_mmSMC_MSG_ARG_0,4,2            ; @mmSMC_MSG_ARG_0
	.comm	_FAN_CONTROL_FUZZY,4,2          ; @FAN_CONTROL_FUZZY
	.comm	_PPSMC_StartFanControl,4,2      ; @PPSMC_StartFanControl
	.comm	_PHM_PlatformCaps_FanSpeedInTableIsRPM,4,2 ; @PHM_PlatformCaps_FanSpeedInTableIsRPM
	.comm	_FAN_CONTROL_TABLE,4,2          ; @FAN_CONTROL_TABLE
	.comm	_PPSMC_MSG_SetFanTemperatureTarget,4,2 ; @PPSMC_MSG_SetFanTemperatureTarget
.subsections_via_symbols
