	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function acerhdf_change_fanstate
_acerhdf_change_fanstate:               ## @acerhdf_change_fanstate
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	_verbose@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_2
## %bb.1:
	movq	_ACERHDF_FAN_OFF@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rsi
	cmoveq	%rax, %rsi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_notice
LBB0_2:
	movq	_ACERHDF_FAN_OFF@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	cmpl	%ebx, %eax
	je	LBB0_5
## %bb.3:
	movq	_ACERHDF_FAN_AUTO@GOTPCREL(%rip), %r12
	cmpl	%ebx, (%r12)
	je	LBB0_5
## %bb.4:
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %esi
	callq	_pr_err
	movl	(%r12), %ebx
	movl	(%r15), %eax
LBB0_5:
	xorl	%ecx, %ecx
	cmpl	%eax, %ebx
	sete	%cl
	movq	_ctrl_cfg@GOTPCREL(%rip), %r12
	movq	_fanstate@GOTPCREL(%rip), %rax
	negq	%rcx
	movzbl	13(%r12,%rcx), %esi
	movl	%ebx, (%rax)
	movl	8(%r12), %edi
	callq	_ec_write
	cmpq	$0, (%r12)
	je	LBB0_10
## %bb.6:
	cmpl	(%r15), %ebx
	jne	LBB0_10
## %bb.7:
	cmpq	$0, (%r14)
	je	LBB0_9
## %bb.8:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_notice
LBB0_9:
	movq	_mcmd@GOTPCREL(%rip), %rax
	movl	4(%rax), %edi
	movzbl	(%rax), %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ec_write                       ## TAILCALL
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_verbose,8,3                    ## @verbose
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fan %s\n"

	.comm	_ACERHDF_FAN_OFF,4,2            ## @ACERHDF_FAN_OFF
L_.str.1:                               ## @.str.1
	.asciz	"OFF"

L_.str.2:                               ## @.str.2
	.asciz	"ON"

	.comm	_ACERHDF_FAN_AUTO,4,2           ## @ACERHDF_FAN_AUTO
L_.str.3:                               ## @.str.3
	.asciz	"invalid fan state %d requested, setting to auto!\n"

	.comm	_ctrl_cfg,16,3                  ## @ctrl_cfg
	.comm	_fanstate,4,2                   ## @fanstate
L_.str.4:                               ## @.str.4
	.asciz	"turning off fan manually\n"

	.comm	_mcmd,8,2                       ## @mcmd
	.no_dead_strip	_acerhdf_change_fanstate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function acerhdf_change_fanstate
_acerhdf_change_fanstate:               ; @acerhdf_change_fanstate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x0
Lloh0:
	adrp	x20, _verbose@GOTPAGE
Lloh1:
	ldr	x20, [x20, _verbose@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh2:
	adrp	x21, _ACERHDF_FAN_OFF@GOTPAGE
Lloh3:
	ldr	x21, [x21, _ACERHDF_FAN_OFF@GOTPAGEOFF]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w8, [x21]
Lloh4:
	adrp	x9, l_.str.2@PAGE
Lloh5:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh6:
	adrp	x10, l_.str.1@PAGE
Lloh7:
	add	x10, x10, l_.str.1@PAGEOFF
	cmp	w8, w19
	csel	x8, x10, x9, eq
	str	x8, [sp]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_notice
LBB0_2:
	ldr	w8, [x21]
Lloh10:
	adrp	x22, _ACERHDF_FAN_AUTO@GOTPAGE
Lloh11:
	ldr	x22, [x22, _ACERHDF_FAN_AUTO@GOTPAGEOFF]
	ldr	w9, [x22]
	cmp	w8, w19
	ccmp	w9, w19, #4, ne
	b.eq	LBB0_4
; %bb.3:
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_pr_err
	ldr	w19, [x22]
	ldr	w8, [x21]
LBB0_4:
Lloh14:
	adrp	x22, _ctrl_cfg@GOTPAGE
Lloh15:
	ldr	x22, [x22, _ctrl_cfg@GOTPAGEOFF]
	add	x9, x22, #12
Lloh16:
	adrp	x10, _fanstate@GOTPAGE
Lloh17:
	ldr	x10, [x10, _fanstate@GOTPAGEOFF]
	add	x11, x22, #13
	cmp	w19, w8
	csel	x8, x9, x11, eq
	ldrb	w1, [x8]
Lloh18:
	str	w19, [x10]
	ldr	w0, [x22, #8]
	bl	_ec_write
	ldr	x8, [x22]
	ldr	w9, [x21]
	cmp	x8, #0
	ccmp	w19, w9, #0, ne
	b.eq	LBB0_6
; %bb.5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_6:
	ldr	x8, [x20]
	cbz	x8, LBB0_8
; %bb.7:
Lloh19:
	adrp	x0, l_.str.4@PAGE
Lloh20:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_notice
LBB0_8:
Lloh21:
	adrp	x8, _mcmd@GOTPAGE
Lloh22:
	ldr	x8, [x8, _mcmd@GOTPAGEOFF]
	ldr	w0, [x8, #4]
	ldrb	w1, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_ec_write
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_verbose,8,3                    ; @verbose
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fan %s\n"

	.comm	_ACERHDF_FAN_OFF,4,2            ; @ACERHDF_FAN_OFF
l_.str.1:                               ; @.str.1
	.asciz	"OFF"

l_.str.2:                               ; @.str.2
	.asciz	"ON"

	.comm	_ACERHDF_FAN_AUTO,4,2           ; @ACERHDF_FAN_AUTO
l_.str.3:                               ; @.str.3
	.asciz	"invalid fan state %d requested, setting to auto!\n"

	.comm	_ctrl_cfg,16,3                  ; @ctrl_cfg
	.comm	_fanstate,4,2                   ; @fanstate
l_.str.4:                               ; @.str.4
	.asciz	"turning off fan manually\n"

	.comm	_mcmd,8,2                       ; @mcmd
	.no_dead_strip	_acerhdf_change_fanstate
.subsections_via_symbols
