; LLVM IR from JoshuaSBrown/QC_Tools :: src/libcatnip/matrix.ll (ZN6catnip6Matrix6resizeEii)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.catnip::Matrix" = type { i32, i32, i32, ptr }

@.str.28 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [53 x i8], align 1

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

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

declare i32 @printf(ptr noundef, ...) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6catnip6Matrix6resizeEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, i32 noundef %2) #6 align 2 {
  %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 i32, align 4
  %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
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  %15 = load ptr, ptr %4, align 8
  %16 = load i32, ptr %5, align 4, !tbaa !9
  %17 = icmp slt i32 %16, 1
  br i1 %17, label %18, label %20

18:                                               ; preds = %3
  %19 = call i32 (ptr, ...) @printf(ptr noundef @.str.28)
  call void @exit(i32 noundef 1) #8
  unreachable

20:                                               ; preds = %3
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = icmp slt i32 %21, 1
  br i1 %22, label %23, label %25

23:                                               ; preds = %20
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str.29)
  call void @exit(i32 noundef 1) #8
  unreachable

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = mul nsw i32 %26, %27
  %29 = sext i32 %28 to i64
  %30 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %29, i64 8)
  %31 = extractvalue { i64, i1 } %30, 1
  %32 = extractvalue { i64, i1 } %30, 0
  %33 = select i1 %31, i64 -1, i64 %32
  %34 = call noalias noundef nonnull ptr @_Znam(i64 noundef %33) #10
  store ptr %34, ptr %7, align 8, !tbaa !5
  %35 = load i32, ptr %5, align 4, !tbaa !9
  %36 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 0
  %37 = load i32, ptr %36, align 8, !tbaa !11
  %38 = icmp sle i32 %35, %37
  br i1 %38, label %39, label %142

39:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %138, %39
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = load i32, ptr %5, align 4, !tbaa !9
  %43 = icmp sle i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %141

45:                                               ; preds = %40
  %46 = load i32, ptr %6, align 4, !tbaa !9
  %47 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 1
  %48 = load i32, ptr %47, align 4, !tbaa !13
  %49 = icmp sle i32 %46, %48
  br i1 %49, label %50, label %83

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %79, %50
  %52 = load i32, ptr %10, align 4, !tbaa !9
  %53 = load i32, ptr %6, align 4, !tbaa !9
  %54 = icmp sle i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  br label %82

56:                                               ; preds = %51
  %57 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 3
  %58 = load ptr, ptr %57, align 8, !tbaa !14
  %59 = load i32, ptr %8, align 4, !tbaa !9
  %60 = load i32, ptr %10, align 4, !tbaa !9
  %61 = call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %59, i32 noundef %60, i32 noundef 1)
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds double, ptr %58, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !15
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = load i32, ptr %8, align 4, !tbaa !9
  %67 = sub nsw i32 %66, 1
  %68 = load i32, ptr %6, align 4, !tbaa !9
  %69 = mul nsw i32 %67, %68
  %70 = mul nsw i32 %69, 1
  %71 = load i32, ptr %10, align 4, !tbaa !9
  %72 = sub nsw i32 %71, 1
  %73 = mul nsw i32 %72, 1
  %74 = add nsw i32 %70, %73
  %75 = add nsw i32 %74, 1
  %76 = sub nsw i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds double, ptr %65, i64 %77
  store double %64, ptr %78, align 8, !tbaa !15
  br label %79

79:                                               ; preds = %56
  %80 = load i32, ptr %10, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %10, align 4, !tbaa !9
  br label %51, !llvm.loop !17

82:                                               ; preds = %55
  br label %137

83:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %133, %83
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = load i32, ptr %6, align 4, !tbaa !9
  %87 = icmp sle i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  br label %136

89:                                               ; preds = %84
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 1
  %92 = load i32, ptr %91, align 4, !tbaa !13
  %93 = icmp sle i32 %90, %92
  br i1 %93, label %94, label %117

94:                                               ; preds = %89
  %95 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 3
  %96 = load ptr, ptr %95, align 8, !tbaa !14
  %97 = load i32, ptr %8, align 4, !tbaa !9
  %98 = load i32, ptr %11, align 4, !tbaa !9
  %99 = call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %97, i32 noundef %98, i32 noundef 1)
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds double, ptr %96, i64 %100
  %102 = load double, ptr %101, align 8, !tbaa !15
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = load i32, ptr %8, align 4, !tbaa !9
  %105 = sub nsw i32 %104, 1
  %106 = load i32, ptr %6, align 4, !tbaa !9
  %107 = mul nsw i32 %105, %106
  %108 = mul nsw i32 %107, 1
  %109 = load i32, ptr %11, align 4, !tbaa !9
  %110 = sub nsw i32 %109, 1
  %111 = mul nsw i32 %110, 1
  %112 = add nsw i32 %108, %111
  %113 = add nsw i32 %112, 1
  %114 = sub nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds double, ptr %103, i64 %115
  store double %102, ptr %116, align 8, !tbaa !15
  br label %132

117:                                              ; preds = %89
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load i32, ptr %8, align 4, !tbaa !9
  %120 = sub nsw i32 %119, 1
  %121 = load i32, ptr %6, align 4, !tbaa !9
  %122 = mul nsw i32 %120, %121
  %123 = mul nsw i32 %122, 1
  %124 = load i32, ptr %11, align 4, !tbaa !9
  %125 = sub nsw i32 %124, 1
  %126 = mul nsw i32 %125, 1
  %127 = add nsw i32 %123, %126
  %128 = add nsw i32 %127, 1
  %129 = sub nsw i32 %128, 1
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds double, ptr %118, i64 %130
  store double 0.000000e+00, ptr %131, align 8, !tbaa !15
  br label %132

132:                                              ; preds = %117, %94
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %11, align 4, !tbaa !9
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %11, align 4, !tbaa !9
  br label %84, !llvm.loop !19

136:                                              ; preds = %88
  br label %137

137:                                              ; preds = %136, %82
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %8, align 4, !tbaa !9
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %8, align 4, !tbaa !9
  br label %40, !llvm.loop !20

141:                                              ; preds = %44
  br label %271

142:                                              ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %143

143:                                              ; preds = %267, %142
  %144 = load i32, ptr %12, align 4, !tbaa !9
  %145 = load i32, ptr %5, align 4, !tbaa !9
  %146 = icmp sle i32 %144, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %143
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %270

148:                                              ; preds = %143
  %149 = load i32, ptr %6, align 4, !tbaa !9
  %150 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 1
  %151 = load i32, ptr %150, align 4, !tbaa !13
  %152 = icmp sle i32 %149, %151
  br i1 %152, label %153, label %207

153:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %154

154:                                              ; preds = %203, %153
  %155 = load i32, ptr %13, align 4, !tbaa !9
  %156 = load i32, ptr %6, align 4, !tbaa !9
  %157 = icmp sle i32 %155, %156
  br i1 %157, label %159, label %158

158:                                              ; preds = %154
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %206

159:                                              ; preds = %154
  %160 = load i32, ptr %12, align 4, !tbaa !9
  %161 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 0
  %162 = load i32, ptr %161, align 8, !tbaa !11
  %163 = icmp sle i32 %160, %162
  br i1 %163, label %164, label %187

164:                                              ; preds = %159
  %165 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 3
  %166 = load ptr, ptr %165, align 8, !tbaa !14
  %167 = load i32, ptr %12, align 4, !tbaa !9
  %168 = load i32, ptr %13, align 4, !tbaa !9
  %169 = call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %167, i32 noundef %168, i32 noundef 1)
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds double, ptr %166, i64 %170
  %172 = load double, ptr %171, align 8, !tbaa !15
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  %174 = load i32, ptr %12, align 4, !tbaa !9
  %175 = sub nsw i32 %174, 1
  %176 = load i32, ptr %6, align 4, !tbaa !9
  %177 = mul nsw i32 %175, %176
  %178 = mul nsw i32 %177, 1
  %179 = load i32, ptr %13, align 4, !tbaa !9
  %180 = sub nsw i32 %179, 1
  %181 = mul nsw i32 %180, 1
  %182 = add nsw i32 %178, %181
  %183 = add nsw i32 %182, 1
  %184 = sub nsw i32 %183, 1
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds double, ptr %173, i64 %185
  store double %172, ptr %186, align 8, !tbaa !15
  br label %202

187:                                              ; preds = %159
  %188 = load ptr, ptr %7, align 8, !tbaa !5
  %189 = load i32, ptr %12, align 4, !tbaa !9
  %190 = sub nsw i32 %189, 1
  %191 = load i32, ptr %6, align 4, !tbaa !9
  %192 = mul nsw i32 %190, %191
  %193 = mul nsw i32 %192, 1
  %194 = load i32, ptr %13, align 4, !tbaa !9
  %195 = sub nsw i32 %194, 1
  %196 = mul nsw i32 %195, 1
  %197 = add nsw i32 %193, %196
  %198 = add nsw i32 %197, 1
  %199 = sub nsw i32 %198, 1
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds double, ptr %188, i64 %200
  store double 0.000000e+00, ptr %201, align 8, !tbaa !15
  br label %202

202:                                              ; preds = %187, %164
  br label %203

203:                                              ; preds = %202
  %204 = load i32, ptr %13, align 4, !tbaa !9
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %13, align 4, !tbaa !9
  br label %154, !llvm.loop !21

206:                                              ; preds = %158
  br label %266

207:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %208

208:                                              ; preds = %262, %207
  %209 = load i32, ptr %14, align 4, !tbaa !9
  %210 = load i32, ptr %6, align 4, !tbaa !9
  %211 = icmp sle i32 %209, %210
  br i1 %211, label %213, label %212

212:                                              ; preds = %208
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  br label %265

213:                                              ; preds = %208
  %214 = load i32, ptr %12, align 4, !tbaa !9
  %215 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 0
  %216 = load i32, ptr %215, align 8, !tbaa !11
  %217 = icmp sle i32 %214, %216
  br i1 %217, label %218, label %246

218:                                              ; preds = %213
  %219 = load i32, ptr %14, align 4, !tbaa !9
  %220 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 1
  %221 = load i32, ptr %220, align 4, !tbaa !13
  %222 = icmp sle i32 %219, %221
  br i1 %222, label %223, label %246

223:                                              ; preds = %218
  %224 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 3
  %225 = load ptr, ptr %224, align 8, !tbaa !14
  %226 = load i32, ptr %12, align 4, !tbaa !9
  %227 = load i32, ptr %14, align 4, !tbaa !9
  %228 = call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %226, i32 noundef %227, i32 noundef 1)
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds double, ptr %225, i64 %229
  %231 = load double, ptr %230, align 8, !tbaa !15
  %232 = load ptr, ptr %7, align 8, !tbaa !5
  %233 = load i32, ptr %12, align 4, !tbaa !9
  %234 = sub nsw i32 %233, 1
  %235 = load i32, ptr %6, align 4, !tbaa !9
  %236 = mul nsw i32 %234, %235
  %237 = mul nsw i32 %236, 1
  %238 = load i32, ptr %14, align 4, !tbaa !9
  %239 = sub nsw i32 %238, 1
  %240 = mul nsw i32 %239, 1
  %241 = add nsw i32 %237, %240
  %242 = add nsw i32 %241, 1
  %243 = sub nsw i32 %242, 1
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds double, ptr %232, i64 %244
  store double %231, ptr %245, align 8, !tbaa !15
  br label %261

246:                                              ; preds = %218, %213
  %247 = load ptr, ptr %7, align 8, !tbaa !5
  %248 = load i32, ptr %12, align 4, !tbaa !9
  %249 = sub nsw i32 %248, 1
  %250 = load i32, ptr %6, align 4, !tbaa !9
  %251 = mul nsw i32 %249, %250
  %252 = mul nsw i32 %251, 1
  %253 = load i32, ptr %14, align 4, !tbaa !9
  %254 = sub nsw i32 %253, 1
  %255 = mul nsw i32 %254, 1
  %256 = add nsw i32 %252, %255
  %257 = add nsw i32 %256, 1
  %258 = sub nsw i32 %257, 1
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds double, ptr %247, i64 %259
  store double 0.000000e+00, ptr %260, align 8, !tbaa !15
  br label %261

261:                                              ; preds = %246, %223
  br label %262

262:                                              ; preds = %261
  %263 = load i32, ptr %14, align 4, !tbaa !9
  %264 = add nsw i32 %263, 1
  store i32 %264, ptr %14, align 4, !tbaa !9
  br label %208, !llvm.loop !22

265:                                              ; preds = %212
  br label %266

266:                                              ; preds = %265, %206
  br label %267

267:                                              ; preds = %266
  %268 = load i32, ptr %12, align 4, !tbaa !9
  %269 = add nsw i32 %268, 1
  store i32 %269, ptr %12, align 4, !tbaa !9
  br label %143, !llvm.loop !23

270:                                              ; preds = %147
  br label %271

271:                                              ; preds = %270, %141
  %272 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 3
  %273 = load ptr, ptr %272, align 8, !tbaa !14
  %274 = icmp eq ptr %273, null
  br i1 %274, label %276, label %275

275:                                              ; preds = %271
  call void @_ZdlPvm(ptr noundef %273, i64 noundef 8) #11
  br label %276

276:                                              ; preds = %275, %271
  %277 = load i32, ptr %5, align 4, !tbaa !9
  %278 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 0
  store i32 %277, ptr %278, align 8, !tbaa !11
  %279 = load i32, ptr %6, align 4, !tbaa !9
  %280 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 1
  store i32 %279, ptr %280, align 4, !tbaa !13
  %281 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 2
  store i32 1, ptr %281, align 8, !tbaa !24
  %282 = load ptr, ptr %7, align 8, !tbaa !5
  %283 = getelementptr inbounds %"class.catnip::Matrix", ptr %15, i32 0, i32 3
  store ptr %282, ptr %283, align 8, !tbaa !14
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  ret i32 0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, i32 noundef) #7 align 2

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 = { 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 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin nounwind }

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

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


; 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.28 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [53 x i8], align 1

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6catnip6Matrix6resizeEii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #4 align 2 {
  %4 = icmp slt i32 %1, 1
  br i1 %4, label %5, label %7

5:                                                ; preds = %3
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28)
  tail call void @exit(i32 noundef 1) #6
  unreachable

7:                                                ; preds = %3
  %8 = icmp slt i32 %2, 1
  br i1 %8, label %9, label %11

9:                                                ; preds = %7
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29)
  tail call void @exit(i32 noundef 1) #6
  unreachable

11:                                               ; preds = %7
  %12 = mul nuw nsw i32 %2, %1
  %13 = zext nneg i32 %12 to i64
  %14 = shl nuw nsw i64 %13, 3
  %15 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %14) #7
  %16 = load i32, ptr %0, align 8, !tbaa !5
  %.not = icmp slt i32 %16, %1
  %17 = getelementptr inbounds i8, ptr %0, i64 4
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = add nuw i32 %2, 1
  %wide.trip.count139 = zext i32 %19 to i64
  %wide.trip.count144 = zext i32 %19 to i64
  br i1 %.not, label %.lr.ph122, label %.lr.ph106.split.split

.lr.ph122:                                        ; preds = %11
  %wide.trip.count149 = zext i32 %19 to i64
  %20 = add nsw i64 %wide.trip.count139, -2
  %21 = zext nneg i32 %2 to i64
  %22 = zext nneg i32 %2 to i64
  %min.iters.check = icmp ult i32 %2, 8
  %23 = trunc i64 %20 to i32
  %24 = icmp ugt i64 %20, 4294967295
  %n.vec = and i64 %21, 2147483644
  %ind.end = or disjoint i64 %n.vec, 1
  %cmp.n = icmp eq i64 %n.vec, %21
  br label %54

.lr.ph106.split.split:                            ; preds = %11, %..loopexit93_crit_edge
  %.072104 = phi i32 [ %53, %..loopexit93_crit_edge ], [ 1, %11 ]
  %25 = load i32, ptr %17, align 4, !tbaa !11
  %.not84 = icmp slt i32 %25, %2
  %26 = add nsw i32 %.072104, -1
  %27 = mul nsw i32 %26, %2
  %28 = add i32 %27, -1
  br i1 %.not84, label %.preheader92, label %.preheader94

.preheader94:                                     ; preds = %.lr.ph106.split.split, %.preheader94
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader94 ], [ 1, %.lr.ph106.split.split ]
  %29 = load ptr, ptr %18, align 8, !tbaa !12
  %30 = trunc nuw nsw i64 %indvars.iv to i32
  %31 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.072104, i32 noundef %30, i32 noundef 1)
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds double, ptr %29, i64 %32
  %34 = load double, ptr %33, align 8, !tbaa !13
  %35 = add i32 %28, %30
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds double, ptr %15, i64 %36
  store double %34, ptr %37, align 8, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count139
  br i1 %exitcond.not, label %..loopexit93_crit_edge, label %.preheader94, !llvm.loop !15

.preheader92:                                     ; preds = %.lr.ph106.split.split, %49
  %indvars.iv130 = phi i64 [ %indvars.iv.next131, %49 ], [ 1, %.lr.ph106.split.split ]
  %38 = load i32, ptr %17, align 4, !tbaa !11
  %39 = sext i32 %38 to i64
  %.not86 = icmp sgt i64 %indvars.iv130, %39
  br i1 %.not86, label %47, label %40

40:                                               ; preds = %.preheader92
  %41 = load ptr, ptr %18, align 8, !tbaa !12
  %42 = trunc nuw nsw i64 %indvars.iv130 to i32
  %43 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.072104, i32 noundef %42, i32 noundef 1)
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds double, ptr %41, i64 %44
  %46 = load double, ptr %45, align 8, !tbaa !13
  br label %49

47:                                               ; preds = %.preheader92
  %48 = trunc nuw nsw i64 %indvars.iv130 to i32
  br label %49

49:                                               ; preds = %40, %47
  %.sink159 = phi i32 [ %42, %40 ], [ %48, %47 ]
  %.sink = phi double [ %46, %40 ], [ 0.000000e+00, %47 ]
  %50 = add i32 %28, %.sink159
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds double, ptr %15, i64 %51
  store double %.sink, ptr %52, align 8, !tbaa !13
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %exitcond134.not = icmp eq i64 %indvars.iv.next131, %wide.trip.count144
  br i1 %exitcond134.not, label %..loopexit93_crit_edge, label %.preheader92, !llvm.loop !17

..loopexit93_crit_edge:                           ; preds = %.preheader94, %49
  %53 = add nuw i32 %.072104, 1
  %exitcond135.not = icmp eq i32 %.072104, %1
  br i1 %exitcond135.not, label %.loopexit91, label %.lr.ph106.split.split, !llvm.loop !18

54:                                               ; preds = %.lr.ph122, %.loopexit
  %indvar = phi i32 [ 0, %.lr.ph122 ], [ %indvar.next, %.loopexit ]
  %.069119 = phi i32 [ 1, %.lr.ph122 ], [ %127, %.loopexit ]
  %55 = mul i32 %indvar, %2
  %56 = load i32, ptr %17, align 4, !tbaa !11
  %.not77 = icmp slt i32 %56, %2
  %57 = add nsw i32 %.069119, -1
  %58 = mul nsw i32 %57, %2
  %59 = add i32 %58, -1
  br i1 %.not77, label %.lr.ph117, label %.lr.ph

.lr.ph:                                           ; preds = %54
  %60 = load i32, ptr %0, align 8, !tbaa !5
  %61 = icmp sgt i32 %.069119, %60
  br i1 %61, label %.lr.ph.split.us.preheader, label %.lr.ph.split

.lr.ph.split.us.preheader:                        ; preds = %.lr.ph
  br i1 %min.iters.check, label %.lr.ph.split.us.preheader174, label %vector.scevcheck

vector.scevcheck:                                 ; preds = %.lr.ph.split.us.preheader
  %62 = add i32 %55, %23
  %63 = icmp slt i32 %62, %55
  %64 = or i1 %63, %24
  br i1 %64, label %.lr.ph.split.us.preheader174, label %vector.body

vector.body:                                      ; preds = %vector.scevcheck, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.scevcheck ]
  %65 = trunc i64 %index to i32
  %66 = or disjoint i32 %65, 1
  %67 = add i32 %59, %66
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds double, ptr %15, i64 %68
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  store <2 x double> zeroinitializer, ptr %69, align 8, !tbaa !13
  store <2 x double> zeroinitializer, ptr %70, align 8, !tbaa !13
  %index.next = add nuw i64 %index, 4
  %71 = icmp eq i64 %index.next, %n.vec
  br i1 %71, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %.loopexit, label %.lr.ph.split.us.preheader174

.lr.ph.split.us.preheader174:                     ; preds = %middle.block, %vector.scevcheck, %.lr.ph.split.us.preheader
  %indvars.iv141.ph = phi i64 [ 1, %vector.scevcheck ], [ 1, %.lr.ph.split.us.preheader ], [ %ind.end, %middle.block ]
  %72 = sub nsw i64 %wide.trip.count139, %indvars.iv141.ph
  %73 = sub nsw i64 %22, %indvars.iv141.ph
  %xtraiter = and i64 %72, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.split.us.prol.loopexit, label %.lr.ph.split.us.prol

.lr.ph.split.us.prol:                             ; preds = %.lr.ph.split.us.preheader174, %.lr.ph.split.us.prol
  %indvars.iv141.prol = phi i64 [ %indvars.iv.next142.prol, %.lr.ph.split.us.prol ], [ %indvars.iv141.ph, %.lr.ph.split.us.preheader174 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.split.us.prol ], [ 0, %.lr.ph.split.us.preheader174 ]
  %74 = trunc nuw nsw i64 %indvars.iv141.prol to i32
  %75 = add i32 %59, %74
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds double, ptr %15, i64 %76
  store double 0.000000e+00, ptr %77, align 8, !tbaa !13
  %indvars.iv.next142.prol = add nuw nsw i64 %indvars.iv141.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.split.us.prol.loopexit, label %.lr.ph.split.us.prol, !llvm.loop !22

.lr.ph.split.us.prol.loopexit:                    ; preds = %.lr.ph.split.us.prol, %.lr.ph.split.us.preheader174
  %indvars.iv141.unr = phi i64 [ %indvars.iv141.ph, %.lr.ph.split.us.preheader174 ], [ %indvars.iv.next142.prol, %.lr.ph.split.us.prol ]
  %78 = icmp ult i64 %73, 3
  br i1 %78, label %.loopexit, label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph.split.us.prol.loopexit, %.lr.ph.split.us
  %indvars.iv141 = phi i64 [ %indvars.iv.next142.3, %.lr.ph.split.us ], [ %indvars.iv141.unr, %.lr.ph.split.us.prol.loopexit ]
  %79 = trunc nuw nsw i64 %indvars.iv141 to i32
  %80 = add i32 %59, %79
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds double, ptr %15, i64 %81
  store double 0.000000e+00, ptr %82, align 8, !tbaa !13
  %83 = trunc i64 %indvars.iv141 to i32
  %84 = add i32 %58, %83
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds double, ptr %15, i64 %85
  store double 0.000000e+00, ptr %86, align 8, !tbaa !13
  %87 = trunc i64 %indvars.iv141 to i32
  %88 = add i32 %87, 2
  %89 = add i32 %59, %88
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds double, ptr %15, i64 %90
  store double 0.000000e+00, ptr %91, align 8, !tbaa !13
  %92 = trunc i64 %indvars.iv141 to i32
  %93 = add i32 %92, 3
  %94 = add i32 %59, %93
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds double, ptr %15, i64 %95
  store double 0.000000e+00, ptr %96, align 8, !tbaa !13
  %indvars.iv.next142.3 = add nuw nsw i64 %indvars.iv141, 4
  %exitcond145.not.3 = icmp eq i64 %indvars.iv.next142.3, %wide.trip.count144
  br i1 %exitcond145.not.3, label %.loopexit, label %.lr.ph.split.us, !llvm.loop !24

.lr.ph.split:                                     ; preds = %.lr.ph, %107
  %indvars.iv136 = phi i64 [ %indvars.iv.next137, %107 ], [ 1, %.lr.ph ]
  %97 = load i32, ptr %0, align 8, !tbaa !5
  %.not82 = icmp sgt i32 %.069119, %97
  br i1 %.not82, label %105, label %98

98:                                               ; preds = %.lr.ph.split
  %99 = load ptr, ptr %18, align 8, !tbaa !12
  %100 = trunc nuw nsw i64 %indvars.iv136 to i32
  %101 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.069119, i32 noundef %100, i32 noundef 1)
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds double, ptr %99, i64 %102
  %104 = load double, ptr %103, align 8, !tbaa !13
  br label %107

105:                                              ; preds = %.lr.ph.split
  %106 = trunc nuw nsw i64 %indvars.iv136 to i32
  br label %107

107:                                              ; preds = %98, %105
  %.sink164 = phi i32 [ %100, %98 ], [ %106, %105 ]
  %.sink160 = phi double [ %104, %98 ], [ 0.000000e+00, %105 ]
  %108 = add i32 %59, %.sink164
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds double, ptr %15, i64 %109
  store double %.sink160, ptr %110, align 8, !tbaa !13
  %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
  %exitcond140.not = icmp eq i64 %indvars.iv.next137, %wide.trip.count139
  br i1 %exitcond140.not, label %.loopexit, label %.lr.ph.split, !llvm.loop !25

.lr.ph117:                                        ; preds = %54, %123
  %indvars.iv146 = phi i64 [ %indvars.iv.next147, %123 ], [ 1, %54 ]
  %111 = load i32, ptr %0, align 8, !tbaa !5
  %.not79 = icmp sgt i32 %.069119, %111
  %112 = load i32, ptr %17, align 4
  %113 = sext i32 %112 to i64
  %.not80 = icmp sgt i64 %indvars.iv146, %113
  %or.cond = select i1 %.not79, i1 true, i1 %.not80
  br i1 %or.cond, label %121, label %114

114:                                              ; preds = %.lr.ph117
  %115 = load ptr, ptr %18, align 8, !tbaa !12
  %116 = trunc nuw nsw i64 %indvars.iv146 to i32
  %117 = tail call noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.069119, i32 noundef %116, i32 noundef 1)
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds double, ptr %115, i64 %118
  %120 = load double, ptr %119, align 8, !tbaa !13
  br label %123

121:                                              ; preds = %.lr.ph117
  %122 = trunc nuw nsw i64 %indvars.iv146 to i32
  br label %123

123:                                              ; preds = %114, %121
  %.sink169 = phi i32 [ %116, %114 ], [ %122, %121 ]
  %.sink165 = phi double [ %120, %114 ], [ 0.000000e+00, %121 ]
  %124 = add i32 %59, %.sink169
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds double, ptr %15, i64 %125
  store double %.sink165, ptr %126, align 8, !tbaa !13
  %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
  %exitcond150.not = icmp eq i64 %indvars.iv.next147, %wide.trip.count149
  br i1 %exitcond150.not, label %.loopexit, label %.lr.ph117, !llvm.loop !27

.loopexit:                                        ; preds = %107, %.lr.ph.split.us.prol.loopexit, %.lr.ph.split.us, %123, %middle.block
  %127 = add nuw i32 %.069119, 1
  %exitcond151.not = icmp eq i32 %.069119, %1
  %indvar.next = add i32 %indvar, 1
  br i1 %exitcond151.not, label %.loopexit91, label %54, !llvm.loop !28

.loopexit91:                                      ; preds = %..loopexit93_crit_edge, %.loopexit
  %128 = getelementptr inbounds i8, ptr %0, i64 16
  %129 = load ptr, ptr %128, align 8, !tbaa !12
  %130 = icmp eq ptr %129, null
  br i1 %130, label %132, label %131

131:                                              ; preds = %.loopexit91
  tail call void @_ZdlPvm(ptr noundef nonnull %129, i64 noundef 8) #8
  br label %132

132:                                              ; preds = %131, %.loopexit91
  store i32 %1, ptr %0, align 8, !tbaa !5
  %133 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %2, ptr %133, align 4, !tbaa !11
  %134 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 1, ptr %134, align 8, !tbaa !29
  store ptr %15, ptr %128, align 8, !tbaa !12
  ret i32 0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6catnip6Matrix5indexEiii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5 align 2

attributes #0 = { 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 #1 = { 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 #2 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN6catnip6MatrixE", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !10, i64 16}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.unroll.disable"}
!24 = distinct !{!24, !16, !20}
!25 = distinct !{!25, !16, !26}
!26 = !{!"llvm.loop.unswitch.partial.disable"}
!27 = distinct !{!27, !16}
!28 = distinct !{!28, !16}
!29 = !{!6, !7, i64 8}


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