	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smu7_fan_ctrl_get_fan_speed_percent ## -- Begin function smu7_fan_ctrl_get_fan_speed_percent
	.p2align	4, 0x90
_smu7_fan_ctrl_get_fan_speed_percent:   ## @smu7_fan_ctrl_get_fan_speed_percent
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, 8(%rdi)
	je	LBB0_3
## %bb.1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_3:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	movq	_CGS_IND_REG__SMC@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_CG_FDO_CTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_FMAX_DUTY100@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_PHM_READ_VFPF_INDIRECT_FIELD
	movq	%rax, %r15
	movl	(%rbx), %edi
	movl	(%r12), %esi
	movq	_CG_THERMAL_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_FDO_PWM_DUTY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_PHM_READ_VFPF_INDIRECT_FIELD
	testq	%r15, %r15
	je	LBB0_4
## %bb.5:
	imull	$100, %eax, %ebx
	movl	%ebx, %edi
	movq	%r15, %rsi
	callq	_do_div
	cmpl	$100, %ebx
	movl	$100, %eax
	cmovll	%ebx, %eax
	cltq
	movq	%rax, (%r14)
	xorl	%eax, %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_CGS_IND_REG__SMC,4,2           ## @CGS_IND_REG__SMC
	.comm	_CG_FDO_CTRL1,4,2               ## @CG_FDO_CTRL1
	.comm	_FMAX_DUTY100,4,2               ## @FMAX_DUTY100
	.comm	_CG_THERMAL_STATUS,4,2          ## @CG_THERMAL_STATUS
	.comm	_FDO_PWM_DUTY,4,2               ## @FDO_PWM_DUTY
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smu7_fan_ctrl_get_fan_speed_percent ; -- Begin function smu7_fan_ctrl_get_fan_speed_percent
	.p2align	2
_smu7_fan_ctrl_get_fan_speed_percent:   ; @smu7_fan_ctrl_get_fan_speed_percent
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_3:
	mov	x19, x1
	mov	x21, x0
	ldr	w0, [x0]
Lloh2:
	adrp	x22, _CGS_IND_REG__SMC@GOTPAGE
Lloh3:
	ldr	x22, [x22, _CGS_IND_REG__SMC@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh4:
	adrp	x8, _CG_FDO_CTRL1@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CG_FDO_CTRL1@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
Lloh7:
	adrp	x8, _FMAX_DUTY100@GOTPAGE
Lloh8:
	ldr	x8, [x8, _FMAX_DUTY100@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	bl	_PHM_READ_VFPF_INDIRECT_FIELD
	mov	x20, x0
	ldr	w0, [x21]
	ldr	w1, [x22]
Lloh10:
	adrp	x8, _CG_THERMAL_STATUS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CG_THERMAL_STATUS@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
Lloh13:
	adrp	x8, _FDO_PWM_DUTY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _FDO_PWM_DUTY@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
	bl	_PHM_READ_VFPF_INDIRECT_FIELD
	cbz	x20, LBB0_6
; %bb.4:
	mov	w22, #100
	mul	w21, w0, w22
	mov	x0, x21
	mov	x1, x20
	bl	_do_div
	mov	w0, #0
	cmp	w21, #100
	csel	w8, w21, w22, lt
	sxtw	x8, w8
	str	x8, [x19]
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_CGS_IND_REG__SMC,4,2           ; @CGS_IND_REG__SMC
	.comm	_CG_FDO_CTRL1,4,2               ; @CG_FDO_CTRL1
	.comm	_FMAX_DUTY100,4,2               ; @FMAX_DUTY100
	.comm	_CG_THERMAL_STATUS,4,2          ; @CG_THERMAL_STATUS
	.comm	_FDO_PWM_DUTY,4,2               ; @FDO_PWM_DUTY
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
