; 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: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17FiniteDifferences9updateSorERN7Numeric6MatrixINS_4NodeEEERKSt6vectorISt4pairIiiESaIS7_EERKS5_INS_13Node_internalESaISC_EEd(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, double noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %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
  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
  store double %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %15 = trunc i64 %14 to i32
  store i32 %15, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %16

16:                                               ; preds = %192, %4
  %17 = load i32, ptr %10, align 4, !tbaa !11
  %18 = load i32, ptr %9, align 4, !tbaa !11
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %195

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = load i32, ptr %10, align 4, !tbaa !11
  %24 = sext i32 %23 to i64
  %25 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %24) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %25, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #5
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = load i32, ptr %10, align 4, !tbaa !11
  %28 = sext i32 %27 to i64
  %29 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN17FiniteDifferences13Node_internalESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %28) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %29, i64 32, i1 false), !tbaa.struct !13
  %30 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %31 = load i32, ptr %30, align 4, !tbaa !14
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %50

33:                                               ; preds = %21
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %36 = load i32, ptr %35, align 4, !tbaa !14
  %37 = add nsw i32 %36, 2
  %38 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %39 = load i32, ptr %38, align 4, !tbaa !16
  %40 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %34, i32 noundef %37, i32 noundef %39)
  %41 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %40, i32 0, i32 0
  %42 = load double, ptr %41, align 8, !tbaa !17
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %45 = load i32, ptr %44, align 4, !tbaa !14
  %46 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !16
  %48 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %43, i32 noundef %45, i32 noundef %47)
  %49 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %48, i32 0, i32 0
  store double %42, ptr %49, align 8, !tbaa !17
  br label %191

50:                                               ; preds = %21
  %51 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %52 = load i32, ptr %51, align 4, !tbaa !14
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = call noundef i32 @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEE4rowsEv(ptr noundef nonnull align 8 dereferenceable(32) %53)
  %55 = sub nsw i32 %54, 1
  %56 = icmp eq i32 %52, %55
  br i1 %56, label %57, label %74

57:                                               ; preds = %50
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %60 = load i32, ptr %59, align 4, !tbaa !14
  %61 = sub nsw i32 %60, 2
  %62 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %63 = load i32, ptr %62, align 4, !tbaa !16
  %64 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %58, i32 noundef %61, i32 noundef %63)
  %65 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %64, i32 0, i32 0
  %66 = load double, ptr %65, align 8, !tbaa !17
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %69 = load i32, ptr %68, align 4, !tbaa !14
  %70 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %71 = load i32, ptr %70, align 4, !tbaa !16
  %72 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %67, i32 noundef %69, i32 noundef %71)
  %73 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %72, i32 0, i32 0
  store double %66, ptr %73, align 8, !tbaa !17
  br label %190

74:                                               ; preds = %50
  %75 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %76 = load i32, ptr %75, align 4, !tbaa !16
  %77 = icmp eq i32 %76, 0
  br i1 %77, label %78, label %95

78:                                               ; preds = %74
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %81 = load i32, ptr %80, align 4, !tbaa !14
  %82 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %83 = load i32, ptr %82, align 4, !tbaa !16
  %84 = add nsw i32 %83, 2
  %85 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %79, i32 noundef %81, i32 noundef %84)
  %86 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %85, i32 0, i32 0
  %87 = load double, ptr %86, align 8, !tbaa !17
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %90 = load i32, ptr %89, align 4, !tbaa !14
  %91 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %92 = load i32, ptr %91, align 4, !tbaa !16
  %93 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %88, i32 noundef %90, i32 noundef %92)
  %94 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %93, i32 0, i32 0
  store double %87, ptr %94, align 8, !tbaa !17
  br label %189

95:                                               ; preds = %74
  %96 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %97 = load i32, ptr %96, align 4, !tbaa !16
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = call noundef i32 @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEE4colsEv(ptr noundef nonnull align 8 dereferenceable(32) %98)
  %100 = sub nsw i32 %99, 1
  %101 = icmp eq i32 %97, %100
  br i1 %101, label %102, label %119

102:                                              ; preds = %95
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %105 = load i32, ptr %104, align 4, !tbaa !14
  %106 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !16
  %108 = sub nsw i32 %107, 2
  %109 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %103, i32 noundef %105, i32 noundef %108)
  %110 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %109, i32 0, i32 0
  %111 = load double, ptr %110, align 8, !tbaa !17
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %114 = load i32, ptr %113, align 4, !tbaa !14
  %115 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %116 = load i32, ptr %115, align 4, !tbaa !16
  %117 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %112, i32 noundef %114, i32 noundef %116)
  %118 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %117, i32 0, i32 0
  store double %111, ptr %118, align 8, !tbaa !17
  br label %188

119:                                              ; preds = %95
  %120 = load double, ptr %8, align 8, !tbaa !9
  %121 = fsub double 1.000000e+00, %120
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %124 = load i32, ptr %123, align 4, !tbaa !14
  %125 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %126 = load i32, ptr %125, align 4, !tbaa !16
  %127 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %122, i32 noundef %124, i32 noundef %126)
  %128 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %127, i32 0, i32 0
  %129 = load double, ptr %128, align 8, !tbaa !17
  %130 = load double, ptr %8, align 8, !tbaa !9
  %131 = getelementptr inbounds %"struct.FiniteDifferences::Node_internal", ptr %12, i32 0, i32 0
  %132 = load double, ptr %131, align 8, !tbaa !19
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %135 = load i32, ptr %134, align 4, !tbaa !14
  %136 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %137 = load i32, ptr %136, align 4, !tbaa !16
  %138 = sub nsw i32 %137, 1
  %139 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %133, i32 noundef %135, i32 noundef %138)
  %140 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %139, i32 0, i32 0
  %141 = load double, ptr %140, align 8, !tbaa !17
  %142 = getelementptr inbounds %"struct.FiniteDifferences::Node_internal", ptr %12, i32 0, i32 1
  %143 = load double, ptr %142, align 8, !tbaa !21
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %146 = load i32, ptr %145, align 4, !tbaa !14
  %147 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %148 = load i32, ptr %147, align 4, !tbaa !16
  %149 = add nsw i32 %148, 1
  %150 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %144, i32 noundef %146, i32 noundef %149)
  %151 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %150, i32 0, i32 0
  %152 = load double, ptr %151, align 8, !tbaa !17
  %153 = fmul double %143, %152
  %154 = call double @llvm.fmuladd.f64(double %132, double %141, double %153)
  %155 = getelementptr inbounds %"struct.FiniteDifferences::Node_internal", ptr %12, i32 0, i32 2
  %156 = load double, ptr %155, align 8, !tbaa !22
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %159 = load i32, ptr %158, align 4, !tbaa !14
  %160 = sub nsw i32 %159, 1
  %161 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %162 = load i32, ptr %161, align 4, !tbaa !16
  %163 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %157, i32 noundef %160, i32 noundef %162)
  %164 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %163, i32 0, i32 0
  %165 = load double, ptr %164, align 8, !tbaa !17
  %166 = call double @llvm.fmuladd.f64(double %156, double %165, double %154)
  %167 = getelementptr inbounds %"struct.FiniteDifferences::Node_internal", ptr %12, i32 0, i32 3
  %168 = load double, ptr %167, align 8, !tbaa !23
  %169 = load ptr, ptr %5, align 8, !tbaa !5
  %170 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %171 = load i32, ptr %170, align 4, !tbaa !14
  %172 = add nsw i32 %171, 1
  %173 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %174 = load i32, ptr %173, align 4, !tbaa !16
  %175 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %169, i32 noundef %172, i32 noundef %174)
  %176 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %175, i32 0, i32 0
  %177 = load double, ptr %176, align 8, !tbaa !17
  %178 = call double @llvm.fmuladd.f64(double %168, double %177, double %166)
  %179 = fmul double %130, %178
  %180 = call double @llvm.fmuladd.f64(double %121, double %129, double %179)
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 0
  %183 = load i32, ptr %182, align 4, !tbaa !14
  %184 = getelementptr inbounds %"struct.std::pair.5", ptr %11, i32 0, i32 1
  %185 = load i32, ptr %184, align 4, !tbaa !16
  %186 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %181, i32 noundef %183, i32 noundef %185)
  %187 = getelementptr inbounds %"struct.FiniteDifferences::Node", ptr %186, i32 0, i32 0
  store double %180, ptr %187, align 8, !tbaa !17
  br label %188

188:                                              ; preds = %119, %102
  br label %189

189:                                              ; preds = %188, %78
  br label %190

190:                                              ; preds = %189, %57
  br label %191

191:                                              ; preds = %190, %33
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %192

192:                                              ; preds = %191
  %193 = load i32, ptr %10, align 4, !tbaa !11
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %10, align 4, !tbaa !11
  br label %16, !llvm.loop !24

195:                                              ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret void
}

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 8, !9, i64 8, i64 8, !9, i64 16, i64 8, !9, i64 24, i64 8, !9}
!14 = !{!15, !12, i64 0}
!15 = !{!"_ZTSSt4pairIiiE", !12, i64 0, !12, i64 4}
!16 = !{!15, !12, i64 4}
!17 = !{!18, !10, i64 0}
!18 = !{!"_ZTSN17FiniteDifferences4NodeE", !10, i64 0, !10, i64 8, !10, i64 16}
!19 = !{!20, !10, i64 0}
!20 = !{!"_ZTSN17FiniteDifferences13Node_internalE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!21 = !{!20, !10, i64 8}
!22 = !{!20, !10, i64 16}
!23 = !{!20, !10, 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 uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17FiniteDifferences9updateSorERN7Numeric6MatrixINS_4NodeEEERKSt6vectorISt4pairIiiESaIS7_EERKS5_INS_13Node_internalESaISC_EEd(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, double noundef %3) local_unnamed_addr #0 {
  %5 = tail call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  %6 = trunc i64 %5 to i32
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %4
  %8 = fsub double 1.000000e+00, %3
  %wide.trip.count = and i64 %5, 2147483647
  br label %9

._crit_edge:                                      ; preds = %63, %4
  ret void

9:                                                ; preds = %.lr.ph, %63
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %63 ]
  %10 = 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.01.0.copyload = load i32, ptr %10, align 4
  %.sroa.19.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 4
  %.sroa.19.0.copyload = load i32, ptr %.sroa.19.0..sroa_idx, align 4
  %11 = 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 %11, align 8, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %11, 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 %11, 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 %11, i64 24
  %.sroa.6.0.copyload = load double, ptr %.sroa.6.0..sroa_idx, align 8, !tbaa !5
  %12 = icmp eq i32 %.sroa.01.0.copyload, 0
  br i1 %12, label %13, label %17

13:                                               ; preds = %9
  %14 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 2, i32 noundef %.sroa.19.0.copyload)
  %15 = load double, ptr %14, align 8, !tbaa !9
  %16 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 0, i32 noundef %.sroa.19.0.copyload)
  store double %15, ptr %16, align 8, !tbaa !9
  br label %63

17:                                               ; preds = %9
  %18 = tail call noundef i32 @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEE4rowsEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %19 = add nsw i32 %18, -1
  %20 = icmp eq i32 %.sroa.01.0.copyload, %19
  br i1 %20, label %21, label %26

21:                                               ; preds = %17
  %22 = add nsw i32 %.sroa.01.0.copyload, -2
  %23 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %22, i32 noundef %.sroa.19.0.copyload)
  %24 = load double, ptr %23, align 8, !tbaa !9
  %25 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.sroa.01.0.copyload, i32 noundef %.sroa.19.0.copyload)
  store double %24, ptr %25, align 8, !tbaa !9
  br label %63

26:                                               ; preds = %17
  %27 = icmp eq i32 %.sroa.19.0.copyload, 0
  br i1 %27, label %28, label %32

28:                                               ; preds = %26
  %29 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.sroa.01.0.copyload, i32 noundef 2)
  %30 = load double, ptr %29, align 8, !tbaa !9
  %31 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.sroa.01.0.copyload, i32 noundef 0)
  store double %30, ptr %31, align 8, !tbaa !9
  br label %63

32:                                               ; preds = %26
  %33 = tail call noundef i32 @_ZNK7Numeric6MatrixIN17FiniteDifferences4NodeEE4colsEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %34 = add nsw i32 %33, -1
  %35 = icmp eq i32 %.sroa.19.0.copyload, %34
  br i1 %35, label %36, label %41

36:                                               ; preds = %32
  %37 = add nsw i32 %.sroa.19.0.copyload, -2
  %38 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.sroa.01.0.copyload, i32 noundef %37)
  %39 = load double, ptr %38, align 8, !tbaa !9
  %40 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.sroa.01.0.copyload, i32 noundef %.sroa.19.0.copyload)
  store double %39, ptr %40, align 8, !tbaa !9
  br label %63

41:                                               ; preds = %32
  %42 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.sroa.01.0.copyload, i32 noundef %.sroa.19.0.copyload)
  %43 = load double, ptr %42, align 8, !tbaa !9
  %44 = add nsw i32 %.sroa.19.0.copyload, -1
  %45 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.sroa.01.0.copyload, i32 noundef %44)
  %46 = load double, ptr %45, align 8, !tbaa !9
  %47 = add nsw i32 %.sroa.19.0.copyload, 1
  %48 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.sroa.01.0.copyload, i32 noundef %47)
  %49 = load double, ptr %48, align 8, !tbaa !9
  %50 = fmul double %.sroa.4.0.copyload, %49
  %51 = tail call double @llvm.fmuladd.f64(double %.sroa.0.0.copyload, double %46, double %50)
  %52 = add nsw i32 %.sroa.01.0.copyload, -1
  %53 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %52, i32 noundef %.sroa.19.0.copyload)
  %54 = load double, ptr %53, align 8, !tbaa !9
  %55 = tail call double @llvm.fmuladd.f64(double %.sroa.5.0.copyload, double %54, double %51)
  %56 = add nsw i32 %.sroa.01.0.copyload, 1
  %57 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %56, i32 noundef %.sroa.19.0.copyload)
  %58 = load double, ptr %57, align 8, !tbaa !9
  %59 = tail call double @llvm.fmuladd.f64(double %.sroa.6.0.copyload, double %58, double %55)
  %60 = fmul double %59, %3
  %61 = tail call double @llvm.fmuladd.f64(double %8, double %43, double %60)
  %62 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Numeric6MatrixIN17FiniteDifferences4NodeEEclEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.sroa.01.0.copyload, i32 noundef %.sroa.19.0.copyload)
  store double %61, ptr %62, align 8, !tbaa !9
  br label %63

63:                                               ; preds = %21, %36, %41, %28, %13
  %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 %9, !llvm.loop !11
}

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass