; LLVM IR from sourceryinstitute/MORFEUS-Source :: src/FV/src/mesh_optimize/OptMS (SMoptimize)

; 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.__SMlocal_mesh = type { i32, i32, i32, [3 x double], [3 x double], [3 x double], ptr, ptr, ptr, i32, double, ptr, double, i32, i32, i32, ptr, ptr, ptr }
%struct.__SMoptimal = type { i32, i32, i32, i32, i32, i32, i32, double, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, [3 x double], double, double, ptr, ptr, ptr, ptr, [3 x i32], i32 }
%struct.__SMactive = type { i32, i32, ptr, double }

@.str.1 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 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

declare i32 @SMerror(i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) #1

; 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: nounwind
declare void @free(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @SMcomputeVerticalStep(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca double, align 8
  %15 = alloca [3 x double], align 16
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.__SMlocal_mesh, ptr %19, i32 0, i32 16
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  store ptr %21, ptr %17, align 8, !tbaa !5
  %22 = load ptr, ptr %17, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.__SMoptimal, ptr %22, i32 0, i32 26
  %24 = load i32, ptr %23, align 4, !tbaa !13
  store i32 %24, ptr %9, align 4, !tbaa !15
  %25 = load ptr, ptr %17, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.__SMoptimal, ptr %25, i32 0, i32 11
  %27 = load ptr, ptr %26, align 8, !tbaa !16
  store ptr %27, ptr %16, align 8, !tbaa !5
  %28 = load ptr, ptr %17, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.__SMoptimal, ptr %28, i32 0, i32 25
  %30 = getelementptr inbounds [3 x i32], ptr %29, i64 0, i64 0
  store ptr %30, ptr %8, align 8, !tbaa !5
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.__SMlocal_mesh, ptr %31, i32 0, i32 0
  %33 = load i32, ptr %32, align 8, !tbaa !17
  store i32 %33, ptr %10, align 4, !tbaa !15
  %34 = load i32, ptr %9, align 4, !tbaa !15
  %35 = load ptr, ptr %17, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.__SMoptimal, ptr %35, i32 0, i32 24
  %37 = load ptr, ptr %36, align 8, !tbaa !18
  %38 = call i32 @SMformVerticalMatrix(i32 noundef %34, ptr noundef %37, ptr noundef %11)
  store i32 %38, ptr %6, align 4, !tbaa !15
  %39 = load i32, ptr %6, align 4, !tbaa !15
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %44

41:                                               ; preds = %2
  %42 = load i32, ptr %6, align 4, !tbaa !15
  %43 = call i32 @SMerror(i32 noundef 553, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef %42, i32 noundef 0, ptr noundef null)
  store i32 %43, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %316

44:                                               ; preds = %2
  %45 = load i32, ptr %9, align 4, !tbaa !15
  %46 = load ptr, ptr %17, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.__SMoptimal, ptr %46, i32 0, i32 10
  %48 = load ptr, ptr %47, align 8, !tbaa !19
  %49 = load ptr, ptr %17, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.__SMoptimal, ptr %49, i32 0, i32 25
  %51 = getelementptr inbounds [3 x i32], ptr %50, i64 0, i64 0
  %52 = load ptr, ptr %17, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.__SMoptimal, ptr %52, i32 0, i32 14
  %54 = load ptr, ptr %53, align 8, !tbaa !20
  %55 = getelementptr inbounds %struct.__SMactive, ptr %54, i32 0, i32 3
  %56 = load double, ptr %55, align 8, !tbaa !21
  %57 = call i32 @SMformVerticalRHS(i32 noundef %45, ptr noundef %48, ptr noundef %51, double noundef %56, ptr noundef %12)
  store i32 %57, ptr %6, align 4, !tbaa !15
  %58 = load i32, ptr %6, align 4, !tbaa !15
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %63

60:                                               ; preds = %44
  %61 = load i32, ptr %6, align 4, !tbaa !15
  %62 = call i32 @SMerror(i32 noundef 559, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef %61, i32 noundef 0, ptr noundef null)
  store i32 %62, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %316

63:                                               ; preds = %44
  %64 = load i32, ptr %9, align 4, !tbaa !15
  switch i32 %64, label %257 [
    i32 1, label %65
    i32 2, label %100
    i32 3, label %183
  ]

65:                                               ; preds = %63
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = getelementptr inbounds double, ptr %66, i64 0
  %68 = load double, ptr %67, align 8, !tbaa !23
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = getelementptr inbounds ptr, ptr %69, i64 0
  %71 = load ptr, ptr %70, align 8, !tbaa !5
  %72 = getelementptr inbounds double, ptr %71, i64 0
  %73 = load double, ptr %72, align 8, !tbaa !23
  %74 = fdiv double %68, %73
  store double %74, ptr %14, align 8, !tbaa !23
  store i32 0, ptr %7, align 4, !tbaa !15
  br label %75

75:                                               ; preds = %96, %65
  %76 = load i32, ptr %7, align 4, !tbaa !15
  %77 = load i32, ptr %10, align 4, !tbaa !15
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %79, label %99

79:                                               ; preds = %75
  %80 = load ptr, ptr %16, align 8, !tbaa !5
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds i32, ptr %81, i64 0
  %83 = load i32, ptr %82, align 4, !tbaa !15
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds ptr, ptr %80, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = load i32, ptr %7, align 4, !tbaa !15
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds double, ptr %86, i64 %88
  %90 = load double, ptr %89, align 8, !tbaa !23
  %91 = load double, ptr %14, align 8, !tbaa !23
  %92 = fmul double %90, %91
  %93 = load i32, ptr %7, align 4, !tbaa !15
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 %94
  store double %92, ptr %95, align 8, !tbaa !23
  br label %96

96:                                               ; preds = %79
  %97 = load i32, ptr %7, align 4, !tbaa !15
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %7, align 4, !tbaa !15
  br label %75, !llvm.loop !24

99:                                               ; preds = %75
  br label %257

100:                                              ; preds = %63
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = getelementptr inbounds ptr, ptr %101, i64 0
  %103 = load ptr, ptr %102, align 8, !tbaa !5
  %104 = getelementptr inbounds double, ptr %103, i64 0
  %105 = load double, ptr %104, align 8, !tbaa !23
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = getelementptr inbounds ptr, ptr %106, i64 0
  %108 = load ptr, ptr %107, align 8, !tbaa !5
  %109 = getelementptr inbounds double, ptr %108, i64 1
  %110 = load double, ptr %109, align 8, !tbaa !23
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = getelementptr inbounds ptr, ptr %111, i64 1
  %113 = load ptr, ptr %112, align 8, !tbaa !5
  %114 = getelementptr inbounds double, ptr %113, i64 0
  %115 = load double, ptr %114, align 8, !tbaa !23
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = getelementptr inbounds ptr, ptr %116, i64 1
  %118 = load ptr, ptr %117, align 8, !tbaa !5
  %119 = getelementptr inbounds double, ptr %118, i64 1
  %120 = load double, ptr %119, align 8, !tbaa !23
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = getelementptr inbounds double, ptr %121, i64 0
  %123 = load double, ptr %122, align 8, !tbaa !23
  %124 = load ptr, ptr %12, align 8, !tbaa !5
  %125 = getelementptr inbounds double, ptr %124, i64 1
  %126 = load double, ptr %125, align 8, !tbaa !23
  %127 = call i32 @SMsolve2x2(double noundef %105, double noundef %110, double noundef %115, double noundef %120, double noundef %123, double noundef %126, ptr noundef %13)
  store i32 %127, ptr %6, align 4, !tbaa !15
  %128 = load i32, ptr %6, align 4, !tbaa !15
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %133

130:                                              ; preds = %100
  %131 = load i32, ptr %6, align 4, !tbaa !15
  %132 = call i32 @SMerror(i32 noundef 571, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef %131, i32 noundef 0, ptr noundef null)
  store i32 %132, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %316

133:                                              ; preds = %100
  store i32 0, ptr %7, align 4, !tbaa !15
  br label %134

134:                                              ; preds = %172, %133
  %135 = load i32, ptr %7, align 4, !tbaa !15
  %136 = load i32, ptr %10, align 4, !tbaa !15
  %137 = icmp slt i32 %135, %136
  br i1 %137, label %138, label %175

138:                                              ; preds = %134
  %139 = load ptr, ptr %16, align 8, !tbaa !5
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  %141 = getelementptr inbounds i32, ptr %140, i64 0
  %142 = load i32, ptr %141, align 4, !tbaa !15
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds ptr, ptr %139, i64 %143
  %145 = load ptr, ptr %144, align 8, !tbaa !5
  %146 = load i32, ptr %7, align 4, !tbaa !15
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds double, ptr %145, i64 %147
  %149 = load double, ptr %148, align 8, !tbaa !23
  %150 = load ptr, ptr %13, align 8, !tbaa !5
  %151 = getelementptr inbounds double, ptr %150, i64 0
  %152 = load double, ptr %151, align 8, !tbaa !23
  %153 = load ptr, ptr %16, align 8, !tbaa !5
  %154 = load ptr, ptr %8, align 8, !tbaa !5
  %155 = getelementptr inbounds i32, ptr %154, i64 1
  %156 = load i32, ptr %155, align 4, !tbaa !15
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds ptr, ptr %153, i64 %157
  %159 = load ptr, ptr %158, align 8, !tbaa !5
  %160 = load i32, ptr %7, align 4, !tbaa !15
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds double, ptr %159, i64 %161
  %163 = load double, ptr %162, align 8, !tbaa !23
  %164 = load ptr, ptr %13, align 8, !tbaa !5
  %165 = getelementptr inbounds double, ptr %164, i64 1
  %166 = load double, ptr %165, align 8, !tbaa !23
  %167 = fmul double %163, %166
  %168 = call double @llvm.fmuladd.f64(double %149, double %152, double %167)
  %169 = load i32, ptr %7, align 4, !tbaa !15
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 %170
  store double %168, ptr %171, align 8, !tbaa !23
  br label %172

172:                                              ; preds = %138
  %173 = load i32, ptr %7, align 4, !tbaa !15
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %7, align 4, !tbaa !15
  br label %134, !llvm.loop !26

175:                                              ; preds = %134
  %176 = load ptr, ptr %13, align 8, !tbaa !5
  %177 = icmp eq ptr %176, null
  br i1 %177, label %178, label %180

178:                                              ; preds = %175
  %179 = call i32 @SMerror(i32 noundef 576, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 60, i32 noundef 0, ptr noundef null)
  store i32 %179, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %316

180:                                              ; preds = %175
  %181 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %181) #5
  br label %182

182:                                              ; preds = %180
  br label %257

183:                                              ; preds = %63
  %184 = load ptr, ptr %11, align 8, !tbaa !5
  %185 = load ptr, ptr %12, align 8, !tbaa !5
  %186 = call i32 @SMsolveSPD3x3(ptr noundef %184, ptr noundef %185, ptr noundef %13)
  store i32 %186, ptr %6, align 4, !tbaa !15
  %187 = load i32, ptr %6, align 4, !tbaa !15
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %189, label %192

189:                                              ; preds = %183
  %190 = load i32, ptr %6, align 4, !tbaa !15
  %191 = call i32 @SMerror(i32 noundef 579, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef %190, i32 noundef 0, ptr noundef null)
  store i32 %191, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %316

192:                                              ; preds = %183
  store i32 0, ptr %7, align 4, !tbaa !15
  br label %193

193:                                              ; preds = %246, %192
  %194 = load i32, ptr %7, align 4, !tbaa !15
  %195 = load i32, ptr %10, align 4, !tbaa !15
  %196 = icmp slt i32 %194, %195
  br i1 %196, label %197, label %249

197:                                              ; preds = %193
  %198 = load ptr, ptr %16, align 8, !tbaa !5
  %199 = load ptr, ptr %8, align 8, !tbaa !5
  %200 = getelementptr inbounds i32, ptr %199, i64 0
  %201 = load i32, ptr %200, align 4, !tbaa !15
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds ptr, ptr %198, i64 %202
  %204 = load ptr, ptr %203, align 8, !tbaa !5
  %205 = load i32, ptr %7, align 4, !tbaa !15
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds double, ptr %204, i64 %206
  %208 = load double, ptr %207, align 8, !tbaa !23
  %209 = load ptr, ptr %13, align 8, !tbaa !5
  %210 = getelementptr inbounds double, ptr %209, i64 0
  %211 = load double, ptr %210, align 8, !tbaa !23
  %212 = load ptr, ptr %16, align 8, !tbaa !5
  %213 = load ptr, ptr %8, align 8, !tbaa !5
  %214 = getelementptr inbounds i32, ptr %213, i64 1
  %215 = load i32, ptr %214, align 4, !tbaa !15
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds ptr, ptr %212, i64 %216
  %218 = load ptr, ptr %217, align 8, !tbaa !5
  %219 = load i32, ptr %7, align 4, !tbaa !15
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds double, ptr %218, i64 %220
  %222 = load double, ptr %221, align 8, !tbaa !23
  %223 = load ptr, ptr %13, align 8, !tbaa !5
  %224 = getelementptr inbounds double, ptr %223, i64 1
  %225 = load double, ptr %224, align 8, !tbaa !23
  %226 = fmul double %222, %225
  %227 = call double @llvm.fmuladd.f64(double %208, double %211, double %226)
  %228 = load ptr, ptr %16, align 8, !tbaa !5
  %229 = load ptr, ptr %8, align 8, !tbaa !5
  %230 = getelementptr inbounds i32, ptr %229, i64 2
  %231 = load i32, ptr %230, align 4, !tbaa !15
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds ptr, ptr %228, i64 %232
  %234 = load ptr, ptr %233, align 8, !tbaa !5
  %235 = load i32, ptr %7, align 4, !tbaa !15
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds double, ptr %234, i64 %236
  %238 = load double, ptr %237, align 8, !tbaa !23
  %239 = load ptr, ptr %13, align 8, !tbaa !5
  %240 = getelementptr inbounds double, ptr %239, i64 2
  %241 = load double, ptr %240, align 8, !tbaa !23
  %242 = call double @llvm.fmuladd.f64(double %238, double %241, double %227)
  %243 = load i32, ptr %7, align 4, !tbaa !15
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 %244
  store double %242, ptr %245, align 8, !tbaa !23
  br label %246

246:                                              ; preds = %197
  %247 = load i32, ptr %7, align 4, !tbaa !15
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %7, align 4, !tbaa !15
  br label %193, !llvm.loop !27

249:                                              ; preds = %193
  %250 = load ptr, ptr %13, align 8, !tbaa !5
  %251 = icmp eq ptr %250, null
  br i1 %251, label %252, label %254

252:                                              ; preds = %249
  %253 = call i32 @SMerror(i32 noundef 585, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 60, i32 noundef 0, ptr noundef null)
  store i32 %253, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %316

254:                                              ; preds = %249
  %255 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %255) #5
  br label %256

256:                                              ; preds = %254
  br label %257

257:                                              ; preds = %256, %182, %99, %63
  store i32 0, ptr %7, align 4, !tbaa !15
  br label %258

258:                                              ; preds = %274, %257
  %259 = load i32, ptr %7, align 4, !tbaa !15
  %260 = load i32, ptr %10, align 4, !tbaa !15
  %261 = icmp slt i32 %259, %260
  br i1 %261, label %262, label %277

262:                                              ; preds = %258
  %263 = load i32, ptr %7, align 4, !tbaa !15
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [3 x double], ptr %15, i64 0, i64 %264
  %266 = load double, ptr %265, align 8, !tbaa !23
  %267 = load ptr, ptr %4, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.__SMlocal_mesh, ptr %267, i32 0, i32 5
  %269 = load i32, ptr %7, align 4, !tbaa !15
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [3 x double], ptr %268, i64 0, i64 %270
  %272 = load double, ptr %271, align 8, !tbaa !23
  %273 = fadd double %272, %266
  store double %273, ptr %271, align 8, !tbaa !23
  br label %274

274:                                              ; preds = %262
  %275 = load i32, ptr %7, align 4, !tbaa !15
  %276 = add nsw i32 %275, 1
  store i32 %276, ptr %7, align 4, !tbaa !15
  br label %258, !llvm.loop !28

277:                                              ; preds = %258
  store i32 0, ptr %7, align 4, !tbaa !15
  br label %278

278:                                              ; preds = %298, %277
  %279 = load i32, ptr %7, align 4, !tbaa !15
  %280 = load i32, ptr %9, align 4, !tbaa !15
  %281 = icmp slt i32 %279, %280
  br i1 %281, label %282, label %301

282:                                              ; preds = %278
  %283 = load ptr, ptr %11, align 8, !tbaa !5
  %284 = load i32, ptr %7, align 4, !tbaa !15
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds ptr, ptr %283, i64 %285
  %287 = load ptr, ptr %286, align 8, !tbaa !5
  %288 = icmp eq ptr %287, null
  br i1 %288, label %289, label %291

289:                                              ; preds = %282
  %290 = call i32 @SMerror(i32 noundef 594, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 60, i32 noundef 0, ptr noundef null)
  store i32 %290, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %316

291:                                              ; preds = %282
  %292 = load ptr, ptr %11, align 8, !tbaa !5
  %293 = load i32, ptr %7, align 4, !tbaa !15
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds ptr, ptr %292, i64 %294
  %296 = load ptr, ptr %295, align 8, !tbaa !5
  call void @free(ptr noundef %296) #5
  br label %297

297:                                              ; preds = %291
  br label %298

298:                                              ; preds = %297
  %299 = load i32, ptr %7, align 4, !tbaa !15
  %300 = add nsw i32 %299, 1
  store i32 %300, ptr %7, align 4, !tbaa !15
  br label %278, !llvm.loop !29

301:                                              ; preds = %278
  %302 = load ptr, ptr %11, align 8, !tbaa !5
  %303 = icmp eq ptr %302, null
  br i1 %303, label %304, label %306

304:                                              ; preds = %301
  %305 = call i32 @SMerror(i32 noundef 594, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 60, i32 noundef 0, ptr noundef null)
  store i32 %305, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %316

306:                                              ; preds = %301
  %307 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %307) #5
  br label %308

308:                                              ; preds = %306
  %309 = load ptr, ptr %12, align 8, !tbaa !5
  %310 = icmp eq ptr %309, null
  br i1 %310, label %311, label %313

311:                                              ; preds = %308
  %312 = call i32 @SMerror(i32 noundef 595, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 60, i32 noundef 0, ptr noundef null)
  store i32 %312, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %316

313:                                              ; preds = %308
  %314 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %314) #5
  br label %315

315:                                              ; preds = %313
  store i32 0, ptr %6, align 4, !tbaa !15
  store i32 0, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %316

316:                                              ; preds = %315, %311, %304, %289, %252, %189, %178, %130, %60, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %317 = load i32, ptr %3, align 4
  ret i32 %317
}

declare i32 @SMformVerticalMatrix(i32 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @SMformVerticalRHS(i32 noundef, ptr noundef, ptr noundef, double noundef, ptr noundef) #4

declare i32 @SMsolve2x2(double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, ptr noundef) #1

declare i32 @SMsolveSPD3x3(ptr noundef, ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #4 = { 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 #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/C++ TBAA"}
!9 = !{!10, !6, i64 160}
!10 = !{!"__SMlocal_mesh", !11, i64 0, !11, i64 4, !11, i64 8, !7, i64 16, !7, i64 40, !7, i64 64, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !12, i64 120, !6, i64 128, !12, i64 136, !11, i64 144, !11, i64 148, !11, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !11, i64 196}
!14 = !{!"__SMoptimal", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !12, i64 32, !11, i64 40, !11, i64 44, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !11, i64 104, !7, i64 112, !12, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !7, i64 184, !11, i64 196}
!15 = !{!11, !11, i64 0}
!16 = !{!14, !6, i64 56}
!17 = !{!10, !11, i64 0}
!18 = !{!14, !6, i64 176}
!19 = !{!14, !6, i64 48}
!20 = !{!14, !6, i64 80}
!21 = !{!22, !12, i64 16}
!22 = !{!"__SMactive", !11, i64 0, !11, i64 4, !6, i64 8, !12, i64 16}
!23 = !{!12, !12, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = distinct !{!27, !25}
!28 = distinct !{!28, !25}
!29 = distinct !{!29, !25}


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

@.str.1 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 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

declare i32 @SMerror(i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local i32 @SMcomputeVerticalStep(ptr nocapture noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #4 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [3 x double], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  %7 = getelementptr inbounds i8, ptr %0, i64 160
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %8, i64 196
  %10 = load i32, ptr %9, align 4, !tbaa !12
  %11 = getelementptr inbounds i8, ptr %8, i64 56
  %12 = load ptr, ptr %11, align 8, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %8, i64 184
  %14 = load i32, ptr %0, align 8, !tbaa !15
  %15 = getelementptr inbounds i8, ptr %8, i64 176
  %16 = load ptr, ptr %15, align 8, !tbaa !16
  %17 = call i32 @SMformVerticalMatrix(i32 noundef %10, ptr noundef %16, ptr noundef nonnull %3) #6
  %.not = icmp eq i32 %17, 0
  br i1 %.not, label %20, label %18

18:                                               ; preds = %2
  %19 = call i32 @SMerror(i32 noundef 553, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef %17, i32 noundef 0, ptr noundef null) #6
  br label %192

20:                                               ; preds = %2
  %21 = getelementptr inbounds i8, ptr %8, i64 48
  %22 = load ptr, ptr %21, align 8, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %8, i64 80
  %24 = load ptr, ptr %23, align 8, !tbaa !18
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  %26 = load double, ptr %25, align 8, !tbaa !19
  %27 = call i32 @SMformVerticalRHS(i32 noundef %10, ptr noundef %22, ptr noundef nonnull %13, double noundef %26, ptr noundef nonnull %4)
  %.not72 = icmp eq i32 %27, 0
  br i1 %.not72, label %30, label %28

28:                                               ; preds = %20
  %29 = call i32 @SMerror(i32 noundef 559, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef %27, i32 noundef 0, ptr noundef null) #6
  br label %192

30:                                               ; preds = %20
  switch i32 %10, label %.loopexit [
    i32 1, label %31
    i32 2, label %54
    i32 3, label %106
  ]

31:                                               ; preds = %30
  %32 = load ptr, ptr %4, align 8, !tbaa !21
  %33 = load double, ptr %32, align 8, !tbaa !22
  %34 = load ptr, ptr %3, align 8, !tbaa !21
  %35 = load ptr, ptr %34, align 8, !tbaa !21
  %36 = load double, ptr %35, align 8, !tbaa !22
  %37 = fdiv double %33, %36
  %38 = icmp sgt i32 %14, 0
  br i1 %38, label %.lr.ph83, label %.lr.ph88.preheader

.lr.ph83:                                         ; preds = %31
  %39 = load i32, ptr %13, align 4, !tbaa !23
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds ptr, ptr %12, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !21
  %wide.trip.count99 = zext nneg i32 %14 to i64
  %min.iters.check142 = icmp ult i32 %14, 4
  br i1 %min.iters.check142, label %scalar.ph141.preheader, label %vector.ph143

vector.ph143:                                     ; preds = %.lr.ph83
  %n.vec145 = and i64 %wide.trip.count99, 2147483644
  %broadcast.splatinsert151 = insertelement <2 x double> poison, double %37, i64 0
  %broadcast.splat152 = shufflevector <2 x double> %broadcast.splatinsert151, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body147

vector.body147:                                   ; preds = %vector.body147, %vector.ph143
  %index148 = phi i64 [ 0, %vector.ph143 ], [ %index.next153, %vector.body147 ]
  %43 = getelementptr inbounds double, ptr %42, i64 %index148
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  %wide.load149 = load <2 x double>, ptr %43, align 8, !tbaa !22
  %wide.load150 = load <2 x double>, ptr %44, align 8, !tbaa !22
  %45 = fmul <2 x double> %broadcast.splat152, %wide.load149
  %46 = fmul <2 x double> %broadcast.splat152, %wide.load150
  %47 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 %index148
  %48 = getelementptr inbounds i8, ptr %47, i64 16
  store <2 x double> %45, ptr %47, align 16, !tbaa !22
  store <2 x double> %46, ptr %48, align 16, !tbaa !22
  %index.next153 = add nuw i64 %index148, 4
  %49 = icmp eq i64 %index.next153, %n.vec145
  br i1 %49, label %middle.block140, label %vector.body147, !llvm.loop !24

middle.block140:                                  ; preds = %vector.body147
  %cmp.n154 = icmp eq i64 %n.vec145, %wide.trip.count99
  br i1 %cmp.n154, label %.loopexit, label %scalar.ph141.preheader

scalar.ph141.preheader:                           ; preds = %middle.block140, %.lr.ph83
  %indvars.iv96.ph = phi i64 [ 0, %.lr.ph83 ], [ %n.vec145, %middle.block140 ]
  br label %scalar.ph141

scalar.ph141:                                     ; preds = %scalar.ph141.preheader, %scalar.ph141
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %scalar.ph141 ], [ %indvars.iv96.ph, %scalar.ph141.preheader ]
  %50 = getelementptr inbounds double, ptr %42, i64 %indvars.iv96
  %51 = load double, ptr %50, align 8, !tbaa !22
  %52 = fmul double %37, %51
  %53 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 %indvars.iv96
  store double %52, ptr %53, align 8, !tbaa !22
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %exitcond100.not = icmp eq i64 %indvars.iv.next97, %wide.trip.count99
  br i1 %exitcond100.not, label %.loopexit, label %scalar.ph141, !llvm.loop !28

54:                                               ; preds = %30
  %55 = load ptr, ptr %3, align 8, !tbaa !21
  %56 = load ptr, ptr %55, align 8, !tbaa !21
  %57 = load double, ptr %56, align 8, !tbaa !22
  %58 = getelementptr inbounds i8, ptr %56, i64 8
  %59 = load double, ptr %58, align 8, !tbaa !22
  %60 = getelementptr inbounds i8, ptr %55, i64 8
  %61 = load ptr, ptr %60, align 8, !tbaa !21
  %62 = load double, ptr %61, align 8, !tbaa !22
  %63 = getelementptr inbounds i8, ptr %61, i64 8
  %64 = load double, ptr %63, align 8, !tbaa !22
  %65 = load ptr, ptr %4, align 8, !tbaa !21
  %66 = load double, ptr %65, align 8, !tbaa !22
  %67 = getelementptr inbounds i8, ptr %65, i64 8
  %68 = load double, ptr %67, align 8, !tbaa !22
  %69 = call i32 @SMsolve2x2(double noundef %57, double noundef %59, double noundef %62, double noundef %64, double noundef %66, double noundef %68, ptr noundef nonnull %5) #6
  %.not74 = icmp eq i32 %69, 0
  br i1 %.not74, label %.preheader75, label %94

.preheader75:                                     ; preds = %54
  %70 = icmp sgt i32 %14, 0
  %.pre111 = load ptr, ptr %5, align 8, !tbaa !21
  br i1 %70, label %.lr.ph79, label %._crit_edge80

.lr.ph79:                                         ; preds = %.preheader75
  %71 = load i32, ptr %13, align 4, !tbaa !23
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds ptr, ptr %12, i64 %72
  %74 = load ptr, ptr %73, align 8, !tbaa !21
  %75 = load double, ptr %.pre111, align 8, !tbaa !22
  %76 = getelementptr inbounds i8, ptr %8, i64 188
  %77 = load i32, ptr %76, align 4, !tbaa !23
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds ptr, ptr %12, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !21
  %81 = getelementptr inbounds i8, ptr %.pre111, i64 8
  %82 = load double, ptr %81, align 8, !tbaa !22
  %wide.trip.count94 = zext nneg i32 %14 to i64
  %min.iters.check123 = icmp ult i32 %14, 4
  br i1 %min.iters.check123, label %scalar.ph122.preheader, label %vector.ph124

scalar.ph122.preheader:                           ; preds = %middle.block121, %.lr.ph79
  %indvars.iv91.ph = phi i64 [ 0, %.lr.ph79 ], [ %n.vec126, %middle.block121 ]
  br label %scalar.ph122

vector.ph124:                                     ; preds = %.lr.ph79
  %n.vec126 = and i64 %wide.trip.count94, 2147483644
  %broadcast.splatinsert134 = insertelement <2 x double> poison, double %82, i64 0
  %broadcast.splat135 = shufflevector <2 x double> %broadcast.splatinsert134, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert136 = insertelement <2 x double> poison, double %75, i64 0
  %broadcast.splat137 = shufflevector <2 x double> %broadcast.splatinsert136, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body128

vector.body128:                                   ; preds = %vector.body128, %vector.ph124
  %index129 = phi i64 [ 0, %vector.ph124 ], [ %index.next138, %vector.body128 ]
  %83 = getelementptr inbounds double, ptr %74, i64 %index129
  %84 = getelementptr inbounds i8, ptr %83, i64 16
  %wide.load130 = load <2 x double>, ptr %83, align 8, !tbaa !22
  %wide.load131 = load <2 x double>, ptr %84, align 8, !tbaa !22
  %85 = getelementptr inbounds double, ptr %80, i64 %index129
  %86 = getelementptr inbounds i8, ptr %85, i64 16
  %wide.load132 = load <2 x double>, ptr %85, align 8, !tbaa !22
  %wide.load133 = load <2 x double>, ptr %86, align 8, !tbaa !22
  %87 = fmul <2 x double> %wide.load132, %broadcast.splat135
  %88 = fmul <2 x double> %wide.load133, %broadcast.splat135
  %89 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load130, <2 x double> %broadcast.splat137, <2 x double> %87)
  %90 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load131, <2 x double> %broadcast.splat137, <2 x double> %88)
  %91 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 %index129
  %92 = getelementptr inbounds i8, ptr %91, i64 16
  store <2 x double> %89, ptr %91, align 16, !tbaa !22
  store <2 x double> %90, ptr %92, align 16, !tbaa !22
  %index.next138 = add nuw i64 %index129, 4
  %93 = icmp eq i64 %index.next138, %n.vec126
  br i1 %93, label %middle.block121, label %vector.body128, !llvm.loop !29

middle.block121:                                  ; preds = %vector.body128
  %cmp.n139 = icmp eq i64 %n.vec126, %wide.trip.count94
  br i1 %cmp.n139, label %._crit_edge80, label %scalar.ph122.preheader

94:                                               ; preds = %54
  %95 = call i32 @SMerror(i32 noundef 571, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef %69, i32 noundef 0, ptr noundef null) #6
  br label %192

scalar.ph122:                                     ; preds = %scalar.ph122.preheader, %scalar.ph122
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %scalar.ph122 ], [ %indvars.iv91.ph, %scalar.ph122.preheader ]
  %96 = getelementptr inbounds double, ptr %74, i64 %indvars.iv91
  %97 = load double, ptr %96, align 8, !tbaa !22
  %98 = getelementptr inbounds double, ptr %80, i64 %indvars.iv91
  %99 = load double, ptr %98, align 8, !tbaa !22
  %100 = fmul double %99, %82
  %101 = call double @llvm.fmuladd.f64(double %97, double %75, double %100)
  %102 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 %indvars.iv91
  store double %101, ptr %102, align 8, !tbaa !22
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %exitcond95.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count94
  br i1 %exitcond95.not, label %._crit_edge80, label %scalar.ph122, !llvm.loop !30

._crit_edge80:                                    ; preds = %scalar.ph122, %middle.block121, %.preheader75
  %103 = icmp eq ptr %.pre111, null
  br i1 %103, label %104, label %.loopexit.sink.split

104:                                              ; preds = %._crit_edge80
  %105 = call i32 @SMerror(i32 noundef 576, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 60, i32 noundef 0, ptr noundef null) #6
  br label %192

106:                                              ; preds = %30
  %107 = load ptr, ptr %3, align 8, !tbaa !21
  %108 = load ptr, ptr %4, align 8, !tbaa !21
  %109 = call i32 @SMsolveSPD3x3(ptr noundef %107, ptr noundef %108, ptr noundef nonnull %5) #6
  %.not73 = icmp eq i32 %109, 0
  br i1 %.not73, label %.preheader76, label %145

.preheader76:                                     ; preds = %106
  %110 = icmp sgt i32 %14, 0
  %.pre = load ptr, ptr %5, align 8, !tbaa !21
  br i1 %110, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader76
  %111 = load i32, ptr %13, align 4, !tbaa !23
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds ptr, ptr %12, i64 %112
  %114 = load ptr, ptr %113, align 8, !tbaa !21
  %115 = load double, ptr %.pre, align 8, !tbaa !22
  %116 = getelementptr inbounds i8, ptr %8, i64 188
  %117 = load i32, ptr %116, align 4, !tbaa !23
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds ptr, ptr %12, i64 %118
  %120 = load ptr, ptr %119, align 8, !tbaa !21
  %121 = getelementptr inbounds i8, ptr %.pre, i64 8
  %122 = load double, ptr %121, align 8, !tbaa !22
  %123 = getelementptr inbounds i8, ptr %8, i64 192
  %124 = load i32, ptr %123, align 4, !tbaa !23
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds ptr, ptr %12, i64 %125
  %127 = load ptr, ptr %126, align 8, !tbaa !21
  %128 = getelementptr inbounds i8, ptr %.pre, i64 16
  %129 = load double, ptr %128, align 8, !tbaa !22
  %wide.trip.count = zext nneg i32 %14 to i64
  %min.iters.check = icmp ult i32 %14, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483644
  %broadcast.splatinsert = insertelement <2 x double> poison, double %122, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert115 = insertelement <2 x double> poison, double %115, i64 0
  %broadcast.splat116 = shufflevector <2 x double> %broadcast.splatinsert115, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert119 = insertelement <2 x double> poison, double %129, i64 0
  %broadcast.splat120 = shufflevector <2 x double> %broadcast.splatinsert119, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %130 = getelementptr inbounds double, ptr %114, i64 %index
  %131 = getelementptr inbounds i8, ptr %130, i64 16
  %wide.load = load <2 x double>, ptr %130, align 8, !tbaa !22
  %wide.load112 = load <2 x double>, ptr %131, align 8, !tbaa !22
  %132 = getelementptr inbounds double, ptr %120, i64 %index
  %133 = getelementptr inbounds i8, ptr %132, i64 16
  %wide.load113 = load <2 x double>, ptr %132, align 8, !tbaa !22
  %wide.load114 = load <2 x double>, ptr %133, align 8, !tbaa !22
  %134 = fmul <2 x double> %wide.load113, %broadcast.splat
  %135 = fmul <2 x double> %wide.load114, %broadcast.splat
  %136 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load, <2 x double> %broadcast.splat116, <2 x double> %134)
  %137 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load112, <2 x double> %broadcast.splat116, <2 x double> %135)
  %138 = getelementptr inbounds double, ptr %127, i64 %index
  %139 = getelementptr inbounds i8, ptr %138, i64 16
  %wide.load117 = load <2 x double>, ptr %138, align 8, !tbaa !22
  %wide.load118 = load <2 x double>, ptr %139, align 8, !tbaa !22
  %140 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load117, <2 x double> %broadcast.splat120, <2 x double> %136)
  %141 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load118, <2 x double> %broadcast.splat120, <2 x double> %137)
  %142 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 %index
  %143 = getelementptr inbounds i8, ptr %142, i64 16
  store <2 x double> %140, ptr %142, align 16, !tbaa !22
  store <2 x double> %141, ptr %143, align 16, !tbaa !22
  %index.next = add nuw i64 %index, 4
  %144 = icmp eq i64 %index.next, %n.vec
  br i1 %144, label %middle.block, label %vector.body, !llvm.loop !31

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

145:                                              ; preds = %106
  %146 = call i32 @SMerror(i32 noundef 579, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef %109, i32 noundef 0, ptr noundef null) #6
  br label %192

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %147 = getelementptr inbounds double, ptr %114, i64 %indvars.iv
  %148 = load double, ptr %147, align 8, !tbaa !22
  %149 = getelementptr inbounds double, ptr %120, i64 %indvars.iv
  %150 = load double, ptr %149, align 8, !tbaa !22
  %151 = fmul double %150, %122
  %152 = call double @llvm.fmuladd.f64(double %148, double %115, double %151)
  %153 = getelementptr inbounds double, ptr %127, i64 %indvars.iv
  %154 = load double, ptr %153, align 8, !tbaa !22
  %155 = call double @llvm.fmuladd.f64(double %154, double %129, double %152)
  %156 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 %indvars.iv
  store double %155, ptr %156, align 8, !tbaa !22
  %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 %scalar.ph, !llvm.loop !32

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %.preheader76
  %157 = icmp eq ptr %.pre, null
  br i1 %157, label %158, label %.loopexit.sink.split

158:                                              ; preds = %._crit_edge
  %159 = call i32 @SMerror(i32 noundef 585, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 60, i32 noundef 0, ptr noundef null) #6
  br label %192

.loopexit.sink.split:                             ; preds = %._crit_edge, %._crit_edge80
  %.pre.sink = phi ptr [ %.pre111, %._crit_edge80 ], [ %.pre, %._crit_edge ]
  call void @free(ptr noundef nonnull %.pre.sink) #6
  br label %.loopexit

.loopexit:                                        ; preds = %scalar.ph141, %middle.block140, %.loopexit.sink.split, %30
  %160 = icmp sgt i32 %14, 0
  br i1 %160, label %.lr.ph86, label %.preheader

.lr.ph86:                                         ; preds = %.loopexit
  %161 = getelementptr inbounds i8, ptr %0, i64 64
  %wide.trip.count104 = zext nneg i32 %14 to i64
  %min.iters.check157 = icmp ult i32 %14, 4
  br i1 %min.iters.check157, label %scalar.ph156.preheader, label %vector.ph158

scalar.ph156.preheader:                           ; preds = %middle.block155, %.lr.ph86
  %indvars.iv101.ph = phi i64 [ 0, %.lr.ph86 ], [ %n.vec160, %middle.block155 ]
  br label %scalar.ph156

vector.ph158:                                     ; preds = %.lr.ph86
  %n.vec160 = and i64 %wide.trip.count104, 2147483644
  br label %vector.body162

vector.body162:                                   ; preds = %vector.body162, %vector.ph158
  %index163 = phi i64 [ 0, %vector.ph158 ], [ %index.next168, %vector.body162 ]
  %162 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 %index163
  %163 = getelementptr inbounds i8, ptr %162, i64 16
  %wide.load164 = load <2 x double>, ptr %162, align 16, !tbaa !22
  %wide.load165 = load <2 x double>, ptr %163, align 16, !tbaa !22
  %164 = getelementptr inbounds [3 x double], ptr %161, i64 0, i64 %index163
  %165 = getelementptr inbounds i8, ptr %164, i64 16
  %wide.load166 = load <2 x double>, ptr %164, align 8, !tbaa !22
  %wide.load167 = load <2 x double>, ptr %165, align 8, !tbaa !22
  %166 = fadd <2 x double> %wide.load164, %wide.load166
  %167 = fadd <2 x double> %wide.load165, %wide.load167
  store <2 x double> %166, ptr %164, align 8, !tbaa !22
  store <2 x double> %167, ptr %165, align 8, !tbaa !22
  %index.next168 = add nuw i64 %index163, 4
  %168 = icmp eq i64 %index.next168, %n.vec160
  br i1 %168, label %middle.block155, label %vector.body162, !llvm.loop !33

middle.block155:                                  ; preds = %vector.body162
  %cmp.n169 = icmp eq i64 %n.vec160, %wide.trip.count104
  br i1 %cmp.n169, label %.preheader, label %scalar.ph156.preheader

.preheader:                                       ; preds = %scalar.ph156, %middle.block155, %.loopexit
  %169 = icmp sgt i32 %10, 0
  br i1 %169, label %.lr.ph88.preheader, label %._crit_edge89

.lr.ph88.preheader:                               ; preds = %31, %.preheader
  %wide.trip.count109 = zext nneg i32 %10 to i64
  br label %.lr.ph88

scalar.ph156:                                     ; preds = %scalar.ph156.preheader, %scalar.ph156
  %indvars.iv101 = phi i64 [ %indvars.iv.next102, %scalar.ph156 ], [ %indvars.iv101.ph, %scalar.ph156.preheader ]
  %170 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 %indvars.iv101
  %171 = load double, ptr %170, align 8, !tbaa !22
  %172 = getelementptr inbounds [3 x double], ptr %161, i64 0, i64 %indvars.iv101
  %173 = load double, ptr %172, align 8, !tbaa !22
  %174 = fadd double %171, %173
  store double %174, ptr %172, align 8, !tbaa !22
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %exitcond105.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count104
  br i1 %exitcond105.not, label %.preheader, label %scalar.ph156, !llvm.loop !34

.lr.ph88:                                         ; preds = %.lr.ph88.preheader, %181
  %indvars.iv106 = phi i64 [ 0, %.lr.ph88.preheader ], [ %indvars.iv.next107, %181 ]
  %175 = load ptr, ptr %3, align 8, !tbaa !21
  %176 = getelementptr inbounds ptr, ptr %175, i64 %indvars.iv106
  %177 = load ptr, ptr %176, align 8, !tbaa !21
  %178 = icmp eq ptr %177, null
  br i1 %178, label %179, label %181

179:                                              ; preds = %.lr.ph88
  %180 = call i32 @SMerror(i32 noundef 594, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 60, i32 noundef 0, ptr noundef null) #6
  br label %192

181:                                              ; preds = %.lr.ph88
  call void @free(ptr noundef nonnull %177) #6
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %exitcond110.not = icmp eq i64 %indvars.iv.next107, %wide.trip.count109
  br i1 %exitcond110.not, label %._crit_edge89, label %.lr.ph88, !llvm.loop !35

._crit_edge89:                                    ; preds = %181, %.preheader
  %182 = load ptr, ptr %3, align 8, !tbaa !21
  %183 = icmp eq ptr %182, null
  br i1 %183, label %184, label %186

184:                                              ; preds = %._crit_edge89
  %185 = call i32 @SMerror(i32 noundef 594, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 60, i32 noundef 0, ptr noundef null) #6
  br label %192

186:                                              ; preds = %._crit_edge89
  call void @free(ptr noundef nonnull %182) #6
  %187 = load ptr, ptr %4, align 8, !tbaa !21
  %188 = icmp eq ptr %187, null
  br i1 %188, label %189, label %191

189:                                              ; preds = %186
  %190 = call i32 @SMerror(i32 noundef 595, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 60, i32 noundef 0, ptr noundef null) #6
  br label %192

191:                                              ; preds = %186
  call void @free(ptr noundef nonnull %187) #6
  br label %192

192:                                              ; preds = %191, %189, %184, %179, %158, %145, %104, %94, %28, %18
  %.0 = phi i32 [ %19, %18 ], [ %29, %28 ], [ %180, %179 ], [ %185, %184 ], [ %190, %189 ], [ 0, %191 ], [ %146, %145 ], [ %159, %158 ], [ %95, %94 ], [ %105, %104 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i32 %.0
}

declare i32 @SMformVerticalMatrix(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @SMformVerticalRHS(i32 noundef, ptr noundef, ptr noundef, double noundef, ptr noundef) local_unnamed_addr #4

declare i32 @SMsolve2x2(double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, ptr noundef) local_unnamed_addr #1

declare i32 @SMsolveSPD3x3(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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, !10, i64 160}
!6 = !{!"__SMlocal_mesh", !7, i64 0, !7, i64 4, !7, i64 8, !8, i64 16, !8, i64 40, !8, i64 64, !10, i64 88, !10, i64 96, !10, i64 104, !7, i64 112, !11, i64 120, !10, i64 128, !11, i64 136, !7, i64 144, !7, i64 148, !7, i64 152, !10, i64 160, !10, i64 168, !10, i64 176}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!13, !7, i64 196}
!13 = !{!"__SMoptimal", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !11, i64 32, !7, i64 40, !7, i64 44, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !7, i64 104, !8, i64 112, !11, i64 136, !11, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !8, i64 184, !7, i64 196}
!14 = !{!13, !10, i64 56}
!15 = !{!6, !7, i64 0}
!16 = !{!13, !10, i64 176}
!17 = !{!13, !10, i64 48}
!18 = !{!13, !10, i64 80}
!19 = !{!20, !11, i64 16}
!20 = !{!"__SMactive", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 16}
!21 = !{!10, !10, i64 0}
!22 = !{!11, !11, i64 0}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !25, !26, !27}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!"llvm.loop.isvectorized", i32 1}
!27 = !{!"llvm.loop.unroll.runtime.disable"}
!28 = distinct !{!28, !25, !27, !26}
!29 = distinct !{!29, !25, !26, !27}
!30 = distinct !{!30, !25, !27, !26}
!31 = distinct !{!31, !25, !26, !27}
!32 = distinct !{!32, !25, !27, !26}
!33 = distinct !{!33, !25, !26, !27}
!34 = distinct !{!34, !25, !27, !26}
!35 = distinct !{!35, !25}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass