; LLVM IR from ebirenbaum/ParticleSolver :: cpu/src/solver/matrix.ll (ZN12SparseMatrix16getFrobeniusNormEv)

; 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.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::_Rb_tree_const_iterator.0" = type { ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%class.SparseMatrix = type { %"class.std::map", i32, i32 }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::map<int, double>>, std::_Select1st<std::pair<const int, std::map<int, double>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::map<int, double>>, std::_Select1st<std::pair<const int, std::map<int, double>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, %"class.std::map.1" }
%"class.std::map.1" = type { %"class.std::_Rb_tree.2" }
%"class.std::_Rb_tree.2" = type { %"struct.std::_Rb_tree<int, std::pair<const int, double>, std::_Select1st<std::pair<const int, double>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, double>, std::_Select1st<std::pair<const int, double>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::pair.6" = type { i32, double }

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; 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 zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEESB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKidEES5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN12SparseMatrix16getFrobeniusNormEv(ptr noundef nonnull align 8 dereferenceable(56) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca double, align 8
  %4 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_const_iterator.0", align 8
  %6 = alloca %"struct.std::_Rb_tree_const_iterator.0", align 8
  %7 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator.0", align 8
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store double 0.000000e+00, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKidEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %13 = getelementptr inbounds %class.SparseMatrix, ptr %12, i32 0, i32 0
  %14 = call ptr @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #5
  %15 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %7, i32 0, i32 0
  store ptr %14, ptr %15, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEC2ERKSt17_Rb_tree_iteratorIS8_E(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 %6, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %16

16:                                               ; preds = %44, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %17 = getelementptr inbounds %class.SparseMatrix, ptr %12, i32 0, i32 0
  %18 = call ptr @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %17) #5
  %19 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %9, i32 0, i32 0
  store ptr %18, ptr %19, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEC2ERKSt17_Rb_tree_iteratorIS8_E(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %20 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEESB_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br i1 %20, label %21, label %46

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %22 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %23 = getelementptr inbounds %"struct.std::pair", ptr %22, i32 0, i32 1
  %24 = call ptr @_ZNKSt3mapIidSt4lessIiESaISt4pairIKidEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %23) #5
  %25 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %10, i32 0, i32 0
  store ptr %24, ptr %25, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %10, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %26

26:                                               ; preds = %41, %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %27 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %28 = getelementptr inbounds %"struct.std::pair", ptr %27, i32 0, i32 1
  %29 = call ptr @_ZNKSt3mapIidSt4lessIiESaISt4pairIKidEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %28) #5
  %30 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %11, i32 0, i32 0
  store ptr %29, ptr %30, align 8
  %31 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKidEES5_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br i1 %31, label %32, label %43

32:                                               ; preds = %26
  %33 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKidEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %34 = getelementptr inbounds %"struct.std::pair.6", ptr %33, i32 0, i32 1
  %35 = load double, ptr %34, align 8, !tbaa !12
  %36 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKidEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %37 = getelementptr inbounds %"struct.std::pair.6", ptr %36, i32 0, i32 1
  %38 = load double, ptr %37, align 8, !tbaa !12
  %39 = load double, ptr %3, align 8, !tbaa !9
  %40 = call double @llvm.fmuladd.f64(double %35, double %38, double %39)
  store double %40, ptr %3, align 8, !tbaa !9
  br label %41

41:                                               ; preds = %32
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKidEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  br label %26, !llvm.loop !15

43:                                               ; preds = %26
  br label %44

44:                                               ; preds = %43
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br label %16, !llvm.loop !17

46:                                               ; preds = %16
  %47 = load double, ptr %3, align 8, !tbaa !9
  %48 = call double @sqrt(double noundef %47) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret double %48
}

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

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

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

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #4

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind "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 #5 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{i64 0, i64 8, !5}
!12 = !{!13, !10, i64 8}
!13 = !{!"_ZTSSt4pairIKidE", !14, i64 0, !10, i64 8}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; 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.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::_Rb_tree_const_iterator.0" = type { ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }

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

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

; 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 zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEESB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKidEES5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN12SparseMatrix16getFrobeniusNormEv(ptr noundef nonnull align 8 dereferenceable(56) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %3 = alloca %"struct.std::_Rb_tree_const_iterator.0", align 8
  %4 = alloca %"struct.std::_Rb_tree_const_iterator.0", align 8
  %5 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %6 = alloca %"struct.std::_Rb_tree_const_iterator.0", align 8
  %7 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKidEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %9 = call ptr @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %0) #4
  store ptr %9, ptr %5, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEC2ERKSt17_Rb_tree_iteratorIS8_E(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %10 = load i64, ptr %4, align 8, !tbaa !5
  store i64 %10, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %11 = call ptr @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %0) #4
  store ptr %11, ptr %7, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEC2ERKSt17_Rb_tree_iteratorIS8_E(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  %12 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEESB_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br i1 %12, label %.lr.ph6, label %._crit_edge7

.lr.ph6:                                          ; preds = %1, %._crit_edge
  %.04 = phi double [ %.1.lcssa, %._crit_edge ], [ 0.000000e+00, %1 ]
  %13 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = call ptr @_ZNKSt3mapIidSt4lessIiESaISt4pairIKidEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %14) #4
  store ptr %15, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %16 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = call ptr @_ZNKSt3mapIidSt4lessIiESaISt4pairIKidEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %17) #4
  store ptr %18, ptr %8, align 8
  %19 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKidEES5_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph6, %.lr.ph
  %.13 = phi double [ %26, %.lr.ph ], [ %.04, %.lr.ph6 ]
  %20 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKidEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  %22 = load double, ptr %21, align 8, !tbaa !9
  %23 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKidEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %24 = getelementptr inbounds i8, ptr %23, i64 8
  %25 = load double, ptr %24, align 8, !tbaa !9
  %26 = call double @llvm.fmuladd.f64(double %22, double %25, double %.13)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKidEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %28 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = call ptr @_ZNKSt3mapIidSt4lessIiESaISt4pairIKidEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %29) #4
  store ptr %30, ptr %8, align 8
  %31 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKidEES5_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph6
  %.1.lcssa = phi double [ %.04, %.lr.ph6 ], [ %26, %.lr.ph ]
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %33 = call ptr @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %0) #4
  store ptr %33, ptr %7, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEC2ERKSt17_Rb_tree_iteratorIS8_E(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  %34 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEESB_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br i1 %34, label %.lr.ph6, label %._crit_edge7, !llvm.loop !15

._crit_edge7:                                     ; preds = %._crit_edge, %1
  %.0.lcssa = phi double [ 0.000000e+00, %1 ], [ %.1.lcssa, %._crit_edge ]
  %35 = call double @sqrt(double noundef %.0.lcssa) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  ret double %35
}

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3

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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 8}
!10 = !{!"_ZTSSt4pairIKidE", !11, i64 0, !12, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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