	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_fan
_set_fan:                               ## @set_fan
	.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, %r15
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	callq	_to_sensor_dev_attr_2
	movslq	(%rax), %r13
	movslq	4(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_dev_get_drvdata
	movq	%rax, %r12
	leaq	-56(%rbp), %rdx
	movq	%r15, %rdi
	movl	$10, %esi
	callq	_kstrtol
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	movq	%r12, %r15
	addq	$16, %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%r12, %rdi
	callq	_has_16bit_fans
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	-56(%rbp), %rdi
	callq	_FAN16_TO_REG
	movq	(%r12), %rcx
	movq	(%rcx,%r13,8), %rcx
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, (%rcx,%rbx,4)
	movq	_IT87_REG_FAN_MIN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%r13,4), %esi
	movzbl	%al, %edx
	movq	%r12, %rdi
	callq	_it87_write_value
	movq	_IT87_REG_FANX_MIN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r13,4), %esi
	movq	(%r12), %rax
	movq	(%rax,%r13,8), %rax
	movl	(%rax,%rbx,4), %edx
	sarl	$8, %edx
	movq	%r12, %rdi
	jmp	LBB0_12
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subq	(%rax), %r14
	jmp	LBB0_13
LBB0_4:
	movq	_IT87_REG_FAN_DIV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_it87_read_value
	testl	%r13d, %r13d
	je	LBB0_8
## %bb.5:
	cmpl	$1, %r13d
	je	LBB0_9
## %bb.6:
	cmpl	$2, %r13d
	jne	LBB0_7
## %bb.10:
	andl	$64, %eax
	shrl	$5, %eax
	orl	$1, %eax
	movq	8(%r12), %rcx
	movl	%eax, 8(%rcx)
	jmp	LBB0_11
LBB0_8:
	andl	$7, %eax
	movq	8(%r12), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_11
LBB0_9:
	shrl	$3, %eax
	andl	$7, %eax
	movq	8(%r12), %rcx
	movl	%eax, 4(%rcx)
	jmp	LBB0_11
LBB0_7:
	movq	8(%r12), %rcx
LBB0_11:
	movq	-56(%rbp), %rbx
	movl	(%rcx,%r13,4), %edi
	callq	_DIV_FROM_REG
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_FAN_TO_REG
	movq	(%r12), %rcx
	movq	(%rcx,%r13,8), %rcx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, (%rcx,%rdx,4)
	movq	_IT87_REG_FAN_MIN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%r13,4), %esi
	movq	%r12, %rdi
	movl	%eax, %edx
LBB0_12:
	callq	_it87_write_value
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_13:
	movq	%r14, %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
	.comm	_IT87_REG_FAN_MIN,8,3           ## @IT87_REG_FAN_MIN
	.comm	_IT87_REG_FANX_MIN,8,3          ## @IT87_REG_FANX_MIN
	.comm	_IT87_REG_FAN_DIV,4,2           ## @IT87_REG_FAN_DIV
	.no_dead_strip	_set_fan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_fan
_set_fan:                               ; @set_fan
	.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	x21, x2
	mov	x20, x0
	mov	x0, x1
	bl	_to_sensor_dev_attr_2
	ldpsw	x23, x24, [x0]
	mov	x0, x20
	bl	_dev_get_drvdata
	mov	x20, x0
	add	x2, sp, #8
	mov	x0, x21
	mov	w1, #10
	bl	_kstrtol
	tbnz	x0, #63, LBB0_3
; %bb.1:
	add	x21, x20, #16
	mov	x0, x21
	bl	_mutex_lock
	mov	x0, x20
	bl	_has_16bit_fans
	cbz	x0, LBB0_4
; %bb.2:
	ldr	x0, [sp, #8]
	bl	_FAN16_TO_REG
	ldr	x8, [x20]
	lsl	x22, x23, #3
	ldr	x8, [x8, x22]
	lsl	x24, x24, #2
	str	w0, [x8, x24]
Lloh0:
	adrp	x8, _IT87_REG_FAN_MIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IT87_REG_FAN_MIN@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	lsl	x23, x23, #2
	ldr	w1, [x8, x23]
	and	w2, w0, #0xff
	mov	x0, x20
	bl	_it87_write_value
Lloh3:
	adrp	x8, _IT87_REG_FANX_MIN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IT87_REG_FANX_MIN@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w1, [x8, x23]
	ldr	x8, [x20]
	ldr	x8, [x8, x22]
	ldr	w8, [x8, x24]
	asr	w2, w8, #8
	b	LBB0_12
LBB0_3:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	neg	x19, x8
	b	LBB0_13
LBB0_4:
Lloh9:
	adrp	x8, _IT87_REG_FAN_DIV@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IT87_REG_FAN_DIV@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_it87_read_value
	cbz	w23, LBB0_8
; %bb.5:
	cmp	w23, #1
	b.eq	LBB0_9
; %bb.6:
	cmp	w23, #2
	b.ne	LBB0_10
; %bb.7:
	tst	w0, #0x40
	mov	w8, #3
	csinc	w9, w8, wzr, ne
	ldr	x8, [x20, #8]
	str	w9, [x8, #8]
	b	LBB0_11
LBB0_8:
	and	w9, w0, #0x7
	ldr	x8, [x20, #8]
	str	w9, [x8]
	b	LBB0_11
LBB0_9:
	ubfx	w9, w0, #3, #3
	ldr	x8, [x20, #8]
	str	w9, [x8, #4]
	b	LBB0_11
LBB0_10:
	ldr	x8, [x20, #8]
LBB0_11:
	ldr	x22, [sp, #8]
	lsl	x25, x23, #2
	ldr	w0, [x8, x25]
	bl	_DIV_FROM_REG
	mov	x1, x0
	mov	x0, x22
	bl	_FAN_TO_REG
	mov	x2, x0
	ldr	x8, [x20]
	ldr	x8, [x8, x23, lsl #3]
	str	w0, [x8, x24, lsl #2]
Lloh12:
	adrp	x8, _IT87_REG_FAN_MIN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IT87_REG_FAN_MIN@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	ldr	w1, [x8, x25]
LBB0_12:
	mov	x0, x20
	bl	_it87_write_value
	mov	x0, x21
	bl	_mutex_unlock
LBB0_13:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_IT87_REG_FAN_MIN,8,3           ; @IT87_REG_FAN_MIN
	.comm	_IT87_REG_FANX_MIN,8,3          ; @IT87_REG_FANX_MIN
	.comm	_IT87_REG_FAN_DIV,4,2           ; @IT87_REG_FAN_DIV
	.no_dead_strip	_set_fan
.subsections_via_symbols
