	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fan1_target_store
_fan1_target_store:                     ## @fan1_target_store
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, %rbx
	callq	_emc2103_update_device
	movq	%rax, %r12
	movq	24(%rax), %r14
	leaq	-40(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_kstrtoul
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	-40(%rbp), %rdi
	xorl	%esi, %esi
	movl	$16384, %edx                    ## imm = 0x4000
	callq	_clamp_val
	movq	%rax, -40(%rbp)
	movq	%r12, %rbx
	addq	$16, %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	-40(%rbp), %rcx
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.4:
	movq	_FAN_RPM_FACTOR@GOTPCREL(%rip), %rdx
	movq	8(%r12), %rax
	imulq	(%rdx), %rax
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_5
## %bb.6:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_7
LBB0_1:
	movl	%eax, %r15d
	jmp	LBB0_9
LBB0_3:
	movl	$8191, %esi                     ## imm = 0x1FFF
	jmp	LBB0_8
LBB0_5:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_7:
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$8191, %edx                     ## imm = 0x1FFF
	callq	_clamp_val
	movq	%rax, %rsi
LBB0_8:
	movl	%esi, (%r12)
	movq	%r14, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_write_fan_target_to_i2c
	movq	%rbx, %rdi
	callq	_mutex_unlock
LBB0_9:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FAN_RPM_FACTOR,8,3             ## @FAN_RPM_FACTOR
	.no_dead_strip	_fan1_target_store
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fan1_target_store
_fan1_target_store:                     ; @fan1_target_store
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x3
	mov	x22, x2
	bl	_emc2103_update_device
	mov	x21, x0
	ldr	x20, [x0, #24]
	add	x2, sp, #8
	mov	x0, x22
	mov	w1, #10
	bl	_kstrtoul
	tbnz	w0, #31, LBB0_3
; %bb.1:
	ldr	x0, [sp, #8]
	mov	w1, #0
	mov	w2, #16384
	bl	_clamp_val
	str	x0, [sp, #8]
	add	x22, x21, #16
	mov	x0, x22
	bl	_mutex_lock
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_4
; %bb.2:
Lloh0:
	adrp	x9, _FAN_RPM_FACTOR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FAN_RPM_FACTOR@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	x10, [x21, #8]
	mul	x9, x10, x9
	udiv	x0, x9, x8
	mov	w1, #0
	mov	w2, #8191
	bl	_clamp_val
	mov	x1, x0
	b	LBB0_5
LBB0_3:
	mov	x19, x0
	b	LBB0_6
LBB0_4:
	mov	w1, #8191
LBB0_5:
	str	w1, [x21]
	mov	x0, x20
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_write_fan_target_to_i2c
	mov	x0, x22
	bl	_mutex_unlock
LBB0_6:
	mov	x0, x19
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_FAN_RPM_FACTOR,8,3             ; @FAN_RPM_FACTOR
	.no_dead_strip	_fan1_target_store
.subsections_via_symbols
