	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fan_set_enable
_fan_set_enable:                        ## @fan_set_enable
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_fan_control_allowed@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_3
## %bb.1:
	movq	_fan_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock_killable
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_EPERM@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_6:
	movq	_fan_control_access_mode@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$130, %eax
	je	LBB0_9
## %bb.7:
	cmpl	$129, %eax
	je	LBB0_14
## %bb.8:
	cmpl	$128, %eax
	jne	LBB0_18
LBB0_9:
	leaq	-12(%rbp), %rdi
	callq	_fan_get_status
	testl	%eax, %eax
	js	LBB0_17
## %bb.10:
	movl	-12(%rbp), %eax
	movl	$7, %esi
	cmpl	$7, %eax
	je	LBB0_12
## %bb.11:
	andl	$3, %eax
	movq	_TP_EC_FAN_AUTO@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	orl	$4, %eax
	movl	%eax, -12(%rbp)
	movl	%eax, %esi
LBB0_12:
	movq	_fan_status_offset@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_acpi_ec_write
	testl	%eax, %eax
	je	LBB0_20
## %bb.13:
	movq	_tp_features@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	jmp	LBB0_16
LBB0_14:
	leaq	-12(%rbp), %rdi
	callq	_fan_get_status
	testl	%eax, %eax
	js	LBB0_17
## %bb.15:
	movl	-12(%rbp), %r8d
	andl	$3, %r8d
	orl	$4, %r8d
	movl	%r8d, -12(%rbp)
	movq	_sfan_handle@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rcx
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_acpi_evalf
	testl	%eax, %eax
	je	LBB0_20
LBB0_16:
	movq	_fan_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	jmp	LBB0_23
LBB0_17:
	movl	%eax, %ebx
	movq	_fan_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	jmp	LBB0_5
LBB0_18:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_20:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_21:
	movl	(%rax), %ebx
	movq	_fan_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_23
## %bb.22:
	negl	%ebx
	jmp	LBB0_5
LBB0_23:
	movq	_TPACPI_DBG_FAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-12(%rbp), %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_vdbg_printk
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_fan_control_allowed,4,2        ## @fan_control_allowed
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_fan_mutex,4,2                  ## @fan_mutex
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_fan_control_access_mode,4,2    ## @fan_control_access_mode
	.comm	_TP_EC_FAN_AUTO,4,2             ## @TP_EC_FAN_AUTO
	.comm	_fan_status_offset,4,2          ## @fan_status_offset
	.comm	_EIO,4,2                        ## @EIO
	.comm	_tp_features,4,2                ## @tp_features
	.comm	_sfan_handle,4,2                ## @sfan_handle
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vd"

	.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_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fan_set_enable
_fan_set_enable:                        ; @fan_set_enable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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_3
; %bb.1:
Lloh3:
	adrp	x0, _fan_mutex@GOTPAGE
Lloh4:
	ldr	x0, [x0, _fan_mutex@GOTPAGEOFF]
	bl	_mutex_lock_killable
	cbz	x0, LBB0_6
; %bb.2:
Lloh5:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh7:
	adrp	x8, _EPERM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_5:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_6:
Lloh9:
	adrp	x8, _fan_control_access_mode@GOTPAGE
Lloh10:
	ldr	x8, [x8, _fan_control_access_mode@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w8, #130
	b.eq	LBB0_9
; %bb.7:
	cmp	w8, #129
	b.eq	LBB0_12
; %bb.8:
	cmp	w8, #128
	b.ne	LBB0_15
LBB0_9:
	add	x0, sp, #12
	bl	_fan_get_status
	tbnz	w0, #31, LBB0_14
; %bb.10:
	ldr	w8, [sp, #12]
	cmp	w8, #7
	b.ne	LBB0_16
; %bb.11:
	mov	w1, #7
	b	LBB0_17
LBB0_12:
	add	x0, sp, #12
	bl	_fan_get_status
	tbnz	w0, #31, LBB0_14
; %bb.13:
	ldr	w8, [sp, #12]
	mov	w4, #4
	bfxil	w4, w8, #0, #2
	str	w4, [sp, #12]
Lloh12:
	adrp	x8, _sfan_handle@GOTPAGE
Lloh13:
	ldr	x8, [x8, _sfan_handle@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x3, l_.str@PAGE
Lloh16:
	add	x3, x3, l_.str@PAGEOFF
	mov	x1, #0
	mov	x2, #0
	bl	_acpi_evalf
	cbnz	w0, LBB0_19
	b	LBB0_20
LBB0_14:
	mov	x19, x0
Lloh17:
	adrp	x0, _fan_mutex@GOTPAGE
Lloh18:
	ldr	x0, [x0, _fan_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	b	LBB0_5
LBB0_15:
Lloh19:
	adrp	x8, _ENXIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_21
LBB0_16:
	and	w8, w8, #0x3
Lloh21:
	adrp	x9, _TP_EC_FAN_AUTO@GOTPAGE
Lloh22:
	ldr	x9, [x9, _TP_EC_FAN_AUTO@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w8, w9
	orr	w1, w8, #0x4
	str	w1, [sp, #12]
LBB0_17:
Lloh24:
	adrp	x8, _fan_status_offset@GOTPAGE
Lloh25:
	ldr	x8, [x8, _fan_status_offset@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	bl	_acpi_ec_write
	cbz	w0, LBB0_20
; %bb.18:
Lloh27:
	adrp	x8, _tp_features@GOTPAGE
Lloh28:
	ldr	x8, [x8, _tp_features@GOTPAGEOFF]
Lloh29:
	str	wzr, [x8]
LBB0_19:
Lloh30:
	adrp	x0, _fan_mutex@GOTPAGE
Lloh31:
	ldr	x0, [x0, _fan_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	b	LBB0_23
LBB0_20:
Lloh32:
	adrp	x8, _EIO@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_21:
	ldr	w19, [x8]
Lloh34:
	adrp	x0, _fan_mutex@GOTPAGE
Lloh35:
	ldr	x0, [x0, _fan_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	cbz	w19, LBB0_23
; %bb.22:
	neg	w19, w19
	b	LBB0_5
LBB0_23:
Lloh36:
	adrp	x8, _TPACPI_DBG_FAN@GOTPAGE
Lloh37:
	ldr	x8, [x8, _TPACPI_DBG_FAN@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
	ldr	w2, [sp, #12]
Lloh39:
	adrp	x1, l_.str.1@PAGE
Lloh40:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_vdbg_printk
	mov	w19, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_fan_control_allowed,4,2        ; @fan_control_allowed
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_fan_mutex,4,2                  ; @fan_mutex
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_fan_control_access_mode,4,2    ; @fan_control_access_mode
	.comm	_TP_EC_FAN_AUTO,4,2             ; @TP_EC_FAN_AUTO
	.comm	_fan_status_offset,4,2          ; @fan_status_offset
	.comm	_EIO,4,2                        ; @EIO
	.comm	_tp_features,4,2                ; @tp_features
	.comm	_sfan_handle,4,2                ; @sfan_handle
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vd"

	.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_enable
.subsections_via_symbols
