	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hwpstate_get_info_from_msr
_hwpstate_get_info_from_msr:            ## @hwpstate_get_info_from_msr
	.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
	movl	%edi, %ebx
	movq	_cpu_id@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CPUID_TO_FAMILY
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_device_get_softc
	movq	%rax, %r13
	movq	_MSR_AMD_10H_11H_LIMIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_rdmsr
	movl	%eax, %edi
	callq	_AMD_10H_11H_GET_PSTATE_MAX_VAL
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %ecx
	movl	%ecx, (%r13)
	testl	%eax, %eax
	js	LBB0_10
## %bb.1:
	movq	8(%r13), %r14
	xorl	%r15d, %r15d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	imull	$100, %eax, %eax
	addl	$1600, %eax                     ## imm = 0x640
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%r12d, %ecx
	sarl	%cl, %eax
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, (%r14)
	movl	%r15d, 4(%r14)
	movq	_CPUFREQ_VAL_UNKNOWN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	movq	%rax, 24(%r14)
	movq	(%rcx), %rax
	movq	%rax, 16(%r14)
	movq	(%rcx), %rax
	movq	%rax, 8(%r14)
	incq	%r15
	movslq	(%r13), %rax
	addq	$32, %r14
	cmpq	%rax, %r15
	jge	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_MSR_AMD_10H_11H_CONFIG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	%r15, %rdi
	callq	_rdmsr
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_AMD_10H_11H_CUR_DID
	movl	%eax, %r12d
	movl	%ebx, %edi
	callq	_AMD_10H_11H_CUR_FID
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	cmpl	$23, %edx
	ja	LBB0_14
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$6619136, %ecx                  ## imm = 0x650000
	btl	%edx, %ecx
	jb	LBB0_13
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$17, %edx
	je	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$23, %edx
	jne	LBB0_14
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %edi
	callq	_AMD_17H_CUR_DID
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_HWPSTATE_DEBUG
	movl	$1, %r12d
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %edi
	callq	_AMD_17H_CUR_FID
	imull	$200, %eax, %eax
	cltd
	idivl	%r12d
	jmp	LBB0_9
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	imull	$100, %eax, %eax
	addl	$800, %eax                      ## imm = 0x320
	jmp	LBB0_12
LBB0_10:
	xorl	%eax, %eax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	leaq	L_.str.2(%rip), %rsi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_HWPSTATE_DEBUG
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_cpu_id,4,2                     ## @cpu_id
	.comm	_MSR_AMD_10H_11H_LIMIT,8,3      ## @MSR_AMD_10H_11H_LIMIT
	.comm	_MSR_AMD_10H_11H_CONFIG,8,3     ## @MSR_AMD_10H_11H_CONFIG
	.comm	_ENXIO,4,2                      ## @ENXIO
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"unexpected did: 0\n"

L_.str.2:                               ## @.str.2
	.asciz	"get_info_from_msr: AMD family 0x%02x CPUs are not supported yet\n"

	.comm	_CPUFREQ_VAL_UNKNOWN,8,3        ## @CPUFREQ_VAL_UNKNOWN
	.no_dead_strip	_hwpstate_get_info_from_msr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hwpstate_get_info_from_msr
_hwpstate_get_info_from_msr:            ; @hwpstate_get_info_from_msr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x8, _cpu_id@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cpu_id@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_CPUID_TO_FAMILY
	mov	x20, x0
	str	w19, [sp, #12]                  ; 4-byte Folded Spill
	mov	x0, x19
	bl	_device_get_softc
	mov	x21, x0
Lloh3:
	adrp	x8, _MSR_AMD_10H_11H_LIMIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MSR_AMD_10H_11H_LIMIT@GOTPAGEOFF]
Lloh5:
	ldr	x0, [x8]
	bl	_rdmsr
	bl	_AMD_10H_11H_GET_PSTATE_MAX_VAL
	add	w8, w0, #1
	str	w8, [x21]
	tbnz	w0, #31, LBB0_13
; %bb.1:
	mov	x25, #0
	ldr	x8, [x21, #8]
	add	x26, x8, #16
Lloh6:
	adrp	x27, _MSR_AMD_10H_11H_CONFIG@GOTPAGE
Lloh7:
	ldr	x27, [x27, _MSR_AMD_10H_11H_CONFIG@GOTPAGEOFF]
	mov	w28, #1
	mov	w22, #6619136
Lloh8:
	adrp	x19, _CPUFREQ_VAL_UNKNOWN@GOTPAGE
Lloh9:
	ldr	x19, [x19, _CPUFREQ_VAL_UNKNOWN@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w8, #100
	mul	w8, w0, w8
	add	w8, w8, #1600
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	asr	w8, w8, w24
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	stp	w8, w25, [x26, #-16]
	ldr	x8, [x19]
	str	x8, [x26, #8]
	ldr	x8, [x19]
	str	x8, [x26]
	ldr	x8, [x19]
	stur	x8, [x26, #-8]
	add	x25, x25, #1
	ldrsw	x8, [x21]
	add	x26, x26, #32
	cmp	x25, x8
	b.ge	LBB0_13
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x27]
	add	x0, x25, x8
	bl	_rdmsr
	mov	x23, x0
	bl	_AMD_10H_11H_CUR_DID
	mov	x24, x0
	mov	x0, x23
	bl	_AMD_10H_11H_CUR_FID
	cmp	w20, #23
	b.hi	LBB0_15
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	lsl	w8, w28, w20
	tst	w8, w22
	b.ne	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w20, #17
	b.eq	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w20, #23
	b.ne	LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x23
	bl	_AMD_17H_CUR_DID
	mov	x24, x0
	cbnz	w0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [sp, #12]                   ; 4-byte Folded Reload
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_HWPSTATE_DEBUG
	mov	w24, #1
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x23
	bl	_AMD_17H_CUR_FID
	mov	w8, #200
	mul	w8, w0, w8
	sdiv	w8, w8, w24
	b	LBB0_4
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w8, #100
	mul	w8, w0, w8
	add	w8, w8, #800
	b	LBB0_3
LBB0_13:
	mov	w0, #0
LBB0_14:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_15:
	str	x20, [sp]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	ldr	w0, [sp, #12]                   ; 4-byte Folded Reload
	bl	_HWPSTATE_DEBUG
Lloh14:
	adrp	x8, _ENXIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_cpu_id,4,2                     ; @cpu_id
	.comm	_MSR_AMD_10H_11H_LIMIT,8,3      ; @MSR_AMD_10H_11H_LIMIT
	.comm	_MSR_AMD_10H_11H_CONFIG,8,3     ; @MSR_AMD_10H_11H_CONFIG
	.comm	_ENXIO,4,2                      ; @ENXIO
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"unexpected did: 0\n"

l_.str.2:                               ; @.str.2
	.asciz	"get_info_from_msr: AMD family 0x%02x CPUs are not supported yet\n"

	.comm	_CPUFREQ_VAL_UNKNOWN,8,3        ; @CPUFREQ_VAL_UNKNOWN
	.no_dead_strip	_hwpstate_get_info_from_msr
.subsections_via_symbols
