; LLVM IR from InsightSoftwareConsortium/ITK :: Modules/ThirdParty/VNL/src/vxl/v3p/netlib/sparse (spAllocate)

; 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.MatrixFrame = type { double, i32, i32, i32, i32, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, i32, i32, ptr, ptr, i64, ptr, i32, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i8, i32, double, i32, i32, i32, i32, i32, i32, %struct.MatrixElement, ptr, i32, ptr, i32, ptr, i32, ptr, ptr }
%struct.MatrixElement = type { double, i32, i32, ptr, ptr, ptr }

@stdout = external global ptr, align 8
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [66 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [125 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @spCreate(i32 noundef %0, i32 noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %16 = load ptr, ptr %7, align 8, !tbaa !9
  store i32 0, ptr %16, align 4, !tbaa !5
  %17 = load i32, ptr %5, align 4, !tbaa !5
  %18 = icmp sge i32 %17, 0
  br i1 %18, label %19, label %23

19:                                               ; preds = %3
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %30, label %22

22:                                               ; preds = %19
  br i1 true, label %30, label %23

23:                                               ; preds = %22, %3
  %24 = load ptr, ptr @stdout, align 8, !tbaa !9
  %25 = call i32 @fflush(ptr noundef %24)
  %26 = load ptr, ptr @stderr, align 8, !tbaa !9
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 136, ptr noundef @.str.2) #6
  %28 = load ptr, ptr @stderr, align 8, !tbaa !9
  %29 = call i32 @fflush(ptr noundef %28)
  call void @abort() #7
  unreachable

30:                                               ; preds = %22, %19
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %40

33:                                               ; preds = %30
  %34 = load ptr, ptr @stdout, align 8, !tbaa !9
  %35 = call i32 @fflush(ptr noundef %34)
  %36 = load ptr, ptr @stderr, align 8, !tbaa !9
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 140, ptr noundef @.str.4) #6
  %38 = load ptr, ptr @stderr, align 8, !tbaa !9
  %39 = call i32 @fflush(ptr noundef %38)
  call void @abort() #7
  unreachable

40:                                               ; preds = %30
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = icmp sgt i32 %41, 6
  br i1 %42, label %43, label %45

43:                                               ; preds = %40
  %44 = load i32, ptr %5, align 4, !tbaa !5
  br label %46

45:                                               ; preds = %40
  br label %46

46:                                               ; preds = %45, %43
  %47 = phi i32 [ %44, %43 ], [ 6, %45 ]
  store i32 %47, ptr %11, align 4, !tbaa !5
  %48 = load i32, ptr %11, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %8, align 4, !tbaa !5
  %50 = call ptr @malloc(i64 noundef 336) #8
  store ptr %50, ptr %9, align 8, !tbaa !9
  %51 = icmp eq ptr %50, null
  br i1 %51, label %52, label %54

52:                                               ; preds = %46
  %53 = load ptr, ptr %7, align 8, !tbaa !9
  store i32 5, ptr %53, align 4, !tbaa !5
  store ptr null, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %380

54:                                               ; preds = %46
  %55 = load ptr, ptr %9, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.MatrixFrame, ptr %55, i32 0, i32 17
  store i64 3735928559, ptr %56, align 8, !tbaa !11
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = load ptr, ptr %9, align 8, !tbaa !9
  %59 = getelementptr inbounds %struct.MatrixFrame, ptr %58, i32 0, i32 3
  store i32 %57, ptr %59, align 8, !tbaa !16
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = load ptr, ptr %9, align 8, !tbaa !9
  %62 = getelementptr inbounds %struct.MatrixFrame, ptr %61, i32 0, i32 32
  store i32 %60, ptr %62, align 4, !tbaa !17
  %63 = load ptr, ptr %9, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.MatrixFrame, ptr %63, i32 0, i32 13
  store i32 0, ptr %64, align 8, !tbaa !18
  %65 = load ptr, ptr %9, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct.MatrixFrame, ptr %65, i32 0, i32 8
  store i32 0, ptr %66, align 8, !tbaa !19
  %67 = load ptr, ptr %7, align 8, !tbaa !9
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = load ptr, ptr %9, align 8, !tbaa !9
  %70 = getelementptr inbounds %struct.MatrixFrame, ptr %69, i32 0, i32 9
  store i32 %68, ptr %70, align 4, !tbaa !20
  %71 = load ptr, ptr %9, align 8, !tbaa !9
  %72 = getelementptr inbounds %struct.MatrixFrame, ptr %71, i32 0, i32 14
  store i32 0, ptr %72, align 4, !tbaa !21
  %73 = load ptr, ptr %9, align 8, !tbaa !9
  %74 = getelementptr inbounds %struct.MatrixFrame, ptr %73, i32 0, i32 34
  store i32 0, ptr %74, align 8, !tbaa !22
  %75 = load ptr, ptr %9, align 8, !tbaa !9
  %76 = getelementptr inbounds %struct.MatrixFrame, ptr %75, i32 0, i32 26
  store i32 1, ptr %76, align 4, !tbaa !23
  %77 = load ptr, ptr %9, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct.MatrixFrame, ptr %77, i32 0, i32 27
  store i32 0, ptr %78, align 8, !tbaa !24
  %79 = load ptr, ptr %9, align 8, !tbaa !9
  %80 = getelementptr inbounds %struct.MatrixFrame, ptr %79, i32 0, i32 28
  store i32 0, ptr %80, align 4, !tbaa !25
  %81 = load ptr, ptr %9, align 8, !tbaa !9
  %82 = getelementptr inbounds %struct.MatrixFrame, ptr %81, i32 0, i32 35
  store i32 0, ptr %82, align 4, !tbaa !26
  %83 = load ptr, ptr %9, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.MatrixFrame, ptr %83, i32 0, i32 19
  store i32 0, ptr %84, align 8, !tbaa !27
  %85 = load ptr, ptr %9, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.MatrixFrame, ptr %85, i32 0, i32 36
  store i32 0, ptr %86, align 8, !tbaa !28
  %87 = load ptr, ptr %9, align 8, !tbaa !9
  %88 = getelementptr inbounds %struct.MatrixFrame, ptr %87, i32 0, i32 37
  store i32 0, ptr %88, align 4, !tbaa !29
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = load ptr, ptr %9, align 8, !tbaa !9
  %91 = getelementptr inbounds %struct.MatrixFrame, ptr %90, i32 0, i32 39
  store i32 %89, ptr %91, align 4, !tbaa !30
  %92 = load i32, ptr %11, align 4, !tbaa !5
  %93 = load ptr, ptr %9, align 8, !tbaa !9
  %94 = getelementptr inbounds %struct.MatrixFrame, ptr %93, i32 0, i32 1
  store i32 %92, ptr %94, align 8, !tbaa !31
  %95 = load i32, ptr %5, align 4, !tbaa !5
  %96 = load ptr, ptr %9, align 8, !tbaa !9
  %97 = getelementptr inbounds %struct.MatrixFrame, ptr %96, i32 0, i32 10
  store i32 %95, ptr %97, align 8, !tbaa !32
  %98 = load i32, ptr %11, align 4, !tbaa !5
  %99 = load ptr, ptr %9, align 8, !tbaa !9
  %100 = getelementptr inbounds %struct.MatrixFrame, ptr %99, i32 0, i32 2
  store i32 %98, ptr %100, align 4, !tbaa !33
  %101 = load ptr, ptr %9, align 8, !tbaa !9
  %102 = getelementptr inbounds %struct.MatrixFrame, ptr %101, i32 0, i32 4
  store i32 0, ptr %102, align 4, !tbaa !34
  %103 = load ptr, ptr %9, align 8, !tbaa !9
  %104 = getelementptr inbounds %struct.MatrixFrame, ptr %103, i32 0, i32 11
  store ptr null, ptr %104, align 8, !tbaa !35
  %105 = load ptr, ptr %9, align 8, !tbaa !9
  %106 = getelementptr inbounds %struct.MatrixFrame, ptr %105, i32 0, i32 12
  store ptr null, ptr %106, align 8, !tbaa !36
  %107 = load ptr, ptr %9, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.MatrixFrame, ptr %107, i32 0, i32 20
  store ptr null, ptr %108, align 8, !tbaa !37
  %109 = load ptr, ptr %9, align 8, !tbaa !9
  %110 = getelementptr inbounds %struct.MatrixFrame, ptr %109, i32 0, i32 21
  store ptr null, ptr %110, align 8, !tbaa !38
  %111 = load ptr, ptr %9, align 8, !tbaa !9
  %112 = getelementptr inbounds %struct.MatrixFrame, ptr %111, i32 0, i32 22
  store ptr null, ptr %112, align 8, !tbaa !39
  %113 = load ptr, ptr %9, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct.MatrixFrame, ptr %113, i32 0, i32 23
  store ptr null, ptr %114, align 8, !tbaa !40
  %115 = load ptr, ptr %9, align 8, !tbaa !9
  %116 = getelementptr inbounds %struct.MatrixFrame, ptr %115, i32 0, i32 24
  store ptr null, ptr %116, align 8, !tbaa !41
  %117 = load ptr, ptr %9, align 8, !tbaa !9
  %118 = getelementptr inbounds %struct.MatrixFrame, ptr %117, i32 0, i32 6
  store ptr null, ptr %118, align 8, !tbaa !42
  %119 = load ptr, ptr %9, align 8, !tbaa !9
  %120 = getelementptr inbounds %struct.MatrixFrame, ptr %119, i32 0, i32 7
  store ptr null, ptr %120, align 8, !tbaa !43
  %121 = load ptr, ptr %9, align 8, !tbaa !9
  %122 = getelementptr inbounds %struct.MatrixFrame, ptr %121, i32 0, i32 18
  store ptr null, ptr %122, align 8, !tbaa !44
  %123 = load ptr, ptr %9, align 8, !tbaa !9
  %124 = getelementptr inbounds %struct.MatrixFrame, ptr %123, i32 0, i32 33
  store double 1.000000e-03, ptr %124, align 8, !tbaa !45
  %125 = load ptr, ptr %9, align 8, !tbaa !9
  %126 = getelementptr inbounds %struct.MatrixFrame, ptr %125, i32 0, i32 0
  store double 0.000000e+00, ptr %126, align 8, !tbaa !46
  %127 = load ptr, ptr %9, align 8, !tbaa !9
  %128 = getelementptr inbounds %struct.MatrixFrame, ptr %127, i32 0, i32 41
  store ptr null, ptr %128, align 8, !tbaa !47
  %129 = load ptr, ptr %9, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct.MatrixFrame, ptr %129, i32 0, i32 42
  store i32 0, ptr %130, align 8, !tbaa !48
  %131 = load ptr, ptr %9, align 8, !tbaa !9
  %132 = getelementptr inbounds %struct.MatrixFrame, ptr %131, i32 0, i32 44
  store i32 0, ptr %132, align 8, !tbaa !49
  %133 = load ptr, ptr %9, align 8, !tbaa !9
  %134 = getelementptr inbounds %struct.MatrixFrame, ptr %133, i32 0, i32 46
  store i32 0, ptr %134, align 8, !tbaa !50
  %135 = load ptr, ptr %9, align 8, !tbaa !9
  %136 = load ptr, ptr %9, align 8, !tbaa !9
  call void @RecordAllocation(ptr noundef %135, ptr noundef %136)
  %137 = load ptr, ptr %9, align 8, !tbaa !9
  %138 = getelementptr inbounds %struct.MatrixFrame, ptr %137, i32 0, i32 9
  %139 = load i32, ptr %138, align 4, !tbaa !20
  %140 = icmp eq i32 %139, 5
  br i1 %140, label %141, label %142

141:                                              ; preds = %54
  br label %377

142:                                              ; preds = %54
  %143 = load ptr, ptr %9, align 8, !tbaa !9
  %144 = getelementptr inbounds %struct.MatrixFrame, ptr %143, i32 0, i32 40
  %145 = getelementptr inbounds %struct.MatrixElement, ptr %144, i32 0, i32 0
  store double 0.000000e+00, ptr %145, align 8, !tbaa !51
  %146 = load ptr, ptr %9, align 8, !tbaa !9
  %147 = getelementptr inbounds %struct.MatrixFrame, ptr %146, i32 0, i32 40
  %148 = getelementptr inbounds %struct.MatrixElement, ptr %147, i32 0, i32 1
  store i32 0, ptr %148, align 8, !tbaa !52
  %149 = load ptr, ptr %9, align 8, !tbaa !9
  %150 = getelementptr inbounds %struct.MatrixFrame, ptr %149, i32 0, i32 40
  %151 = getelementptr inbounds %struct.MatrixElement, ptr %150, i32 0, i32 2
  store i32 0, ptr %151, align 4, !tbaa !53
  %152 = load ptr, ptr %9, align 8, !tbaa !9
  %153 = getelementptr inbounds %struct.MatrixFrame, ptr %152, i32 0, i32 40
  %154 = getelementptr inbounds %struct.MatrixElement, ptr %153, i32 0, i32 3
  store ptr null, ptr %154, align 8, !tbaa !54
  %155 = load ptr, ptr %9, align 8, !tbaa !9
  %156 = getelementptr inbounds %struct.MatrixFrame, ptr %155, i32 0, i32 40
  %157 = getelementptr inbounds %struct.MatrixElement, ptr %156, i32 0, i32 4
  store ptr null, ptr %157, align 8, !tbaa !55
  %158 = load ptr, ptr %9, align 8, !tbaa !9
  %159 = getelementptr inbounds %struct.MatrixFrame, ptr %158, i32 0, i32 40
  %160 = getelementptr inbounds %struct.MatrixElement, ptr %159, i32 0, i32 5
  store ptr null, ptr %160, align 8, !tbaa !56
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %161 = load i32, ptr %8, align 4, !tbaa !5
  %162 = zext i32 %161 to i64
  %163 = mul i64 8, %162
  %164 = trunc i64 %163 to i32
  %165 = zext i32 %164 to i64
  %166 = call ptr @malloc(i64 noundef %165) #8
  %167 = load ptr, ptr %9, align 8, !tbaa !9
  %168 = getelementptr inbounds %struct.MatrixFrame, ptr %167, i32 0, i32 5
  store ptr %166, ptr %168, align 8, !tbaa !57
  %169 = load ptr, ptr %9, align 8, !tbaa !9
  %170 = getelementptr inbounds %struct.MatrixFrame, ptr %169, i32 0, i32 5
  %171 = load ptr, ptr %170, align 8, !tbaa !57
  %172 = icmp ne ptr %171, null
  br i1 %172, label %173, label %190

173:                                              ; preds = %142
  %174 = load i32, ptr %8, align 4, !tbaa !5
  %175 = sub i32 %174, 1
  store i32 %175, ptr %13, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %186, %173
  %177 = load i32, ptr %13, align 4, !tbaa !5
  %178 = icmp sge i32 %177, 0
  br i1 %178, label %179, label %189

179:                                              ; preds = %176
  %180 = load ptr, ptr %9, align 8, !tbaa !9
  %181 = getelementptr inbounds %struct.MatrixFrame, ptr %180, i32 0, i32 5
  %182 = load ptr, ptr %181, align 8, !tbaa !57
  %183 = load i32, ptr %13, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds ptr, ptr %182, i64 %184
  store ptr null, ptr %185, align 8, !tbaa !9
  br label %186

186:                                              ; preds = %179
  %187 = load i32, ptr %13, align 4, !tbaa !5
  %188 = add nsw i32 %187, -1
  store i32 %188, ptr %13, align 4, !tbaa !5
  br label %176, !llvm.loop !58

189:                                              ; preds = %176
  br label %190

190:                                              ; preds = %189, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  %191 = load ptr, ptr %9, align 8, !tbaa !9
  %192 = getelementptr inbounds %struct.MatrixFrame, ptr %191, i32 0, i32 5
  %193 = load ptr, ptr %192, align 8, !tbaa !57
  %194 = icmp eq ptr %193, null
  br i1 %194, label %195, label %196

195:                                              ; preds = %190
  br label %377

196:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %197 = load i32, ptr %8, align 4, !tbaa !5
  %198 = zext i32 %197 to i64
  %199 = mul i64 8, %198
  %200 = trunc i64 %199 to i32
  %201 = zext i32 %200 to i64
  %202 = call ptr @malloc(i64 noundef %201) #8
  %203 = load ptr, ptr %9, align 8, !tbaa !9
  %204 = getelementptr inbounds %struct.MatrixFrame, ptr %203, i32 0, i32 15
  store ptr %202, ptr %204, align 8, !tbaa !60
  %205 = load ptr, ptr %9, align 8, !tbaa !9
  %206 = getelementptr inbounds %struct.MatrixFrame, ptr %205, i32 0, i32 15
  %207 = load ptr, ptr %206, align 8, !tbaa !60
  %208 = icmp ne ptr %207, null
  br i1 %208, label %209, label %226

209:                                              ; preds = %196
  %210 = load i32, ptr %8, align 4, !tbaa !5
  %211 = sub i32 %210, 1
  store i32 %211, ptr %14, align 4, !tbaa !5
  br label %212

212:                                              ; preds = %222, %209
  %213 = load i32, ptr %14, align 4, !tbaa !5
  %214 = icmp sge i32 %213, 0
  br i1 %214, label %215, label %225

215:                                              ; preds = %212
  %216 = load ptr, ptr %9, align 8, !tbaa !9
  %217 = getelementptr inbounds %struct.MatrixFrame, ptr %216, i32 0, i32 15
  %218 = load ptr, ptr %217, align 8, !tbaa !60
  %219 = load i32, ptr %14, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds ptr, ptr %218, i64 %220
  store ptr null, ptr %221, align 8, !tbaa !9
  br label %222

222:                                              ; preds = %215
  %223 = load i32, ptr %14, align 4, !tbaa !5
  %224 = add nsw i32 %223, -1
  store i32 %224, ptr %14, align 4, !tbaa !5
  br label %212, !llvm.loop !61

225:                                              ; preds = %212
  br label %226

226:                                              ; preds = %225, %196
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  %227 = load ptr, ptr %9, align 8, !tbaa !9
  %228 = getelementptr inbounds %struct.MatrixFrame, ptr %227, i32 0, i32 15
  %229 = load ptr, ptr %228, align 8, !tbaa !60
  %230 = icmp eq ptr %229, null
  br i1 %230, label %231, label %232

231:                                              ; preds = %226
  br label %377

232:                                              ; preds = %226
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %233 = load i32, ptr %8, align 4, !tbaa !5
  %234 = zext i32 %233 to i64
  %235 = mul i64 8, %234
  %236 = trunc i64 %235 to i32
  %237 = zext i32 %236 to i64
  %238 = call ptr @malloc(i64 noundef %237) #8
  %239 = load ptr, ptr %9, align 8, !tbaa !9
  %240 = getelementptr inbounds %struct.MatrixFrame, ptr %239, i32 0, i32 16
  store ptr %238, ptr %240, align 8, !tbaa !62
  %241 = load ptr, ptr %9, align 8, !tbaa !9
  %242 = getelementptr inbounds %struct.MatrixFrame, ptr %241, i32 0, i32 16
  %243 = load ptr, ptr %242, align 8, !tbaa !62
  %244 = icmp ne ptr %243, null
  br i1 %244, label %245, label %262

245:                                              ; preds = %232
  %246 = load i32, ptr %8, align 4, !tbaa !5
  %247 = sub i32 %246, 1
  store i32 %247, ptr %15, align 4, !tbaa !5
  br label %248

248:                                              ; preds = %258, %245
  %249 = load i32, ptr %15, align 4, !tbaa !5
  %250 = icmp sge i32 %249, 0
  br i1 %250, label %251, label %261

251:                                              ; preds = %248
  %252 = load ptr, ptr %9, align 8, !tbaa !9
  %253 = getelementptr inbounds %struct.MatrixFrame, ptr %252, i32 0, i32 16
  %254 = load ptr, ptr %253, align 8, !tbaa !62
  %255 = load i32, ptr %15, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds ptr, ptr %254, i64 %256
  store ptr null, ptr %257, align 8, !tbaa !9
  br label %258

258:                                              ; preds = %251
  %259 = load i32, ptr %15, align 4, !tbaa !5
  %260 = add nsw i32 %259, -1
  store i32 %260, ptr %15, align 4, !tbaa !5
  br label %248, !llvm.loop !63

261:                                              ; preds = %248
  br label %262

262:                                              ; preds = %261, %232
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %263 = load ptr, ptr %9, align 8, !tbaa !9
  %264 = getelementptr inbounds %struct.MatrixFrame, ptr %263, i32 0, i32 16
  %265 = load ptr, ptr %264, align 8, !tbaa !62
  %266 = icmp eq ptr %265, null
  br i1 %266, label %267, label %268

267:                                              ; preds = %262
  br label %377

268:                                              ; preds = %262
  %269 = load i32, ptr %8, align 4, !tbaa !5
  %270 = zext i32 %269 to i64
  %271 = mul i64 4, %270
  %272 = trunc i64 %271 to i32
  %273 = zext i32 %272 to i64
  %274 = call ptr @malloc(i64 noundef %273) #8
  %275 = load ptr, ptr %9, align 8, !tbaa !9
  %276 = getelementptr inbounds %struct.MatrixFrame, ptr %275, i32 0, i32 20
  store ptr %274, ptr %276, align 8, !tbaa !37
  %277 = icmp eq ptr %274, null
  br i1 %277, label %278, label %279

278:                                              ; preds = %268
  br label %377

279:                                              ; preds = %268
  %280 = load i32, ptr %8, align 4, !tbaa !5
  %281 = zext i32 %280 to i64
  %282 = mul i64 4, %281
  %283 = trunc i64 %282 to i32
  %284 = zext i32 %283 to i64
  %285 = call ptr @malloc(i64 noundef %284) #8
  %286 = load ptr, ptr %9, align 8, !tbaa !9
  %287 = getelementptr inbounds %struct.MatrixFrame, ptr %286, i32 0, i32 21
  store ptr %285, ptr %287, align 8, !tbaa !38
  %288 = icmp eq ptr %285, null
  br i1 %288, label %289, label %290

289:                                              ; preds = %279
  br label %377

290:                                              ; preds = %279
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %291

291:                                              ; preds = %310, %290
  %292 = load i32, ptr %10, align 4, !tbaa !5
  %293 = load i32, ptr %11, align 4, !tbaa !5
  %294 = icmp sle i32 %292, %293
  br i1 %294, label %295, label %313

295:                                              ; preds = %291
  %296 = load i32, ptr %10, align 4, !tbaa !5
  %297 = load ptr, ptr %9, align 8, !tbaa !9
  %298 = getelementptr inbounds %struct.MatrixFrame, ptr %297, i32 0, i32 21
  %299 = load ptr, ptr %298, align 8, !tbaa !38
  %300 = load i32, ptr %10, align 4, !tbaa !5
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds i32, ptr %299, i64 %301
  store i32 %296, ptr %302, align 4, !tbaa !5
  %303 = load i32, ptr %10, align 4, !tbaa !5
  %304 = load ptr, ptr %9, align 8, !tbaa !9
  %305 = getelementptr inbounds %struct.MatrixFrame, ptr %304, i32 0, i32 20
  %306 = load ptr, ptr %305, align 8, !tbaa !37
  %307 = load i32, ptr %10, align 4, !tbaa !5
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds i32, ptr %306, i64 %308
  store i32 %303, ptr %309, align 4, !tbaa !5
  br label %310

310:                                              ; preds = %295
  %311 = load i32, ptr %10, align 4, !tbaa !5
  %312 = add nsw i32 %311, 1
  store i32 %312, ptr %10, align 4, !tbaa !5
  br label %291, !llvm.loop !64

313:                                              ; preds = %291
  %314 = load i32, ptr %8, align 4, !tbaa !5
  %315 = zext i32 %314 to i64
  %316 = mul i64 4, %315
  %317 = trunc i64 %316 to i32
  %318 = zext i32 %317 to i64
  %319 = call ptr @malloc(i64 noundef %318) #8
  %320 = load ptr, ptr %9, align 8, !tbaa !9
  %321 = getelementptr inbounds %struct.MatrixFrame, ptr %320, i32 0, i32 11
  store ptr %319, ptr %321, align 8, !tbaa !35
  %322 = icmp eq ptr %319, null
  br i1 %322, label %323, label %324

323:                                              ; preds = %313
  br label %377

324:                                              ; preds = %313
  %325 = load i32, ptr %8, align 4, !tbaa !5
  %326 = zext i32 %325 to i64
  %327 = mul i64 4, %326
  %328 = trunc i64 %327 to i32
  %329 = zext i32 %328 to i64
  %330 = call ptr @malloc(i64 noundef %329) #8
  %331 = load ptr, ptr %9, align 8, !tbaa !9
  %332 = getelementptr inbounds %struct.MatrixFrame, ptr %331, i32 0, i32 12
  store ptr %330, ptr %332, align 8, !tbaa !36
  %333 = icmp eq ptr %330, null
  br i1 %333, label %334, label %335

334:                                              ; preds = %324
  br label %377

335:                                              ; preds = %324
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %336

336:                                              ; preds = %353, %335
  %337 = load i32, ptr %10, align 4, !tbaa !5
  %338 = load i32, ptr %11, align 4, !tbaa !5
  %339 = icmp sle i32 %337, %338
  br i1 %339, label %340, label %356

340:                                              ; preds = %336
  %341 = load ptr, ptr %9, align 8, !tbaa !9
  %342 = getelementptr inbounds %struct.MatrixFrame, ptr %341, i32 0, i32 11
  %343 = load ptr, ptr %342, align 8, !tbaa !35
  %344 = load i32, ptr %10, align 4, !tbaa !5
  %345 = sext i32 %344 to i64
  %346 = getelementptr inbounds i32, ptr %343, i64 %345
  store i32 -1, ptr %346, align 4, !tbaa !5
  %347 = load ptr, ptr %9, align 8, !tbaa !9
  %348 = getelementptr inbounds %struct.MatrixFrame, ptr %347, i32 0, i32 12
  %349 = load ptr, ptr %348, align 8, !tbaa !36
  %350 = load i32, ptr %10, align 4, !tbaa !5
  %351 = sext i32 %350 to i64
  %352 = getelementptr inbounds i32, ptr %349, i64 %351
  store i32 -1, ptr %352, align 4, !tbaa !5
  br label %353

353:                                              ; preds = %340
  %354 = load i32, ptr %10, align 4, !tbaa !5
  %355 = add nsw i32 %354, 1
  store i32 %355, ptr %10, align 4, !tbaa !5
  br label %336, !llvm.loop !65

356:                                              ; preds = %336
  %357 = load ptr, ptr %9, align 8, !tbaa !9
  %358 = getelementptr inbounds %struct.MatrixFrame, ptr %357, i32 0, i32 11
  %359 = load ptr, ptr %358, align 8, !tbaa !35
  %360 = getelementptr inbounds i32, ptr %359, i64 0
  store i32 0, ptr %360, align 4, !tbaa !5
  %361 = load ptr, ptr %9, align 8, !tbaa !9
  %362 = getelementptr inbounds %struct.MatrixFrame, ptr %361, i32 0, i32 12
  %363 = load ptr, ptr %362, align 8, !tbaa !36
  %364 = getelementptr inbounds i32, ptr %363, i64 0
  store i32 0, ptr %364, align 4, !tbaa !5
  %365 = load ptr, ptr %9, align 8, !tbaa !9
  %366 = load i32, ptr %11, align 4, !tbaa !5
  %367 = mul nsw i32 6, %366
  %368 = load i32, ptr %11, align 4, !tbaa !5
  %369 = mul nsw i32 4, %368
  call void @InitializeElementBlocks(ptr noundef %365, i32 noundef %367, i32 noundef %369)
  %370 = load ptr, ptr %9, align 8, !tbaa !9
  %371 = getelementptr inbounds %struct.MatrixFrame, ptr %370, i32 0, i32 9
  %372 = load i32, ptr %371, align 4, !tbaa !20
  %373 = icmp eq i32 %372, 5
  br i1 %373, label %374, label %375

374:                                              ; preds = %356
  br label %377

375:                                              ; preds = %356
  %376 = load ptr, ptr %9, align 8, !tbaa !9
  store ptr %376, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %380

377:                                              ; preds = %374, %334, %323, %289, %278, %267, %231, %195, %141
  %378 = load ptr, ptr %7, align 8, !tbaa !9
  store i32 5, ptr %378, align 4, !tbaa !5
  %379 = load ptr, ptr %9, align 8, !tbaa !9
  call void @spDestroy(ptr noundef %379)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %380

380:                                              ; preds = %377, %375, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %381 = load ptr, ptr %4, align 8
  ret ptr %381
}

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

declare i32 @fflush(ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

; Function Attrs: noreturn nounwind
declare void @abort() #4

; Function Attrs: allocsize(0)
declare ptr @malloc(i64 noundef) #5

; Function Attrs: nounwind uwtable
declare hidden void @RecordAllocation(ptr noundef, ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare hidden void @InitializeElementBlocks(ptr noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @spDestroy(ptr noundef) #0

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "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 = { noreturn 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 = { 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 = { nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { allocsize(0) }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !14, i64 104}
!12 = !{!"MatrixFrame", !13, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !10, i64 24, !10, i64 32, !10, i64 40, !6, i64 48, !6, i64 52, !6, i64 56, !10, i64 64, !10, i64 72, !6, i64 80, !6, i64 84, !10, i64 88, !10, i64 96, !14, i64 104, !10, i64 112, !6, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !6, i64 168, !6, i64 172, !6, i64 176, !6, i64 180, !6, i64 184, !6, i64 188, !7, i64 192, !6, i64 196, !13, i64 200, !6, i64 208, !6, i64 212, !6, i64 216, !6, i64 220, !6, i64 224, !6, i64 228, !15, i64 232, !10, i64 272, !6, i64 280, !10, i64 288, !6, i64 296, !10, i64 304, !6, i64 312, !10, i64 320, !10, i64 328}
!13 = !{!"double", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"MatrixElement", !13, i64 0, !6, i64 8, !6, i64 12, !10, i64 16, !10, i64 24, !10, i64 32}
!16 = !{!12, !6, i64 16}
!17 = !{!12, !6, i64 196}
!18 = !{!12, !6, i64 80}
!19 = !{!12, !6, i64 48}
!20 = !{!12, !6, i64 52}
!21 = !{!12, !6, i64 84}
!22 = !{!12, !6, i64 208}
!23 = !{!12, !6, i64 172}
!24 = !{!12, !6, i64 176}
!25 = !{!12, !6, i64 180}
!26 = !{!12, !6, i64 212}
!27 = !{!12, !6, i64 120}
!28 = !{!12, !6, i64 216}
!29 = !{!12, !6, i64 220}
!30 = !{!12, !6, i64 228}
!31 = !{!12, !6, i64 8}
!32 = !{!12, !6, i64 56}
!33 = !{!12, !6, i64 12}
!34 = !{!12, !6, i64 20}
!35 = !{!12, !10, i64 64}
!36 = !{!12, !10, i64 72}
!37 = !{!12, !10, i64 128}
!38 = !{!12, !10, i64 136}
!39 = !{!12, !10, i64 144}
!40 = !{!12, !10, i64 152}
!41 = !{!12, !10, i64 160}
!42 = !{!12, !10, i64 32}
!43 = !{!12, !10, i64 40}
!44 = !{!12, !10, i64 112}
!45 = !{!12, !13, i64 200}
!46 = !{!12, !13, i64 0}
!47 = !{!12, !10, i64 272}
!48 = !{!12, !6, i64 280}
!49 = !{!12, !6, i64 296}
!50 = !{!12, !6, i64 312}
!51 = !{!12, !13, i64 232}
!52 = !{!12, !6, i64 240}
!53 = !{!12, !6, i64 244}
!54 = !{!12, !10, i64 248}
!55 = !{!12, !10, i64 256}
!56 = !{!12, !10, i64 264}
!57 = !{!12, !10, i64 24}
!58 = distinct !{!58, !59}
!59 = !{!"llvm.loop.mustprogress"}
!60 = !{!12, !10, i64 88}
!61 = distinct !{!61, !59}
!62 = !{!12, !10, i64 96}
!63 = distinct !{!63, !59}
!64 = distinct !{!64, !59}
!65 = distinct !{!65, !59}


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

@stdout = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [66 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [125 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @spCreate(i32 noundef %0, i32 noundef %1, ptr nocapture noundef writeonly %2) local_unnamed_addr #0 {
  store i32 0, ptr %2, align 4, !tbaa !5
  %4 = icmp sgt i32 %0, -1
  br i1 %4, label %5, label %6

5:                                                ; preds = %3
  %.not = icmp eq i32 %1, 0
  br i1 %.not, label %20, label %13

6:                                                ; preds = %3
  %7 = load ptr, ptr @stdout, align 8, !tbaa !9
  %8 = tail call i32 @fflush(ptr noundef %7)
  %9 = load ptr, ptr @stderr, align 8, !tbaa !9
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 136, ptr noundef nonnull @.str.2) #6
  %11 = load ptr, ptr @stderr, align 8, !tbaa !9
  %12 = tail call i32 @fflush(ptr noundef %11)
  tail call void @abort() #7
  unreachable

13:                                               ; preds = %5
  %14 = load ptr, ptr @stdout, align 8, !tbaa !9
  %15 = tail call i32 @fflush(ptr noundef %14)
  %16 = load ptr, ptr @stderr, align 8, !tbaa !9
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 140, ptr noundef nonnull @.str.4) #6
  %18 = load ptr, ptr @stderr, align 8, !tbaa !9
  %19 = tail call i32 @fflush(ptr noundef %18)
  tail call void @abort() #7
  unreachable

20:                                               ; preds = %5
  %21 = tail call i32 @llvm.umax.i32(i32 %0, i32 6)
  %22 = add nuw i32 %21, 1
  %23 = tail call dereferenceable_or_null(336) ptr @malloc(i64 noundef 336) #8
  %24 = icmp eq ptr %23, null
  br i1 %24, label %25, label %26

25:                                               ; preds = %20
  store i32 5, ptr %2, align 4, !tbaa !5
  br label %140

26:                                               ; preds = %20
  %27 = getelementptr inbounds i8, ptr %23, i64 104
  store i64 3735928559, ptr %27, align 8, !tbaa !11
  %28 = getelementptr inbounds i8, ptr %23, i64 16
  store i32 0, ptr %28, align 8, !tbaa !16
  %29 = getelementptr inbounds i8, ptr %23, i64 196
  store i32 0, ptr %29, align 4, !tbaa !17
  %30 = getelementptr inbounds i8, ptr %23, i64 80
  store i32 0, ptr %30, align 8, !tbaa !18
  %31 = getelementptr inbounds i8, ptr %23, i64 48
  store i32 0, ptr %31, align 8, !tbaa !19
  %32 = getelementptr inbounds i8, ptr %23, i64 52
  store i32 0, ptr %32, align 4, !tbaa !20
  %33 = getelementptr inbounds i8, ptr %23, i64 84
  store i32 0, ptr %33, align 4, !tbaa !21
  %34 = getelementptr inbounds i8, ptr %23, i64 208
  %35 = getelementptr inbounds i8, ptr %23, i64 172
  store i32 1, ptr %35, align 4, !tbaa !22
  %36 = getelementptr inbounds i8, ptr %23, i64 176
  store i32 0, ptr %36, align 8, !tbaa !23
  %37 = getelementptr inbounds i8, ptr %23, i64 180
  store i32 0, ptr %37, align 4, !tbaa !24
  %38 = getelementptr inbounds i8, ptr %23, i64 120
  store i32 0, ptr %38, align 8, !tbaa !25
  store <4 x i32> zeroinitializer, ptr %34, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %23, i64 228
  store i32 %0, ptr %39, align 4, !tbaa !26
  %40 = getelementptr inbounds i8, ptr %23, i64 8
  store i32 %21, ptr %40, align 8, !tbaa !27
  %41 = getelementptr inbounds i8, ptr %23, i64 56
  store i32 %0, ptr %41, align 8, !tbaa !28
  %42 = getelementptr inbounds i8, ptr %23, i64 12
  store i32 %21, ptr %42, align 4, !tbaa !29
  %43 = getelementptr inbounds i8, ptr %23, i64 20
  store i32 0, ptr %43, align 4, !tbaa !30
  %44 = getelementptr inbounds i8, ptr %23, i64 64
  %45 = getelementptr inbounds i8, ptr %23, i64 72
  %46 = getelementptr inbounds i8, ptr %23, i64 128
  %47 = getelementptr inbounds i8, ptr %23, i64 136
  %48 = getelementptr inbounds i8, ptr %23, i64 32
  %49 = getelementptr inbounds i8, ptr %23, i64 112
  store ptr null, ptr %49, align 8, !tbaa !31
  %50 = getelementptr inbounds i8, ptr %23, i64 200
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %48, i8 0, i64 16, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %44, i8 0, i64 16, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %46, i8 0, i64 40, i1 false)
  store double 1.000000e-03, ptr %50, align 8, !tbaa !32
  store double 0.000000e+00, ptr %23, align 8, !tbaa !33
  %51 = getelementptr inbounds i8, ptr %23, i64 272
  store ptr null, ptr %51, align 8, !tbaa !34
  %52 = getelementptr inbounds i8, ptr %23, i64 280
  store i32 0, ptr %52, align 8, !tbaa !35
  %53 = getelementptr inbounds i8, ptr %23, i64 296
  store i32 0, ptr %53, align 8, !tbaa !36
  %54 = getelementptr inbounds i8, ptr %23, i64 312
  store i32 0, ptr %54, align 8, !tbaa !37
  tail call void @RecordAllocation(ptr noundef nonnull %23, ptr noundef nonnull %23)
  %55 = load i32, ptr %32, align 4, !tbaa !20
  %56 = icmp eq i32 %55, 5
  br i1 %56, label %.thread, label %57

57:                                               ; preds = %26
  %58 = getelementptr inbounds i8, ptr %23, i64 232
  %59 = shl i32 %22, 3
  %60 = zext i32 %59 to i64
  %61 = tail call ptr @malloc(i64 noundef %60) #8
  %62 = getelementptr inbounds i8, ptr %23, i64 24
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %58, i8 0, i64 40, i1 false)
  store ptr %61, ptr %62, align 8, !tbaa !38
  %.not128 = icmp eq ptr %61, null
  br i1 %.not128, label %.thread, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %57
  %63 = tail call i32 @llvm.umax.i32(i32 %0, i32 6)
  %umax = zext nneg i32 %63 to i64
  %64 = add nuw nsw i64 %umax, 1
  %xtraiter = and i64 %64, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.preheader.new, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader, %.lr.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.lr.ph.prol ], [ %umax, %.lr.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader ]
  %65 = load ptr, ptr %62, align 8, !tbaa !38
  %66 = getelementptr inbounds ptr, ptr %65, i64 %indvars.iv.prol
  store ptr null, ptr %66, align 8, !tbaa !9
  %indvars.iv.next.prol = add nsw i64 %indvars.iv.prol, -1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.preheader.new, label %.lr.ph.prol, !llvm.loop !39

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader, %.lr.ph.prol
  %indvars.iv.unr = phi i64 [ %umax, %.lr.ph.preheader ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ %indvars.iv.unr, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %67 = load ptr, ptr %62, align 8, !tbaa !38
  %68 = getelementptr inbounds ptr, ptr %67, i64 %indvars.iv
  store ptr null, ptr %68, align 8, !tbaa !9
  %69 = load ptr, ptr %62, align 8, !tbaa !38
  %70 = getelementptr ptr, ptr %69, i64 %indvars.iv
  %71 = getelementptr i8, ptr %70, i64 -8
  store ptr null, ptr %71, align 8, !tbaa !9
  %72 = load ptr, ptr %62, align 8, !tbaa !38
  %73 = getelementptr ptr, ptr %72, i64 %indvars.iv
  %74 = getelementptr i8, ptr %73, i64 -16
  store ptr null, ptr %74, align 8, !tbaa !9
  %indvars.iv.next.2 = add nsw i64 %indvars.iv, -3
  %75 = load ptr, ptr %62, align 8, !tbaa !38
  %76 = getelementptr inbounds ptr, ptr %75, i64 %indvars.iv.next.2
  store ptr null, ptr %76, align 8, !tbaa !9
  %indvars.iv.next.3 = add nsw i64 %indvars.iv, -4
  %.not170.3 = icmp eq i64 %indvars.iv.next.2, 0
  br i1 %.not170.3, label %._crit_edge, label %.lr.ph, !llvm.loop !41

._crit_edge:                                      ; preds = %.lr.ph
  %.pr.pre = load ptr, ptr %62, align 8, !tbaa !38
  %77 = icmp eq ptr %.pr.pre, null
  br i1 %77, label %.thread, label %78

78:                                               ; preds = %._crit_edge
  %79 = tail call ptr @malloc(i64 noundef %60) #8
  %80 = getelementptr inbounds i8, ptr %23, i64 88
  store ptr %79, ptr %80, align 8, !tbaa !43
  %.not129 = icmp eq ptr %79, null
  br i1 %.not129, label %.thread, label %.lr.ph145.preheader

.lr.ph145.preheader:                              ; preds = %78
  %81 = tail call i32 @llvm.umax.i32(i32 %0, i32 6)
  %umax152 = zext nneg i32 %81 to i64
  %xtraiter175 = and i64 %64, 3
  %lcmp.mod176.not = icmp eq i64 %xtraiter175, 0
  br i1 %lcmp.mod176.not, label %.lr.ph145.preheader.new, label %.lr.ph145.prol

.lr.ph145.prol:                                   ; preds = %.lr.ph145.preheader, %.lr.ph145.prol
  %indvars.iv153.prol = phi i64 [ %indvars.iv.next154.prol, %.lr.ph145.prol ], [ %umax152, %.lr.ph145.preheader ]
  %prol.iter177 = phi i64 [ %prol.iter177.next, %.lr.ph145.prol ], [ 0, %.lr.ph145.preheader ]
  %82 = load ptr, ptr %80, align 8, !tbaa !43
  %83 = getelementptr inbounds ptr, ptr %82, i64 %indvars.iv153.prol
  store ptr null, ptr %83, align 8, !tbaa !9
  %indvars.iv.next154.prol = add nsw i64 %indvars.iv153.prol, -1
  %prol.iter177.next = add i64 %prol.iter177, 1
  %prol.iter177.cmp.not = icmp eq i64 %prol.iter177.next, %xtraiter175
  br i1 %prol.iter177.cmp.not, label %.lr.ph145.preheader.new, label %.lr.ph145.prol, !llvm.loop !44

.lr.ph145.preheader.new:                          ; preds = %.lr.ph145.preheader, %.lr.ph145.prol
  %indvars.iv153.unr = phi i64 [ %umax152, %.lr.ph145.preheader ], [ %indvars.iv.next154.prol, %.lr.ph145.prol ]
  br label %.lr.ph145

.lr.ph145:                                        ; preds = %.lr.ph145, %.lr.ph145.preheader.new
  %indvars.iv153 = phi i64 [ %indvars.iv153.unr, %.lr.ph145.preheader.new ], [ %indvars.iv.next154.3, %.lr.ph145 ]
  %84 = load ptr, ptr %80, align 8, !tbaa !43
  %85 = getelementptr inbounds ptr, ptr %84, i64 %indvars.iv153
  store ptr null, ptr %85, align 8, !tbaa !9
  %86 = load ptr, ptr %80, align 8, !tbaa !43
  %87 = getelementptr ptr, ptr %86, i64 %indvars.iv153
  %88 = getelementptr i8, ptr %87, i64 -8
  store ptr null, ptr %88, align 8, !tbaa !9
  %89 = load ptr, ptr %80, align 8, !tbaa !43
  %90 = getelementptr ptr, ptr %89, i64 %indvars.iv153
  %91 = getelementptr i8, ptr %90, i64 -16
  store ptr null, ptr %91, align 8, !tbaa !9
  %indvars.iv.next154.2 = add nsw i64 %indvars.iv153, -3
  %92 = load ptr, ptr %80, align 8, !tbaa !43
  %93 = getelementptr inbounds ptr, ptr %92, i64 %indvars.iv.next154.2
  store ptr null, ptr %93, align 8, !tbaa !9
  %indvars.iv.next154.3 = add nsw i64 %indvars.iv153, -4
  %.not171.3 = icmp eq i64 %indvars.iv.next154.2, 0
  br i1 %.not171.3, label %._crit_edge146, label %.lr.ph145, !llvm.loop !45

._crit_edge146:                                   ; preds = %.lr.ph145
  %.pr134.pre = load ptr, ptr %80, align 8, !tbaa !43
  %94 = icmp eq ptr %.pr134.pre, null
  br i1 %94, label %.thread, label %95

95:                                               ; preds = %._crit_edge146
  %96 = tail call ptr @malloc(i64 noundef %60) #8
  %97 = getelementptr inbounds i8, ptr %23, i64 96
  store ptr %96, ptr %97, align 8, !tbaa !46
  %.not130 = icmp eq ptr %96, null
  br i1 %.not130, label %.thread, label %.lr.ph148.preheader

.lr.ph148.preheader:                              ; preds = %95
  %98 = tail call i32 @llvm.umax.i32(i32 %0, i32 6)
  %umax155 = zext nneg i32 %98 to i64
  %xtraiter178 = and i64 %64, 3
  %lcmp.mod179.not = icmp eq i64 %xtraiter178, 0
  br i1 %lcmp.mod179.not, label %.lr.ph148.preheader.new, label %.lr.ph148.prol

.lr.ph148.prol:                                   ; preds = %.lr.ph148.preheader, %.lr.ph148.prol
  %indvars.iv156.prol = phi i64 [ %indvars.iv.next157.prol, %.lr.ph148.prol ], [ %umax155, %.lr.ph148.preheader ]
  %prol.iter180 = phi i64 [ %prol.iter180.next, %.lr.ph148.prol ], [ 0, %.lr.ph148.preheader ]
  %99 = load ptr, ptr %97, align 8, !tbaa !46
  %100 = getelementptr inbounds ptr, ptr %99, i64 %indvars.iv156.prol
  store ptr null, ptr %100, align 8, !tbaa !9
  %indvars.iv.next157.prol = add nsw i64 %indvars.iv156.prol, -1
  %prol.iter180.next = add i64 %prol.iter180, 1
  %prol.iter180.cmp.not = icmp eq i64 %prol.iter180.next, %xtraiter178
  br i1 %prol.iter180.cmp.not, label %.lr.ph148.preheader.new, label %.lr.ph148.prol, !llvm.loop !47

.lr.ph148.preheader.new:                          ; preds = %.lr.ph148.preheader, %.lr.ph148.prol
  %indvars.iv156.unr = phi i64 [ %umax155, %.lr.ph148.preheader ], [ %indvars.iv.next157.prol, %.lr.ph148.prol ]
  br label %.lr.ph148

.lr.ph148:                                        ; preds = %.lr.ph148, %.lr.ph148.preheader.new
  %indvars.iv156 = phi i64 [ %indvars.iv156.unr, %.lr.ph148.preheader.new ], [ %indvars.iv.next157.3, %.lr.ph148 ]
  %101 = load ptr, ptr %97, align 8, !tbaa !46
  %102 = getelementptr inbounds ptr, ptr %101, i64 %indvars.iv156
  store ptr null, ptr %102, align 8, !tbaa !9
  %103 = load ptr, ptr %97, align 8, !tbaa !46
  %104 = getelementptr ptr, ptr %103, i64 %indvars.iv156
  %105 = getelementptr i8, ptr %104, i64 -8
  store ptr null, ptr %105, align 8, !tbaa !9
  %106 = load ptr, ptr %97, align 8, !tbaa !46
  %107 = getelementptr ptr, ptr %106, i64 %indvars.iv156
  %108 = getelementptr i8, ptr %107, i64 -16
  store ptr null, ptr %108, align 8, !tbaa !9
  %indvars.iv.next157.2 = add nsw i64 %indvars.iv156, -3
  %109 = load ptr, ptr %97, align 8, !tbaa !46
  %110 = getelementptr inbounds ptr, ptr %109, i64 %indvars.iv.next157.2
  store ptr null, ptr %110, align 8, !tbaa !9
  %indvars.iv.next157.3 = add nsw i64 %indvars.iv156, -4
  %.not172.3 = icmp eq i64 %indvars.iv.next157.2, 0
  br i1 %.not172.3, label %._crit_edge149, label %.lr.ph148, !llvm.loop !48

._crit_edge149:                                   ; preds = %.lr.ph148
  %.pr137.pre = load ptr, ptr %97, align 8, !tbaa !46
  %111 = icmp eq ptr %.pr137.pre, null
  br i1 %111, label %.thread, label %112

112:                                              ; preds = %._crit_edge149
  %113 = shl i32 %22, 2
  %114 = zext i32 %113 to i64
  %115 = tail call ptr @malloc(i64 noundef %114) #8
  store ptr %115, ptr %46, align 8, !tbaa !49
  %116 = icmp eq ptr %115, null
  br i1 %116, label %.thread, label %117

117:                                              ; preds = %112
  %118 = tail call ptr @malloc(i64 noundef %114) #8
  store ptr %118, ptr %47, align 8, !tbaa !50
  %119 = icmp eq ptr %118, null
  br i1 %119, label %.thread, label %.preheader139.preheader

.preheader139.preheader:                          ; preds = %117
  %wide.trip.count = zext i32 %22 to i64
  %120 = zext nneg i32 %21 to i64
  %min.iters.check = icmp ult i32 %0, 8
  br i1 %min.iters.check, label %.preheader139.preheader174, label %vector.ph

vector.ph:                                        ; preds = %.preheader139.preheader
  %n.vec = and i64 %120, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %offset.idx = or disjoint i64 %index, 1
  %121 = getelementptr inbounds i32, ptr %118, i64 %offset.idx
  %122 = getelementptr inbounds i8, ptr %121, i64 16
  store <4 x i32> %vec.ind, ptr %121, align 4, !tbaa !5
  store <4 x i32> %step.add, ptr %122, align 4, !tbaa !5
  %123 = getelementptr inbounds i32, ptr %115, i64 %offset.idx
  %124 = getelementptr inbounds i8, ptr %123, i64 16
  store <4 x i32> %vec.ind, ptr %123, align 4, !tbaa !5
  store <4 x i32> %step.add, ptr %124, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %125 = icmp eq i64 %index.next, %n.vec
  br i1 %125, label %middle.block, label %vector.body, !llvm.loop !51

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %120
  br i1 %cmp.n, label %.loopexit, label %.preheader139.preheader174

.preheader139.preheader174:                       ; preds = %middle.block, %.preheader139.preheader
  %indvars.iv158.ph = phi i64 [ 1, %.preheader139.preheader ], [ %ind.end, %middle.block ]
  br label %.preheader139

.preheader139:                                    ; preds = %.preheader139.preheader174, %.preheader139
  %indvars.iv158 = phi i64 [ %indvars.iv.next159, %.preheader139 ], [ %indvars.iv158.ph, %.preheader139.preheader174 ]
  %126 = getelementptr inbounds i32, ptr %118, i64 %indvars.iv158
  %127 = trunc nuw nsw i64 %indvars.iv158 to i32
  store i32 %127, ptr %126, align 4, !tbaa !5
  %128 = getelementptr inbounds i32, ptr %115, i64 %indvars.iv158
  store i32 %127, ptr %128, align 4, !tbaa !5
  %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next159, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.preheader139, !llvm.loop !54

.loopexit:                                        ; preds = %.preheader139, %middle.block
  %129 = tail call ptr @malloc(i64 noundef %114) #8
  store ptr %129, ptr %44, align 8, !tbaa !55
  %130 = icmp eq ptr %129, null
  br i1 %130, label %.thread, label %131

131:                                              ; preds = %.loopexit
  %132 = tail call ptr @malloc(i64 noundef %114) #8
  store ptr %132, ptr %45, align 8, !tbaa !56
  %133 = icmp eq ptr %132, null
  br i1 %133, label %.thread, label %.preheader.preheader

.preheader.preheader:                             ; preds = %131
  %scevgep = getelementptr i8, ptr %129, i64 4
  %134 = tail call i32 @llvm.umax.i32(i32 %0, i32 6)
  %umax161 = zext nneg i32 %134 to i64
  %135 = shl nuw nsw i64 %umax161, 2
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i8 -1, i64 %135, i1 false), !tbaa !5
  %scevgep162 = getelementptr i8, ptr %132, i64 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep162, i8 -1, i64 %135, i1 false), !tbaa !5
  store i32 0, ptr %129, align 4, !tbaa !5
  store i32 0, ptr %132, align 4, !tbaa !5
  %136 = mul nuw nsw i32 %21, 6
  %137 = shl nsw i32 %21, 2
  tail call void @InitializeElementBlocks(ptr noundef nonnull %23, i32 noundef %136, i32 noundef %137)
  %138 = load i32, ptr %32, align 4, !tbaa !20
  %139 = icmp eq i32 %138, 5
  br i1 %139, label %.thread, label %140

.thread:                                          ; preds = %95, %78, %57, %.preheader.preheader, %131, %.loopexit, %117, %112, %._crit_edge149, %._crit_edge146, %._crit_edge, %26
  store i32 5, ptr %2, align 4, !tbaa !5
  tail call void @spDestroy(ptr noundef nonnull %23)
  br label %140

140:                                              ; preds = %.preheader.preheader, %.thread, %25
  %.0122 = phi ptr [ null, %25 ], [ null, %.thread ], [ %23, %.preheader.preheader ]
  ret ptr %.0122
}

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @RecordAllocation(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @InitializeElementBlocks(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @spDestroy(ptr noundef) local_unnamed_addr #0

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

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

attributes #0 = { 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 #1 = { nofree 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 #2 = { noreturn 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 #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { cold nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { allocsize(0) }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !14, i64 104}
!12 = !{!"MatrixFrame", !13, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !10, i64 24, !10, i64 32, !10, i64 40, !6, i64 48, !6, i64 52, !6, i64 56, !10, i64 64, !10, i64 72, !6, i64 80, !6, i64 84, !10, i64 88, !10, i64 96, !14, i64 104, !10, i64 112, !6, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !6, i64 168, !6, i64 172, !6, i64 176, !6, i64 180, !6, i64 184, !6, i64 188, !7, i64 192, !6, i64 196, !13, i64 200, !6, i64 208, !6, i64 212, !6, i64 216, !6, i64 220, !6, i64 224, !6, i64 228, !15, i64 232, !10, i64 272, !6, i64 280, !10, i64 288, !6, i64 296, !10, i64 304, !6, i64 312, !10, i64 320, !10, i64 328}
!13 = !{!"double", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"MatrixElement", !13, i64 0, !6, i64 8, !6, i64 12, !10, i64 16, !10, i64 24, !10, i64 32}
!16 = !{!12, !6, i64 16}
!17 = !{!12, !6, i64 196}
!18 = !{!12, !6, i64 80}
!19 = !{!12, !6, i64 48}
!20 = !{!12, !6, i64 52}
!21 = !{!12, !6, i64 84}
!22 = !{!12, !6, i64 172}
!23 = !{!12, !6, i64 176}
!24 = !{!12, !6, i64 180}
!25 = !{!12, !6, i64 120}
!26 = !{!12, !6, i64 228}
!27 = !{!12, !6, i64 8}
!28 = !{!12, !6, i64 56}
!29 = !{!12, !6, i64 12}
!30 = !{!12, !6, i64 20}
!31 = !{!12, !10, i64 112}
!32 = !{!12, !13, i64 200}
!33 = !{!12, !13, i64 0}
!34 = !{!12, !10, i64 272}
!35 = !{!12, !6, i64 280}
!36 = !{!12, !6, i64 296}
!37 = !{!12, !6, i64 312}
!38 = !{!12, !10, i64 24}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.unroll.disable"}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = !{!12, !10, i64 88}
!44 = distinct !{!44, !40}
!45 = distinct !{!45, !42}
!46 = !{!12, !10, i64 96}
!47 = distinct !{!47, !40}
!48 = distinct !{!48, !42}
!49 = !{!12, !10, i64 128}
!50 = !{!12, !10, i64 136}
!51 = distinct !{!51, !42, !52, !53}
!52 = !{!"llvm.loop.isvectorized", i32 1}
!53 = !{!"llvm.loop.unroll.runtime.disable"}
!54 = distinct !{!54, !42, !53, !52}
!55 = !{!12, !10, i64 64}
!56 = !{!12, !10, i64 72}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass