	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ci_fan_ctrl_get_fan_speed_percent ## -- Begin function ci_fan_ctrl_get_fan_speed_percent
	.p2align	4, 0x90
_ci_fan_ctrl_get_fan_speed_percent:     ## @ci_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rdi)
	je	LBB0_3
## %bb.1:
	movq	_ENOENT@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_3:
	movq	%rsi, %r14
	movq	_CG_FDO_CTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32_SMC
	movl	%eax, %ebx
	movq	_FMAX_DUTY100_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	_FMAX_DUTY100_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %ebx
	movq	_CG_THERMAL_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32_SMC
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.5:
	movq	_FDO_PWM_DUTY_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_FDO_PWM_DUTY_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	imull	$100, %eax, %r15d
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_do_div
	cmpl	$100, %r15d
	movl	$100, %eax
	cmovll	%r15d, %eax
	movl	%eax, (%r14)
	xorl	%eax, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_CG_FDO_CTRL1,4,2               ## @CG_FDO_CTRL1
	.comm	_FMAX_DUTY100_MASK,4,2          ## @FMAX_DUTY100_MASK
	.comm	_FMAX_DUTY100_SHIFT,4,2         ## @FMAX_DUTY100_SHIFT
	.comm	_CG_THERMAL_STATUS,4,2          ## @CG_THERMAL_STATUS
	.comm	_FDO_PWM_DUTY_MASK,4,2          ## @FDO_PWM_DUTY_MASK
	.comm	_FDO_PWM_DUTY_SHIFT,4,2         ## @FDO_PWM_DUTY_SHIFT
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ci_fan_ctrl_get_fan_speed_percent ; -- Begin function ci_fan_ctrl_get_fan_speed_percent
	.p2align	2
_ci_fan_ctrl_get_fan_speed_percent:     ; @ci_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]
	cbz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _ENOENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_3:
	mov	x19, x1
Lloh2:
	adrp	x8, _CG_FDO_CTRL1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CG_FDO_CTRL1@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_RREG32_SMC
Lloh5:
	adrp	x8, _FMAX_DUTY100_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FMAX_DUTY100_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _FMAX_DUTY100_SHIFT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _FMAX_DUTY100_SHIFT@GOTPAGEOFF]
	and	w8, w8, w0
Lloh10:
	ldr	w9, [x9]
	asr	w20, w8, w9
Lloh11:
	adrp	x8, _CG_THERMAL_STATUS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CG_THERMAL_STATUS@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_RREG32_SMC
	cbz	w20, LBB0_6
; %bb.4:
Lloh14:
	adrp	x8, _FDO_PWM_DUTY_MASK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _FDO_PWM_DUTY_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh17:
	adrp	x9, _FDO_PWM_DUTY_SHIFT@GOTPAGE
Lloh18:
	ldr	x9, [x9, _FDO_PWM_DUTY_SHIFT@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	asr	w8, w8, w9
	mov	w22, #100
	mul	w21, w8, w22
	mov	x0, x21
	mov	x1, x20
	bl	_do_div
	mov	w0, #0
	cmp	w21, #100
	csel	w8, w21, w22, lt
	str	w8, [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:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_CG_FDO_CTRL1,4,2               ; @CG_FDO_CTRL1
	.comm	_FMAX_DUTY100_MASK,4,2          ; @FMAX_DUTY100_MASK
	.comm	_FMAX_DUTY100_SHIFT,4,2         ; @FMAX_DUTY100_SHIFT
	.comm	_CG_THERMAL_STATUS,4,2          ; @CG_THERMAL_STATUS
	.comm	_FDO_PWM_DUTY_MASK,4,2          ; @FDO_PWM_DUTY_MASK
	.comm	_FDO_PWM_DUTY_SHIFT,4,2         ; @FDO_PWM_DUTY_SHIFT
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
