; 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"

%"class.Harness::SpinBarrier" = type <{ i32, %"struct.tbb::atomic.10", %"struct.tbb::atomic.10", i8, [3 x i8] }>
%"struct.tbb::atomic.10" = type { %"struct.tbb::internal::atomic_impl_with_arithmetic.11" }
%"struct.tbb::internal::atomic_impl_with_arithmetic.11" = type { %"struct.tbb::internal::atomic_impl.12" }
%"struct.tbb::internal::atomic_impl.12" = type { %"struct.tbb::internal::aligned_storage.13" }
%"struct.tbb::internal::aligned_storage.13" = type { i32 }
%"class.Perf::internal::TimingFunctor" = type { ptr, ptr, { i64, i64 }, i64, i64, i64 }
%"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 }
%"struct.Perf::internal::RunConfig" = type { i32, i32, i32, i32, i32 }

@_ZN4Perf8internal10TlsTimingsE = external dso_local global ptr, align 8
@_ZN4Perf8internal22multipleMastersBarrierE = external dso_local global %"class.Harness::SpinBarrier", align 4

; 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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local 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 %4, ptr noundef nonnull align 8 dereferenceable(56) %5) #2 {
  %7 = alloca { i64, i64 }, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca { i64, i64 }, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca %"class.Perf::internal::TimingFunctor", align 8
  %16 = alloca { i64, i64 }, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 0
  store i64 %2, ptr %23, align 8
  %24 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 1
  store i64 %3, ptr %24, align 8
  %25 = load { i64, i64 }, ptr %7, align 8, !tbaa !5
  store ptr %0, ptr %8, align 8, !tbaa !8
  store ptr %1, ptr %9, align 8, !tbaa !8
  store { i64, i64 } %25, ptr %10, align 8, !tbaa !5
  store i64 %4, ptr %11, align 8, !tbaa !10
  store ptr %5, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %26 = load ptr, ptr %9, align 8, !tbaa !8
  %27 = call noundef i32 @_ZNK4Perf8internal9RunConfig10NumMastersEv(ptr noundef nonnull align 4 dereferenceable(20) %26)
  store i32 %27, ptr %13, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %28 = load ptr, ptr %12, align 8, !tbaa !8
  %29 = getelementptr inbounds %"struct.Perf::internal::TimingSeries", ptr %28, i32 0, i32 0
  %30 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #3
  %31 = load i32, ptr %13, align 4, !tbaa !12
  %32 = sext i32 %31 to i64
  %33 = udiv i64 %30, %32
  store i64 %33, ptr %14, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 56, ptr %15) #3
  %34 = load ptr, ptr %8, align 8, !tbaa !8
  %35 = getelementptr inbounds %"struct.Perf::internal::TestResults", ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !14
  %37 = load ptr, ptr %9, align 8, !tbaa !8
  %38 = load { i64, i64 }, ptr %10, align 8, !tbaa !5
  %39 = load i64, ptr %14, align 8, !tbaa !10
  %40 = load i64, ptr %11, align 8, !tbaa !10
  %41 = load ptr, ptr %8, align 8, !tbaa !8
  %42 = getelementptr inbounds %"struct.Perf::internal::TestResults", ptr %41, i32 0, i32 1
  %43 = load i64, ptr %42, align 8, !tbaa !29
  store { i64, i64 } %38, ptr %16, align 8, !tbaa !5
  %44 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 0
  %45 = load i64, ptr %44, align 8
  %46 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 1
  %47 = load i64, ptr %46, align 8
  call void @_ZN4Perf8internal13TimingFunctorC2EPNS_4TestEPNS0_9RunConfigEMS2_FvRNS2_10ThreadInfoEEmmm(ptr noundef nonnull align 8 dereferenceable(56) %15, ptr noundef %36, ptr noundef %37, i64 %45, i64 %47, i64 noundef %39, i64 noundef %40, i64 noundef %43)
  %48 = load i32, ptr %13, align 4, !tbaa !12
  call void @_ZN7Harness11SpinBarrier10initializeEjb(ptr noundef nonnull align 4 dereferenceable(13) @_ZN4Perf8internal22multipleMastersBarrierE, i32 noundef %48, i1 noundef zeroext false)
  %49 = load ptr, ptr %8, align 8, !tbaa !8
  %50 = getelementptr inbounds %"struct.Perf::internal::TestResults", ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !14
  %52 = load ptr, ptr %9, align 8, !tbaa !8
  %53 = getelementptr inbounds %"struct.Perf::internal::RunConfig", ptr %52, i32 0, i32 4
  %54 = load i32, ptr %53, align 4, !tbaa !30
  %55 = load ptr, ptr %51, align 8, !tbaa !32
  %56 = getelementptr inbounds ptr, ptr %55, i64 3
  %57 = load ptr, ptr %56, align 8
  call void %57(ptr noundef nonnull align 8 dereferenceable(8) %51, i32 noundef %54)
  %58 = load i32, ptr %13, align 4, !tbaa !12
  %59 = icmp eq i32 %58, 1
  br i1 %59, label %60, label %64

60:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %61 = load ptr, ptr @_ZN4Perf8internal10TlsTimingsE, align 8, !tbaa !8
  store ptr %61, ptr %17, align 8, !tbaa !8
  %62 = load ptr, ptr %12, align 8, !tbaa !8
  store ptr %62, ptr @_ZN4Perf8internal10TlsTimingsE, align 8, !tbaa !8
  call void @_ZNK4Perf8internal13TimingFunctorclEi(ptr noundef nonnull align 8 dereferenceable(56) %15, i32 noundef 0)
  %63 = load ptr, ptr %17, align 8, !tbaa !8
  store ptr %63, ptr @_ZN4Perf8internal10TlsTimingsE, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  br label %109

64:                                               ; preds = %6
  %65 = load ptr, ptr %12, align 8, !tbaa !8
  %66 = getelementptr inbounds %"struct.Perf::internal::TimingSeries", ptr %65, i32 0, i32 0
  %67 = load i32, ptr %13, align 4, !tbaa !12
  %68 = sext i32 %67 to i64
  %69 = load i64, ptr %14, align 8, !tbaa !10
  %70 = mul i64 %68, %69
  call void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %70)
  %71 = load i32, ptr %13, align 4, !tbaa !12
  call void @_Z17NativeParallelForIiN4Perf8internal13TimingFunctorEEvT_RKT0_(i32 noundef %71, ptr noundef nonnull align 8 dereferenceable(56) %15)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  store i32 0, ptr %18, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  store i32 0, ptr %19, align 4, !tbaa !12
  br label %72

72:                                               ; preds = %104, %64
  %73 = load i32, ptr %18, align 4, !tbaa !12
  %74 = load i32, ptr %13, align 4, !tbaa !12
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  store i32 2, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  br label %107

77:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %78 = load ptr, ptr @_ZN4Perf8internal10TlsTimingsE, align 8, !tbaa !8
  %79 = load i32, ptr %18, align 4, !tbaa !12
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds %"struct.Perf::internal::TimingSeries", ptr %78, i64 %80
  %82 = getelementptr inbounds %"struct.Perf::internal::TimingSeries", ptr %81, i32 0, i32 0
  store ptr %82, ptr %21, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  store i64 0, ptr %22, align 8, !tbaa !10
  br label %83

83:                                               ; preds = %98, %77
  %84 = load i64, ptr %22, align 8, !tbaa !10
  %85 = load i64, ptr %14, align 8, !tbaa !10
  %86 = icmp ult i64 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 5, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  br label %103

88:                                               ; preds = %83
  %89 = load ptr, ptr %21, align 8, !tbaa !8
  %90 = load i64, ptr %22, align 8, !tbaa !10
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %89, i64 noundef %90) #3
  %92 = load double, ptr %91, align 8, !tbaa !34
  %93 = load ptr, ptr %12, align 8, !tbaa !8
  %94 = getelementptr inbounds %"struct.Perf::internal::TimingSeries", ptr %93, i32 0, i32 0
  %95 = load i32, ptr %19, align 4, !tbaa !12
  %96 = sext i32 %95 to i64
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %94, i64 noundef %96) #3
  store double %92, ptr %97, align 8, !tbaa !34
  br label %98

98:                                               ; preds = %88
  %99 = load i64, ptr %22, align 8, !tbaa !10
  %100 = add i64 %99, 1
  store i64 %100, ptr %22, align 8, !tbaa !10
  %101 = load i32, ptr %19, align 4, !tbaa !12
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %19, align 4, !tbaa !12
  br label %83, !llvm.loop !36

103:                                              ; preds = %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %18, align 4, !tbaa !12
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %18, align 4, !tbaa !12
  br label %72, !llvm.loop !38

107:                                              ; preds = %76
  %108 = load ptr, ptr %12, align 8, !tbaa !8
  call void @_ZN4Perf8internal12TimingSeries19CalculateStatisticsEv(ptr noundef nonnull align 8 dereferenceable(56) %108)
  br label %109

109:                                              ; preds = %107, %60
  call void @llvm.lifetime.end.p0(i64 56, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Perf8internal13TimingFunctorC2EPNS_4TestEPNS0_9RunConfigEMS2_FvRNS2_10ThreadInfoEEmmm(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, ptr noundef, i64, i64, i64 noundef, i64 noundef, i64 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Harness11SpinBarrier10initializeEjb(ptr noundef nonnull align 4 dereferenceable(13), i32 noundef, i1 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4Perf8internal13TimingFunctorclEi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17NativeParallelForIiN4Perf8internal13TimingFunctorEEvT_RKT0_(i32 noundef, ptr noundef nonnull align 8 dereferenceable(56)) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Perf8internal12TimingSeries19CalculateStatisticsEv(ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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, !13, i64 0}
!13 = !{!"int", !6, i64 0}
!14 = !{!15, !9, i64 0}
!15 = !{!"_ZTSN4Perf8internal11TestResultsE", !9, i64 0, !11, i64 8, !16, i64 16, !16, i64 40, !20, i64 64, !24, i64 88, !9, i64 112, !28, i64 120}
!16 = !{!"_ZTSSt6vectorIN4Perf8internal12TimingSeriesESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIN4Perf8internal12TimingSeriesESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal12TimingSeriesESaIS2_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal12TimingSeriesESaIS2_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!20 = !{!"_ZTSSt6vectorIPKcSaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIPKcSaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!24 = !{!"_ZTSSt6vectorIN4Perf8internal10RunResultsESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIN4Perf8internal10RunResultsESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal10RunResultsESaIS2_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal10RunResultsESaIS2_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!28 = !{!"bool", !6, i64 0}
!29 = !{!15, !11, i64 8}
!30 = !{!31, !13, i64 16}
!31 = !{!"_ZTSN4Perf8internal9RunConfigE", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16}
!32 = !{!33, !33, i64 0}
!33 = !{!"vtable pointer", !7, i64 0}
!34 = !{!35, !35, i64 0}
!35 = !{!"double", !6, i64 0}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = distinct !{!38, !37}


; 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"

%"class.Harness::SpinBarrier" = type <{ i32, %"struct.tbb::atomic.10", %"struct.tbb::atomic.10", i8, [3 x i8] }>
%"struct.tbb::atomic.10" = type { %"struct.tbb::internal::atomic_impl_with_arithmetic.11" }
%"struct.tbb::internal::atomic_impl_with_arithmetic.11" = type { %"struct.tbb::internal::atomic_impl.12" }
%"struct.tbb::internal::atomic_impl.12" = type { %"struct.tbb::internal::aligned_storage.13" }
%"struct.tbb::internal::aligned_storage.13" = type { i32 }
%"class.Perf::internal::TimingFunctor" = type { ptr, ptr, { i64, i64 }, i64, i64, i64 }
%"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 }

@_ZN4Perf8internal10TlsTimingsE = external dso_local local_unnamed_addr global ptr, align 8
@_ZN4Perf8internal22multipleMastersBarrierE = external dso_local global %"class.Harness::SpinBarrier", align 4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Perf8internal8DoTimingERNS0_11TestResultsERNS0_9RunConfigEMNS_4TestEFvRNS5_10ThreadInfoEEmRNS0_12TimingSeriesE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(121) %0, ptr noundef nonnull align 4 dereferenceable(20) %1, i64 %2, i64 %3, i64 noundef %4, ptr noundef nonnull align 8 dereferenceable(56) %5) local_unnamed_addr #2 {
  %7 = alloca %"class.Perf::internal::TimingFunctor", align 8
  %8 = tail call noundef i32 @_ZNK4Perf8internal9RunConfig10NumMastersEv(ptr noundef nonnull align 4 dereferenceable(20) %1)
  %9 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  %10 = sext i32 %8 to i64
  %11 = udiv i64 %9, %10
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %7) #3
  %12 = load ptr, ptr %0, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = load i64, ptr %13, align 8, !tbaa !24
  call void @_ZN4Perf8internal13TimingFunctorC2EPNS_4TestEPNS0_9RunConfigEMS2_FvRNS2_10ThreadInfoEEmmm(ptr noundef nonnull align 8 dereferenceable(56) %7, ptr noundef %12, ptr noundef nonnull %1, i64 %2, i64 %3, i64 noundef %11, i64 noundef %4, i64 noundef %14)
  call void @_ZN7Harness11SpinBarrier10initializeEjb(ptr noundef nonnull align 4 dereferenceable(13) @_ZN4Perf8internal22multipleMastersBarrierE, i32 noundef %8, i1 noundef zeroext false)
  %15 = load ptr, ptr %0, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load i32, ptr %16, align 4, !tbaa !25
  %18 = load ptr, ptr %15, align 8, !tbaa !28
  %19 = getelementptr inbounds i8, ptr %18, i64 24
  %20 = load ptr, ptr %19, align 8
  call void %20(ptr noundef nonnull align 8 dereferenceable(8) %15, i32 noundef %17)
  %21 = icmp eq i32 %8, 1
  br i1 %21, label %22, label %24

22:                                               ; preds = %6
  %23 = load ptr, ptr @_ZN4Perf8internal10TlsTimingsE, align 8, !tbaa !30
  store ptr %5, ptr @_ZN4Perf8internal10TlsTimingsE, align 8, !tbaa !30
  call void @_ZNK4Perf8internal13TimingFunctorclEi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef 0)
  store ptr %23, ptr @_ZN4Perf8internal10TlsTimingsE, align 8, !tbaa !30
  br label %36

24:                                               ; preds = %6
  %25 = mul i64 %11, %10
  call void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %25)
  call void @_Z17NativeParallelForIiN4Perf8internal13TimingFunctorEEvT_RKT0_(i32 noundef %8, ptr noundef nonnull align 8 dereferenceable(56) %7)
  %26 = icmp slt i32 %8, 1
  %.not = icmp ult i64 %9, %10
  %or.cond = or i1 %26, %.not
  br i1 %or.cond, label %._crit_edge49, label %.lr.ph.us.preheader

.lr.ph.us.preheader:                              ; preds = %24
  %wide.trip.count = zext nneg i32 %8 to i64
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %._crit_edge.us
  %indvars.iv52 = phi i64 [ 0, %.lr.ph.us.preheader ], [ %indvars.iv.next53, %._crit_edge.us ]
  %.04145.us = phi i64 [ 0, %.lr.ph.us.preheader ], [ %indvars.iv.next, %._crit_edge.us ]
  %27 = load ptr, ptr @_ZN4Perf8internal10TlsTimingsE, align 8, !tbaa !30
  %28 = getelementptr inbounds %"struct.Perf::internal::TimingSeries", ptr %27, i64 %indvars.iv52
  %sext = shl i64 %.04145.us, 32
  %29 = ashr exact i64 %sext, 32
  br label %30

30:                                               ; preds = %.lr.ph.us, %30
  %indvars.iv = phi i64 [ %29, %.lr.ph.us ], [ %indvars.iv.next, %30 ]
  %.044.us = phi i64 [ 0, %.lr.ph.us ], [ %34, %30 ]
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %.044.us) #3
  %32 = load double, ptr %31, align 8, !tbaa !31
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv) #3
  store double %32, ptr %33, align 8, !tbaa !31
  %34 = add nuw i64 %.044.us, 1
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %35 = icmp ult i64 %34, %11
  br i1 %35, label %30, label %._crit_edge.us, !llvm.loop !33

._crit_edge.us:                                   ; preds = %30
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge49, label %.lr.ph.us, !llvm.loop !35

._crit_edge49:                                    ; preds = %._crit_edge.us, %24
  call void @_ZN4Perf8internal12TimingSeries19CalculateStatisticsEv(ptr noundef nonnull align 8 dereferenceable(56) %5)
  br label %36

36:                                               ; preds = %._crit_edge49, %22
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7) #3
  ret void
}

; 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 nounwind uwtable
declare dso_local void @_ZN4Perf8internal13TimingFunctorC2EPNS_4TestEPNS0_9RunConfigEMS2_FvRNS2_10ThreadInfoEEmmm(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, ptr noundef, i64, i64, i64 noundef, i64 noundef, i64 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Harness11SpinBarrier10initializeEjb(ptr noundef nonnull align 4 dereferenceable(13), i32 noundef, i1 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4Perf8internal13TimingFunctorclEi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17NativeParallelForIiN4Perf8internal13TimingFunctorEEvT_RKT0_(i32 noundef, ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Perf8internal12TimingSeries19CalculateStatisticsEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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, !7, i64 0}
!6 = !{!"_ZTSN4Perf8internal11TestResultsE", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 40, !15, i64 64, !19, i64 88, !7, i64 112, !23, i64 120}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"_ZTSSt6vectorIN4Perf8internal12TimingSeriesESaIS2_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIN4Perf8internal12TimingSeriesESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal12TimingSeriesESaIS2_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal12TimingSeriesESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!15 = !{!"_ZTSSt6vectorIPKcSaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIPKcSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIPKcSaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!19 = !{!"_ZTSSt6vectorIN4Perf8internal10RunResultsESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIN4Perf8internal10RunResultsESaIS2_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal10RunResultsESaIS2_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIN4Perf8internal10RunResultsESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!23 = !{!"bool", !8, i64 0}
!24 = !{!6, !10, i64 8}
!25 = !{!26, !27, i64 16}
!26 = !{!"_ZTSN4Perf8internal9RunConfigE", !27, i64 0, !27, i64 4, !27, i64 8, !27, i64 12, !27, i64 16}
!27 = !{!"int", !8, i64 0}
!28 = !{!29, !29, i64 0}
!29 = !{!"vtable pointer", !9, i64 0}
!30 = !{!7, !7, i64 0}
!31 = !{!32, !32, i64 0}
!32 = !{!"double", !8, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass