	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i8k_set_fan
_i8k_set_fan:                           ## @i8k_set_fan
	.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	_I8K_SMM_SET_FAN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movq	_disallow_fan_support@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_4
LBB0_2:
	movl	%edi, %ebx
	movq	_i8k_fan_max@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%esi, %eax
	cmovgel	%esi, %eax
	shll	$8, %eax
	xorl	%ecx, %ecx
	testl	%esi, %esi
	cmovnsl	%eax, %ecx
	movzbl	%bl, %eax
	orl	%ecx, %eax
	movl	%eax, -16(%rbp)
	leaq	-16(%rbp), %rdi
	callq	_i8k_smm
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movl	%ebx, %edi
	callq	_i8k_get_fan_status
	movl	%eax, %eax
LBB0_4:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I8K_SMM_SET_FAN,4,2            ## @I8K_SMM_SET_FAN
	.comm	_disallow_fan_support,8,3       ## @disallow_fan_support
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_i8k_fan_max,4,2                ## @i8k_fan_max
	.no_dead_strip	_i8k_set_fan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i8k_set_fan
_i8k_set_fan:                           ; @i8k_set_fan
	.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, _I8K_SMM_SET_FAN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I8K_SMM_SET_FAN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #12]
Lloh3:
	adrp	x8, _disallow_fan_support@GOTPAGE
Lloh4:
	ldr	x8, [x8, _disallow_fan_support@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_2:
	mov	x19, x0
Lloh9:
	adrp	x8, _i8k_fan_max@GOTPAGE
Lloh10:
	ldr	x8, [x8, _i8k_fan_max@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w8, w1
	csel	w8, w8, w1, lt
	lsl	w8, w8, #8
	cmp	w1, #0
	csel	w8, wzr, w8, lt
	bfxil	w8, w0, #0, #8
	str	w8, [sp, #8]
	add	x0, sp, #8
	bl	_i8k_smm
	cbnz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_i8k_get_fan_status
	mov	w0, w0
LBB0_4:
                                        ; kill: def $w0 killed $w0 killed $x0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_I8K_SMM_SET_FAN,4,2            ; @I8K_SMM_SET_FAN
	.comm	_disallow_fan_support,8,3       ; @disallow_fan_support
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_i8k_fan_max,4,2                ; @i8k_fan_max
	.no_dead_strip	_i8k_set_fan
.subsections_via_symbols
