	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fan1_div_store
_fan1_div_store:                        ## @fan1_div_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %rbx
	callq	_emc2103_update_device
	movq	%rax, %r15
	movq	16(%rax), %r12
	movl	$8, %eax
	xorl	%edx, %edx
	idivl	(%r15)
	movl	%eax, %r13d
	leaq	-56(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_kstrtol
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	-56(%rbp), %rbx
	movslq	%r13d, %rax
	cmpq	%rax, %rbx
	je	LBB0_17
## %bb.3:
	leaq	-1(%rbx), %rax
	cmpq	$8, %rax
	jae	LBB0_4
## %bb.5:
	movl	$139, %ecx
	btl	%eax, %ecx
	jb	LBB0_6
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_17
LBB0_1:
	movl	%eax, %r14d
LBB0_17:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	12(%r15), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	_REG_FAN_CONF1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_i2c_smbus_read_byte_data
	movq	%r12, %rdi
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	leaq	l_switch.table.fan1_div_store(%rip), %rax
	andl	$159, %r12d
	orl	-4(%rax,%rbx,4), %r12d
	movq	_REG_FAN_CONF1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rdi, %rbx
	movl	%r12d, %edx
	callq	_i2c_smbus_write_byte_data
	movq	-56(%rbp), %rsi
	movq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_9
## %bb.10:
	movl	$8, %eax
	xorl	%edx, %edx
	idivq	%rsi
	jmp	LBB0_11
LBB0_7:
	movq	_REG_FAN_CONF1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %ecx
	callq	_dev_dbg
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	%r12d, %r14d
	jmp	LBB0_17
LBB0_9:
	movl	$8, %eax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
LBB0_11:
	movq	%rbx, %r12
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, (%r15)
	movl	4(%r15), %eax
	movl	%eax, %ecx
	notl	%ecx
	testl	$8160, %ecx                     ## imm = 0x1FE0
	je	LBB0_16
## %bb.12:
	imull	%r13d, %eax
	movslq	%eax, %rcx
	movq	%rcx, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_13
## %bb.14:
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	movq	%rax, %rdi
	jmp	LBB0_15
LBB0_13:
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %edi
LBB0_15:
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$8191, %esi                     ## imm = 0x1FFF
	callq	_min
	movl	%eax, 4(%r15)
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_write_fan_target_to_i2c
LBB0_16:
	movl	$0, 8(%r15)
	movq	%rbx, %rdi
	callq	_mutex_unlock
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_REG_FAN_CONF1,4,2              ## @REG_FAN_CONF1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reg 0x%02x, err %d\n"

	.no_dead_strip	_fan1_div_store
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.fan1_div_store
l_switch.table.fan1_div_store:
	.long	96                              ## 0x60
	.long	64                              ## 0x40
	.long	96                              ## 0x60
	.long	32                              ## 0x20
	.long	96                              ## 0x60
	.long	96                              ## 0x60
	.long	96                              ## 0x60
	.long	0                               ## 0x0

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fan1_div_store
_fan1_div_store:                        ; @fan1_div_store
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x3
	mov	x22, x2
	bl	_emc2103_update_device
	mov	x20, x0
	ldr	x21, [x0, #16]
	ldr	w23, [x0]
	add	x2, sp, #8
	mov	x0, x22
	mov	w1, #10
	bl	_kstrtol
	tbnz	w0, #31, LBB0_5
; %bb.1:
	mov	w8, #8
	sdiv	w24, w8, w23
	ldr	x8, [sp, #8]
	cmp	x8, w24, sxtw
	b.eq	LBB0_6
; %bb.2:
	sub	x25, x8, #1
	cmp	x25, #8
	b.hs	LBB0_4
; %bb.3:
	mov	w8, #139
	lsr	w8, w8, w25
	tbnz	w8, #0, LBB0_7
LBB0_4:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_6
LBB0_5:
	mov	x19, x0
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_7:
	add	x22, x20, #12
	mov	x0, x22
	bl	_mutex_lock
Lloh3:
	adrp	x26, _REG_FAN_CONF1@GOTPAGE
Lloh4:
	ldr	x26, [x26, _REG_FAN_CONF1@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x21
	bl	_i2c_smbus_read_byte_data
	mov	x23, x0
	tbnz	w0, #31, LBB0_11
; %bb.8:
Lloh5:
	adrp	x8, l_switch.table.fan1_div_store@PAGE
Lloh6:
	add	x8, x8, l_switch.table.fan1_div_store@PAGEOFF
	ldr	w8, [x8, x25, lsl #2]
	mov	w9, #159
	and	w9, w23, w9
	orr	w2, w9, w8
	ldr	w1, [x26]
	mov	x0, x21
	bl	_i2c_smbus_write_byte_data
	ldr	x8, [sp, #8]
	mov	w9, #8
	sdiv	x9, x9, x8
	str	w9, [x20]
	ldr	w9, [x20, #4]
	mvn	w10, w9
	tst	w10, #0x1fe0
	b.eq	LBB0_10
; %bb.9:
	mul	w9, w9, w24
	sxtw	x9, w9
	sdiv	x0, x9, x8
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	w1, #8191
	bl	_min
	mov	x1, x0
	str	w0, [x20, #4]
	mov	x0, x21
	bl	_write_fan_target_to_i2c
LBB0_10:
	str	wzr, [x20, #8]
	mov	x0, x22
	bl	_mutex_unlock
	b	LBB0_6
LBB0_11:
	ldr	w2, [x26]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x3, x23
	bl	_dev_dbg
	mov	x0, x22
	bl	_mutex_unlock
	mov	x19, x23
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_REG_FAN_CONF1,4,2              ; @REG_FAN_CONF1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg 0x%02x, err %d\n"

	.no_dead_strip	_fan1_div_store
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.fan1_div_store
l_switch.table.fan1_div_store:
	.long	96                              ; 0x60
	.long	64                              ; 0x40
	.long	96                              ; 0x60
	.long	32                              ; 0x20
	.long	96                              ; 0x60
	.long	96                              ; 0x60
	.long	96                              ; 0x60
	.long	0                               ; 0x0

.subsections_via_symbols
