	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fan_set_level_safe
_fan_set_level_safe:                    ## @fan_set_level_safe
	.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_1
## %bb.3:
	movl	%edi, %r14d
	movq	_fan_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock_killable
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_EPERM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_5:
	movq	_TPACPI_FAN_LAST_LEVEL@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_7
## %bb.6:
	movq	_fan_control_desired_level@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_7:
	movl	%r14d, %edi
	callq	_fan_set_level
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movl	%r14d, %edi
	callq	_fan_update_desired_level
LBB0_9:
	movq	_fan_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_10:
	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_mutex,4,2                  ## @fan_mutex
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_TPACPI_FAN_LAST_LEVEL,4,2      ## @TPACPI_FAN_LAST_LEVEL
	.comm	_fan_control_desired_level,4,2  ## @fan_control_desired_level
	.no_dead_strip	_fan_set_level_safe
.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_safe
_fan_set_level_safe:                    ; @fan_set_level_safe
	.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_3
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x0, _fan_mutex@GOTPAGE
Lloh4:
	ldr	x0, [x0, _fan_mutex@GOTPAGEOFF]
	bl	_mutex_lock_killable
	cbz	x0, LBB0_5
; %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
	b	LBB0_8
LBB0_5:
Lloh9:
	adrp	x8, _TPACPI_FAN_LAST_LEVEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TPACPI_FAN_LAST_LEVEL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _fan_control_desired_level@GOTPAGE
Lloh13:
	ldr	x9, [x9, _fan_control_desired_level@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w19
	csel	w20, w9, w19, eq
	mov	x0, x20
	bl	_fan_set_level
	mov	x19, x0
	cbnz	w0, LBB0_7
; %bb.6:
	mov	x0, x20
	bl	_fan_update_desired_level
LBB0_7:
Lloh15:
	adrp	x0, _fan_mutex@GOTPAGE
Lloh16:
	ldr	x0, [x0, _fan_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_8:
	mov	x0, x19
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.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	_TPACPI_FAN_LAST_LEVEL,4,2      ; @TPACPI_FAN_LAST_LEVEL
	.comm	_fan_control_desired_level,4,2  ; @fan_control_desired_level
	.no_dead_strip	_fan_set_level_safe
.subsections_via_symbols
