	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ips_detect_cpu
_ips_detect_cpu:                        ## @ips_detect_cpu
	.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	%rdi, %r14
	movq	_boot_cpu_data@GOTPCREL(%rip), %rbx
	cmpl	$6, (%rbx)
	jne	LBB0_2
## %bb.1:
	cmpl	$37, 4(%rbx)
	jne	LBB0_2
## %bb.4:
	movq	_IA32_MISC_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rdmsrl
	movl	$0, (%r14)
	movl	8(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_ips_sv_limits@GOTPCREL(%rip), %rbx
	jmp	LBB0_10
LBB0_2:
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
LBB0_3:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_info
	jmp	LBB0_12
LBB0_6:
	movl	8(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_ips_lv_limits@GOTPCREL(%rip), %rbx
	jmp	LBB0_10
LBB0_8:
	movl	8(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_13
## %bb.9:
	movq	_ips_ulv_limits@GOTPCREL(%rip), %rbx
LBB0_10:
	movq	_TURBO_POWER_CURRENT_LIMIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rdmsrl
	movl	(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	4(%r14), %edi
	cltq
	imulq	$274877907, %rax, %rcx          ## imm = 0x10624DD3
	movq	%rcx, %rax
	shrq	$63, %rax
	sarq	$38, %rcx
	addl	%eax, %ecx
	leaq	L_.str.5(%rip), %rsi
	xorl	%edx, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_dev_info
	movl	$0, (%rbx)
LBB0_12:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_13:
	movl	4(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_boot_cpu_data,12,2             ## @boot_cpu_data
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Non-IPS CPU detected.\n"

	.comm	_IA32_MISC_ENABLE,4,2           ## @IA32_MISC_ENABLE
	.comm	_IA32_MISC_TURBO_EN,4,2         ## @IA32_MISC_TURBO_EN
L_.str.1:                               ## @.str.1
	.asciz	"CPU       M"

	.comm	_ips_sv_limits,4,2              ## @ips_sv_limits
L_.str.2:                               ## @.str.2
	.asciz	"CPU       L"

	.comm	_ips_lv_limits,4,2              ## @ips_lv_limits
L_.str.3:                               ## @.str.3
	.asciz	"CPU       U"

	.comm	_ips_ulv_limits,4,2             ## @ips_ulv_limits
L_.str.4:                               ## @.str.4
	.asciz	"No CPUID match found.\n"

	.comm	_TURBO_POWER_CURRENT_LIMIT,4,2  ## @TURBO_POWER_CURRENT_LIMIT
	.comm	_TURBO_TDP_MASK,4,2             ## @TURBO_TDP_MASK
L_.str.5:                               ## @.str.5
	.asciz	"CPU TDP doesn't match expected value (found %d, expected %d)\n"

	.no_dead_strip	_ips_detect_cpu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ips_detect_cpu
_ips_detect_cpu:                        ; @ips_detect_cpu
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _boot_cpu_data@GOTPAGE
Lloh1:
	ldr	x20, [x20, _boot_cpu_data@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #6
	b.ne	LBB0_4
; %bb.1:
	ldr	w8, [x20, #4]
	cmp	w8, #37
	b.ne	LBB0_4
; %bb.2:
Lloh2:
	adrp	x8, _IA32_MISC_ENABLE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IA32_MISC_ENABLE@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_rdmsrl
	str	wzr, [x19]
	ldr	w0, [x20, #8]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_6
; %bb.3:
Lloh7:
	adrp	x20, _ips_sv_limits@GOTPAGE
Lloh8:
	ldr	x20, [x20, _ips_sv_limits@GOTPAGEOFF]
	b	LBB0_10
LBB0_4:
	ldr	w0, [x19, #4]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
LBB0_5:
	bl	_dev_info
	mov	x20, #0
	b	LBB0_12
LBB0_6:
	ldr	w0, [x20, #8]
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_8
; %bb.7:
Lloh13:
	adrp	x20, _ips_lv_limits@GOTPAGE
Lloh14:
	ldr	x20, [x20, _ips_lv_limits@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
	ldr	w0, [x20, #8]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_13
; %bb.9:
Lloh17:
	adrp	x20, _ips_ulv_limits@GOTPAGE
Lloh18:
	ldr	x20, [x20, _ips_ulv_limits@GOTPAGEOFF]
LBB0_10:
Lloh19:
	adrp	x8, _TURBO_POWER_CURRENT_LIMIT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _TURBO_POWER_CURRENT_LIMIT@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_rdmsrl
	ldr	w8, [x20]
	cbz	w8, LBB0_12
; %bb.11:
	ldr	w0, [x19, #4]
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	stp	xzr, x8, [sp]
Lloh22:
	adrp	x1, l_.str.5@PAGE
Lloh23:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_info
	str	wzr, [x20]
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_13:
	ldr	w0, [x19, #4]
Lloh24:
	adrp	x1, l_.str.4@PAGE
Lloh25:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_boot_cpu_data,12,2             ; @boot_cpu_data
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Non-IPS CPU detected.\n"

	.comm	_IA32_MISC_ENABLE,4,2           ; @IA32_MISC_ENABLE
	.comm	_IA32_MISC_TURBO_EN,4,2         ; @IA32_MISC_TURBO_EN
l_.str.1:                               ; @.str.1
	.asciz	"CPU       M"

	.comm	_ips_sv_limits,4,2              ; @ips_sv_limits
l_.str.2:                               ; @.str.2
	.asciz	"CPU       L"

	.comm	_ips_lv_limits,4,2              ; @ips_lv_limits
l_.str.3:                               ; @.str.3
	.asciz	"CPU       U"

	.comm	_ips_ulv_limits,4,2             ; @ips_ulv_limits
l_.str.4:                               ; @.str.4
	.asciz	"No CPUID match found.\n"

	.comm	_TURBO_POWER_CURRENT_LIMIT,4,2  ; @TURBO_POWER_CURRENT_LIMIT
	.comm	_TURBO_TDP_MASK,4,2             ; @TURBO_TDP_MASK
l_.str.5:                               ; @.str.5
	.asciz	"CPU TDP doesn't match expected value (found %d, expected %d)\n"

	.no_dead_strip	_ips_detect_cpu
.subsections_via_symbols
