; LLVM IR from cvxpy/cvxpy :: cvxpy/cvxcore/src/LinOpOperations.ll (Z17get_upper_tri_matRK5LinOpi)

; 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.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<double>>>>, std::_Select1st<std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<double>>>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<double>>>>, std::_Select1st<std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<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 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl" }
%"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Eigen::SparseMatrix" = type { %"class.Eigen::SparseCompressedBase", i64, i64, ptr, ptr, %"class.Eigen::internal::CompressedStorage" }
%"class.Eigen::SparseCompressedBase" = type { %"class.Eigen::SparseMatrixBase" }
%"class.Eigen::SparseMatrixBase" = type { i8 }
%"class.Eigen::internal::CompressedStorage" = type { ptr, ptr, i64, i64 }
%"class.std::vector.33" = type { %"struct.std::_Vector_base.34" }
%"struct.std::_Vector_base.34" = type { %"struct.std::_Vector_base<Eigen::Triplet<double>, std::allocator<Eigen::Triplet<double>>>::_Vector_impl" }
%"struct.std::_Vector_base<Eigen::Triplet<double>, std::allocator<Eigen::Triplet<double>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Eigen::Triplet<double>, std::allocator<Eigen::Triplet<double>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Eigen::Triplet<double>, std::allocator<Eigen::Triplet<double>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Eigen::Triplet" = type { i32, i32, double }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@.str.5 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [28 x i8], align 1
@__PRETTY_FUNCTION__._Z17get_upper_tri_matRK5LinOpi = external hidden unnamed_addr constant [45 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z17get_upper_tri_matRK5LinOpi(ptr dead_on_unwind noalias writable sret(%"class.std::map") align 8 %0, ptr noundef nonnull align 8 dereferenceable(193) %1, i32 noundef %2) #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.std::vector.4", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::vector", align 8
  %14 = alloca %"class.std::vector.4", align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::vector", align 8
  %17 = alloca %"class.Eigen::SparseMatrix", align 8
  %18 = alloca %"class.std::vector.33", align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %"class.Eigen::Triplet", align 8
  %26 = alloca double, align 8
  %27 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %28 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call noundef i32 @_ZNK5LinOp8get_typeEv(ptr noundef nonnull align 8 dereferenceable(193) %29)
  %31 = icmp eq i32 %30, 16
  br i1 %31, label %32, label %33

32:                                               ; preds = %3
  br label %35

33:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.5, i32 noundef 546, ptr noundef @__PRETTY_FUNCTION__._Z17get_upper_tri_matRK5LinOpi) #6
  unreachable

34:                                               ; No predecessors!
  br label %35

35:                                               ; preds = %34, %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #7
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNK5LinOp8get_argsEv(ptr dead_on_unwind writable sret(%"class.std::vector.4") align 8 %9, ptr noundef nonnull align 8 dereferenceable(193) %36)
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPK5LinOpSaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef 0) #7
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  invoke void @_ZNK5LinOp9get_shapeEv(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %8, ptr noundef nonnull align 8 dereferenceable(193) %38)
          to label %39 unwind label %65

39:                                               ; preds = %35
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 0) #7
  %41 = load i32, ptr %40, align 4, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  store i32 %41, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #7
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNK5LinOp8get_argsEv(ptr dead_on_unwind writable sret(%"class.std::vector.4") align 8 %14, ptr noundef nonnull align 8 dereferenceable(193) %42)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPK5LinOpSaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef 0) #7
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  invoke void @_ZNK5LinOp9get_shapeEv(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %13, ptr noundef nonnull align 8 dereferenceable(193) %44)
          to label %45 unwind label %69

45:                                               ; preds = %39
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef 1) #7
  %47 = load i32, ptr %46, align 4, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  store i32 %47, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #7
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNK5LinOp9get_shapeEv(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %16, ptr noundef nonnull align 8 dereferenceable(193) %48)
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef 0) #7
  %50 = load i32, ptr %49, align 4, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #7
  store i32 %50, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 72, ptr %17) #7
  %51 = load i32, ptr %15, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = load i32, ptr %7, align 4, !tbaa !9
  %54 = load i32, ptr %12, align 4, !tbaa !9
  %55 = mul nsw i32 %53, %54
  %56 = sext i32 %55 to i64
  call void @_ZN5Eigen12SparseMatrixIdLi0EiEC2Ell(ptr noundef nonnull align 8 dereferenceable(72) %17, i64 noundef %52, i64 noundef %56)
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #7
  call void @_ZNSt6vectorIN5Eigen7TripletIdiEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  %57 = load i32, ptr %15, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  invoke void @_ZNSt6vectorIN5Eigen7TripletIdiEESaIS2_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %58)
          to label %59 unwind label %73

59:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %107, %59
  %61 = load i32, ptr %20, align 4, !tbaa !9
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %77, label %64

64:                                               ; preds = %60
  store i32 2, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %110

65:                                               ; preds = %35
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %10, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %11, align 4
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  br label %129

69:                                               ; preds = %39
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %10, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %11, align 4
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  br label %128

73:                                               ; preds = %45
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %10, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %11, align 4
  br label %127

77:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %103, %77
  %79 = load i32, ptr %22, align 4, !tbaa !9
  %80 = load i32, ptr %12, align 4, !tbaa !9
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  store i32 5, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %106

83:                                               ; preds = %78
  %84 = load i32, ptr %22, align 4, !tbaa !9
  %85 = load i32, ptr %20, align 4, !tbaa !9
  %86 = icmp sgt i32 %84, %85
  br i1 %86, label %87, label %102

87:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %88 = load i32, ptr %19, align 4, !tbaa !9
  store i32 %88, ptr %23, align 4, !tbaa !9
  %89 = load i32, ptr %19, align 4, !tbaa !9
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %91 = load i32, ptr %22, align 4, !tbaa !9
  %92 = load i32, ptr %7, align 4, !tbaa !9
  %93 = mul nsw i32 %91, %92
  %94 = load i32, ptr %20, align 4, !tbaa !9
  %95 = add nsw i32 %93, %94
  store i32 %95, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  store double 1.000000e+00, ptr %26, align 8, !tbaa !11
  invoke void @_ZN5Eigen7TripletIdiEC2ERKiS3_RKd(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %96 unwind label %98

96:                                               ; preds = %87
  invoke void @_ZNSt6vectorIN5Eigen7TripletIdiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(16) %25)
          to label %97 unwind label %98

97:                                               ; preds = %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %102

98:                                               ; preds = %96, %87
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %10, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %126

102:                                              ; preds = %97, %83
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %22, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %22, align 4, !tbaa !9
  br label %78, !llvm.loop !13

106:                                              ; preds = %82
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %20, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %20, align 4, !tbaa !9
  br label %60, !llvm.loop !15

110:                                              ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %111 = call ptr @_ZNSt6vectorIN5Eigen7TripletIdiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  %112 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  store ptr %111, ptr %112, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %113 = call ptr @_ZNSt6vectorIN5Eigen7TripletIdiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  %114 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %28, i32 0, i32 0
  store ptr %113, ptr %114, align 8
  invoke void @_ZN5Eigen12SparseMatrixIdLi0EiE15setFromTripletsIN9__gnu_cxx17__normal_iteratorIPNS_7TripletIdiEESt6vectorIS6_SaIS6_EEEEEEvRKT_SE_(ptr noundef nonnull align 8 dereferenceable(72) %17, ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %28)
          to label %115 unwind label %118

115:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  invoke void @_ZN5Eigen12SparseMatrixIdLi0EiE14makeCompressedEv(ptr noundef nonnull align 8 dereferenceable(72) %17)
          to label %116 unwind label %122

116:                                              ; preds = %115
  invoke void @_Z12build_tensorRN5Eigen12SparseMatrixIdLi0EiEE(ptr dead_on_unwind writable sret(%"class.std::map") align 8 %0, ptr noundef nonnull align 8 dereferenceable(72) %17)
          to label %117 unwind label %122

117:                                              ; preds = %116
  store i32 1, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @_ZNSt6vectorIN5Eigen7TripletIdiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #7
  call void @_ZN5Eigen12SparseMatrixIdLi0EiED2Ev(ptr noundef nonnull align 8 dereferenceable(72) %17) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  ret void

118:                                              ; preds = %110
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %10, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %126

122:                                              ; preds = %116, %115
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %10, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %11, align 4
  br label %126

126:                                              ; preds = %122, %118, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %127

127:                                              ; preds = %126, %73
  call void @_ZNSt6vectorIN5Eigen7TripletIdiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #7
  call void @_ZN5Eigen12SparseMatrixIdLi0EiED2Ev(ptr noundef nonnull align 8 dereferenceable(72) %17) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %128

128:                                              ; preds = %127, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %129

129:                                              ; preds = %128, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %130

130:                                              ; preds = %129
  %131 = load ptr, ptr %10, align 8
  %132 = load i32, ptr %11, align 4
  %133 = insertvalue { ptr, i32 } poison, ptr %131, 0
  %134 = insertvalue { ptr, i32 } %133, i32 %132, 1
  resume { ptr, i32 } %134
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK5LinOp8get_argsEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector.4") align 8, ptr noundef nonnull align 8 dereferenceable(193)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12build_tensorRN5Eigen12SparseMatrixIdLi0EiEE(ptr dead_on_unwind noalias writable sret(%"class.std::map") align 8, ptr noundef nonnull align 8 dereferenceable(72)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Eigen12SparseMatrixIdLi0EiED2Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen12SparseMatrixIdLi0EiEC2Ell(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef, i64 noundef) unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Eigen7TripletIdiEC2ERKiS3_RKd(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0 align 2

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Eigen12SparseMatrixIdLi0EiE14makeCompressedEv(ptr noundef nonnull align 8 dereferenceable(72)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK5LinOp9get_shapeEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(193)) #2 align 2

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 #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 = { noreturn 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 #6 = { noreturn nounwind }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<double>>>>, std::_Select1st<std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<double>>>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<double>>>>, std::_Select1st<std::pair<const int, std::map<int, std::vector<Eigen::SparseMatrix<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 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl" }
%"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const LinOp *, std::allocator<const LinOp *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Eigen::SparseMatrix" = type { %"class.Eigen::SparseCompressedBase", i64, i64, ptr, ptr, %"class.Eigen::internal::CompressedStorage" }
%"class.Eigen::SparseCompressedBase" = type { %"class.Eigen::SparseMatrixBase" }
%"class.Eigen::SparseMatrixBase" = type { i8 }
%"class.Eigen::internal::CompressedStorage" = type { ptr, ptr, i64, i64 }
%"class.std::vector.33" = type { %"struct.std::_Vector_base.34" }
%"struct.std::_Vector_base.34" = type { %"struct.std::_Vector_base<Eigen::Triplet<double>, std::allocator<Eigen::Triplet<double>>>::_Vector_impl" }
%"struct.std::_Vector_base<Eigen::Triplet<double>, std::allocator<Eigen::Triplet<double>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Eigen::Triplet<double>, std::allocator<Eigen::Triplet<double>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Eigen::Triplet<double>, std::allocator<Eigen::Triplet<double>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Eigen::Triplet" = type { i32, i32, double }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@.str.5 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [28 x i8], align 1
@__PRETTY_FUNCTION__._Z17get_upper_tri_matRK5LinOpi = external hidden unnamed_addr constant [45 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5LinOp8get_typeEv(ptr noundef nonnull align 8 dereferenceable(193)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z17get_upper_tri_matRK5LinOpi(ptr dead_on_unwind noalias writable sret(%"class.std::map") align 8 %0, ptr noundef nonnull align 8 dereferenceable(193) %1, i32 noundef %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::vector.4", align 8
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca %"class.std::vector.4", align 8
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.Eigen::SparseMatrix", align 8
  %10 = alloca %"class.std::vector.33", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.Eigen::Triplet", align 8
  %14 = alloca double, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = tail call noundef i32 @_ZNK5LinOp8get_typeEv(ptr noundef nonnull align 8 dereferenceable(193) %1)
  %18 = icmp eq i32 %17, 16
  br i1 %18, label %20, label %19

19:                                               ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.5, i32 noundef 546, ptr noundef nonnull @__PRETTY_FUNCTION__._Z17get_upper_tri_matRK5LinOpi) #6
  unreachable

20:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  call void @_ZNK5LinOp8get_argsEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.4") align 8 %5, ptr noundef nonnull align 8 dereferenceable(193) %1)
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPK5LinOpSaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 0) #7
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  invoke void @_ZNK5LinOp9get_shapeEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %4, ptr noundef nonnull align 8 dereferenceable(193) %22)
          to label %23 unwind label %51

23:                                               ; preds = %20
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 0) #7
  %25 = load i32, ptr %24, align 4, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  call void @_ZNK5LinOp8get_argsEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.4") align 8 %7, ptr noundef nonnull align 8 dereferenceable(193) %1)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPK5LinOpSaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 0) #7
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  invoke void @_ZNK5LinOp9get_shapeEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %6, ptr noundef nonnull align 8 dereferenceable(193) %27)
          to label %28 unwind label %53

28:                                               ; preds = %23
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef 1) #7
  %30 = load i32, ptr %29, align 4, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  call void @_ZNK5LinOp9get_shapeEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %8, ptr noundef nonnull align 8 dereferenceable(193) %1)
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 0) #7
  %32 = load i32, ptr %31, align 4, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %9) #7
  %33 = sext i32 %32 to i64
  %34 = mul nsw i32 %30, %25
  %35 = sext i32 %34 to i64
  call void @_ZN5Eigen12SparseMatrixIdLi0EiEC2Ell(ptr noundef nonnull align 8 dereferenceable(72) %9, i64 noundef %33, i64 noundef %35)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #7
  call void @_ZNSt6vectorIN5Eigen7TripletIdiEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  invoke void @_ZNSt6vectorIN5Eigen7TripletIdiEESaIS2_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %33)
          to label %.preheader36 unwind label %55

.preheader36:                                     ; preds = %28
  %36 = icmp sgt i32 %25, 0
  %37 = icmp sgt i32 %30, 0
  %or.cond = select i1 %36, i1 %37, i1 false
  br i1 %or.cond, label %.preheader.us, label %._crit_edge42

.preheader.us:                                    ; preds = %.preheader36, %._crit_edge.us
  %.02241.us = phi i32 [ %47, %._crit_edge.us ], [ 0, %.preheader36 ]
  %.02340.us = phi i32 [ %.2.us, %._crit_edge.us ], [ 0, %.preheader36 ]
  br label %38

38:                                               ; preds = %.preheader.us, %45
  %.039.us = phi i32 [ 0, %.preheader.us ], [ %46, %45 ]
  %.138.us = phi i32 [ %.02340.us, %.preheader.us ], [ %.2.us, %45 ]
  %39 = icmp ugt i32 %.039.us, %.02241.us
  br i1 %39, label %40, label %45

40:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  store i32 %.138.us, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  %41 = mul nuw nsw i32 %.039.us, %25
  %42 = add nuw nsw i32 %41, %.02241.us
  store i32 %42, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  store double 1.000000e+00, ptr %14, align 8, !tbaa !11
  call void @_ZN5Eigen7TripletIdiEC2ERKiS3_RKd(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 8 dereferenceable(8) %14)
  invoke void @_ZNSt6vectorIN5Eigen7TripletIdiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %43 unwind label %.split.us

43:                                               ; preds = %40
  %44 = add nsw i32 %.138.us, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  br label %45

45:                                               ; preds = %43, %38
  %.2.us = phi i32 [ %44, %43 ], [ %.138.us, %38 ]
  %46 = add nuw nsw i32 %.039.us, 1
  %exitcond.not = icmp eq i32 %46, %30
  br i1 %exitcond.not, label %._crit_edge.us, label %38, !llvm.loop !13

._crit_edge.us:                                   ; preds = %45
  %47 = add nuw nsw i32 %.02241.us, 1
  %exitcond44.not = icmp eq i32 %47, %25
  br i1 %exitcond44.not, label %._crit_edge42, label %.preheader.us, !llvm.loop !15

.split.us:                                        ; preds = %40
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  br label %64

._crit_edge42:                                    ; preds = %._crit_edge.us, %.preheader36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #7
  %49 = call ptr @_ZNSt6vectorIN5Eigen7TripletIdiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  store ptr %49, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #7
  %50 = call ptr @_ZNSt6vectorIN5Eigen7TripletIdiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  store ptr %50, ptr %16, align 8
  invoke void @_ZN5Eigen12SparseMatrixIdLi0EiE15setFromTripletsIN9__gnu_cxx17__normal_iteratorIPNS_7TripletIdiEESt6vectorIS6_SaIS6_EEEEEEvRKT_SE_(ptr noundef nonnull align 8 dereferenceable(72) %9, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %57 unwind label %60

51:                                               ; preds = %20
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  br label %65

53:                                               ; preds = %23
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIPK5LinOpSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  br label %65

55:                                               ; preds = %28
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %64

57:                                               ; preds = %._crit_edge42
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #7
  invoke void @_ZN5Eigen12SparseMatrixIdLi0EiE14makeCompressedEv(ptr noundef nonnull align 8 dereferenceable(72) %9)
          to label %58 unwind label %62

58:                                               ; preds = %57
  invoke void @_Z12build_tensorRN5Eigen12SparseMatrixIdLi0EiEE(ptr dead_on_unwind writable sret(%"class.std::map") align 8 %0, ptr noundef nonnull align 8 dereferenceable(72) %9)
          to label %59 unwind label %62

59:                                               ; preds = %58
  call void @_ZNSt6vectorIN5Eigen7TripletIdiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  call void @_ZN5Eigen12SparseMatrixIdLi0EiED2Ev(ptr noundef nonnull align 8 dereferenceable(72) %9) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %9) #7
  ret void

60:                                               ; preds = %._crit_edge42
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #7
  br label %64

62:                                               ; preds = %58, %57
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %64

64:                                               ; preds = %.split.us, %60, %62, %55
  %.pn.pn = phi { ptr, i32 } [ %56, %55 ], [ %48, %.split.us ], [ %63, %62 ], [ %61, %60 ]
  call void @_ZNSt6vectorIN5Eigen7TripletIdiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  call void @_ZN5Eigen12SparseMatrixIdLi0EiED2Ev(ptr noundef nonnull align 8 dereferenceable(72) %9) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %9) #7
  br label %65

65:                                               ; preds = %53, %64, %51
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %52, %51 ], [ %.pn.pn, %64 ], [ %54, %53 ]
  resume { ptr, i32 } %.pn.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK5LinOp8get_argsEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector.4") align 8, ptr noundef nonnull align 8 dereferenceable(193)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12build_tensorRN5Eigen12SparseMatrixIdLi0EiEE(ptr dead_on_unwind noalias writable sret(%"class.std::map") align 8, ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Eigen12SparseMatrixIdLi0EiED2Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen12SparseMatrixIdLi0EiEC2Ell(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef, i64 noundef) unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Eigen7TripletIdiEC2ERKiS3_RKd(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0 align 2

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Eigen12SparseMatrixIdLi0EiE14makeCompressedEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK5LinOp9get_shapeEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(193)) local_unnamed_addr #2 align 2

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 #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 = { noreturn 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 #6 = { noreturn nounwind }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, 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,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass