; LLVM IR from stan-dev/math :: lib/tbb_2020.3/src/perf (perf)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.Perf::SessionSettings" = type { i64, ptr, ptr }
%"struct.Perf::internal::TimingSeries" = type { %"class.std::vector", double, double, double, double }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.Perf::internal::TestResults" = type <{ ptr, i64, %"class.std::vector.14", %"class.std::vector.14", %"class.std::vector.19", %"class.std::vector.24", ptr, i8, [7 x i8] }>
%"class.std::vector.14" = type { %"struct.std::_Vector_base.15" }
%"struct.std::_Vector_base.15" = type { %"struct.std::_Vector_base<Perf::internal::TimingSeries, std::allocator<Perf::internal::TimingSeries>>::_Vector_impl" }
%"struct.std::_Vector_base<Perf::internal::TimingSeries, std::allocator<Perf::internal::TimingSeries>>::_Vector_impl" = type { %"struct.std::_Vector_base<Perf::internal::TimingSeries, std::allocator<Perf::internal::TimingSeries>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Perf::internal::TimingSeries, std::allocator<Perf::internal::TimingSeries>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.19" = type { %"struct.std::_Vector_base.20" }
%"struct.std::_Vector_base.20" = type { %"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl" }
%"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const char *, std::allocator<const char *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.24" = type { %"struct.std::_Vector_base.25" }
%"struct.std::_Vector_base.25" = type { %"struct.std::_Vector_base<Perf::internal::RunResults, std::allocator<Perf::internal::RunResults>>::_Vector_impl" }
%"struct.std::_Vector_base<Perf::internal::RunResults, std::allocator<Perf::internal::RunResults>>::_Vector_impl" = type { %"struct.std::_Vector_base<Perf::internal::RunResults, std::allocator<Perf::internal::RunResults>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Perf::internal::RunResults, std::allocator<Perf::internal::RunResults>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZN4Perf11theSettingsE = external dso_local global %"struct.Perf::SessionSettings", align 8
@_ZN4PerfL11NoHistogramE = external hidden global ptr, align 8
@_ZN4Perf8internal17CalibrationTimingE = external dso_local global %"struct.Perf::internal::TimingSeries", align 8
@_ZN4Perf8internalL7NumRunsE = external hidden global i64, align 8
@_ZN4Perf8internalL11RunDurationE = external hidden global double, align 8
@_ZN4PerfL16DefaultHistogramE = external hidden global ptr, align 8

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Perf8internal14TraceHistogramERKSt6vectorIdSaIdEEPKc(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Perf8internal8DoTimingERNS0_11TestResultsERNS0_9RunConfigEMNS_4TestEFvRNS5_10ThreadInfoEEmRNS0_12TimingSeriesE(ptr noundef nonnull align 8 dereferenceable(121), ptr noundef nonnull align 4 dereferenceable(20), i64, i64, i64 noundef, ptr noundef nonnull align 8 dereferenceable(56)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4Perf8internal9RunConfig10NumMastersEv(ptr noundef nonnull align 4 dereferenceable(20)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Perf8internal11RunTestImplERNS0_11TestResultsERNS0_9RunConfigEMNS_4TestEFvRNS5_10ThreadInfoEERNS0_12TimingSeriesE(ptr noundef nonnull align 8 dereferenceable(121) %0, ptr noundef nonnull align 4 dereferenceable(20) %1, i64 %2, i64 %3, ptr noundef nonnull align 8 dereferenceable(56) %4) #1 {
  %6 = alloca { i64, i64 }, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca { i64, i64 }, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca { i64, i64 }, align 8
  %13 = alloca { i64, i64 }, align 8
  %14 = alloca ptr, align 8
  %15 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 0
  store i64 %2, ptr %15, align 8
  %16 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 1
  store i64 %3, ptr %16, align 8
  %17 = load { i64, i64 }, ptr %6, align 8, !tbaa !5
  store ptr %0, ptr %7, align 8, !tbaa !8
  store ptr %1, ptr %8, align 8, !tbaa !8
  store { i64, i64 } %17, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i64 1, ptr %11, align 8, !tbaa !10
  %18 = load i64, ptr @_ZN4Perf8internalL7NumRunsE, align 8, !tbaa !10
  %19 = icmp ult i64 %18, 4
  br i1 %19, label %20, label %22

20:                                               ; preds = %5
  %21 = load i64, ptr @_ZN4Perf8internalL7NumRunsE, align 8, !tbaa !10
  br label %23

22:                                               ; preds = %5
  br label %23

23:                                               ; preds = %22, %20
  %24 = phi i64 [ %21, %20 ], [ 3, %22 ]
  %25 = load ptr, ptr %8, align 8, !tbaa !8
  %26 = call noundef i32 @_ZNK4Perf8internal9RunConfig10NumMastersEv(ptr noundef nonnull align 4 dereferenceable(20) %25)
  %27 = sext i32 %26 to i64
  %28 = mul i64 %24, %27
  call void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN4Perf8internal17CalibrationTimingE, i64 noundef %28)
  br label %29

29:                                               ; preds = %44, %23
  %30 = load ptr, ptr %7, align 8, !tbaa !8
  %31 = load ptr, ptr %8, align 8, !tbaa !8
  %32 = load { i64, i64 }, ptr %9, align 8, !tbaa !5
  %33 = load i64, ptr %11, align 8, !tbaa !10
  store { i64, i64 } %32, ptr %12, align 8, !tbaa !5
  %34 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 0
  %35 = load i64, ptr %34, align 8
  %36 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 1
  %37 = load i64, ptr %36, align 8
  call void @_ZN4Perf8internal8DoTimingERNS0_11TestResultsERNS0_9RunConfigEMNS_4TestEFvRNS5_10ThreadInfoEEmRNS0_12TimingSeriesE(ptr noundef nonnull align 8 dereferenceable(121) %30, ptr noundef nonnull align 4 dereferenceable(20) %31, i64 %35, i64 %37, i64 noundef %33, ptr noundef nonnull align 8 dereferenceable(56) @_ZN4Perf8internal17CalibrationTimingE)
  %38 = load double, ptr getelementptr inbounds (%"struct.Perf::internal::TimingSeries", ptr @_ZN4Perf8internal17CalibrationTimingE, i32 0, i32 1), align 8, !tbaa !12
  %39 = load i64, ptr %11, align 8, !tbaa !10
  %40 = uitofp i64 %39 to double
  %41 = fmul double %38, %40
  %42 = fcmp ogt double %41, 1.000000e-04
  br i1 %42, label %43, label %44

43:                                               ; preds = %29
  br label %47

44:                                               ; preds = %29
  %45 = load i64, ptr %11, align 8, !tbaa !10
  %46 = mul i64 %45, 2
  store i64 %46, ptr %11, align 8, !tbaa !10
  br label %29, !llvm.loop !19

47:                                               ; preds = %43
  %48 = load double, ptr @_ZN4Perf8internalL11RunDurationE, align 8, !tbaa !21
  %49 = load double, ptr getelementptr inbounds (%"struct.Perf::internal::TimingSeries", ptr @_ZN4Perf8internal17CalibrationTimingE, i32 0, i32 1), align 8, !tbaa !12
  %50 = load i64, ptr %11, align 8, !tbaa !10
  %51 = uitofp i64 %50 to double
  %52 = fmul double %49, %51
  %53 = fdiv double %48, %52
  %54 = call double @llvm.ceil.f64(double %53)
  %55 = fptoui double %54 to i64
  %56 = load i64, ptr %11, align 8, !tbaa !10
  %57 = mul i64 %56, %55
  store i64 %57, ptr %11, align 8, !tbaa !10
  %58 = load ptr, ptr %7, align 8, !tbaa !8
  %59 = load ptr, ptr %8, align 8, !tbaa !8
  %60 = load { i64, i64 }, ptr %9, align 8, !tbaa !5
  %61 = load i64, ptr %11, align 8, !tbaa !10
  %62 = load ptr, ptr %10, align 8, !tbaa !8
  store { i64, i64 } %60, ptr %13, align 8, !tbaa !5
  %63 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %64 = load i64, ptr %63, align 8
  %65 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %66 = load i64, ptr %65, align 8
  call void @_ZN4Perf8internal8DoTimingERNS0_11TestResultsERNS0_9RunConfigEMNS_4TestEFvRNS5_10ThreadInfoEEmRNS0_12TimingSeriesE(ptr noundef nonnull align 8 dereferenceable(121) %58, ptr noundef nonnull align 4 dereferenceable(20) %59, i64 %64, i64 %66, i64 noundef %61, ptr noundef nonnull align 8 dereferenceable(56) %62)
  %67 = load { i64, i64 }, ptr %9, align 8, !tbaa !5
  %68 = extractvalue { i64, i64 } %67, 0
  %69 = icmp ne i64 %68, 65
  %70 = icmp ne i64 %68, 0
  %71 = extractvalue { i64, i64 } %67, 1
  %72 = icmp ne i64 %71, 0
  %73 = and i1 %70, %72
  %74 = or i1 %69, %73
  br i1 %74, label %75, label %116

75:                                               ; preds = %47
  %76 = load { i64, i64 }, ptr %9, align 8, !tbaa !5
  %77 = extractvalue { i64, i64 } %76, 0
  %78 = icmp ne i64 %77, 89
  %79 = icmp ne i64 %77, 0
  %80 = extractvalue { i64, i64 } %76, 1
  %81 = icmp ne i64 %80, 0
  %82 = and i1 %79, %81
  %83 = or i1 %78, %82
  br i1 %83, label %84, label %116

84:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %85 = load ptr, ptr getelementptr inbounds (%"struct.Perf::SessionSettings", ptr @_ZN4Perf11theSettingsE, i32 0, i32 2), align 8, !tbaa !22
  store ptr %85, ptr %14, align 8, !tbaa !8
  %86 = load ptr, ptr %14, align 8, !tbaa !8
  %87 = load ptr, ptr @_ZN4PerfL11NoHistogramE, align 8, !tbaa !8
  %88 = icmp ne ptr %86, %87
  br i1 %88, label %89, label %107

89:                                               ; preds = %84
  %90 = load ptr, ptr %7, align 8, !tbaa !8
  %91 = getelementptr inbounds %"struct.Perf::internal::TestResults", ptr %90, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !24
  %93 = load ptr, ptr %92, align 8, !tbaa !39
  %94 = getelementptr inbounds ptr, ptr %93, i64 13
  %95 = load ptr, ptr %94, align 8
  %96 = call noundef ptr %95(ptr noundef nonnull align 8 dereferenceable(8) %92)
  %97 = load ptr, ptr @_ZN4PerfL16DefaultHistogramE, align 8, !tbaa !8
  %98 = icmp ne ptr %96, %97
  br i1 %98, label %99, label %107

99:                                               ; preds = %89
  %100 = load ptr, ptr %7, align 8, !tbaa !8
  %101 = getelementptr inbounds %"struct.Perf::internal::TestResults", ptr %100, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !24
  %103 = load ptr, ptr %102, align 8, !tbaa !39
  %104 = getelementptr inbounds ptr, ptr %103, i64 13
  %105 = load ptr, ptr %104, align 8
  %106 = call noundef ptr %105(ptr noundef nonnull align 8 dereferenceable(8) %102)
  store ptr %106, ptr %14, align 8, !tbaa !8
  br label %107

107:                                              ; preds = %99, %89, %84
  %108 = load ptr, ptr %14, align 8, !tbaa !8
  %109 = load ptr, ptr @_ZN4PerfL11NoHistogramE, align 8, !tbaa !8
  %110 = icmp ne ptr %108, %109
  br i1 %110, label %111, label %115

111:                                              ; preds = %107
  %112 = load ptr, ptr %10, align 8, !tbaa !8
  %113 = getelementptr inbounds %"struct.Perf::internal::TimingSeries", ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %14, align 8, !tbaa !8
  call void @_ZN4Perf8internal14TraceHistogramERKSt6vectorIdSaIdEEPKc(ptr noundef nonnull align 8 dereferenceable(24) %113, ptr noundef %114)
  br label %115

115:                                              ; preds = %111, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %116

116:                                              ; preds = %115, %75, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !6, i64 0}
!12 = !{!13, !18, i64 24}
!13 = !{!"_ZTSN4Perf8internal12TimingSeriesE", !14, i64 0, !18, i64 24, !18, i64 32, !18, i64 40, !18, i64 48}
!14 = !{!"_ZTSSt6vectorIdSaIdEE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!18 = !{!"double", !6, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!18, !18, i64 0}
!22 = !{!23, !9, i64 16}
!23 = !{!"_ZTSN4Perf15SessionSettingsE", !11, i64 0, !9, i64 8, !9, i64 16}
!24 = !{!25, !9, i64 0}
!25 = !{!"_ZTSN4Perf8internal11TestResultsE", !9, i64 0, !11, i64 8, !26, i64 16, !26, i64 40, !30, i64 64, !34, i64 88, !9, i64 112, !38, i64 120}
!26 = !{!"_ZTSSt6vectorIN4Perf8internal12TimingSeriesESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIN4Perf8internal12TimingSeriesESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal12TimingSeriesESaIS2_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal12TimingSeriesESaIS2_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!30 = !{!"_ZTSSt6vectorIPKcSaIS1_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseIPKcSaIS1_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!34 = !{!"_ZTSSt6vectorIN4Perf8internal10RunResultsESaIS2_EE", !35, i64 0}
!35 = !{!"_ZTSSt12_Vector_baseIN4Perf8internal10RunResultsESaIS2_EE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal10RunResultsESaIS2_EE12_Vector_implE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal10RunResultsESaIS2_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!38 = !{!"bool", !6, i64 0}
!39 = !{!40, !40, i64 0}
!40 = !{!"vtable pointer", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.Perf::SessionSettings" = type { i64, ptr, ptr }
%"struct.Perf::internal::TimingSeries" = type { %"class.std::vector", double, double, double, double }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZN4Perf11theSettingsE = external dso_local local_unnamed_addr global %"struct.Perf::SessionSettings", align 8
@_ZN4PerfL11NoHistogramE = external hidden local_unnamed_addr global ptr, align 8
@_ZN4Perf8internal17CalibrationTimingE = external dso_local global %"struct.Perf::internal::TimingSeries", align 8
@_ZN4Perf8internalL7NumRunsE = external hidden local_unnamed_addr global i64, align 8
@_ZN4Perf8internalL11RunDurationE = external hidden local_unnamed_addr global double, align 8
@_ZN4PerfL16DefaultHistogramE = external hidden local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Perf8internal14TraceHistogramERKSt6vectorIdSaIdEEPKc(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Perf8internal8DoTimingERNS0_11TestResultsERNS0_9RunConfigEMNS_4TestEFvRNS5_10ThreadInfoEEmRNS0_12TimingSeriesE(ptr noundef nonnull align 8 dereferenceable(121), ptr noundef nonnull align 4 dereferenceable(20), i64, i64, i64 noundef, ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4Perf8internal9RunConfig10NumMastersEv(ptr noundef nonnull align 4 dereferenceable(20)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Perf8internal11RunTestImplERNS0_11TestResultsERNS0_9RunConfigEMNS_4TestEFvRNS5_10ThreadInfoEERNS0_12TimingSeriesE(ptr noundef nonnull align 8 dereferenceable(121) %0, ptr noundef nonnull align 4 dereferenceable(20) %1, i64 %2, i64 %3, ptr noundef nonnull align 8 dereferenceable(56) %4) local_unnamed_addr #0 {
  %6 = load i64, ptr @_ZN4Perf8internalL7NumRunsE, align 8
  %7 = tail call i64 @llvm.umin.i64(i64 %6, i64 3)
  %8 = tail call noundef i32 @_ZNK4Perf8internal9RunConfig10NumMastersEv(ptr noundef nonnull align 4 dereferenceable(20) %1)
  %9 = sext i32 %8 to i64
  %10 = mul nsw i64 %7, %9
  tail call void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN4Perf8internal17CalibrationTimingE, i64 noundef %10)
  br label %11

11:                                               ; preds = %11, %5
  %.054 = phi i64 [ 1, %5 ], [ %16, %11 ]
  tail call void @_ZN4Perf8internal8DoTimingERNS0_11TestResultsERNS0_9RunConfigEMNS_4TestEFvRNS5_10ThreadInfoEEmRNS0_12TimingSeriesE(ptr noundef nonnull align 8 dereferenceable(121) %0, ptr noundef nonnull align 4 dereferenceable(20) %1, i64 %2, i64 %3, i64 noundef %.054, ptr noundef nonnull align 8 dereferenceable(56) @_ZN4Perf8internal17CalibrationTimingE)
  %12 = load double, ptr getelementptr inbounds (i8, ptr @_ZN4Perf8internal17CalibrationTimingE, i64 24), align 8, !tbaa !5
  %13 = uitofp i64 %.054 to double
  %14 = fmul double %12, %13
  %15 = fcmp ogt double %14, 1.000000e-04
  %16 = shl i64 %.054, 1
  br i1 %15, label %17, label %11, !llvm.loop !15

17:                                               ; preds = %11
  %18 = load double, ptr @_ZN4Perf8internalL11RunDurationE, align 8, !tbaa !17
  %19 = fdiv double %18, %14
  %20 = tail call double @llvm.ceil.f64(double %19)
  %21 = fptoui double %20 to i64
  %22 = mul i64 %.054, %21
  tail call void @_ZN4Perf8internal8DoTimingERNS0_11TestResultsERNS0_9RunConfigEMNS_4TestEFvRNS5_10ThreadInfoEEmRNS0_12TimingSeriesE(ptr noundef nonnull align 8 dereferenceable(121) %0, ptr noundef nonnull align 4 dereferenceable(20) %1, i64 %2, i64 %3, i64 noundef %22, ptr noundef nonnull align 8 dereferenceable(56) %4)
  %23 = icmp ne i64 %2, 65
  %24 = icmp ne i64 %3, 0
  %25 = icmp ne i64 %2, 89
  %26 = and i1 %23, %25
  %or.cond = or i1 %26, %24
  br i1 %or.cond, label %27, label %46

27:                                               ; preds = %17
  %28 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN4Perf11theSettingsE, i64 16), align 8, !tbaa !18
  %29 = load ptr, ptr @_ZN4PerfL11NoHistogramE, align 8, !tbaa !21
  %.not = icmp eq ptr %28, %29
  br i1 %.not, label %43, label %30

30:                                               ; preds = %27
  %31 = load ptr, ptr %0, align 8, !tbaa !22
  %32 = load ptr, ptr %31, align 8, !tbaa !37
  %33 = getelementptr inbounds i8, ptr %32, i64 104
  %34 = load ptr, ptr %33, align 8
  %35 = tail call noundef ptr %34(ptr noundef nonnull align 8 dereferenceable(8) %31)
  %36 = load ptr, ptr @_ZN4PerfL16DefaultHistogramE, align 8, !tbaa !21
  %.not57 = icmp eq ptr %35, %36
  br i1 %.not57, label %43, label %37

37:                                               ; preds = %30
  %38 = load ptr, ptr %0, align 8, !tbaa !22
  %39 = load ptr, ptr %38, align 8, !tbaa !37
  %40 = getelementptr inbounds i8, ptr %39, i64 104
  %41 = load ptr, ptr %40, align 8
  %42 = tail call noundef ptr %41(ptr noundef nonnull align 8 dereferenceable(8) %38)
  br label %43

43:                                               ; preds = %37, %30, %27
  %.0 = phi ptr [ %42, %37 ], [ %28, %30 ], [ %28, %27 ]
  %44 = load ptr, ptr @_ZN4PerfL11NoHistogramE, align 8, !tbaa !21
  %.not58 = icmp eq ptr %.0, %44
  br i1 %.not58, label %46, label %45

45:                                               ; preds = %43
  tail call void @_ZN4Perf8internal14TraceHistogramERKSt6vectorIdSaIdEEPKc(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef %.0)
  br label %46

46:                                               ; preds = %43, %45, %17
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #3

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !14, i64 24}
!6 = !{!"_ZTSN4Perf8internal12TimingSeriesE", !7, i64 0, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48}
!7 = !{!"_ZTSSt6vectorIdSaIdEE", !8, i64 0}
!8 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !9, i64 0}
!9 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"double", !12, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!14, !14, i64 0}
!18 = !{!19, !11, i64 16}
!19 = !{!"_ZTSN4Perf15SessionSettingsE", !20, i64 0, !11, i64 8, !11, i64 16}
!20 = !{!"long", !12, i64 0}
!21 = !{!11, !11, i64 0}
!22 = !{!23, !11, i64 0}
!23 = !{!"_ZTSN4Perf8internal11TestResultsE", !11, i64 0, !20, i64 8, !24, i64 16, !24, i64 40, !28, i64 64, !32, i64 88, !11, i64 112, !36, i64 120}
!24 = !{!"_ZTSSt6vectorIN4Perf8internal12TimingSeriesESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIN4Perf8internal12TimingSeriesESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal12TimingSeriesESaIS2_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal12TimingSeriesESaIS2_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!28 = !{!"_ZTSSt6vectorIPKcSaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIPKcSaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!32 = !{!"_ZTSSt6vectorIN4Perf8internal10RunResultsESaIS2_EE", !33, i64 0}
!33 = !{!"_ZTSSt12_Vector_baseIN4Perf8internal10RunResultsESaIS2_EE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal10RunResultsESaIS2_EE12_Vector_implE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal10RunResultsESaIS2_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!36 = !{!"bool", !12, i64 0}
!37 = !{!38, !38, i64 0}
!38 = !{!"vtable pointer", !13, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass