	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function speedstep_cpu_init
_speedstep_cpu_init:                    ## @speedstep_cpu_init
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rdi)
	je	LBB0_2
## %bb.1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_4
LBB0_2:
	movq	%rdi, %r14
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_speedstep_smi_ownership
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintk
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_4:
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_speedstep_freqs@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	_SPEEDSTEP_LOW@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	leaq	(%rax,%rcx,4), %r15
	movq	_SPEEDSTEP_HIGH@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rax,%rcx,4), %rbx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_speedstep_smi_get_freqs
	testl	%eax, %eax
	je	LBB0_10
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintk
	movq	_speedstep_processor@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_speedstep_set_state@GOTPCREL(%rip), %r8
	movq	%r15, %rsi
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	callq	_speedstep_get_freqs
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintk
	jmp	LBB0_5
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintk
LBB0_10:
	xorl	%eax, %eax
	callq	_speedstep_get_state
	movq	(%r12), %rcx
	movl	%eax, %eax
	movl	(%rcx,%rax,4), %ebx
	movq	(%r13), %rax
	cmpl	(%rcx,%rax,4), %ebx
	leaq	L_.str.5(%rip), %rax
	leaq	L_.str.6(%rip), %rsi
	cmoveq	%rax, %rsi
	imulq	$274877907, %rbx, %rdx          ## imm = 0x10624DD3
	shrq	$38, %rdx
	leaq	L_.str.4(%rip), %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_dprintk
	movq	_CPUFREQ_ETERNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
	movl	%ebx, 8(%r14)
	movq	(%r12), %rsi
	movq	%r14, %rdi
	callq	_cpufreq_frequency_table_cpuinfo
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_5
## %bb.11:
	movq	(%r12), %rdi
	movq	(%r14), %rsi
	callq	_cpufreq_frequency_table_get_attr
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fails in aquiring ownership of a SMI interface.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_speedstep_freqs,8,3            ## @speedstep_freqs
	.comm	_SPEEDSTEP_LOW,8,3              ## @SPEEDSTEP_LOW
	.comm	_SPEEDSTEP_HIGH,8,3             ## @SPEEDSTEP_HIGH
L_.str.1:                               ## @.str.1
	.asciz	"could not detect low and high frequencies by SMI call.\n"

	.comm	_speedstep_processor,4,2        ## @speedstep_processor
	.comm	_speedstep_set_state,4,2        ## @speedstep_set_state
L_.str.2:                               ## @.str.2
	.asciz	"could not detect two different speeds -- aborting.\n"

L_.str.3:                               ## @.str.3
	.asciz	"workaround worked.\n"

L_.str.4:                               ## @.str.4
	.asciz	"currently at %s speed setting - %i MHz\n"

L_.str.5:                               ## @.str.5
	.asciz	"low"

L_.str.6:                               ## @.str.6
	.asciz	"high"

	.comm	_CPUFREQ_ETERNAL,4,2            ## @CPUFREQ_ETERNAL
	.no_dead_strip	_speedstep_cpu_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function speedstep_cpu_init
_speedstep_cpu_init:                    ; @speedstep_cpu_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	ldr	x8, [x0]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
	mov	x19, x0
	bl	_speedstep_smi_ownership
	cbz	w0, LBB0_6
; %bb.3:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_6:
Lloh6:
	adrp	x22, _speedstep_freqs@GOTPAGE
Lloh7:
	ldr	x22, [x22, _speedstep_freqs@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh8:
	adrp	x23, _SPEEDSTEP_LOW@GOTPAGE
Lloh9:
	ldr	x23, [x23, _SPEEDSTEP_LOW@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x20, x8, x9, lsl #2
Lloh10:
	adrp	x9, _SPEEDSTEP_HIGH@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SPEEDSTEP_HIGH@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	add	x21, x8, x9, lsl #2
	mov	x0, x20
	mov	x1, x21
	bl	_speedstep_smi_get_freqs
	cbz	w0, LBB0_10
; %bb.7:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dprintk
Lloh15:
	adrp	x8, _speedstep_processor@GOTPAGE
Lloh16:
	ldr	x8, [x8, _speedstep_processor@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
Lloh18:
	adrp	x4, _speedstep_set_state@GOTPAGE
Lloh19:
	ldr	x4, [x4, _speedstep_set_state@GOTPAGEOFF]
	mov	x1, x20
	mov	x2, x21
	mov	x3, #0
	bl	_speedstep_get_freqs
	cbz	w0, LBB0_9
; %bb.8:
	mov	x20, x0
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_dprintk
	b	LBB0_5
LBB0_9:
Lloh22:
	adrp	x0, l_.str.3@PAGE
Lloh23:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_dprintk
LBB0_10:
	bl	_speedstep_get_state
	ldr	x8, [x22]
	ldr	w20, [x8, w0, uxtw #2]
	ldr	x9, [x23]
	ldr	w8, [x8, x9, lsl #2]
Lloh24:
	adrp	x9, l_.str.6@PAGE
Lloh25:
	add	x9, x9, l_.str.6@PAGEOFF
Lloh26:
	adrp	x10, l_.str.5@PAGE
Lloh27:
	add	x10, x10, l_.str.5@PAGEOFF
	cmp	w20, w8
	csel	x8, x10, x9, eq
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	mul	x9, x20, x9
	lsr	x9, x9, #38
	stp	x8, x9, [sp]
Lloh28:
	adrp	x0, l_.str.4@PAGE
Lloh29:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_dprintk
Lloh30:
	adrp	x8, _CPUFREQ_ETERNAL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _CPUFREQ_ETERNAL@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	stp	w20, w8, [x19, #8]
	ldr	x1, [x22]
	mov	x0, x19
	bl	_cpufreq_frequency_table_cpuinfo
	mov	x20, x0
	cbnz	w0, LBB0_5
; %bb.11:
	ldr	x0, [x22]
	ldr	x1, [x19]
	bl	_cpufreq_frequency_table_get_attr
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fails in aquiring ownership of a SMI interface.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_speedstep_freqs,8,3            ; @speedstep_freqs
	.comm	_SPEEDSTEP_LOW,8,3              ; @SPEEDSTEP_LOW
	.comm	_SPEEDSTEP_HIGH,8,3             ; @SPEEDSTEP_HIGH
l_.str.1:                               ; @.str.1
	.asciz	"could not detect low and high frequencies by SMI call.\n"

	.comm	_speedstep_processor,4,2        ; @speedstep_processor
	.comm	_speedstep_set_state,4,2        ; @speedstep_set_state
l_.str.2:                               ; @.str.2
	.asciz	"could not detect two different speeds -- aborting.\n"

l_.str.3:                               ; @.str.3
	.asciz	"workaround worked.\n"

l_.str.4:                               ; @.str.4
	.asciz	"currently at %s speed setting - %i MHz\n"

l_.str.5:                               ; @.str.5
	.asciz	"low"

l_.str.6:                               ; @.str.6
	.asciz	"high"

	.comm	_CPUFREQ_ETERNAL,4,2            ; @CPUFREQ_ETERNAL
	.no_dead_strip	_speedstep_cpu_init
.subsections_via_symbols
