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

%"struct.std::pair.5" = type { i32, i32 }
%"struct.FiniteDifferences::Node_internal" = type { double, double, double, double }
%"struct.FiniteDifferences::Node" = type { double, double, double }

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN17FiniteDifferences4stopERKN7Numeric6MatrixINS_4NodeEEERKSt6vectorISt4pairIiiESaIS8_EERKS6_INS_13Node_internalESaISD_EE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair.5", align 4
  %12 = alloca %"struct.FiniteDifferences::Node_internal", align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  %21 = trunc i64 %20 to i32
  store i32 %21, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %246, %3
  %23 = load i32, ptr %9, align 4, !tbaa !9
  %24 = load i32, ptr %8, align 4, !tbaa !9
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  store i32 2, ptr %10, align 4
  br label %249

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = load i32, ptr %9, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %30) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %31, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #5
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = load i32, ptr %9, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN17FiniteDifferences13Node_internalESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef %34) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %35, i64 32, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %38 = load i32, ptr %37, align 4, !tbaa !14
  %39 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %40 = load i32, ptr %39, align 4, !tbaa !16
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %36, i32 noundef %38, i32 noundef %40)
  %42 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %41, i32 0, i32 0
  %43 = load double, ptr %42, align 8, !tbaa !17
  store double %43, ptr %13, align 8, !tbaa !12
  %44 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %45 = load i32, ptr %44, align 4, !tbaa !14
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %74

47:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %50 = load i32, ptr %49, align 4, !tbaa !14
  %51 = add nsw i32 %50, 2
  %52 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %53 = load i32, ptr %52, align 4, !tbaa !16
  %54 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %48, i32 noundef %51, i32 noundef %53)
  %55 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %54, i32 0, i32 0
  %56 = load double, ptr %55, align 8, !tbaa !17
  %57 = load double, ptr %13, align 8, !tbaa !12
  %58 = fsub double %56, %57
  store double %58, ptr %14, align 8, !tbaa !12
  %59 = load double, ptr %13, align 8, !tbaa !12
  %60 = fcmp une double %59, 0.000000e+00
  br i1 %60, label %61, label %65

61:                                               ; preds = %47
  %62 = load double, ptr %13, align 8, !tbaa !12
  %63 = load double, ptr %14, align 8, !tbaa !12
  %64 = fdiv double %63, %62
  store double %64, ptr %14, align 8, !tbaa !12
  br label %65

65:                                               ; preds = %61, %47
  %66 = load double, ptr %14, align 8, !tbaa !12
  %67 = call double @llvm.fabs.f64(double %66)
  %68 = fcmp ogt double %67, 1.000000e-05
  br i1 %68, label %69, label %70

69:                                               ; preds = %65
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %71

70:                                               ; preds = %65
  store i32 0, ptr %10, align 4
  br label %71

71:                                               ; preds = %70, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  %72 = load i32, ptr %10, align 4
  switch i32 %72, label %243 [
    i32 0, label %73
  ]

73:                                               ; preds = %71
  br label %242

74:                                               ; preds = %27
  %75 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %76 = load i32, ptr %75, align 4, !tbaa !14
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = call noundef i32 @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEE4rowsEv(ptr noundef nonnull align 8 dereferenceable(32) %77)
  %79 = sub nsw i32 %78, 1
  %80 = icmp eq i32 %76, %79
  br i1 %80, label %81, label %108

81:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %84 = load i32, ptr %83, align 4, !tbaa !14
  %85 = sub nsw i32 %84, 2
  %86 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %87 = load i32, ptr %86, align 4, !tbaa !16
  %88 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %82, i32 noundef %85, i32 noundef %87)
  %89 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %88, i32 0, i32 0
  %90 = load double, ptr %89, align 8, !tbaa !17
  %91 = load double, ptr %13, align 8, !tbaa !12
  %92 = fsub double %90, %91
  store double %92, ptr %15, align 8, !tbaa !12
  %93 = load double, ptr %13, align 8, !tbaa !12
  %94 = fcmp une double %93, 0.000000e+00
  br i1 %94, label %95, label %99

95:                                               ; preds = %81
  %96 = load double, ptr %13, align 8, !tbaa !12
  %97 = load double, ptr %15, align 8, !tbaa !12
  %98 = fdiv double %97, %96
  store double %98, ptr %15, align 8, !tbaa !12
  br label %99

99:                                               ; preds = %95, %81
  %100 = load double, ptr %15, align 8, !tbaa !12
  %101 = call double @llvm.fabs.f64(double %100)
  %102 = fcmp ogt double %101, 1.000000e-05
  br i1 %102, label %103, label %104

103:                                              ; preds = %99
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %105

104:                                              ; preds = %99
  store i32 0, ptr %10, align 4
  br label %105

105:                                              ; preds = %104, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  %106 = load i32, ptr %10, align 4
  switch i32 %106, label %243 [
    i32 0, label %107
  ]

107:                                              ; preds = %105
  br label %241

108:                                              ; preds = %74
  %109 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %110 = load i32, ptr %109, align 4, !tbaa !16
  %111 = icmp eq i32 %110, 0
  br i1 %111, label %112, label %139

112:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %115 = load i32, ptr %114, align 4, !tbaa !14
  %116 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %117 = load i32, ptr %116, align 4, !tbaa !16
  %118 = add nsw i32 %117, 2
  %119 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %113, i32 noundef %115, i32 noundef %118)
  %120 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %119, i32 0, i32 0
  %121 = load double, ptr %120, align 8, !tbaa !17
  %122 = load double, ptr %13, align 8, !tbaa !12
  %123 = fsub double %121, %122
  store double %123, ptr %16, align 8, !tbaa !12
  %124 = load double, ptr %13, align 8, !tbaa !12
  %125 = fcmp une double %124, 0.000000e+00
  br i1 %125, label %126, label %130

126:                                              ; preds = %112
  %127 = load double, ptr %13, align 8, !tbaa !12
  %128 = load double, ptr %16, align 8, !tbaa !12
  %129 = fdiv double %128, %127
  store double %129, ptr %16, align 8, !tbaa !12
  br label %130

130:                                              ; preds = %126, %112
  %131 = load double, ptr %16, align 8, !tbaa !12
  %132 = call double @llvm.fabs.f64(double %131)
  %133 = fcmp ogt double %132, 1.000000e-05
  br i1 %133, label %134, label %135

134:                                              ; preds = %130
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %136

135:                                              ; preds = %130
  store i32 0, ptr %10, align 4
  br label %136

136:                                              ; preds = %135, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  %137 = load i32, ptr %10, align 4
  switch i32 %137, label %243 [
    i32 0, label %138
  ]

138:                                              ; preds = %136
  br label %240

139:                                              ; preds = %108
  %140 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %141 = load i32, ptr %140, align 4, !tbaa !16
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = call noundef i32 @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEE4colsEv(ptr noundef nonnull align 8 dereferenceable(32) %142)
  %144 = sub nsw i32 %143, 1
  %145 = icmp eq i32 %141, %144
  br i1 %145, label %146, label %173

146:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %149 = load i32, ptr %148, align 4, !tbaa !14
  %150 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %151 = load i32, ptr %150, align 4, !tbaa !16
  %152 = sub nsw i32 %151, 2
  %153 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %147, i32 noundef %149, i32 noundef %152)
  %154 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %153, i32 0, i32 0
  %155 = load double, ptr %154, align 8, !tbaa !17
  %156 = load double, ptr %13, align 8, !tbaa !12
  %157 = fsub double %155, %156
  store double %157, ptr %17, align 8, !tbaa !12
  %158 = load double, ptr %13, align 8, !tbaa !12
  %159 = fcmp une double %158, 0.000000e+00
  br i1 %159, label %160, label %164

160:                                              ; preds = %146
  %161 = load double, ptr %13, align 8, !tbaa !12
  %162 = load double, ptr %17, align 8, !tbaa !12
  %163 = fdiv double %162, %161
  store double %163, ptr %17, align 8, !tbaa !12
  br label %164

164:                                              ; preds = %160, %146
  %165 = load double, ptr %17, align 8, !tbaa !12
  %166 = call double @llvm.fabs.f64(double %165)
  %167 = fcmp ogt double %166, 1.000000e-05
  br i1 %167, label %168, label %169

168:                                              ; preds = %164
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %170

169:                                              ; preds = %164
  store i32 0, ptr %10, align 4
  br label %170

170:                                              ; preds = %169, %168
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  %171 = load i32, ptr %10, align 4
  switch i32 %171, label %243 [
    i32 0, label %172
  ]

172:                                              ; preds = %170
  br label %239

173:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %174 = getelementptr inbounds %"struct.FiniteDifferences::Node_internal", ptr %12, i32 0, i32 0
  %175 = load double, ptr %174, align 8, !tbaa !19
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %178 = load i32, ptr %177, align 4, !tbaa !14
  %179 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %180 = load i32, ptr %179, align 4, !tbaa !16
  %181 = sub nsw i32 %180, 1
  %182 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %176, i32 noundef %178, i32 noundef %181)
  %183 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %182, i32 0, i32 0
  %184 = load double, ptr %183, align 8, !tbaa !17
  %185 = getelementptr inbounds %"struct.FiniteDifferences::Node_internal", ptr %12, i32 0, i32 1
  %186 = load double, ptr %185, align 8, !tbaa !21
  %187 = load ptr, ptr %5, align 8, !tbaa !5
  %188 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %189 = load i32, ptr %188, align 4, !tbaa !14
  %190 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %191 = load i32, ptr %190, align 4, !tbaa !16
  %192 = add nsw i32 %191, 1
  %193 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %187, i32 noundef %189, i32 noundef %192)
  %194 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %193, i32 0, i32 0
  %195 = load double, ptr %194, align 8, !tbaa !17
  %196 = fmul double %186, %195
  %197 = call double @llvm.fmuladd.f64(double %175, double %184, double %196)
  %198 = getelementptr inbounds %"struct.FiniteDifferences::Node_internal", ptr %12, i32 0, i32 2
  %199 = load double, ptr %198, align 8, !tbaa !22
  %200 = load ptr, ptr %5, align 8, !tbaa !5
  %201 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %202 = load i32, ptr %201, align 4, !tbaa !14
  %203 = sub nsw i32 %202, 1
  %204 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %205 = load i32, ptr %204, align 4, !tbaa !16
  %206 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %200, i32 noundef %203, i32 noundef %205)
  %207 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %206, i32 0, i32 0
  %208 = load double, ptr %207, align 8, !tbaa !17
  %209 = call double @llvm.fmuladd.f64(double %199, double %208, double %197)
  %210 = getelementptr inbounds %"struct.FiniteDifferences::Node_internal", ptr %12, i32 0, i32 3
  %211 = load double, ptr %210, align 8, !tbaa !23
  %212 = load ptr, ptr %5, align 8, !tbaa !5
  %213 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %214 = load i32, ptr %213, align 4, !tbaa !14
  %215 = add nsw i32 %214, 1
  %216 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %217 = load i32, ptr %216, align 4, !tbaa !16
  %218 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %212, i32 noundef %215, i32 noundef %217)
  %219 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %218, i32 0, i32 0
  %220 = load double, ptr %219, align 8, !tbaa !17
  %221 = call double @llvm.fmuladd.f64(double %211, double %220, double %209)
  %222 = load double, ptr %13, align 8, !tbaa !12
  %223 = fsub double %221, %222
  store double %223, ptr %18, align 8, !tbaa !12
  %224 = load double, ptr %13, align 8, !tbaa !12
  %225 = fcmp une double %224, 0.000000e+00
  br i1 %225, label %226, label %230

226:                                              ; preds = %173
  %227 = load double, ptr %13, align 8, !tbaa !12
  %228 = load double, ptr %18, align 8, !tbaa !12
  %229 = fdiv double %228, %227
  store double %229, ptr %18, align 8, !tbaa !12
  br label %230

230:                                              ; preds = %226, %173
  %231 = load double, ptr %18, align 8, !tbaa !12
  %232 = call double @llvm.fabs.f64(double %231)
  %233 = fcmp ogt double %232, 1.000000e-05
  br i1 %233, label %234, label %235

234:                                              ; preds = %230
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %236

235:                                              ; preds = %230
  store i32 0, ptr %10, align 4
  br label %236

236:                                              ; preds = %235, %234
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  %237 = load i32, ptr %10, align 4
  switch i32 %237, label %243 [
    i32 0, label %238
  ]

238:                                              ; preds = %236
  br label %239

239:                                              ; preds = %238, %172
  br label %240

240:                                              ; preds = %239, %138
  br label %241

241:                                              ; preds = %240, %107
  br label %242

242:                                              ; preds = %241, %73
  store i32 0, ptr %10, align 4
  br label %243

243:                                              ; preds = %242, %236, %170, %136, %105, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %244 = load i32, ptr %10, align 4
  switch i32 %244, label %249 [
    i32 0, label %245
  ]

245:                                              ; preds = %243
  br label %246

246:                                              ; preds = %245
  %247 = load i32, ptr %9, align 4, !tbaa !9
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %9, align 4, !tbaa !9
  br label %22, !llvm.loop !24

249:                                              ; preds = %243, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %250 = load i32, ptr %10, align 4
  switch i32 %250, label %252 [
    i32 2, label %251
  ]

251:                                              ; preds = %249
  store i1 true, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %252

252:                                              ; preds = %251, %249
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %253 = load i1, ptr %4, align 1
  ret i1 %253
}

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 8, !12, i64 8, i64 8, !12, i64 16, i64 8, !12, i64 24, i64 8, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!15, !10, i64 0}
!15 = !{!"_ZTSSt4pairIiiE", !10, i64 0, !10, i64 4}
!16 = !{!15, !10, i64 4}
!17 = !{!18, !13, i64 0}
!18 = !{!"_ZTSN17FiniteDifferences4NodeE", !13, i64 0, !13, i64 8, !13, i64 16}
!19 = !{!20, !13, i64 0}
!20 = !{!"_ZTSN17FiniteDifferences13Node_internalE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!21 = !{!20, !13, i64 8}
!22 = !{!20, !13, i64 16}
!23 = !{!20, !13, 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"

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN17FiniteDifferences4stopERKN7Numeric6MatrixINS_4NodeEEERKSt6vectorISt4pairIiiESaIS8_EERKS6_INS_13Node_internalESaISD_EE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #1 {
  %4 = tail call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  %5 = trunc i64 %4 to i32
  %.not98 = icmp slt i32 %5, 1
  br i1 %.not98, label %.critedge97, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %3
  %6 = and i64 %4, 2147483647
  %wide.trip.count = and i64 %4, 2147483647
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.critedge
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.critedge ]
  %.not100 = phi i1 [ false, %.lr.ph.preheader ], [ %.not, %.critedge ]
  %7 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #3
  %.sroa.031.0.copyload = load i32, ptr %7, align 4
  %.sroa.14.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 4
  %.sroa.14.0.copyload = load i32, ptr %.sroa.14.0..sroa_idx, align 4
  %8 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN17FiniteDifferences13Node_internalESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #3
  %.sroa.0.0.copyload = load double, ptr %8, align 8, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  %.sroa.4.0.copyload = load double, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 16
  %.sroa.5.0.copyload = load double, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !5
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 24
  %.sroa.6.0.copyload = load double, ptr %.sroa.6.0..sroa_idx, align 8, !tbaa !5
  %9 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.sroa.031.0.copyload, i32 noundef %.sroa.14.0.copyload)
  %10 = load double, ptr %9, align 8, !tbaa !9
  %11 = icmp eq i32 %.sroa.031.0.copyload, 0
  br i1 %11, label %12, label %20

12:                                               ; preds = %.lr.ph
  %13 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 2, i32 noundef %.sroa.14.0.copyload)
  %14 = load double, ptr %13, align 8, !tbaa !9
  %15 = fsub double %14, %10
  %16 = fcmp une double %10, 0.000000e+00
  %17 = fdiv double %15, %10
  %.081 = select i1 %16, double %17, double %15
  %18 = tail call double @llvm.fabs.f64(double %.081)
  %19 = fcmp ule double %18, 1.000000e-05
  br i1 %19, label %.critedge, label %.critedge97

20:                                               ; preds = %.lr.ph
  %21 = tail call noundef i32 @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEE4rowsEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %22 = add nsw i32 %21, -1
  %23 = icmp eq i32 %.sroa.031.0.copyload, %22
  br i1 %23, label %24, label %33

24:                                               ; preds = %20
  %25 = add nsw i32 %.sroa.031.0.copyload, -2
  %26 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %25, i32 noundef %.sroa.14.0.copyload)
  %27 = load double, ptr %26, align 8, !tbaa !9
  %28 = fsub double %27, %10
  %29 = fcmp une double %10, 0.000000e+00
  %30 = fdiv double %28, %10
  %.080 = select i1 %29, double %30, double %28
  %31 = tail call double @llvm.fabs.f64(double %.080)
  %32 = fcmp ule double %31, 1.000000e-05
  br i1 %32, label %.critedge, label %.critedge97

33:                                               ; preds = %20
  %34 = icmp eq i32 %.sroa.14.0.copyload, 0
  br i1 %34, label %35, label %43

35:                                               ; preds = %33
  %36 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.sroa.031.0.copyload, i32 noundef 2)
  %37 = load double, ptr %36, align 8, !tbaa !9
  %38 = fsub double %37, %10
  %39 = fcmp une double %10, 0.000000e+00
  %40 = fdiv double %38, %10
  %.079 = select i1 %39, double %40, double %38
  %41 = tail call double @llvm.fabs.f64(double %.079)
  %42 = fcmp ule double %41, 1.000000e-05
  br i1 %42, label %.critedge, label %.critedge97

43:                                               ; preds = %33
  %44 = tail call noundef i32 @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEE4colsEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %45 = add nsw i32 %44, -1
  %46 = icmp eq i32 %.sroa.14.0.copyload, %45
  br i1 %46, label %47, label %56

47:                                               ; preds = %43
  %48 = add nsw i32 %.sroa.14.0.copyload, -2
  %49 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.sroa.031.0.copyload, i32 noundef %48)
  %50 = load double, ptr %49, align 8, !tbaa !9
  %51 = fsub double %50, %10
  %52 = fcmp une double %10, 0.000000e+00
  %53 = fdiv double %51, %10
  %.078 = select i1 %52, double %53, double %51
  %54 = tail call double @llvm.fabs.f64(double %.078)
  %55 = fcmp ule double %54, 1.000000e-05
  br i1 %55, label %.critedge, label %.critedge97

56:                                               ; preds = %43
  %57 = add nsw i32 %.sroa.14.0.copyload, -1
  %58 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.sroa.031.0.copyload, i32 noundef %57)
  %59 = load double, ptr %58, align 8, !tbaa !9
  %60 = add nsw i32 %.sroa.14.0.copyload, 1
  %61 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.sroa.031.0.copyload, i32 noundef %60)
  %62 = load double, ptr %61, align 8, !tbaa !9
  %63 = fmul double %.sroa.4.0.copyload, %62
  %64 = tail call double @llvm.fmuladd.f64(double %.sroa.0.0.copyload, double %59, double %63)
  %65 = add nsw i32 %.sroa.031.0.copyload, -1
  %66 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %65, i32 noundef %.sroa.14.0.copyload)
  %67 = load double, ptr %66, align 8, !tbaa !9
  %68 = tail call double @llvm.fmuladd.f64(double %.sroa.5.0.copyload, double %67, double %64)
  %69 = add nsw i32 %.sroa.031.0.copyload, 1
  %70 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %69, i32 noundef %.sroa.14.0.copyload)
  %71 = load double, ptr %70, align 8, !tbaa !9
  %72 = tail call double @llvm.fmuladd.f64(double %.sroa.6.0.copyload, double %71, double %68)
  %73 = fsub double %72, %10
  %74 = fcmp une double %10, 0.000000e+00
  %75 = fdiv double %73, %10
  %.0 = select i1 %74, double %75, double %73
  %76 = tail call double @llvm.fabs.f64(double %.0)
  %77 = fcmp ule double %76, 1.000000e-05
  br i1 %77, label %.critedge, label %.critedge97

.critedge:                                        ; preds = %24, %47, %56, %35, %12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not = icmp uge i64 %indvars.iv.next, %6
  %exitcond = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond, label %.critedge97, label %.lr.ph, !llvm.loop !11

.critedge97:                                      ; preds = %56, %47, %35, %24, %12, %.critedge, %3
  %.not.lcssa = phi i1 [ true, %3 ], [ %.not, %.critedge ], [ %.not100, %12 ], [ %.not100, %24 ], [ %.not100, %35 ], [ %.not100, %47 ], [ %.not100, %56 ]
  ret i1 %.not.lcssa
}

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN17FiniteDifferences4NodeE", !6, i64 0, !6, i64 8, !6, i64 16}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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