; LLVM IR from buresjan/optim_lbm :: nomad/ext/sgtelib/src/Surrogate_PRS.ll (ZN7SGTELIB13Surrogate_PRS15get_PRS_monomesEii)

; 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.SGTELIB::Matrix" = type { ptr, %"class.std::__cxx11::basic_string", i32, i32, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@.str.10 = external hidden unnamed_addr constant [8 x i8], align 1

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

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

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

declare i32 @__gxx_personality_v0(...)

declare void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #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: nounwind
declare void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7SGTELIB13Surrogate_PRS15get_PRS_monomesEii(ptr dead_on_unwind noalias writable sret(%"class.SGTELIB::Matrix") align 8 %0, i32 noundef %1, i32 noundef %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i1, align 1
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store i32 %1, ptr %5, align 4, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %23, i64 8)
  %25 = extractvalue { i64, i1 } %24, 1
  %26 = extractvalue { i64, i1 } %24, 0
  %27 = select i1 %25, i64 -1, i64 %26
  %28 = call noalias noundef nonnull ptr @_Znam(i64 noundef %27) #10
  store ptr %28, ptr %7, align 8, !tbaa !9
  store i1 false, ptr %8, align 1
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef @.str.10, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %29 unwind label %39

29:                                               ; preds = %3
  %30 = load i32, ptr %5, align 4, !tbaa !5
  invoke void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(32) %9, i32 noundef 1, i32 noundef %30)
          to label %31 unwind label %43

31:                                               ; preds = %29
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  store i32 1, ptr %18, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %263, %31
  %33 = load i32, ptr %18, align 4, !tbaa !5
  %34 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %35 unwind label %48

35:                                               ; preds = %32
  %36 = load i32, ptr %34, align 4, !tbaa !5
  %37 = icmp sle i32 %33, %36
  br i1 %37, label %52, label %38

38:                                               ; preds = %35
  store i32 2, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  br label %267

39:                                               ; preds = %3
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %11, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %12, align 4
  br label %47

43:                                               ; preds = %29
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %11, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %12, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #9
  br label %47

47:                                               ; preds = %43, %39
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #9
  br label %275

48:                                               ; preds = %32
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %11, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %12, align 4
  br label %266

52:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  %53 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %53, ptr %20, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %259, %52
  %55 = load i32, ptr %20, align 4, !tbaa !5
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 5, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  br label %262

59:                                               ; preds = %54
  %60 = load i32, ptr %20, align 4, !tbaa !5
  %61 = load i32, ptr %18, align 4, !tbaa !5
  %62 = sub nsw i32 %60, %61
  %63 = add nsw i32 %62, 1
  %64 = sitofp i32 %63 to double
  %65 = load ptr, ptr %7, align 8, !tbaa !9
  %66 = getelementptr inbounds double, ptr %65, i64 0
  store double %64, ptr %66, align 8, !tbaa !11
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %76, %59
  %68 = load i32, ptr %14, align 4, !tbaa !5
  %69 = load i32, ptr %18, align 4, !tbaa !5
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %71, label %79

71:                                               ; preds = %67
  %72 = load ptr, ptr %7, align 8, !tbaa !9
  %73 = load i32, ptr %14, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds double, ptr %72, i64 %74
  store double 1.000000e+00, ptr %75, align 8, !tbaa !11
  br label %76

76:                                               ; preds = %71
  %77 = load i32, ptr %14, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %14, align 4, !tbaa !5
  br label %67, !llvm.loop !13

79:                                               ; preds = %67
  %80 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %80, ptr %14, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %90, %79
  %82 = load i32, ptr %14, align 4, !tbaa !5
  %83 = load i32, ptr %5, align 4, !tbaa !5
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %85, label %93

85:                                               ; preds = %81
  %86 = load ptr, ptr %7, align 8, !tbaa !9
  %87 = load i32, ptr %14, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds double, ptr %86, i64 %88
  store double 0.000000e+00, ptr %89, align 8, !tbaa !11
  br label %90

90:                                               ; preds = %85
  %91 = load i32, ptr %14, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %14, align 4, !tbaa !5
  br label %81, !llvm.loop !15

93:                                               ; preds = %81
  store i8 1, ptr %13, align 1, !tbaa !16
  br label %94

94:                                               ; preds = %257, %93
  %95 = load i8, ptr %13, align 1, !tbaa !16, !range !18, !noundef !19
  %96 = trunc i8 %95 to i1
  br i1 %96, label %97, label %258

97:                                               ; preds = %94
  %98 = load ptr, ptr %7, align 8, !tbaa !9
  invoke void @_ZN7SGTELIB6Matrix7add_rowEPKd(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef %98)
          to label %99 unwind label %145

99:                                               ; preds = %97
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %142, %99
  %101 = load i32, ptr %14, align 4, !tbaa !5
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = sub nsw i32 %102, 1
  %104 = icmp slt i32 %101, %103
  br i1 %104, label %105, label %140

105:                                              ; preds = %100
  %106 = load ptr, ptr %7, align 8, !tbaa !9
  %107 = load i32, ptr %14, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds double, ptr %106, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !11
  %111 = load ptr, ptr %7, align 8, !tbaa !9
  %112 = load i32, ptr %14, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds double, ptr %111, i64 %114
  %116 = load double, ptr %115, align 8, !tbaa !11
  %117 = fcmp ole double %110, %116
  br i1 %117, label %118, label %140

118:                                              ; preds = %105
  %119 = load ptr, ptr %7, align 8, !tbaa !9
  %120 = load i32, ptr %14, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds double, ptr %119, i64 %121
  %123 = load double, ptr %122, align 8, !tbaa !11
  %124 = fcmp ole double %123, 1.000000e+00
  br i1 %124, label %138, label %125

125:                                              ; preds = %118
  %126 = load ptr, ptr %7, align 8, !tbaa !9
  %127 = load i32, ptr %14, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds double, ptr %126, i64 %129
  %131 = load double, ptr %130, align 8, !tbaa !11
  %132 = load i32, ptr %20, align 4, !tbaa !5
  %133 = load i32, ptr %18, align 4, !tbaa !5
  %134 = sub nsw i32 %132, %133
  %135 = add nsw i32 %134, 1
  %136 = sitofp i32 %135 to double
  %137 = fcmp oge double %131, %136
  br label %138

138:                                              ; preds = %125, %118
  %139 = phi i1 [ true, %118 ], [ %137, %125 ]
  br label %140

140:                                              ; preds = %138, %105, %100
  %141 = phi i1 [ false, %105 ], [ false, %100 ], [ %139, %138 ]
  br i1 %141, label %142, label %149

142:                                              ; preds = %140
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %14, align 4, !tbaa !5
  br label %100, !llvm.loop !20

145:                                              ; preds = %97
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %11, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  br label %266

149:                                              ; preds = %140
  %150 = load i32, ptr %14, align 4, !tbaa !5
  %151 = load i32, ptr %5, align 4, !tbaa !5
  %152 = sub nsw i32 %151, 1
  %153 = icmp slt i32 %150, %152
  br i1 %153, label %154, label %256

154:                                              ; preds = %149
  %155 = load ptr, ptr %7, align 8, !tbaa !9
  %156 = load i32, ptr %14, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds double, ptr %155, i64 %158
  %160 = load double, ptr %159, align 8, !tbaa !11
  %161 = fadd double %160, 1.000000e+00
  store double %161, ptr %159, align 8, !tbaa !11
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %171, %154
  %163 = load i32, ptr %15, align 4, !tbaa !5
  %164 = load i32, ptr %14, align 4, !tbaa !5
  %165 = icmp sle i32 %163, %164
  br i1 %165, label %166, label %174

166:                                              ; preds = %162
  %167 = load ptr, ptr %7, align 8, !tbaa !9
  %168 = load i32, ptr %15, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds double, ptr %167, i64 %169
  store double 0.000000e+00, ptr %170, align 8, !tbaa !11
  br label %171

171:                                              ; preds = %166
  %172 = load i32, ptr %15, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %15, align 4, !tbaa !5
  br label %162, !llvm.loop !21

174:                                              ; preds = %162
  %175 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %175, ptr %17, align 4, !tbaa !5
  %176 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %176, ptr %16, align 4, !tbaa !5
  %177 = load i32, ptr %14, align 4, !tbaa !5
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %15, align 4, !tbaa !5
  br label %179

179:                                              ; preds = %201, %174
  %180 = load i32, ptr %15, align 4, !tbaa !5
  %181 = load i32, ptr %5, align 4, !tbaa !5
  %182 = icmp slt i32 %180, %181
  br i1 %182, label %183, label %204

183:                                              ; preds = %179
  %184 = load ptr, ptr %7, align 8, !tbaa !9
  %185 = load i32, ptr %15, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds double, ptr %184, i64 %186
  %188 = load double, ptr %187, align 8, !tbaa !11
  %189 = fcmp une double %188, 0.000000e+00
  %190 = zext i1 %189 to i32
  %191 = load i32, ptr %17, align 4, !tbaa !5
  %192 = sub nsw i32 %191, %190
  store i32 %192, ptr %17, align 4, !tbaa !5
  %193 = load ptr, ptr %7, align 8, !tbaa !9
  %194 = load i32, ptr %15, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds double, ptr %193, i64 %195
  %197 = load double, ptr %196, align 8, !tbaa !11
  %198 = fptosi double %197 to i32
  %199 = load i32, ptr %16, align 4, !tbaa !5
  %200 = sub nsw i32 %199, %198
  store i32 %200, ptr %16, align 4, !tbaa !5
  br label %201

201:                                              ; preds = %183
  %202 = load i32, ptr %15, align 4, !tbaa !5
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %15, align 4, !tbaa !5
  br label %179, !llvm.loop !22

204:                                              ; preds = %179
  %205 = load i32, ptr %17, align 4, !tbaa !5
  %206 = icmp eq i32 %205, 0
  br i1 %206, label %207, label %225

207:                                              ; preds = %204
  %208 = load i32, ptr %16, align 4, !tbaa !5
  %209 = icmp sgt i32 %208, 0
  br i1 %209, label %210, label %225

210:                                              ; preds = %207
  %211 = load ptr, ptr %7, align 8, !tbaa !9
  %212 = load i32, ptr %14, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds double, ptr %211, i64 %214
  %216 = load double, ptr %215, align 8, !tbaa !11
  %217 = load i32, ptr %16, align 4, !tbaa !5
  %218 = sitofp i32 %217 to double
  %219 = fadd double %216, %218
  %220 = load ptr, ptr %7, align 8, !tbaa !9
  %221 = load i32, ptr %14, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds double, ptr %220, i64 %223
  store double %219, ptr %224, align 8, !tbaa !11
  br label %255

225:                                              ; preds = %207, %204
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %226

226:                                              ; preds = %245, %225
  %227 = load i32, ptr %21, align 4, !tbaa !5
  %228 = load i32, ptr %17, align 4, !tbaa !5
  %229 = icmp slt i32 %227, %228
  br i1 %229, label %231, label %230

230:                                              ; preds = %226
  store i32 24, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  br label %248

231:                                              ; preds = %226
  %232 = load ptr, ptr %7, align 8, !tbaa !9
  %233 = load i32, ptr %21, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds double, ptr %232, i64 %234
  store double 1.000000e+00, ptr %235, align 8, !tbaa !11
  %236 = load ptr, ptr %7, align 8, !tbaa !9
  %237 = load i32, ptr %21, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds double, ptr %236, i64 %238
  %240 = load double, ptr %239, align 8, !tbaa !11
  %241 = load ptr, ptr %7, align 8, !tbaa !9
  %242 = getelementptr inbounds double, ptr %241, i64 0
  %243 = load double, ptr %242, align 8, !tbaa !11
  %244 = fsub double %243, %240
  store double %244, ptr %242, align 8, !tbaa !11
  br label %245

245:                                              ; preds = %231
  %246 = load i32, ptr %21, align 4, !tbaa !5
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr %21, align 4, !tbaa !5
  br label %226, !llvm.loop !23

248:                                              ; preds = %230
  %249 = load i32, ptr %16, align 4, !tbaa !5
  %250 = sitofp i32 %249 to double
  %251 = load ptr, ptr %7, align 8, !tbaa !9
  %252 = getelementptr inbounds double, ptr %251, i64 0
  %253 = load double, ptr %252, align 8, !tbaa !11
  %254 = fadd double %253, %250
  store double %254, ptr %252, align 8, !tbaa !11
  br label %255

255:                                              ; preds = %248, %210
  br label %257

256:                                              ; preds = %149
  store i8 0, ptr %13, align 1, !tbaa !16
  br label %257

257:                                              ; preds = %256, %255
  br label %94, !llvm.loop !24

258:                                              ; preds = %94
  br label %259

259:                                              ; preds = %258
  %260 = load i32, ptr %20, align 4, !tbaa !5
  %261 = add nsw i32 %260, 1
  store i32 %261, ptr %20, align 4, !tbaa !5
  br label %54, !llvm.loop !25

262:                                              ; preds = %58
  br label %263

263:                                              ; preds = %262
  %264 = load i32, ptr %18, align 4, !tbaa !5
  %265 = add nsw i32 %264, 1
  store i32 %265, ptr %18, align 4, !tbaa !5
  br label %32, !llvm.loop !26

266:                                              ; preds = %145, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #9
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #9
  br label %275

267:                                              ; preds = %38
  %268 = load ptr, ptr %7, align 8, !tbaa !9
  %269 = icmp eq ptr %268, null
  br i1 %269, label %271, label %270

270:                                              ; preds = %267
  call void @_ZdaPv(ptr noundef %268) #11
  br label %271

271:                                              ; preds = %270, %267
  store i1 true, ptr %8, align 1
  store i32 1, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #9
  %272 = load i1, ptr %8, align 1
  br i1 %272, label %274, label %273

273:                                              ; preds = %271
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #9
  br label %274

274:                                              ; preds = %273, %271
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  ret void

275:                                              ; preds = %266, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  br label %276

276:                                              ; preds = %275
  %277 = load ptr, ptr %11, align 8
  %278 = load i32, ptr %12, align 4
  %279 = insertvalue { ptr, i32 } poison, ptr %277, 0
  %280 = insertvalue { ptr, i32 } %279, i32 %278, 1
  resume { ptr, i32 } %280
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #5

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #7

declare void @_ZN7SGTELIB6Matrix7add_rowEPKd(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #8

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nobuiltin allocsize(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 #7 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!17, !17, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.SGTELIB::Matrix" = type { ptr, %"class.std::__cxx11::basic_string", i32, i32, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@.str.10 = external hidden unnamed_addr constant [8 x i8], align 1

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

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

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

declare i32 @__gxx_personality_v0(...)

declare void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) unnamed_addr #3

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

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

; Function Attrs: nounwind
declare void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7SGTELIB13Surrogate_PRS15get_PRS_monomesEii(ptr dead_on_unwind noalias writable sret(%"class.SGTELIB::Matrix") align 8 %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator", align 1
  store i32 %1, ptr %4, align 4, !tbaa !5
  store i32 %2, ptr %5, align 4, !tbaa !5
  %8 = zext nneg i32 %1 to i64
  %9 = icmp slt i32 %1, 0
  %10 = shl nuw nsw i64 %8, 3
  %11 = select i1 %9, i64 -1, i64 %10
  %12 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %11) #10
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #11
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #11
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #11
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.10, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %13 unwind label %24

13:                                               ; preds = %3
  invoke void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(32) %6, i32 noundef 1, i32 noundef %1)
          to label %14 unwind label %26

14:                                               ; preds = %13
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #11
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #11
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %.not118 = icmp slt i32 %16, 1
  br i1 %.not118, label %._crit_edge120, label %.preheader98.preheader

.preheader98.preheader:                           ; preds = %14
  %invariant.gep = getelementptr i8, ptr %12, i64 8
  br label %.preheader98

.preheader98:                                     ; preds = %.preheader98.preheader, %._crit_edge117
  %indvars.iv124 = phi i64 [ 1, %.preheader98.preheader ], [ %indvars.iv.next125, %._crit_edge117 ]
  %indvar = phi i64 [ 0, %.preheader98.preheader ], [ %indvar.next, %._crit_edge117 ]
  %17 = shl nuw nsw i64 %indvar, 3
  %gep = getelementptr i8, ptr %invariant.gep, i64 %17
  %18 = trunc i64 %indvar to i32
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %.not90114 = icmp sgt i64 %indvars.iv124, %20
  br i1 %.not90114, label %._crit_edge117, label %.lr.ph116

.lr.ph116:                                        ; preds = %.preheader98
  %21 = icmp ugt i64 %indvars.iv124, 1
  %22 = trunc nuw nsw i64 %indvars.iv124 to i32
  %min.iters.check180 = icmp ult i64 %indvar, 4
  %n.vec183 = and i64 %indvar, 9223372036854775804
  %ind.end184 = or disjoint i64 %n.vec183, 1
  %cmp.n190 = icmp eq i64 %indvar, %n.vec183
  %23 = insertelement <2 x i32> <i32 poison, i32 0>, i32 %22, i64 0
  br label %32

24:                                               ; preds = %3
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %28

26:                                               ; preds = %13
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #11
  br label %28

28:                                               ; preds = %26, %24
  %.pn = phi { ptr, i32 } [ %27, %26 ], [ %25, %24 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #11
  br label %121

._crit_edge117:                                   ; preds = %.critedge.thread, %.preheader98
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %.not.not = icmp slt i64 %indvars.iv124, %31
  %indvar.next = add nuw nsw i64 %indvar, 1
  br i1 %.not.not, label %.preheader98, label %._crit_edge120, !llvm.loop !9

32:                                               ; preds = %.lr.ph116, %.critedge.thread
  %.074115 = phi i32 [ %22, %.lr.ph116 ], [ %119, %.critedge.thread ]
  %reass.sub = sub nuw nsw i32 %.074115, %22
  %33 = add nuw nsw i32 %reass.sub, 1
  %34 = sitofp i32 %33 to double
  store double %34, ptr %12, align 8, !tbaa !11
  br i1 %21, label %.lr.ph.preheader, label %.preheader97

.lr.ph.preheader:                                 ; preds = %32
  br i1 %min.iters.check180, label %.lr.ph.preheader193, label %vector.body186

.lr.ph.preheader193:                              ; preds = %middle.block178, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph.preheader ], [ %ind.end184, %middle.block178 ]
  br label %.lr.ph

vector.body186:                                   ; preds = %.lr.ph.preheader, %vector.body186
  %index187 = phi i64 [ %index.next189, %vector.body186 ], [ 0, %.lr.ph.preheader ]
  %offset.idx188 = or disjoint i64 %index187, 1
  %35 = getelementptr inbounds double, ptr %12, i64 %offset.idx188
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %35, align 8, !tbaa !11
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %36, align 8, !tbaa !11
  %index.next189 = add nuw i64 %index187, 4
  %37 = icmp eq i64 %index.next189, %n.vec183
  br i1 %37, label %middle.block178, label %vector.body186, !llvm.loop !13

middle.block178:                                  ; preds = %vector.body186
  br i1 %cmp.n190, label %.preheader97, label %.lr.ph.preheader193

.preheader97:                                     ; preds = %.lr.ph, %middle.block178, %32
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = icmp slt i64 %indvars.iv124, %39
  br i1 %40, label %.lr.ph103.preheader, label %.preheader96.preheader

.preheader96.preheader:                           ; preds = %.lr.ph103.preheader, %.preheader97
  %41 = insertelement <2 x i32> <i32 poison, i32 0>, i32 %.074115, i64 0
  br label %.preheader96

.lr.ph103.preheader:                              ; preds = %.preheader97
  %reass.sub152 = sub i32 %38, %18
  %42 = add i32 %reass.sub152, -2
  %43 = zext i32 %42 to i64
  %44 = shl nuw nsw i64 %43, 3
  %45 = add nuw nsw i64 %44, 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %gep, i8 0, i64 %45, i1 false), !tbaa !11
  br label %.preheader96.preheader

.lr.ph:                                           ; preds = %.lr.ph.preheader193, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader193 ]
  %46 = getelementptr inbounds double, ptr %12, i64 %indvars.iv
  store double 1.000000e+00, ptr %46, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv124
  br i1 %exitcond.not, label %.preheader97, label %.lr.ph, !llvm.loop !16

.preheader96:                                     ; preds = %.preheader96.preheader, %.critedge
  invoke void @_ZN7SGTELIB6Matrix7add_rowEPKd(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull %12)
          to label %.critedge2.preheader unwind label %58

.critedge2.preheader:                             ; preds = %.preheader96
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = call i32 @llvm.smax.i32(i32 %47, i32 1)
  %smax = add nsw i32 %48, -1
  %wide.trip.count132 = zext nneg i32 %smax to i64
  br label %.critedge2

.critedge2:                                       ; preds = %.critedge2.preheader, %55
  %indvars.iv138 = phi i64 [ 1, %.critedge2.preheader ], [ %indvars.iv.next139, %55 ]
  %indvars.iv129 = phi i64 [ 0, %.critedge2.preheader ], [ %indvars.iv.next130, %55 ]
  %exitcond133.not.not = icmp eq i64 %indvars.iv129, %wide.trip.count132
  br i1 %exitcond133.not.not, label %.critedge.thread, label %49

49:                                               ; preds = %.critedge2
  %50 = getelementptr inbounds double, ptr %12, i64 %indvars.iv129
  %51 = load double, ptr %50, align 8, !tbaa !11
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %52 = getelementptr inbounds double, ptr %12, i64 %indvars.iv.next130
  %53 = load double, ptr %52, align 8, !tbaa !11
  %54 = fcmp ugt double %51, %53
  br i1 %54, label %.preheader95, label %55

55:                                               ; preds = %49
  %56 = fcmp ugt double %51, 1.000000e+00
  %57 = fcmp ult double %53, %34
  %or.cond94 = select i1 %56, i1 %57, i1 false
  %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1
  br i1 %or.cond94, label %.preheader95, label %.critedge2, !llvm.loop !17

58:                                               ; preds = %.preheader96
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #11
  br label %121

.preheader95:                                     ; preds = %55, %49
  %60 = trunc nuw nsw i64 %indvars.iv129 to i32
  %61 = add nuw nsw i32 %60, 1
  %62 = zext nneg i32 %61 to i64
  %63 = getelementptr inbounds double, ptr %12, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !11
  %65 = fadd double %64, 1.000000e+00
  store double %65, ptr %63, align 8, !tbaa !11
  %66 = shl nuw nsw i64 %indvars.iv129, 3
  %67 = add nuw i64 %66, 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %12, i8 0, i64 %67, i1 false), !tbaa !11
  %68 = icmp slt i32 %61, %47
  br i1 %68, label %.lr.ph108.preheader, label %.preheader

.lr.ph108.preheader:                              ; preds = %.preheader95
  %wide.trip.count144 = zext i32 %47 to i64
  %69 = xor i64 %indvars.iv129, -1
  %70 = add nsw i64 %69, %wide.trip.count144
  %min.iters.check = icmp ult i64 %70, 4
  br i1 %min.iters.check, label %.lr.ph108.preheader191, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph108.preheader
  %n.vec = and i64 %70, -4
  %ind.end = add i64 %indvars.iv138, %n.vec
  %71 = getelementptr double, ptr %12, i64 %indvars.iv138
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i32> [ %23, %vector.ph ], [ %78, %vector.body ]
  %vec.phi172 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %79, %vector.body ]
  %vec.phi173 = phi <2 x i32> [ %41, %vector.ph ], [ %82, %vector.body ]
  %vec.phi174 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %83, %vector.body ]
  %72 = getelementptr double, ptr %71, i64 %index
  %73 = getelementptr inbounds i8, ptr %72, i64 16
  %wide.load = load <2 x double>, ptr %72, align 8, !tbaa !11
  %wide.load175 = load <2 x double>, ptr %73, align 8, !tbaa !11
  %74 = fcmp une <2 x double> %wide.load, zeroinitializer
  %75 = fcmp une <2 x double> %wide.load175, zeroinitializer
  %76 = sext <2 x i1> %74 to <2 x i32>
  %77 = sext <2 x i1> %75 to <2 x i32>
  %78 = add <2 x i32> %vec.phi, %76
  %79 = add <2 x i32> %vec.phi172, %77
  %80 = fptosi <2 x double> %wide.load to <2 x i32>
  %81 = fptosi <2 x double> %wide.load175 to <2 x i32>
  %82 = sub <2 x i32> %vec.phi173, %80
  %83 = sub <2 x i32> %vec.phi174, %81
  %index.next = add nuw i64 %index, 4
  %84 = icmp eq i64 %index.next, %n.vec
  br i1 %84, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i32> %79, %78
  %85 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx)
  %bin.rdx176 = add <2 x i32> %83, %82
  %86 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx176)
  %cmp.n = icmp eq i64 %70, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph108.preheader191

.lr.ph108.preheader191:                           ; preds = %middle.block, %.lr.ph108.preheader
  %indvars.iv141.ph = phi i64 [ %indvars.iv138, %.lr.ph108.preheader ], [ %ind.end, %middle.block ]
  %.076107.ph = phi i32 [ %22, %.lr.ph108.preheader ], [ %85, %middle.block ]
  %.077106.ph = phi i32 [ %.074115, %.lr.ph108.preheader ], [ %86, %middle.block ]
  br label %.lr.ph108

.lr.ph108:                                        ; preds = %.lr.ph108.preheader191, %.lr.ph108
  %indvars.iv141 = phi i64 [ %indvars.iv.next142, %.lr.ph108 ], [ %indvars.iv141.ph, %.lr.ph108.preheader191 ]
  %.076107 = phi i32 [ %90, %.lr.ph108 ], [ %.076107.ph, %.lr.ph108.preheader191 ]
  %.077106 = phi i32 [ %92, %.lr.ph108 ], [ %.077106.ph, %.lr.ph108.preheader191 ]
  %87 = getelementptr inbounds double, ptr %12, i64 %indvars.iv141
  %88 = load double, ptr %87, align 8, !tbaa !11
  %89 = fcmp une double %88, 0.000000e+00
  %.neg = sext i1 %89 to i32
  %90 = add i32 %.076107, %.neg
  %91 = fptosi double %88 to i32
  %92 = sub nsw i32 %.077106, %91
  %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
  %exitcond145.not = icmp eq i64 %indvars.iv.next142, %wide.trip.count144
  br i1 %exitcond145.not, label %._crit_edge, label %.lr.ph108, !llvm.loop !19

._crit_edge:                                      ; preds = %.lr.ph108, %middle.block
  %.lcssa169 = phi i32 [ %85, %middle.block ], [ %90, %.lr.ph108 ]
  %.lcssa = phi i32 [ %86, %middle.block ], [ %92, %.lr.ph108 ]
  %93 = icmp eq i32 %.lcssa169, 0
  %94 = icmp sgt i32 %.lcssa, 0
  %or.cond = select i1 %93, i1 %94, i1 false
  br i1 %or.cond, label %97, label %.preheader

.preheader:                                       ; preds = %.preheader95, %._crit_edge
  %.076.lcssa157 = phi i32 [ %.lcssa169, %._crit_edge ], [ %22, %.preheader95 ]
  %.077.lcssa156 = phi i32 [ %.lcssa, %._crit_edge ], [ %.074115, %.preheader95 ]
  %95 = icmp sgt i32 %.076.lcssa157, 0
  br i1 %95, label %.lr.ph111.preheader, label %.preheader.._crit_edge112_crit_edge

.preheader.._crit_edge112_crit_edge:              ; preds = %.preheader
  %.pre = load double, ptr %12, align 8, !tbaa !11
  br label %._crit_edge112

.lr.ph111.preheader:                              ; preds = %.preheader
  %wide.trip.count149 = zext nneg i32 %.076.lcssa157 to i64
  %xtraiter = and i64 %wide.trip.count149, 3
  %96 = icmp ult i32 %.076.lcssa157, 4
  br i1 %96, label %._crit_edge112.loopexit.unr-lcssa, label %.lr.ph111.preheader.new

.lr.ph111.preheader.new:                          ; preds = %.lr.ph111.preheader
  %unroll_iter = and i64 %wide.trip.count149, 2147483644
  br label %.lr.ph111

97:                                               ; preds = %._crit_edge
  %98 = load double, ptr %63, align 8, !tbaa !11
  %99 = uitofp nneg i32 %.lcssa to double
  %100 = fadd double %98, %99
  store double %100, ptr %63, align 8, !tbaa !11
  br label %.critedge

._crit_edge112.loopexit.unr-lcssa:                ; preds = %.lr.ph111, %.lr.ph111.preheader
  %.lcssa203.ph = phi double [ poison, %.lr.ph111.preheader ], [ %118, %.lr.ph111 ]
  %indvars.iv146.unr = phi i64 [ 0, %.lr.ph111.preheader ], [ %indvars.iv.next147.3, %.lr.ph111 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge112, label %.lr.ph111.epil

.lr.ph111.epil:                                   ; preds = %._crit_edge112.loopexit.unr-lcssa, %.lr.ph111.epil
  %indvars.iv146.epil = phi i64 [ %indvars.iv.next147.epil, %.lr.ph111.epil ], [ %indvars.iv146.unr, %._crit_edge112.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph111.epil ], [ 0, %._crit_edge112.loopexit.unr-lcssa ]
  %101 = getelementptr inbounds double, ptr %12, i64 %indvars.iv146.epil
  store double 1.000000e+00, ptr %101, align 8, !tbaa !11
  %102 = load double, ptr %12, align 8, !tbaa !11
  %103 = fadd double %102, -1.000000e+00
  store double %103, ptr %12, align 8, !tbaa !11
  %indvars.iv.next147.epil = add nuw nsw i64 %indvars.iv146.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge112, label %.lr.ph111.epil, !llvm.loop !20

._crit_edge112:                                   ; preds = %._crit_edge112.loopexit.unr-lcssa, %.lr.ph111.epil, %.preheader.._crit_edge112_crit_edge
  %104 = phi double [ %.pre, %.preheader.._crit_edge112_crit_edge ], [ %.lcssa203.ph, %._crit_edge112.loopexit.unr-lcssa ], [ %103, %.lr.ph111.epil ]
  %105 = sitofp i32 %.077.lcssa156 to double
  %106 = fadd double %104, %105
  store double %106, ptr %12, align 8, !tbaa !11
  br label %.critedge

.lr.ph111:                                        ; preds = %.lr.ph111, %.lr.ph111.preheader.new
  %indvars.iv146 = phi i64 [ 0, %.lr.ph111.preheader.new ], [ %indvars.iv.next147.3, %.lr.ph111 ]
  %niter = phi i64 [ 0, %.lr.ph111.preheader.new ], [ %niter.next.3, %.lr.ph111 ]
  %107 = getelementptr inbounds double, ptr %12, i64 %indvars.iv146
  store double 1.000000e+00, ptr %107, align 8, !tbaa !11
  %108 = load double, ptr %12, align 8, !tbaa !11
  %109 = fadd double %108, -1.000000e+00
  store double %109, ptr %12, align 8, !tbaa !11
  %indvars.iv.next147 = or disjoint i64 %indvars.iv146, 1
  %110 = getelementptr inbounds double, ptr %12, i64 %indvars.iv.next147
  store double 1.000000e+00, ptr %110, align 8, !tbaa !11
  %111 = load double, ptr %12, align 8, !tbaa !11
  %112 = fadd double %111, -1.000000e+00
  store double %112, ptr %12, align 8, !tbaa !11
  %indvars.iv.next147.1 = or disjoint i64 %indvars.iv146, 2
  %113 = getelementptr inbounds double, ptr %12, i64 %indvars.iv.next147.1
  store double 1.000000e+00, ptr %113, align 8, !tbaa !11
  %114 = load double, ptr %12, align 8, !tbaa !11
  %115 = fadd double %114, -1.000000e+00
  store double %115, ptr %12, align 8, !tbaa !11
  %indvars.iv.next147.2 = or disjoint i64 %indvars.iv146, 3
  %116 = getelementptr inbounds double, ptr %12, i64 %indvars.iv.next147.2
  store double 1.000000e+00, ptr %116, align 8, !tbaa !11
  %117 = load double, ptr %12, align 8, !tbaa !11
  %118 = fadd double %117, -1.000000e+00
  store double %118, ptr %12, align 8, !tbaa !11
  %indvars.iv.next147.3 = add nuw nsw i64 %indvars.iv146, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge112.loopexit.unr-lcssa, label %.lr.ph111, !llvm.loop !22

.critedge:                                        ; preds = %97, %._crit_edge112
  br i1 %exitcond133.not.not, label %.critedge.thread, label %.preheader96, !llvm.loop !23

.critedge.thread:                                 ; preds = %.critedge, %.critedge2
  %119 = add nuw nsw i32 %.074115, 1
  %120 = load i32, ptr %5, align 4, !tbaa !5
  %.not90.not = icmp slt i32 %.074115, %120
  br i1 %.not90.not, label %32, label %._crit_edge117, !llvm.loop !24

._crit_edge120:                                   ; preds = %._crit_edge117, %14
  call void @_ZdaPv(ptr noundef nonnull %12) #12
  ret void

121:                                              ; preds = %58, %28
  %.pn91 = phi { ptr, i32 } [ %59, %58 ], [ %.pn, %28 ]
  resume { ptr, i32 } %.pn91
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6

declare void @_ZN7SGTELIB6Matrix7add_rowEPKd(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) local_unnamed_addr #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #7

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #9

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v2i32(<2 x i32>) #9

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nobuiltin allocsize(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 #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { nounwind }
attributes #12 = { builtin 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !14, !15}
!19 = distinct !{!19, !10, !15, !14}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass