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

; 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.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::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::_Rb_tree_const_iterator.0" = type { 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: mustprogress uwtable
define dso_local void @_ZNK12SparseMatrix12getTransposeEv(ptr dead_on_unwind noalias writable sret(%class.SparseMatrix) align 8 %0, ptr noundef nonnull align 8 dereferenceable(56) %1) #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::map", align 8
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator.0", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator.0", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator.0", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr %5) #5
  call void @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKidEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %15 = getelementptr inbounds %class.SparseMatrix, ptr %14, i32 0, i32 0
  %16 = call ptr @_ZNKSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %15) #5
  %17 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator.0", ptr %8, i32 0, i32 0
  store ptr %16, ptr %17, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %8, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %18

18:                                               ; preds = %53, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %19 = getelementptr inbounds %class.SparseMatrix, ptr %14, i32 0, i32 0
  %20 = call ptr @_ZNKSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %19) #5
  %21 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator.0", ptr %9, i32 0, i32 0
  store ptr %20, ptr %21, align 8
  %22 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEESB_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br i1 %22, label %23, label %55

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

28:                                               ; preds = %46, %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %29 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %30 = getelementptr inbounds %"struct.std::pair", ptr %29, i32 0, i32 1
  %31 = call ptr @_ZNKSt3mapIidSt4lessIiESaISt4pairIKidEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %30) #5
  %32 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %11, i32 0, i32 0
  store ptr %31, ptr %32, align 8
  %33 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKidEES5_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br i1 %33, label %34, label %52

34:                                               ; preds = %28
  %35 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKidEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %36 = getelementptr inbounds %"struct.std::pair.6", ptr %35, i32 0, i32 1
  %37 = load double, ptr %36, align 8, !tbaa !10
  %38 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKidEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %39 = getelementptr inbounds %"struct.std::pair.6", ptr %38, i32 0, i32 0
  %40 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(4) %39)
          to label %41 unwind label %48

41:                                               ; preds = %34
  %42 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %43 = getelementptr inbounds %"struct.std::pair", ptr %42, i32 0, i32 0
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIidSt4lessIiESaISt4pairIKidEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %40, ptr noundef nonnull align 4 dereferenceable(4) %43)
          to label %45 unwind label %48

45:                                               ; preds = %41
  store double %37, ptr %44, align 8, !tbaa !14
  br label %46

46:                                               ; preds = %45
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKidEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br label %28, !llvm.loop !15

48:                                               ; preds = %55, %41, %34
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %12, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #5
  br label %61

52:                                               ; preds = %28
  br label %53

53:                                               ; preds = %52
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br label %18, !llvm.loop !17

55:                                               ; preds = %18
  %56 = getelementptr inbounds %class.SparseMatrix, ptr %14, i32 0, i32 2
  %57 = load i32, ptr %56, align 4, !tbaa !18
  %58 = getelementptr inbounds %class.SparseMatrix, ptr %14, i32 0, i32 1
  %59 = load i32, ptr %58, align 8, !tbaa !29
  invoke void @_ZN12SparseMatrixC2EiiRKSt3mapIiS0_IidSt4lessIiESaISt4pairIKidEEES2_SaIS3_IS4_S7_EEE(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %57, i32 noundef %59, ptr noundef nonnull align 8 dereferenceable(48) %5)
          to label %60 unwind label %48

60:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #5
  ret void

61:                                               ; preds = %48
  %62 = load ptr, ptr %12, align 8
  %63 = load i32, ptr %13, align 4
  %64 = insertvalue { ptr, i32 } poison, ptr %62, 0
  %65 = insertvalue { ptr, i32 } %64, i32 %63, 1
  resume { ptr, i32 } %65
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 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) #3

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

; 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)) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3mapIidSt4lessIiESaISt4pairIKidEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 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)) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIidSt4lessIiESaISt4pairIKidEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #0 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)) #2 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)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN12SparseMatrixC2EiiRKSt3mapIiS0_IidSt4lessIiESaISt4pairIKidEEES2_SaIS3_IS4_S7_EEE(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint 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 #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 = !{i64 0, i64 8, !5}
!10 = !{!11, !13, i64 8}
!11 = !{!"_ZTSSt4pairIKidE", !12, i64 0, !13, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!19, !12, i64 52}
!19 = !{!"_ZTS12SparseMatrix", !20, i64 0, !12, i64 48, !12, i64 52}
!20 = !{!"_ZTSSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEE", !21, i64 0}
!21 = !{!"_ZTSSt8_Rb_treeIiSt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEESt10_Select1stIS8_ES4_SaIS8_EE", !22, i64 0}
!22 = !{!"_ZTSNSt8_Rb_treeIiSt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEESt10_Select1stIS8_ES4_SaIS8_EE13_Rb_tree_implIS4_Lb1EEE", !23, i64 0, !25, i64 8}
!23 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !24, i64 0}
!24 = !{!"_ZTSSt4lessIiE"}
!25 = !{!"_ZTSSt15_Rb_tree_header", !26, i64 0, !28, i64 32}
!26 = !{!"_ZTSSt18_Rb_tree_node_base", !27, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!27 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!28 = !{!"long", !7, i64 0}
!29 = !{!19, !12, i64 48}


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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK12SparseMatrix12getTransposeEv(ptr dead_on_unwind noalias writable sret(%class.SparseMatrix) align 8 %0, ptr noundef nonnull align 8 dereferenceable(56) %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::map", 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_const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #4
  call void @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKidEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %8 = call ptr @_ZNKSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #4
  store ptr %8, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %9 = call ptr @_ZNKSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #4
  store ptr %9, ptr %6, align 8
  %10 = 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) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br i1 %10, label %.lr.ph4, label %._crit_edge5

.lr.ph4:                                          ; preds = %2, %._crit_edge
  %11 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %12 = getelementptr inbounds i8, ptr %11, i64 8
  %13 = call ptr @_ZNKSt3mapIidSt4lessIiESaISt4pairIKidEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #4
  store ptr %13, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %14 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  %16 = call ptr @_ZNKSt3mapIidSt4lessIiESaISt4pairIKidEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %15) #4
  store ptr %16, ptr %7, align 8
  %17 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKidEES5_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph4, %26
  %18 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKidEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %19 = getelementptr inbounds i8, ptr %18, i64 8
  %20 = load double, ptr %19, align 8, !tbaa !9
  %21 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKidEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %22 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %23 unwind label %.loopexit

23:                                               ; preds = %.lr.ph
  %24 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIidSt4lessIiESaISt4pairIKidEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %22, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %26 unwind label %.loopexit

26:                                               ; preds = %23
  store double %20, ptr %25, align 8, !tbaa !13
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKidEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %28 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #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 %7, 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) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !14

.loopexit:                                        ; preds = %.lr.ph, %23
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %32

.loopexit.split-lp:                               ; preds = %._crit_edge5
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %32

32:                                               ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  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 @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #4
  resume { ptr, i32 } %lpad.phi

._crit_edge:                                      ; preds = %26, %.lr.ph4
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %34 = call ptr @_ZNKSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #4
  store ptr %34, ptr %6, align 8
  %35 = 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) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br i1 %35, label %.lr.ph4, label %._crit_edge5, !llvm.loop !16

._crit_edge5:                                     ; preds = %._crit_edge, %2
  %36 = getelementptr inbounds i8, ptr %1, i64 52
  %37 = load i32, ptr %36, align 4, !tbaa !17
  %38 = getelementptr inbounds i8, ptr %1, i64 48
  %39 = load i32, ptr %38, align 8, !tbaa !28
  invoke void @_ZN12SparseMatrixC2EiiRKSt3mapIiS0_IidSt4lessIiESaISt4pairIKidEEES2_SaIS3_IS4_S7_EEE(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %37, i32 noundef %39, ptr noundef nonnull align 8 dereferenceable(48) %3)
          to label %40 unwind label %.loopexit.split-lp

40:                                               ; preds = %._crit_edge5
  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 @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #4
  ret void
}

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

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

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

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

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

; 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 #2

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

; 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 #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3mapIidSt4lessIiESaISt4pairIKidEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 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 #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3mapIidSt4lessIiESaISt4pairIKidEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 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 #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIidSt4lessIiESaISt4pairIKidEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 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 #2 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 #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN12SparseMatrixC2EiiRKSt3mapIiS0_IidSt4lessIiESaISt4pairIKidEEES2_SaIS3_IS4_S7_EEE(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 #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 = !{!12, !12, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{!18, !11, i64 52}
!18 = !{!"_ZTS12SparseMatrix", !19, i64 0, !11, i64 48, !11, i64 52}
!19 = !{!"_ZTSSt3mapIiS_IidSt4lessIiESaISt4pairIKidEEES1_SaIS2_IS3_S6_EEE", !20, i64 0}
!20 = !{!"_ZTSSt8_Rb_treeIiSt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEESt10_Select1stIS8_ES4_SaIS8_EE", !21, i64 0}
!21 = !{!"_ZTSNSt8_Rb_treeIiSt4pairIKiSt3mapIidSt4lessIiESaIS0_IS1_dEEEESt10_Select1stIS8_ES4_SaIS8_EE13_Rb_tree_implIS4_Lb1EEE", !22, i64 0, !24, i64 8}
!22 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !23, i64 0}
!23 = !{!"_ZTSSt4lessIiE"}
!24 = !{!"_ZTSSt15_Rb_tree_header", !25, i64 0, !27, i64 32}
!25 = !{!"_ZTSSt18_Rb_tree_node_base", !26, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!26 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!27 = !{!"long", !7, i64 0}
!28 = !{!18, !11, i64 48}


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