	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function applesmc_store_fan_speed
_applesmc_store_fan_speed:              ## @applesmc_store_fan_speed
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %rdi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	callq	_to_sensor_dev_attr_2
	movq	%rax, %r12
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$10, %edx
	callq	_simple_strtoul
	cmpl	$16385, %eax                    ## imm = 0x4001
	jl	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_3
LBB0_2:
	movl	%eax, %r15d
	movq	_fan_speed_keys@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r12), %rcx
	movq	(%rax,%rcx,8), %rax
	movb	(%rax), %cl
	movb	%cl, -53(%rbp)
	movb	8(%r12), %cl
	addb	$48, %cl
	movb	%cl, -52(%rbp)
	movb	2(%rax), %cl
	movb	%cl, -51(%rbp)
	movb	3(%rax), %al
	movb	%al, -50(%rbp)
	movb	$0, -49(%rbp)
	movq	_applesmc_lock@GOTPCREL(%rip), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movl	%r15d, %eax
	shrl	$6, %eax
	movzbl	%al, %eax
	movl	%eax, -48(%rbp)
	shll	$2, %r15d
	movzbl	%r15b, %eax
	movl	%eax, -44(%rbp)
	leaq	-53(%rbp), %rdi
	leaq	-48(%rbp), %rsi
	movl	$2, %edx
	callq	_applesmc_write_key
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	cmovnel	%ebx, %r14d
	movl	%r14d, %ebx
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_5
## %bb.4:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_fan_speed_keys,8,3             ## @fan_speed_keys
	.comm	_applesmc_lock,4,2              ## @applesmc_lock
	.no_dead_strip	_applesmc_store_fan_speed
.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_speed
_applesmc_store_fan_speed:              ; @applesmc_store_fan_speed
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x3
	mov	x20, 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, #24]
	bl	_to_sensor_dev_attr_2
	mov	x21, x0
	mov	x0, x20
	mov	x1, #0
	mov	w2, #10
	bl	_simple_strtoul
	cmp	w0, #4, lsl #12                 ; =16384
	b.le	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
	mov	x20, x0
Lloh6:
	adrp	x8, _fan_speed_keys@GOTPAGE
Lloh7:
	ldr	x8, [x8, _fan_speed_keys@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	x9, [x21]
	ldr	x8, [x8, x9, lsl #3]
	ldrb	w9, [x8]
	strb	w9, [sp, #11]
	ldrb	w9, [x21, #8]
	add	w9, w9, #48
	strb	w9, [sp, #12]
	ldrb	w9, [x8, #2]
	strb	w9, [sp, #13]
	ldrb	w8, [x8, #3]
	strb	w8, [sp, #14]
	strb	wzr, [sp, #15]
Lloh9:
	adrp	x21, _applesmc_lock@GOTPAGE
Lloh10:
	ldr	x21, [x21, _applesmc_lock@GOTPAGEOFF]
	mov	x0, x21
	bl	_mutex_lock
	ubfx	w8, w20, #6, #8
	ubfiz	w9, w20, #2, #6
	stp	w8, w9, [sp, #16]
	add	x0, sp, #11
	add	x1, sp, #16
	mov	w2, #2
	bl	_applesmc_write_key
	mov	x20, x0
	mov	x0, x21
	bl	_mutex_unlock
	cmp	w20, #0
	csel	w0, w19, w20, eq
LBB0_3:
	ldr	x8, [sp, #24]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	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
	add	sp, sp, #80
	ret
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_fan_speed_keys,8,3             ; @fan_speed_keys
	.comm	_applesmc_lock,4,2              ; @applesmc_lock
	.no_dead_strip	_applesmc_store_fan_speed
.subsections_via_symbols
