	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmx_msr_init                   ## -- Begin function vmx_msr_init
	.p2align	4, 0x90
_vmx_msr_init:                          ## @vmx_msr_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_MSR_LSTAR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rdmsr
	movq	_host_msrs@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	movq	_IDX_MSR_LSTAR@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	_MSR_CSTAR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rdmsr
	movq	(%rbx), %rcx
	movq	_IDX_MSR_CSTAR@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	_MSR_STAR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rdmsr
	movq	(%rbx), %rcx
	movq	_IDX_MSR_STAR@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	_MSR_SF_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rdmsr
	movq	(%rbx), %rcx
	movq	_IDX_MSR_SF_MASK@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	_MSR_IA32_MISC_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rdmsr
	andl	$-333825, %eax                  ## imm = 0xFFFAE7FF
	orl	$6144, %eax                     ## imm = 0x1800
	movq	_misc_enable@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_nehalem_cpu
	movl	$133330000, %ecx                ## imm = 0x7F27450
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_westmere_cpu
	testq	%rax, %rax
	movl	$100000000, %eax                ## imm = 0x5F5E100
	movl	$133330000, %ecx                ## imm = 0x7F27450
	cmovel	%eax, %ecx
LBB0_2:
	movq	_tsc_freq@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%ecx
	movzbl	%al, %eax
	movl	%eax, %ecx
	shll	$16, %ecx
	movl	%eax, %edx
	shll	$8, %edx
	orl	%ecx, %edx
	orl	%eax, %edx
	shll	$8, %edx
	orl	%eax, %edx
	movq	_turbo_ratio_limit@GOTPCREL(%rip), %rax
	movl	%edx, (%rax)
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSR_LSTAR,4,2                  ## @MSR_LSTAR
	.comm	_host_msrs,8,3                  ## @host_msrs
	.comm	_IDX_MSR_LSTAR,8,3              ## @IDX_MSR_LSTAR
	.comm	_MSR_CSTAR,4,2                  ## @MSR_CSTAR
	.comm	_IDX_MSR_CSTAR,8,3              ## @IDX_MSR_CSTAR
	.comm	_MSR_STAR,4,2                   ## @MSR_STAR
	.comm	_IDX_MSR_STAR,8,3               ## @IDX_MSR_STAR
	.comm	_MSR_SF_MASK,4,2                ## @MSR_SF_MASK
	.comm	_IDX_MSR_SF_MASK,8,3            ## @IDX_MSR_SF_MASK
	.comm	_MSR_IA32_MISC_ENABLE,4,2       ## @MSR_IA32_MISC_ENABLE
	.comm	_misc_enable,4,2                ## @misc_enable
	.comm	_tsc_freq,4,2                   ## @tsc_freq
	.comm	_platform_info,4,2              ## @platform_info
	.comm	_turbo_ratio_limit,4,2          ## @turbo_ratio_limit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmx_msr_init                   ; -- Begin function vmx_msr_init
	.p2align	2
_vmx_msr_init:                          ; @vmx_msr_init
	.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
	mov	w19, #29776
	movk	w19, #2034, lsl #16
Lloh0:
	adrp	x8, _MSR_LSTAR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MSR_LSTAR@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_rdmsr
Lloh3:
	adrp	x20, _host_msrs@GOTPAGE
Lloh4:
	ldr	x20, [x20, _host_msrs@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh5:
	adrp	x9, _IDX_MSR_LSTAR@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IDX_MSR_LSTAR@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	str	x0, [x8, x9, lsl #3]
Lloh8:
	adrp	x8, _MSR_CSTAR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MSR_CSTAR@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_rdmsr
	ldr	x8, [x20]
Lloh11:
	adrp	x9, _IDX_MSR_CSTAR@GOTPAGE
Lloh12:
	ldr	x9, [x9, _IDX_MSR_CSTAR@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	str	x0, [x8, x9, lsl #3]
Lloh14:
	adrp	x8, _MSR_STAR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MSR_STAR@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_rdmsr
	ldr	x8, [x20]
Lloh17:
	adrp	x9, _IDX_MSR_STAR@GOTPAGE
Lloh18:
	ldr	x9, [x9, _IDX_MSR_STAR@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	str	x0, [x8, x9, lsl #3]
Lloh20:
	adrp	x8, _MSR_SF_MASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MSR_SF_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_rdmsr
	ldr	x8, [x20]
Lloh23:
	adrp	x9, _IDX_MSR_SF_MASK@GOTPAGE
Lloh24:
	ldr	x9, [x9, _IDX_MSR_SF_MASK@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	str	x0, [x8, x9, lsl #3]
Lloh26:
	adrp	x8, _MSR_IA32_MISC_ENABLE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MSR_IA32_MISC_ENABLE@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	bl	_rdmsr
	mov	w8, #59391
	movk	w8, #65530, lsl #16
	and	w8, w0, w8
	orr	w8, w8, #0x1800
Lloh29:
	adrp	x9, _misc_enable@GOTPAGE
Lloh30:
	ldr	x9, [x9, _misc_enable@GOTPAGEOFF]
Lloh31:
	str	w8, [x9]
	bl	_nehalem_cpu
	cbnz	x0, LBB0_2
; %bb.1:
	bl	_westmere_cpu
	cmp	x0, #0
	mov	w8, #57600
	movk	w8, #1525, lsl #16
	csel	w19, w8, w19, eq
LBB0_2:
Lloh32:
	adrp	x8, _tsc_freq@GOTPAGE
Lloh33:
	ldr	x8, [x8, _tsc_freq@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	sdiv	w8, w8, w19
	and	w9, w8, #0xff
	lsl	w10, w9, #8
	bfi	w10, w9, #16, #8
	bfxil	w10, w8, #0, #8
	bfi	w8, w10, #8, #24
Lloh35:
	adrp	x9, _turbo_ratio_limit@GOTPAGE
Lloh36:
	ldr	x9, [x9, _turbo_ratio_limit@GOTPAGEOFF]
Lloh37:
	str	w8, [x9]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotStr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_MSR_LSTAR,4,2                  ; @MSR_LSTAR
	.comm	_host_msrs,8,3                  ; @host_msrs
	.comm	_IDX_MSR_LSTAR,8,3              ; @IDX_MSR_LSTAR
	.comm	_MSR_CSTAR,4,2                  ; @MSR_CSTAR
	.comm	_IDX_MSR_CSTAR,8,3              ; @IDX_MSR_CSTAR
	.comm	_MSR_STAR,4,2                   ; @MSR_STAR
	.comm	_IDX_MSR_STAR,8,3               ; @IDX_MSR_STAR
	.comm	_MSR_SF_MASK,4,2                ; @MSR_SF_MASK
	.comm	_IDX_MSR_SF_MASK,8,3            ; @IDX_MSR_SF_MASK
	.comm	_MSR_IA32_MISC_ENABLE,4,2       ; @MSR_IA32_MISC_ENABLE
	.comm	_misc_enable,4,2                ; @misc_enable
	.comm	_tsc_freq,4,2                   ; @tsc_freq
	.comm	_platform_info,4,2              ; @platform_info
	.comm	_turbo_ratio_limit,4,2          ; @turbo_ratio_limit
.subsections_via_symbols
