	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_fan_div
_set_fan_div:                           ## @set_fan_div
	.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, %r12
	movq	%rdx, %r13
	movq	%rsi, %rbx
	callq	_to_i2c_client
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_i2c_get_clientdata
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_to_sensor_dev_attr
	movslq	(%rax), %r14
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$10, %edx
	callq	_simple_strtol
	movl	%eax, %r13d
	leal	-1(%r13), %eax
	cmpl	$8, %eax
	jae	LBB0_1
## %bb.2:
	movl	$139, %ecx
	btl	%eax, %ecx
	jb	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subq	(%rax), %r12
	jmp	LBB0_4
LBB0_3:
	cltq
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	addq	$16, %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movl	%r14d, %edi
	callq	_ADM1031_REG_FAN_DIV
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_adm1031_read_value
	movq	(%r15), %rcx
	movl	%eax, (%rcx,%r14,4)
	movl	%r14d, %edi
	callq	_ADM1031_REG_FAN_MIN
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_adm1031_read_value
	movq	8(%r15), %rcx
	movl	%eax, (%rcx,%r14,4)
	movq	(%r15), %rax
	movl	(%rax,%r14,4), %edi
	callq	_FAN_DIV_FROM_REG
	movq	(%r15), %rcx
	movl	(%rcx,%r14,4), %edx
	andl	$63, %edx
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	leaq	l_switch.table.set_fan_div(%rip), %rdi
	orl	(%rdi,%rsi,4), %edx
	movl	%edx, (%rcx,%r14,4)
	movq	8(%r15), %rcx
	imull	(%rcx,%r14,4), %eax
	cltd
	idivl	%r13d
	cmpl	$255, %eax
	movl	$255, %edx
	cmovll	%eax, %edx
	movl	%edx, (%rcx,%r14,4)
	movl	%r14d, %edi
	callq	_ADM1031_REG_FAN_DIV
	movq	(%r15), %rcx
	movl	(%rcx,%r14,4), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_adm1031_write_value
	movl	%r14d, %edi
	callq	_ADM1031_REG_FAN_MIN
	movq	8(%r15), %rcx
	movl	(%rcx,%r14,4), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_adm1031_write_value
	movq	$0, 24(%r15)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
LBB0_4:
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,8,3                     ## @EINVAL
	.no_dead_strip	_set_fan_div
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.set_fan_div
l_switch.table.set_fan_div:
	.long	0                               ## 0x0
	.long	64                              ## 0x40
	.long	192                             ## 0xc0
	.long	128                             ## 0x80
	.long	192                             ## 0xc0
	.long	192                             ## 0xc0
	.long	192                             ## 0xc0
	.long	192                             ## 0xc0

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_fan_div
_set_fan_div:                           ; @set_fan_div
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x23, x2
	mov	x22, x1
	bl	_to_i2c_client
	mov	x21, x0
	bl	_i2c_get_clientdata
	mov	x20, x0
	mov	x0, x22
	bl	_to_sensor_dev_attr
	ldrsw	x22, [x0]
	mov	x0, x23
	mov	x1, #0
	mov	w2, #10
	bl	_simple_strtol
	sub	w8, w0, #1
	cmp	w8, #8
	b.hs	LBB0_2
; %bb.1:
	mov	w9, #139
	lsr	w9, w9, w8
	tbnz	w9, #0, LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	neg	x19, x8
	b	LBB0_4
LBB0_3:
	mov	x24, x0
Lloh3:
	adrp	x9, l_switch.table.set_fan_div@PAGE
Lloh4:
	add	x9, x9, l_switch.table.set_fan_div@PAGEOFF
	ldr	w25, [x9, w8, sxtw #2]
	add	x23, x20, #16
	mov	x0, x23
	bl	_mutex_lock
	mov	x0, x22
	bl	_ADM1031_REG_FAN_DIV
	mov	x1, x0
	mov	x0, x21
	bl	_adm1031_read_value
	ldr	x8, [x20]
	lsl	x26, x22, #2
	str	w0, [x8, x26]
	mov	x0, x22
	bl	_ADM1031_REG_FAN_MIN
	mov	x1, x0
	mov	x0, x21
	bl	_adm1031_read_value
	ldp	x9, x8, [x20]
	str	w0, [x8, x26]
	ldr	w0, [x9, x26]
	bl	_FAN_DIV_FROM_REG
	ldp	x8, x9, [x20]
	ldr	w10, [x8, x26]
	and	w10, w10, #0x3f
	orr	w10, w10, w25
	str	w10, [x8, x26]
	ldr	w8, [x9, x26]
	mul	w8, w8, w0
	sdiv	w8, w8, w24
	mov	w10, #255
	cmp	w8, #255
	csel	w8, w8, w10, lt
	str	w8, [x9, x26]
	mov	x0, x22
	bl	_ADM1031_REG_FAN_DIV
	mov	x1, x0
	ldr	x8, [x20]
	ldr	w2, [x8, x26]
	mov	x0, x21
	bl	_adm1031_write_value
	mov	x0, x22
	bl	_ADM1031_REG_FAN_MIN
	mov	x1, x0
	ldr	x8, [x20, #8]
	ldr	w2, [x8, x26]
	mov	x0, x21
	bl	_adm1031_write_value
	str	xzr, [x20, #24]
	mov	x0, x23
	bl	_mutex_unlock
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,8,3                     ; @EINVAL
	.no_dead_strip	_set_fan_div
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.set_fan_div
l_switch.table.set_fan_div:
	.long	0                               ; 0x0
	.long	64                              ; 0x40
	.long	192                             ; 0xc0
	.long	128                             ; 0x80
	.long	192                             ; 0xc0
	.long	192                             ; 0xc0
	.long	192                             ; 0xc0
	.long	192                             ; 0xc0

.subsections_via_symbols
