; LLVM IR from Gripnook/numerical-methods :: Assignment1/report/src (finite-differences)

; 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::vector.14" = type { %"struct.std::_Vector_base.15" }
%"struct.std::_Vector_base.15" = type { %"struct.std::_Vector_base<FiniteDifferences::Node_internal, std::allocator<FiniteDifferences::Node_internal>>::_Vector_impl" }
%"struct.std::_Vector_base<FiniteDifferences::Node_internal, std::allocator<FiniteDifferences::Node_internal>>::_Vector_impl" = type { %"struct.std::_Vector_base<FiniteDifferences::Node_internal, std::allocator<FiniteDifferences::Node_internal>>::_Vector_impl_data" }
%"struct.std::_Vector_base<FiniteDifferences::Node_internal, std::allocator<FiniteDifferences::Node_internal>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.16" = type { i8 }
%"struct.std::pair.5" = type { i32, i32 }
%"struct.FiniteDifferences::Node" = type { double, double, double }
%"struct.FiniteDifferences::Node_internal" = type { double, double, double, double }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17FiniteDifferences10precomputeERKN7Numeric6MatrixINS_4NodeEEERKSt6vectorISt4pairIiiESaIS8_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.14") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #1 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i1, align 1
  %9 = alloca %"class.std::allocator.16", align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair.5", align 4
  %14 = alloca ptr, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  %22 = trunc i64 %21 to i32
  store i32 %22, ptr %7, align 4, !tbaa !9
  store i1 false, ptr %8, align 1
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  call void @_ZNSaIN17FiniteDifferences13Node_internalEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #4
  invoke void @_ZNSt6vectorIN17FiniteDifferences13Node_internalESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %24, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %25 unwind label %31

25:                                               ; preds = %3
  call void @_ZNSt15__new_allocatorIN17FiniteDifferences13Node_internalEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %221, %25
  %27 = load i32, ptr %12, align 4, !tbaa !9
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %35, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %225

31:                                               ; preds = %3
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %10, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %11, align 4
  call void @_ZNSt15__new_allocatorIN17FiniteDifferences13Node_internalEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  br label %229

35:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = load i32, ptr %12, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %36, i64 noundef %38) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %39, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %40 = load i32, ptr %12, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorIN17FiniteDifferences13Node_internalESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %41) #4
  store ptr %42, ptr %14, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 0
  %44 = load i32, ptr %43, align 4, !tbaa !11
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %66, label %46

46:                                               ; preds = %35
  %47 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 0
  %48 = load i32, ptr %47, align 4, !tbaa !11
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = invoke noundef i32 @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEE4rowsEv(ptr noundef nonnull align 8 dereferenceable(32) %49)
          to label %51 unwind label %67

51:                                               ; preds = %46
  %52 = sub nsw i32 %50, 1
  %53 = icmp eq i32 %48, %52
  br i1 %53, label %66, label %54

54:                                               ; preds = %51
  %55 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 1
  %56 = load i32, ptr %55, align 4, !tbaa !13
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %66, label %58

58:                                               ; preds = %54
  %59 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 1
  %60 = load i32, ptr %59, align 4, !tbaa !13
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = invoke noundef i32 @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEE4colsEv(ptr noundef nonnull align 8 dereferenceable(32) %61)
          to label %63 unwind label %67

63:                                               ; preds = %58
  %64 = sub nsw i32 %62, 1
  %65 = icmp eq i32 %60, %64
  br i1 %65, label %66, label %71

66:                                               ; preds = %63, %54, %51, %35
  br label %220

67:                                               ; preds = %58, %46
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %10, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %11, align 4
  br label %224

71:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 0
  %74 = load i32, ptr %73, align 4, !tbaa !11
  %75 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 1
  %76 = load i32, ptr %75, align 4, !tbaa !13
  %77 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %72, i32 noundef %74, i32 noundef %76)
          to label %78 unwind label %201

78:                                               ; preds = %71
  %79 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %77, i32 0, i32 1
  %80 = load double, ptr %79, align 8, !tbaa !14
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 0
  %83 = load i32, ptr %82, align 4, !tbaa !11
  %84 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 1
  %85 = load i32, ptr %84, align 4, !tbaa !13
  %86 = sub nsw i32 %85, 1
  %87 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %81, i32 noundef %83, i32 noundef %86)
          to label %88 unwind label %201

88:                                               ; preds = %78
  %89 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %87, i32 0, i32 1
  %90 = load double, ptr %89, align 8, !tbaa !14
  %91 = fsub double %80, %90
  store double %91, ptr %15, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 0
  %94 = load i32, ptr %93, align 4, !tbaa !11
  %95 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !13
  %97 = add nsw i32 %96, 1
  %98 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %92, i32 noundef %94, i32 noundef %97)
          to label %99 unwind label %205

99:                                               ; preds = %88
  %100 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %98, i32 0, i32 1
  %101 = load double, ptr %100, align 8, !tbaa !14
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 0
  %104 = load i32, ptr %103, align 4, !tbaa !11
  %105 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 1
  %106 = load i32, ptr %105, align 4, !tbaa !13
  %107 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %102, i32 noundef %104, i32 noundef %106)
          to label %108 unwind label %205

108:                                              ; preds = %99
  %109 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %107, i32 0, i32 1
  %110 = load double, ptr %109, align 8, !tbaa !14
  %111 = fsub double %101, %110
  store double %111, ptr %16, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 0
  %114 = load i32, ptr %113, align 4, !tbaa !11
  %115 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 1
  %116 = load i32, ptr %115, align 4, !tbaa !13
  %117 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %112, i32 noundef %114, i32 noundef %116)
          to label %118 unwind label %209

118:                                              ; preds = %108
  %119 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %117, i32 0, i32 2
  %120 = load double, ptr %119, align 8, !tbaa !18
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 0
  %123 = load i32, ptr %122, align 4, !tbaa !11
  %124 = sub nsw i32 %123, 1
  %125 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 1
  %126 = load i32, ptr %125, align 4, !tbaa !13
  %127 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %121, i32 noundef %124, i32 noundef %126)
          to label %128 unwind label %209

128:                                              ; preds = %118
  %129 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %127, i32 0, i32 2
  %130 = load double, ptr %129, align 8, !tbaa !18
  %131 = fsub double %120, %130
  store double %131, ptr %17, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 0
  %134 = load i32, ptr %133, align 4, !tbaa !11
  %135 = add nsw i32 %134, 1
  %136 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 1
  %137 = load i32, ptr %136, align 4, !tbaa !13
  %138 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %132, i32 noundef %135, i32 noundef %137)
          to label %139 unwind label %213

139:                                              ; preds = %128
  %140 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %138, i32 0, i32 2
  %141 = load double, ptr %140, align 8, !tbaa !18
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 0
  %144 = load i32, ptr %143, align 4, !tbaa !11
  %145 = getelementptr inbounds %"struct.std::pair.5", ptr %13, i32 0, i32 1
  %146 = load i32, ptr %145, align 4, !tbaa !13
  %147 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %142, i32 noundef %144, i32 noundef %146)
          to label %148 unwind label %213

148:                                              ; preds = %139
  %149 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %147, i32 0, i32 2
  %150 = load double, ptr %149, align 8, !tbaa !18
  %151 = fsub double %141, %150
  store double %151, ptr %18, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %152 = load double, ptr %15, align 8, !tbaa !17
  %153 = load double, ptr %16, align 8, !tbaa !17
  %154 = fmul double %152, %153
  %155 = fdiv double 1.000000e+00, %154
  %156 = load double, ptr %17, align 8, !tbaa !17
  %157 = load double, ptr %18, align 8, !tbaa !17
  %158 = fmul double %156, %157
  %159 = fdiv double 1.000000e+00, %158
  %160 = fadd double %155, %159
  store double %160, ptr %19, align 8, !tbaa !17
  %161 = load double, ptr %15, align 8, !tbaa !17
  %162 = load double, ptr %15, align 8, !tbaa !17
  %163 = load double, ptr %16, align 8, !tbaa !17
  %164 = fadd double %162, %163
  %165 = fmul double %161, %164
  %166 = load double, ptr %19, align 8, !tbaa !17
  %167 = fmul double %165, %166
  %168 = fdiv double 1.000000e+00, %167
  %169 = load ptr, ptr %14, align 8, !tbaa !5
  %170 = getelementptr inbounds %"struct.FiniteDifferences::Node_internal", ptr %169, i32 0, i32 0
  store double %168, ptr %170, align 8, !tbaa !19
  %171 = load double, ptr %16, align 8, !tbaa !17
  %172 = load double, ptr %15, align 8, !tbaa !17
  %173 = load double, ptr %16, align 8, !tbaa !17
  %174 = fadd double %172, %173
  %175 = fmul double %171, %174
  %176 = load double, ptr %19, align 8, !tbaa !17
  %177 = fmul double %175, %176
  %178 = fdiv double 1.000000e+00, %177
  %179 = load ptr, ptr %14, align 8, !tbaa !5
  %180 = getelementptr inbounds %"struct.FiniteDifferences::Node_internal", ptr %179, i32 0, i32 1
  store double %178, ptr %180, align 8, !tbaa !21
  %181 = load double, ptr %17, align 8, !tbaa !17
  %182 = load double, ptr %17, align 8, !tbaa !17
  %183 = load double, ptr %18, align 8, !tbaa !17
  %184 = fadd double %182, %183
  %185 = fmul double %181, %184
  %186 = load double, ptr %19, align 8, !tbaa !17
  %187 = fmul double %185, %186
  %188 = fdiv double 1.000000e+00, %187
  %189 = load ptr, ptr %14, align 8, !tbaa !5
  %190 = getelementptr inbounds %"struct.FiniteDifferences::Node_internal", ptr %189, i32 0, i32 2
  store double %188, ptr %190, align 8, !tbaa !22
  %191 = load double, ptr %18, align 8, !tbaa !17
  %192 = load double, ptr %17, align 8, !tbaa !17
  %193 = load double, ptr %18, align 8, !tbaa !17
  %194 = fadd double %192, %193
  %195 = fmul double %191, %194
  %196 = load double, ptr %19, align 8, !tbaa !17
  %197 = fmul double %195, %196
  %198 = fdiv double 1.000000e+00, %197
  %199 = load ptr, ptr %14, align 8, !tbaa !5
  %200 = getelementptr inbounds %"struct.FiniteDifferences::Node_internal", ptr %199, i32 0, i32 3
  store double %198, ptr %200, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %220

201:                                              ; preds = %78, %71
  %202 = landingpad { ptr, i32 }
          cleanup
  %203 = extractvalue { ptr, i32 } %202, 0
  store ptr %203, ptr %10, align 8
  %204 = extractvalue { ptr, i32 } %202, 1
  store i32 %204, ptr %11, align 4
  br label %219

205:                                              ; preds = %99, %88
  %206 = landingpad { ptr, i32 }
          cleanup
  %207 = extractvalue { ptr, i32 } %206, 0
  store ptr %207, ptr %10, align 8
  %208 = extractvalue { ptr, i32 } %206, 1
  store i32 %208, ptr %11, align 4
  br label %218

209:                                              ; preds = %118, %108
  %210 = landingpad { ptr, i32 }
          cleanup
  %211 = extractvalue { ptr, i32 } %210, 0
  store ptr %211, ptr %10, align 8
  %212 = extractvalue { ptr, i32 } %210, 1
  store i32 %212, ptr %11, align 4
  br label %217

213:                                              ; preds = %139, %128
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %10, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %217

217:                                              ; preds = %213, %209
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %218

218:                                              ; preds = %217, %205
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %219

219:                                              ; preds = %218, %201
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %224

220:                                              ; preds = %148, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %221

221:                                              ; preds = %220
  %222 = load i32, ptr %12, align 4, !tbaa !9
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %12, align 4, !tbaa !9
  br label %26, !llvm.loop !24

224:                                              ; preds = %219, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @_ZNSt6vectorIN17FiniteDifferences13Node_internalESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  br label %229

225:                                              ; preds = %30
  store i1 true, ptr %8, align 1
  %226 = load i1, ptr %8, align 1
  br i1 %226, label %228, label %227

227:                                              ; preds = %225
  call void @_ZNSt6vectorIN17FiniteDifferences13Node_internalESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  br label %228

228:                                              ; preds = %227, %225
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret void

229:                                              ; preds = %224, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %230

230:                                              ; preds = %229
  %231 = load ptr, ptr %10, align 8
  %232 = load i32, ptr %11, align 4
  %233 = insertvalue { ptr, i32 } poison, ptr %231, 0
  %234 = insertvalue { ptr, i32 } %233, i32 %232, 1
  resume { ptr, i32 } %234
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorIN17FiniteDifferences13Node_internalESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSSt4pairIiiE", !10, i64 0, !10, i64 4}
!13 = !{!12, !10, i64 4}
!14 = !{!15, !16, i64 8}
!15 = !{!"_ZTSN17FiniteDifferences4NodeE", !16, i64 0, !16, i64 8, !16, i64 16}
!16 = !{!"double", !7, i64 0}
!17 = !{!16, !16, i64 0}
!18 = !{!15, !16, i64 16}
!19 = !{!20, !16, i64 0}
!20 = !{!"_ZTSN17FiniteDifferences13Node_internalE", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24}
!21 = !{!20, !16, i64 8}
!22 = !{!20, !16, i64 16}
!23 = !{!20, !16, i64 24}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; 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::vector.14" = type { %"struct.std::_Vector_base.15" }
%"struct.std::_Vector_base.15" = type { %"struct.std::_Vector_base<FiniteDifferences::Node_internal, std::allocator<FiniteDifferences::Node_internal>>::_Vector_impl" }
%"struct.std::_Vector_base<FiniteDifferences::Node_internal, std::allocator<FiniteDifferences::Node_internal>>::_Vector_impl" = type { %"struct.std::_Vector_base<FiniteDifferences::Node_internal, std::allocator<FiniteDifferences::Node_internal>>::_Vector_impl_data" }
%"struct.std::_Vector_base<FiniteDifferences::Node_internal, std::allocator<FiniteDifferences::Node_internal>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.16" = type { i8 }

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

declare i32 @__gxx_personality_v0(...)

; 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 uwtable
define dso_local void @_ZN17FiniteDifferences10precomputeERKN7Numeric6MatrixINS_4NodeEEERKSt6vectorISt4pairIiiESaIS8_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.14") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::allocator.16", align 1
  %5 = tail call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %sext = shl i64 %5, 32
  %6 = ashr exact i64 %sext, 32
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #3
  call void @_ZNSaIN17FiniteDifferences13Node_internalEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #3
  invoke void @_ZNSt6vectorIN17FiniteDifferences13Node_internalESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %6, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %7 unwind label %10

7:                                                ; preds = %3
  %8 = trunc i64 %5 to i32
  call void @_ZNSt15__new_allocatorIN17FiniteDifferences13Node_internalEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #3
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %7
  %wide.trip.count = and i64 %5, 2147483647
  br label %.lr.ph

10:                                               ; preds = %3
  %11 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIN17FiniteDifferences13Node_internalEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #3
  br label %99

.lr.ph:                                           ; preds = %.lr.ph.preheader, %98
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %98 ]
  %12 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #3
  %.sroa.0.0.copyload = load i32, ptr %12, align 4
  %.sroa.14.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 4
  %.sroa.14.0.copyload = load i32, ptr %.sroa.14.0..sroa_idx, align 4
  %13 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorIN17FiniteDifferences13Node_internalESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #3
  %14 = icmp eq i32 %.sroa.0.0.copyload, 0
  br i1 %14, label %98, label %15

15:                                               ; preds = %.lr.ph
  %16 = call noundef i32 @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEE4rowsEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %17 = add nsw i32 %16, -1
  %18 = icmp eq i32 %.sroa.0.0.copyload, %17
  %19 = icmp eq i32 %.sroa.14.0.copyload, 0
  %or.cond = select i1 %18, i1 true, i1 %19
  br i1 %or.cond, label %98, label %20

20:                                               ; preds = %15
  %21 = call noundef i32 @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEE4colsEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %22 = add nsw i32 %21, -1
  %23 = icmp eq i32 %.sroa.14.0.copyload, %22
  br i1 %23, label %98, label %24

24:                                               ; preds = %20
  %25 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.sroa.0.0.copyload, i32 noundef %.sroa.14.0.copyload)
          to label %26 unwind label %89

26:                                               ; preds = %24
  %27 = getelementptr inbounds i8, ptr %25, i64 8
  %28 = load double, ptr %27, align 8, !tbaa !5
  %29 = add nsw i32 %.sroa.14.0.copyload, -1
  %30 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.sroa.0.0.copyload, i32 noundef %29)
          to label %31 unwind label %89

31:                                               ; preds = %26
  %32 = getelementptr inbounds i8, ptr %30, i64 8
  %33 = load double, ptr %32, align 8, !tbaa !5
  %34 = fsub double %28, %33
  %35 = add nsw i32 %.sroa.14.0.copyload, 1
  %36 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.sroa.0.0.copyload, i32 noundef %35)
          to label %37 unwind label %91

37:                                               ; preds = %31
  %38 = getelementptr inbounds i8, ptr %36, i64 8
  %39 = load double, ptr %38, align 8, !tbaa !5
  %40 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.sroa.0.0.copyload, i32 noundef %.sroa.14.0.copyload)
          to label %41 unwind label %91

41:                                               ; preds = %37
  %42 = getelementptr inbounds i8, ptr %40, i64 8
  %43 = load double, ptr %42, align 8, !tbaa !5
  %44 = fsub double %39, %43
  %45 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.sroa.0.0.copyload, i32 noundef %.sroa.14.0.copyload)
          to label %46 unwind label %93

46:                                               ; preds = %41
  %47 = getelementptr inbounds i8, ptr %45, i64 16
  %48 = load double, ptr %47, align 8, !tbaa !10
  %49 = add nsw i32 %.sroa.0.0.copyload, -1
  %50 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %49, i32 noundef %.sroa.14.0.copyload)
          to label %51 unwind label %93

51:                                               ; preds = %46
  %52 = getelementptr inbounds i8, ptr %50, i64 16
  %53 = load double, ptr %52, align 8, !tbaa !10
  %54 = fsub double %48, %53
  %55 = add nsw i32 %.sroa.0.0.copyload, 1
  %56 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %55, i32 noundef %.sroa.14.0.copyload)
          to label %57 unwind label %95

57:                                               ; preds = %51
  %58 = getelementptr inbounds i8, ptr %56, i64 16
  %59 = load double, ptr %58, align 8, !tbaa !10
  %60 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.sroa.0.0.copyload, i32 noundef %.sroa.14.0.copyload)
          to label %61 unwind label %95

61:                                               ; preds = %57
  %62 = getelementptr inbounds i8, ptr %60, i64 16
  %63 = load double, ptr %62, align 8, !tbaa !10
  %64 = fsub double %59, %63
  %65 = insertelement <2 x double> poison, double %34, i64 0
  %66 = insertelement <2 x double> %65, double %54, i64 1
  %67 = insertelement <2 x double> poison, double %44, i64 0
  %68 = insertelement <2 x double> %67, double %64, i64 1
  %69 = fmul <2 x double> %66, %68
  %70 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %69
  %shift = shufflevector <2 x double> %70, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %71 = fadd <2 x double> %70, %shift
  %72 = fadd double %34, %44
  %73 = insertelement <2 x double> %65, double %44, i64 1
  %74 = insertelement <2 x double> poison, double %72, i64 0
  %75 = shufflevector <2 x double> %74, <2 x double> poison, <2 x i32> zeroinitializer
  %76 = fmul <2 x double> %73, %75
  %77 = shufflevector <2 x double> %71, <2 x double> poison, <2 x i32> zeroinitializer
  %78 = fmul <2 x double> %76, %77
  %79 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %78
  store <2 x double> %79, ptr %13, align 8, !tbaa !11
  %80 = fadd double %54, %64
  %81 = getelementptr inbounds i8, ptr %13, i64 16
  %82 = insertelement <2 x double> poison, double %54, i64 0
  %83 = insertelement <2 x double> %82, double %64, i64 1
  %84 = insertelement <2 x double> poison, double %80, i64 0
  %85 = shufflevector <2 x double> %84, <2 x double> poison, <2 x i32> zeroinitializer
  %86 = fmul <2 x double> %83, %85
  %87 = fmul <2 x double> %86, %77
  %88 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %87
  store <2 x double> %88, ptr %81, align 8, !tbaa !11
  br label %98

89:                                               ; preds = %26, %24
  %90 = landingpad { ptr, i32 }
          cleanup
  br label %97

91:                                               ; preds = %37, %31
  %92 = landingpad { ptr, i32 }
          cleanup
  br label %97

93:                                               ; preds = %46, %41
  %94 = landingpad { ptr, i32 }
          cleanup
  br label %97

95:                                               ; preds = %57, %51
  %96 = landingpad { ptr, i32 }
          cleanup
  br label %97

97:                                               ; preds = %91, %95, %93, %89
  %.pn.pn.pn = phi { ptr, i32 } [ %90, %89 ], [ %92, %91 ], [ %96, %95 ], [ %94, %93 ]
  call void @_ZNSt6vectorIN17FiniteDifferences13Node_internalESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  br label %99

98:                                               ; preds = %.lr.ph, %15, %20, %61
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !12

._crit_edge:                                      ; preds = %98, %7
  ret void

99:                                               ; preds = %97, %10
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %97 ], [ %11, %10 ]
  resume { ptr, i32 } %.pn.pn.pn.pn
}

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"_ZTSN17FiniteDifferences4NodeE", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 16}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass