	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpu_est_clockrate              ## -- Begin function cpu_est_clockrate
	.p2align	4, 0x90
_cpu_est_clockrate:                     ## @cpu_est_clockrate
	.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
	movq	%rsi, %r12
	callq	_pcpu_find
	testq	%r12, %r12
	je	LBB0_2
## %bb.1:
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	_tsc_is_invariant@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_6
## %bb.4:
	movq	_tsc_perf_stat@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_6
## %bb.5:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_10
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_10
LBB0_6:
	xorl	%eax, %eax
	callq	_intr_disable
	movl	%eax, %r15d
	cmpq	$0, (%rbx)
	je	LBB0_8
## %bb.7:
	movq	_MSR_MPERF@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	xorl	%esi, %esi
	callq	_wrmsr
	movq	_MSR_APERF@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_wrmsr
	xorl	%eax, %eax
	callq	_rdtsc
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_DELAY
	movl	(%r14), %edi
	callq	_rdmsr
	movl	%eax, %r13d
	movl	(%rbx), %edi
	callq	_rdmsr
	movl	%eax, %r14d
	xorl	%eax, %eax
	callq	_rdtsc
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_intr_restore
	imull	$1000, %r14d, %eax              ## imm = 0x3E8
	cltd
	idivl	%r13d
	subl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	imull	%eax, %ebx
	jmp	LBB0_9
LBB0_8:
	xorl	%eax, %eax
	callq	_rdtsc
	movl	%eax, %r14d
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_DELAY
	xorl	%eax, %eax
	callq	_rdtsc
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_intr_restore
	subl	%r14d, %ebx
	imull	$1000, %ebx, %ebx               ## imm = 0x3E8
LBB0_9:
	movl	%ebx, (%r12)
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_tsc_is_invariant,8,3           ## @tsc_is_invariant
	.comm	_tsc_perf_stat,4,2              ## @tsc_perf_stat
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_MSR_MPERF,4,2                  ## @MSR_MPERF
	.comm	_MSR_APERF,4,2                  ## @MSR_APERF
	.comm	_CPUID_TSC,4,2                  ## @CPUID_TSC
	.comm	_cpu_feature,4,2                ## @cpu_feature
	.comm	_curthread,4,2                  ## @curthread
	.comm	_smp_cpus,4,2                   ## @smp_cpus
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpu_est_clockrate              ; -- Begin function cpu_est_clockrate
	.p2align	2
_cpu_est_clockrate:                     ; @cpu_est_clockrate
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	bl	_pcpu_find
	cbz	x19, LBB0_5
; %bb.1:
	cbz	x0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x21, _tsc_is_invariant@GOTPAGE
Lloh1:
	ldr	x21, [x21, _tsc_is_invariant@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh2:
	adrp	x9, _tsc_perf_stat@GOTPAGE
Lloh3:
	ldr	x9, [x9, _tsc_perf_stat@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	x8, #0
	ccmp	w9, #0, #0, ne
	b.eq	LBB0_6
; %bb.3:
	bl	_intr_disable
	mov	x20, x0
	ldr	x8, [x21]
	cbz	x8, LBB0_7
; %bb.4:
Lloh5:
	adrp	x22, _MSR_MPERF@GOTPAGE
Lloh6:
	ldr	x22, [x22, _MSR_MPERF@GOTPAGEOFF]
	ldr	w0, [x22]
	mov	w1, #0
	bl	_wrmsr
Lloh7:
	adrp	x23, _MSR_APERF@GOTPAGE
Lloh8:
	ldr	x23, [x23, _MSR_APERF@GOTPAGEOFF]
	ldr	w0, [x23]
	mov	w1, #0
	bl	_wrmsr
	bl	_rdtsc
	mov	x21, x0
	mov	w25, #1000
	mov	w0, #1000
	bl	_DELAY
	ldr	w0, [x22]
	bl	_rdmsr
	mov	x22, x0
	ldr	w0, [x23]
	bl	_rdmsr
	mov	x23, x0
	bl	_rdtsc
	mov	x24, x0
	mov	x0, x20
	bl	_intr_restore
	mul	w8, w23, w25
	sdiv	w8, w8, w22
	sub	w9, w24, w21
	mul	w8, w8, w9
	b	LBB0_8
LBB0_5:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_6:
Lloh12:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_7:
	bl	_rdtsc
	mov	x21, x0
	mov	w23, #1000
	mov	w0, #1000
	bl	_DELAY
	bl	_rdtsc
	mov	x22, x0
	mov	x0, x20
	bl	_intr_restore
	sub	w8, w22, w21
	mul	w8, w8, w23
LBB0_8:
	mov	w0, #0
	str	w8, [x19]
LBB0_9:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_tsc_is_invariant,8,3           ; @tsc_is_invariant
	.comm	_tsc_perf_stat,4,2              ; @tsc_perf_stat
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_MSR_MPERF,4,2                  ; @MSR_MPERF
	.comm	_MSR_APERF,4,2                  ; @MSR_APERF
	.comm	_CPUID_TSC,4,2                  ; @CPUID_TSC
	.comm	_cpu_feature,4,2                ; @cpu_feature
	.comm	_curthread,4,2                  ; @curthread
	.comm	_smp_cpus,4,2                   ; @smp_cpus
.subsections_via_symbols
