	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_pwm_fan
_set_pwm_fan:                           ## @set_pwm_fan
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$16, %rsp
	movq	_fcu_fans@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edi, %rcx
	shlq	$4, %rcx
	movq	(%rax,%rcx), %rdx
	movq	_FCU_FAN_PWM@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rdx
	jne	LBB0_1
## %bb.2:
	movl	8(%rax,%rcx), %eax
	movq	_FCU_FAN_ABSENT_ID@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_3:
	movb	$25, %cl
	cmpl	$10, %esi
	jl	LBB0_5
## %bb.4:
	cmpl	$100, %esi
	movl	$100, %ecx
	cmovll	%esi, %ecx
	imull	$2559, %ecx, %ecx               ## imm = 0x9FF
	imulq	$274877907, %rcx, %rcx          ## imm = 0x10624DD3
	shrq	$38, %rcx
LBB0_5:
	movb	%cl, -2(%rbp)
	leal	(%rax,%rax), %edi
	addl	$48, %edi
	leaq	-2(%rbp), %rsi
	movl	$1, %edx
	callq	_fan_write_reg
	movl	%eax, %ecx
	sarl	$31, %eax
	andl	%ecx, %eax
LBB0_6:
	addq	$16, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_fcu_fans,8,3                   ## @fcu_fans
	.comm	_FCU_FAN_PWM,8,3                ## @FCU_FAN_PWM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FCU_FAN_ABSENT_ID,4,2          ## @FCU_FAN_ABSENT_ID
	.no_dead_strip	_set_pwm_fan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_pwm_fan
_set_pwm_fan:                           ; @set_pwm_fan
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.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
                                        ; kill: def $w0 killed $w0 def $x0
Lloh0:
	adrp	x8, _fcu_fans@GOTPAGE
Lloh1:
	ldr	x8, [x8, _fcu_fans@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	sbfiz	x9, x0, #4, #32
	ldr	x9, [x8, x9]
Lloh3:
	adrp	x10, _FCU_FAN_PWM@GOTPAGE
Lloh4:
	ldr	x10, [x10, _FCU_FAN_PWM@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_2
; %bb.1:
	sxtw	x9, w0
	add	x8, x8, x9, lsl #4
	ldr	w8, [x8, #8]
Lloh6:
	adrp	x9, _FCU_FAN_ABSENT_ID@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FCU_FAN_ABSENT_ID@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_3
LBB0_2:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_3:
	mov	w9, #25
	mov	w10, #100
	cmp	w1, #100
	csel	w10, w1, w10, lt
	mov	w11, #2559
	mul	w10, w10, w11
	mov	w11, #19923
	movk	w11, #4194, lsl #16
	umull	x10, w10, w11
	lsr	x10, x10, #38
	cmp	w1, #10
	csel	w9, w9, w10, lt
	sturb	w9, [x29, #-2]
	lsl	w8, w8, #1
	add	w0, w8, #48
	sub	x1, x29, #2
	mov	w2, #1
	bl	_fan_write_reg
	cmp	w0, #0
	csel	w0, w0, wzr, lt
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_fcu_fans,8,3                   ; @fcu_fans
	.comm	_FCU_FAN_PWM,8,3                ; @FCU_FAN_PWM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FCU_FAN_ABSENT_ID,4,2          ; @FCU_FAN_ABSENT_ID
	.no_dead_strip	_set_pwm_fan
.subsections_via_symbols
