	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fan_set_level
_fan_set_level:                         ## @fan_set_level
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_fan_control_allowed@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_7
## %bb.1:
	movl	%edi, %r14d
	movq	_fan_control_access_mode@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$128, %eax
	je	LBB0_8
## %bb.2:
	cmpl	$130, %eax
	je	LBB0_8
## %bb.3:
	cmpl	$129, %eax
	jne	LBB0_12
## %bb.4:
	cmpl	$7, %r14d
	ja	LBB0_15
## %bb.5:
	movq	_sfan_handle@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rcx
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	%r14d, %r8d
	callq	_acpi_evalf
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_7:
	movq	_EPERM@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_8:
	movq	_TP_EC_FAN_AUTO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_TP_EC_FAN_FULLSPEED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%r14d, %eax
	je	LBB0_13
LBB0_9:
	movl	%r14d, %edx
	orl	$7, %edx
	movl	%r14d, %esi
	orl	$4, %esi
	testl	%r14d, %eax
	cmovel	%r14d, %esi
	testl	%r14d, %ecx
	movl	%esi, %r14d
	cmovnel	%edx, %r14d
	movq	_fan_status_offset@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_acpi_ec_write
	testl	%eax, %eax
	je	LBB0_16
## %bb.10:
	movq	_tp_features@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
LBB0_11:
	movq	_TPACPI_DBG_FAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edx
	callq	_vdbg_printk
	xorl	%ebx, %ebx
	jmp	LBB0_19
LBB0_12:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_13:
	cmpl	$8, %r14d
	jb	LBB0_9
## %bb.14:
	movl	%ecx, %edx
	andl	%r14d, %edx
	jne	LBB0_9
LBB0_15:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_16:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_17:
	xorl	%ebx, %ebx
LBB0_18:
	subl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_fan_control_allowed,4,2        ## @fan_control_allowed
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_fan_control_access_mode,4,2    ## @fan_control_access_mode
	.comm	_sfan_handle,4,2                ## @sfan_handle
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vd"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TP_EC_FAN_AUTO,4,2             ## @TP_EC_FAN_AUTO
	.comm	_TP_EC_FAN_FULLSPEED,4,2        ## @TP_EC_FAN_FULLSPEED
	.comm	_fan_status_offset,4,2          ## @fan_status_offset
	.comm	_tp_features,4,2                ## @tp_features
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_TPACPI_DBG_FAN,4,2             ## @TPACPI_DBG_FAN
L_.str.1:                               ## @.str.1
	.asciz	"fan control: set fan control register to 0x%02x\n"

	.no_dead_strip	_fan_set_level
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fan_set_level
_fan_set_level:                         ; @fan_set_level
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _fan_control_allowed@GOTPAGE
Lloh1:
	ldr	x8, [x8, _fan_control_allowed@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _fan_control_access_mode@GOTPAGE
Lloh4:
	ldr	x8, [x8, _fan_control_access_mode@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, #128
	b.eq	LBB0_7
; %bb.2:
	cmp	w8, #130
	b.eq	LBB0_7
; %bb.3:
	cmp	w8, #129
	b.ne	LBB0_11
; %bb.4:
	cmp	w19, #7
	b.hi	LBB0_12
; %bb.5:
Lloh6:
	adrp	x8, _sfan_handle@GOTPAGE
Lloh7:
	ldr	x8, [x8, _sfan_handle@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x3, l_.str@PAGE
Lloh10:
	add	x3, x3, l_.str@PAGEOFF
	mov	x1, #0
	mov	x2, #0
	mov	x4, x19
	bl	_acpi_evalf
	cbnz	w0, LBB0_10
	b	LBB0_13
LBB0_6:
Lloh11:
	adrp	x8, _EPERM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_14
LBB0_7:
Lloh13:
	adrp	x8, _TP_EC_FAN_AUTO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _TP_EC_FAN_AUTO@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x10, _TP_EC_FAN_FULLSPEED@GOTPAGE
Lloh17:
	ldr	x10, [x10, _TP_EC_FAN_FULLSPEED@GOTPAGEOFF]
	and	w9, w8, w19
Lloh18:
	ldr	w8, [x10]
	and	w8, w8, w19
	cmp	w9, #0
	ccmp	w19, #8, #0, eq
	ccmp	w8, #0, #0, hs
	b.eq	LBB0_12
; %bb.8:
	orr	w10, w19, #0x7
	orr	w11, w19, #0x4
	cmp	w9, #0
	csel	w9, w19, w11, eq
	cmp	w8, #0
	csel	w19, w9, w10, eq
Lloh19:
	adrp	x8, _fan_status_offset@GOTPAGE
Lloh20:
	ldr	x8, [x8, _fan_status_offset@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_acpi_ec_write
	cbz	w0, LBB0_13
; %bb.9:
Lloh22:
	adrp	x8, _tp_features@GOTPAGE
Lloh23:
	ldr	x8, [x8, _tp_features@GOTPAGEOFF]
Lloh24:
	str	wzr, [x8]
LBB0_10:
Lloh25:
	adrp	x8, _TPACPI_DBG_FAN@GOTPAGE
Lloh26:
	ldr	x8, [x8, _TPACPI_DBG_FAN@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
Lloh28:
	adrp	x1, l_.str.1@PAGE
Lloh29:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	bl	_vdbg_printk
	mov	w0, #0
	b	LBB0_15
LBB0_11:
Lloh30:
	adrp	x8, _ENXIO@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_14
LBB0_12:
Lloh32:
	adrp	x8, _EINVAL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_14
LBB0_13:
Lloh34:
	adrp	x8, _EIO@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotStr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_fan_control_allowed,4,2        ; @fan_control_allowed
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_fan_control_access_mode,4,2    ; @fan_control_access_mode
	.comm	_sfan_handle,4,2                ; @sfan_handle
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vd"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TP_EC_FAN_AUTO,4,2             ; @TP_EC_FAN_AUTO
	.comm	_TP_EC_FAN_FULLSPEED,4,2        ; @TP_EC_FAN_FULLSPEED
	.comm	_fan_status_offset,4,2          ; @fan_status_offset
	.comm	_tp_features,4,2                ; @tp_features
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_TPACPI_DBG_FAN,4,2             ; @TPACPI_DBG_FAN
l_.str.1:                               ; @.str.1
	.asciz	"fan control: set fan control register to 0x%02x\n"

	.no_dead_strip	_fan_set_level
.subsections_via_symbols
