	.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, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r15
	movq	%rdi, %r12
	movq	%rsi, %rdi
	callq	_to_sensor_dev_attr
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_dev_get_drvdata
	movq	%rax, %r12
	movslq	(%rbx), %r14
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$10, %edx
	callq	_simple_strtol
	movq	%rax, %rbx
	movq	(%r12), %rax
	movl	(%rax,%r14,4), %edi
	callq	_DIV_FROM_REG
	cmpq	%rax, %rbx
	je	LBB0_12
## %bb.1:
	movq	%rax, %r13
	leaq	16(%r12), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	leaq	-1(%rbx), %rax
	cmpq	$8, %rax
	jae	LBB0_2
## %bb.3:
	movl	$139, %ecx
	btl	%eax, %ecx
	jb	LBB0_4
LBB0_2:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subq	(%rcx), %rax
	jmp	LBB0_13
LBB0_4:
	leaq	l_switch.table.set_fan_div(%rip), %rax
	movl	-4(%rax,%rbx,4), %eax
	movq	(%r12), %rcx
	movl	%eax, (%rcx,%r14,4)
	cmpl	$2, %r14d
	jae	LBB0_5
## %bb.14:
	movq	_SMSC47M1_REG_FANDIV@GOTPCREL(%rip), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_smsc47m1_read_value
	leal	(%r14,%r14), %ecx
	movl	$48, %edx
	shll	%cl, %edx
	movq	(%r12), %rsi
	movl	(%rsi,%r14,4), %esi
	addb	$4, %cl
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	notl	%edx
	andl	%eax, %edx
	orl	%edx, %esi
	movslq	%esi, %rdx
	jmp	LBB0_7
LBB0_5:
	jne	LBB0_8
## %bb.6:
	movq	_SMSC47M2_REG_FANDIV3@GOTPCREL(%rip), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_smsc47m1_read_value
                                        ## kill: def $eax killed $eax def $rax
	andl	$207, %eax
	movq	(%r12), %rcx
	movl	8(%rcx), %ecx
	shll	$4, %ecx
	movslq	%ecx, %rdx
	orq	%rax, %rdx
LBB0_7:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_smsc47m1_write_value
LBB0_8:
	movq	8(%r12), %rax
	movslq	(%rax,%r14,4), %rax
	movl	$192, %ecx
	subq	%rax, %rcx
	imulq	%rcx, %r13
	movq	%rbx, %rax
	shrq	%rax
	addq	%r13, %rax
	movq	%rbx, %rcx
	orq	%rax, %rcx
	shrq	$32, %rcx
	je	LBB0_9
## %bb.10:
	cqto
	idivq	%rbx
	jmp	LBB0_11
LBB0_9:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ebx
                                        ## kill: def $eax killed $eax def $rax
LBB0_11:
	movl	$192, %edi
	subq	%rax, %rdi
	xorl	%esi, %esi
	movl	$191, %edx
	callq	_SENSORS_LIMIT
	movq	8(%r12), %rcx
	movl	%eax, (%rcx,%r14,4)
	movq	_SMSC47M1_REG_FAN_PRELOAD@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%r14,4), %esi
	movslq	%eax, %rdx
	movq	%r12, %rdi
	callq	_smsc47m1_write_value
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_12:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
LBB0_13:
	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
	.comm	_SMSC47M1_REG_FANDIV,4,2        ## @SMSC47M1_REG_FANDIV
	.comm	_SMSC47M2_REG_FANDIV3,4,2       ## @SMSC47M2_REG_FANDIV3
	.comm	_SMSC47M1_REG_FAN_PRELOAD,8,3   ## @SMSC47M1_REG_FAN_PRELOAD
	.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	1                               ## 0x1
	.long	0                               ## 0x0
	.long	2                               ## 0x2
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	3                               ## 0x3

.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	x21, x2
	mov	x20, x0
	mov	x0, x1
	bl	_to_sensor_dev_attr
	mov	x22, x0
	mov	x0, x20
	bl	_dev_get_drvdata
	mov	x20, x0
	ldrsw	x24, [x22]
	mov	x0, x21
	mov	x1, #0
	mov	w2, #10
	bl	_simple_strtol
	mov	x22, x0
	ldr	x8, [x20]
	ldr	w0, [x8, x24, lsl #2]
	bl	_DIV_FROM_REG
	cmp	x22, x0
	b.eq	LBB0_10
; %bb.1:
	mov	x23, x0
	add	x21, x20, #16
	mov	x0, x21
	bl	_mutex_lock
	sub	x8, x22, #1
	cmp	x8, #8
	b.hs	LBB0_3
; %bb.2:
	mov	w9, #139
	lsr	w9, w9, w8
	tbnz	w9, #0, LBB0_4
LBB0_3:
	mov	x0, x21
	bl	_mutex_unlock
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	neg	x19, x8
	b	LBB0_10
LBB0_4:
Lloh3:
	adrp	x9, l_switch.table.set_fan_div@PAGE
Lloh4:
	add	x9, x9, l_switch.table.set_fan_div@PAGEOFF
	ldr	w8, [x9, x8, lsl #2]
	ldr	x9, [x20]
	str	w8, [x9, x24, lsl #2]
	cmp	w24, #2
	b.hs	LBB0_6
; %bb.5:
Lloh5:
	adrp	x25, _SMSC47M1_REG_FANDIV@GOTPAGE
Lloh6:
	ldr	x25, [x25, _SMSC47M1_REG_FANDIV@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x20
	bl	_smsc47m1_read_value
	lsl	w8, w24, #1
	add	w9, w8, #4
	mov	w10, #48
	lsl	w8, w10, w8
	bic	w8, w0, w8
	ldr	x10, [x20]
	ldr	w10, [x10, x24, lsl #2]
	lsl	w9, w10, w9
	orr	w8, w9, w8
	sxtw	x2, w8
	b	LBB0_8
LBB0_6:
	b.ne	LBB0_9
; %bb.7:
Lloh7:
	adrp	x25, _SMSC47M2_REG_FANDIV3@GOTPAGE
Lloh8:
	ldr	x25, [x25, _SMSC47M2_REG_FANDIV3@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x20
	bl	_smsc47m1_read_value
	mov	w8, #207
	and	w8, w0, w8
	ldr	x9, [x20]
	ldr	w9, [x9, #8]
	lsl	w9, w9, #4
	sxtw	x9, w9
	orr	x2, x9, x8
LBB0_8:
	ldr	w1, [x25]
	mov	x0, x20
	bl	_smsc47m1_write_value
LBB0_9:
	ldr	x8, [x20, #8]
	lsl	x24, x24, #2
	ldrsw	x8, [x8, x24]
	mov	w9, #192
	sub	x8, x9, x8
	mul	x8, x23, x8
	add	x8, x8, x22, lsr #1
	sdiv	x8, x8, x22
	sub	x0, x9, x8
	mov	w1, #0
	mov	w2, #191
	bl	_SENSORS_LIMIT
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	x8, [x20, #8]
	str	w0, [x8, x24]
Lloh9:
	adrp	x8, _SMSC47M1_REG_FAN_PRELOAD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SMSC47M1_REG_FAN_PRELOAD@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	ldr	w1, [x8, x24]
	sxtw	x2, w0
	mov	x0, x20
	bl	_smsc47m1_write_value
	mov	x0, x21
	bl	_mutex_unlock
LBB0_10:
	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
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_SMSC47M1_REG_FANDIV,4,2        ; @SMSC47M1_REG_FANDIV
	.comm	_SMSC47M2_REG_FANDIV3,4,2       ; @SMSC47M2_REG_FANDIV3
	.comm	_SMSC47M1_REG_FAN_PRELOAD,8,3   ; @SMSC47M1_REG_FAN_PRELOAD
	.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	1                               ; 0x1
	.long	0                               ; 0x0
	.long	2                               ; 0x2
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	3                               ; 0x3

.subsections_via_symbols
