	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function applesmc_store_fan_manual
_applesmc_store_fan_manual:             ## @applesmc_store_fan_manual
	.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, %rbx
	movq	%rsi, %rdi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_to_sensor_dev_attr
	movq	%rax, %r14
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$10, %edx
	callq	_simple_strtoul
	movq	%rax, %r15
	movq	_applesmc_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_FANS_MANUAL@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	leaq	-56(%rbp), %rsi
	movl	$2, %edx
	callq	_applesmc_read_key
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movl	-56(%rbp), %eax
	shll	$8, %eax
	orl	-52(%rbp), %eax
	movb	(%r14), %cl
	movl	%eax, %edx
	btsl	%ecx, %edx
	btrl	%ecx, %eax
	testq	%r15, %r15
	cmovnel	%edx, %eax
	movzbl	%ah, %ecx
	movl	%ecx, -56(%rbp)
	movzbl	%al, %eax
	movl	%eax, -52(%rbp)
	movl	(%r13), %edi
	leaq	-56(%rbp), %rsi
	movl	$2, %edx
	callq	_applesmc_write_key
	movl	%eax, %ebx
LBB0_2:
	movq	_applesmc_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	cmovnel	%ebx, %r12d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_4
## %bb.3:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_applesmc_lock,4,2              ## @applesmc_lock
	.comm	_FANS_MANUAL,4,2                ## @FANS_MANUAL
	.no_dead_strip	_applesmc_store_fan_manual
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function applesmc_store_fan_manual
_applesmc_store_fan_manual:             ; @applesmc_store_fan_manual
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x3
	mov	x21, x2
	mov	x0, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	bl	_to_sensor_dev_attr
	mov	x20, x0
	mov	x0, x21
	mov	x1, #0
	mov	w2, #10
	bl	_simple_strtoul
	mov	x21, x0
Lloh3:
	adrp	x0, _applesmc_lock@GOTPAGE
Lloh4:
	ldr	x0, [x0, _applesmc_lock@GOTPAGEOFF]
	bl	_mutex_lock
Lloh5:
	adrp	x23, _FANS_MANUAL@GOTPAGE
Lloh6:
	ldr	x23, [x23, _FANS_MANUAL@GOTPAGEOFF]
	ldr	w0, [x23]
	mov	x1, sp
	mov	w2, #2
	bl	_applesmc_read_key
	mov	x22, x0
	cbnz	w0, LBB0_2
; %bb.1:
	ldp	w8, w9, [sp]
	orr	w8, w9, w8, lsl #8
	ldr	w9, [x20]
	mov	w10, #1
	lsl	w9, w10, w9
	orr	w10, w9, w8
	bic	w8, w8, w9
	cmp	x21, #0
	csel	w8, w8, w10, eq
	ubfx	w9, w8, #8, #8
	and	w8, w8, #0xff
	stp	w9, w8, [sp]
	ldr	w0, [x23]
	mov	x1, sp
	mov	w2, #2
	bl	_applesmc_write_key
	mov	x22, x0
LBB0_2:
Lloh7:
	adrp	x0, _applesmc_lock@GOTPAGE
Lloh8:
	ldr	x0, [x0, _applesmc_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	cmp	w22, #0
	csel	w0, w19, w22, eq
	ldr	x8, [sp, #8]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.3:
	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
	add	sp, sp, #80
	ret
LBB0_4:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_applesmc_lock,4,2              ; @applesmc_lock
	.comm	_FANS_MANUAL,4,2                ; @FANS_MANUAL
	.no_dead_strip	_applesmc_store_fan_manual
.subsections_via_symbols
