; LLVM IR from HRI-EU/Rcs :: external (Rcs_thirdPartyMath)

; 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._MatNd = type { ptr, i32, i32, i32, i8 }

@.str = external hidden unnamed_addr constant [74 x i8], align 1
@stderr = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [59 x i8], align 1
@__func__.MatNd_gaussInverse = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@Rcs_calloc = external global ptr, align 8

; 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

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

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

declare void @print_trace() #3

; Function Attrs: nounwind uwtable
define dso_local double @MatNd_gaussInverse(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca double, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca i32, align 4
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %2
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._MatNd, ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 8, !tbaa !9
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._MatNd, ptr %28, i32 0, i32 2
  %30 = load i32, ptr %29, align 4, !tbaa !13
  %31 = icmp ne i32 %27, %30
  br i1 %31, label %32, label %43

32:                                               ; preds = %24
  %33 = load ptr, ptr @stderr, align 8, !tbaa !5
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._MatNd, ptr %34, i32 0, i32 1
  %36 = load i32, ptr %35, align 8, !tbaa !9
  %37 = uitofp i32 %36 to double
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._MatNd, ptr %38, i32 0, i32 2
  %40 = load i32, ptr %39, align 4, !tbaa !13
  %41 = uitofp i32 %40 to double
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef @.str.7, ptr noundef @.str, ptr noundef @__func__.MatNd_gaussInverse, i32 noundef 297, ptr noundef @.str.8, double noundef %37, ptr noundef @.str.9, double noundef %41) #7
  call void @print_trace()
  call void @exit(i32 noundef 1) #8
  unreachable

43:                                               ; preds = %24
  br label %44

44:                                               ; preds = %43
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._MatNd, ptr %45, i32 0, i32 1
  %47 = load i32, ptr %46, align 8, !tbaa !9
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %44
  store double 1.000000e+00, ptr %3, align 8
  br label %390

50:                                               ; preds = %44
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = icmp ne ptr %51, %52
  br i1 %53, label %54, label %57

54:                                               ; preds = %50
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  call void @MatNd_copy(ptr noundef %55, ptr noundef %56)
  br label %57

57:                                               ; preds = %54, %50
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #7
  store i8 0, ptr %6, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store double 1.000000e+00, ptr %7, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._MatNd, ptr %58, i32 0, i32 1
  %60 = load i32, ptr %59, align 8, !tbaa !9
  store i32 %60, ptr %8, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store ptr null, ptr %11, align 8, !tbaa !5
  %61 = load i32, ptr %8, align 4, !tbaa !17
  %62 = icmp sgt i32 %61, 36
  br i1 %62, label %63, label %76

63:                                               ; preds = %57
  %64 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %65 = load i32, ptr %8, align 4, !tbaa !17
  %66 = sext i32 %65 to i64
  %67 = call ptr %64(i64 noundef %66, i64 noundef 4)
  store ptr %67, ptr %9, align 8, !tbaa !5
  %68 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %69 = load i32, ptr %8, align 4, !tbaa !17
  %70 = sext i32 %69 to i64
  %71 = call ptr %68(i64 noundef %70, i64 noundef 4)
  store ptr %71, ptr %10, align 8, !tbaa !5
  %72 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %73 = load i32, ptr %8, align 4, !tbaa !17
  %74 = sext i32 %73 to i64
  %75 = call ptr %72(i64 noundef %74, i64 noundef 4)
  store ptr %75, ptr %11, align 8, !tbaa !5
  br label %89

76:                                               ; preds = %57
  %77 = load i32, ptr %8, align 4, !tbaa !17
  %78 = sext i32 %77 to i64
  %79 = mul i64 %78, 4
  %80 = alloca i8, i64 %79, align 16
  store ptr %80, ptr %9, align 8, !tbaa !5
  %81 = load i32, ptr %8, align 4, !tbaa !17
  %82 = sext i32 %81 to i64
  %83 = mul i64 %82, 4
  %84 = alloca i8, i64 %83, align 16
  store ptr %84, ptr %10, align 8, !tbaa !5
  %85 = load i32, ptr %8, align 4, !tbaa !17
  %86 = sext i32 %85 to i64
  %87 = mul i64 %86, 4
  %88 = alloca i8, i64 %87, align 16
  store ptr %88, ptr %11, align 8, !tbaa !5
  br label %89

89:                                               ; preds = %76, %63
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = load i32, ptr %8, align 4, !tbaa !17
  %92 = sext i32 %91 to i64
  %93 = mul i64 %92, 4
  call void @llvm.memset.p0.i64(ptr align 4 %90, i8 0, i64 %93, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !17
  br label %94

94:                                               ; preds = %324, %89
  %95 = load i32, ptr %16, align 4, !tbaa !17
  %96 = load i32, ptr %8, align 4, !tbaa !17
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 4, ptr %17, align 4
  br label %327

99:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store double 0.000000e+00, ptr %18, align 8, !tbaa !15
  store i32 0, ptr %12, align 4, !tbaa !17
  br label %100

100:                                              ; preds = %152, %99
  %101 = load i32, ptr %12, align 4, !tbaa !17
  %102 = load i32, ptr %8, align 4, !tbaa !17
  %103 = icmp slt i32 %101, %102
  br i1 %103, label %104, label %155

104:                                              ; preds = %100
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = load i32, ptr %12, align 4, !tbaa !17
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i32, ptr %105, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !17
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %151, label %111

111:                                              ; preds = %104
  store i32 0, ptr %13, align 4, !tbaa !17
  br label %112

112:                                              ; preds = %147, %111
  %113 = load i32, ptr %13, align 4, !tbaa !17
  %114 = load i32, ptr %8, align 4, !tbaa !17
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %116, label %150

116:                                              ; preds = %112
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = load i32, ptr %13, align 4, !tbaa !17
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i32, ptr %117, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !17
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %146, label %123

123:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._MatNd, ptr %124, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8, !tbaa !18
  %127 = load i32, ptr %12, align 4, !tbaa !17
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._MatNd, ptr %128, i32 0, i32 2
  %130 = load i32, ptr %129, align 4, !tbaa !13
  %131 = mul i32 %127, %130
  %132 = load i32, ptr %13, align 4, !tbaa !17
  %133 = add i32 %131, %132
  %134 = zext i32 %133 to i64
  %135 = getelementptr inbounds double, ptr %126, i64 %134
  %136 = load double, ptr %135, align 8, !tbaa !15
  %137 = call double @llvm.fabs.f64(double %136)
  store double %137, ptr %19, align 8, !tbaa !15
  %138 = load double, ptr %19, align 8, !tbaa !15
  %139 = load double, ptr %18, align 8, !tbaa !15
  %140 = fcmp ogt double %138, %139
  br i1 %140, label %141, label %145

141:                                              ; preds = %123
  %142 = load double, ptr %19, align 8, !tbaa !15
  store double %142, ptr %18, align 8, !tbaa !15
  %143 = load i32, ptr %12, align 4, !tbaa !17
  store i32 %143, ptr %14, align 4, !tbaa !17
  %144 = load i32, ptr %13, align 4, !tbaa !17
  store i32 %144, ptr %15, align 4, !tbaa !17
  br label %145

145:                                              ; preds = %141, %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %146

146:                                              ; preds = %145, %116
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %13, align 4, !tbaa !17
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %13, align 4, !tbaa !17
  br label %112, !llvm.loop !19

150:                                              ; preds = %112
  br label %151

151:                                              ; preds = %150, %104
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %12, align 4, !tbaa !17
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %12, align 4, !tbaa !17
  br label %100, !llvm.loop !21

155:                                              ; preds = %100
  %156 = load double, ptr %18, align 8, !tbaa !15
  %157 = fcmp oeq double %156, 0.000000e+00
  br i1 %157, label %158, label %167

158:                                              ; preds = %155
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  call void @MatNd_setZero(ptr noundef %159)
  %160 = load i32, ptr %8, align 4, !tbaa !17
  %161 = icmp sgt i32 %160, 36
  br i1 %161, label %162, label %166

162:                                              ; preds = %158
  %163 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %163) #7
  %164 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %164) #7
  %165 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %165) #7
  br label %166

166:                                              ; preds = %162, %158
  store double 0.000000e+00, ptr %3, align 8
  store i32 1, ptr %17, align 4
  br label %321

167:                                              ; preds = %155
  %168 = load ptr, ptr %11, align 8, !tbaa !5
  %169 = load i32, ptr %15, align 4, !tbaa !17
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds i32, ptr %168, i64 %170
  store i32 1, ptr %171, align 4, !tbaa !17
  %172 = load i32, ptr %14, align 4, !tbaa !17
  %173 = load i32, ptr %15, align 4, !tbaa !17
  %174 = icmp ne i32 %172, %173
  br i1 %174, label %175, label %195

175:                                              ; preds = %167
  %176 = load i8, ptr %6, align 1, !tbaa !14, !range !22, !noundef !23
  %177 = trunc i8 %176 to i1
  %178 = xor i1 %177, true
  %179 = zext i1 %178 to i8
  store i8 %179, ptr %6, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !17
  br label %180

180:                                              ; preds = %191, %175
  %181 = load i32, ptr %20, align 4, !tbaa !17
  %182 = load i32, ptr %8, align 4, !tbaa !17
  %183 = icmp slt i32 %181, %182
  br i1 %183, label %185, label %184

184:                                              ; preds = %180
  store i32 13, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %194

185:                                              ; preds = %180
  %186 = load ptr, ptr %4, align 8, !tbaa !5
  %187 = load i32, ptr %14, align 4, !tbaa !17
  %188 = load i32, ptr %20, align 4, !tbaa !17
  %189 = load i32, ptr %15, align 4, !tbaa !17
  %190 = load i32, ptr %20, align 4, !tbaa !17
  call void @MatNd_swapElements(ptr noundef %186, i32 noundef %187, i32 noundef %188, i32 noundef %189, i32 noundef %190)
  br label %191

191:                                              ; preds = %185
  %192 = load i32, ptr %20, align 4, !tbaa !17
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %20, align 4, !tbaa !17
  br label %180, !llvm.loop !24

194:                                              ; preds = %184
  br label %195

195:                                              ; preds = %194, %167
  %196 = load i32, ptr %14, align 4, !tbaa !17
  %197 = load ptr, ptr %10, align 8, !tbaa !5
  %198 = load i32, ptr %16, align 4, !tbaa !17
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds i32, ptr %197, i64 %199
  store i32 %196, ptr %200, align 4, !tbaa !17
  %201 = load i32, ptr %15, align 4, !tbaa !17
  %202 = load ptr, ptr %9, align 8, !tbaa !5
  %203 = load i32, ptr %16, align 4, !tbaa !17
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds i32, ptr %202, i64 %204
  store i32 %201, ptr %205, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %206 = load ptr, ptr %4, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct._MatNd, ptr %206, i32 0, i32 0
  %208 = load ptr, ptr %207, align 8, !tbaa !18
  %209 = load i32, ptr %15, align 4, !tbaa !17
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct._MatNd, ptr %210, i32 0, i32 2
  %212 = load i32, ptr %211, align 4, !tbaa !13
  %213 = mul i32 %209, %212
  %214 = load i32, ptr %15, align 4, !tbaa !17
  %215 = add i32 %213, %214
  %216 = zext i32 %215 to i64
  %217 = getelementptr inbounds double, ptr %208, i64 %216
  %218 = load double, ptr %217, align 8, !tbaa !15
  store double %218, ptr %21, align 8, !tbaa !15
  %219 = load double, ptr %21, align 8, !tbaa !15
  %220 = load double, ptr %7, align 8, !tbaa !15
  %221 = fmul double %220, %219
  store double %221, ptr %7, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %222 = load double, ptr %21, align 8, !tbaa !15
  %223 = fdiv double 1.000000e+00, %222
  store double %223, ptr %22, align 8, !tbaa !15
  %224 = load ptr, ptr %4, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct._MatNd, ptr %224, i32 0, i32 0
  %226 = load ptr, ptr %225, align 8, !tbaa !18
  %227 = load i32, ptr %15, align 4, !tbaa !17
  %228 = load ptr, ptr %4, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct._MatNd, ptr %228, i32 0, i32 2
  %230 = load i32, ptr %229, align 4, !tbaa !13
  %231 = mul i32 %227, %230
  %232 = load i32, ptr %15, align 4, !tbaa !17
  %233 = add i32 %231, %232
  %234 = zext i32 %233 to i64
  %235 = getelementptr inbounds double, ptr %226, i64 %234
  store double 1.000000e+00, ptr %235, align 8, !tbaa !15
  store i32 0, ptr %13, align 4, !tbaa !17
  br label %236

236:                                              ; preds = %248, %195
  %237 = load i32, ptr %13, align 4, !tbaa !17
  %238 = load i32, ptr %8, align 4, !tbaa !17
  %239 = icmp slt i32 %237, %238
  br i1 %239, label %240, label %251

240:                                              ; preds = %236
  %241 = load double, ptr %22, align 8, !tbaa !15
  %242 = load ptr, ptr %4, align 8, !tbaa !5
  %243 = load i32, ptr %15, align 4, !tbaa !17
  %244 = load i32, ptr %13, align 4, !tbaa !17
  %245 = call ptr @MatNd_getElePtr(ptr noundef %242, i32 noundef %243, i32 noundef %244)
  %246 = load double, ptr %245, align 8, !tbaa !15
  %247 = fmul double %246, %241
  store double %247, ptr %245, align 8, !tbaa !15
  br label %248

248:                                              ; preds = %240
  %249 = load i32, ptr %13, align 4, !tbaa !17
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %13, align 4, !tbaa !17
  br label %236, !llvm.loop !25

251:                                              ; preds = %236
  store i32 0, ptr %12, align 4, !tbaa !17
  br label %252

252:                                              ; preds = %317, %251
  %253 = load i32, ptr %12, align 4, !tbaa !17
  %254 = load i32, ptr %8, align 4, !tbaa !17
  %255 = icmp slt i32 %253, %254
  br i1 %255, label %256, label %320

256:                                              ; preds = %252
  %257 = load i32, ptr %12, align 4, !tbaa !17
  %258 = load i32, ptr %15, align 4, !tbaa !17
  %259 = icmp ne i32 %257, %258
  br i1 %259, label %260, label %316

260:                                              ; preds = %256
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %261 = load ptr, ptr %4, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct._MatNd, ptr %261, i32 0, i32 0
  %263 = load ptr, ptr %262, align 8, !tbaa !18
  %264 = load i32, ptr %12, align 4, !tbaa !17
  %265 = load ptr, ptr %4, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct._MatNd, ptr %265, i32 0, i32 2
  %267 = load i32, ptr %266, align 4, !tbaa !13
  %268 = mul i32 %264, %267
  %269 = load i32, ptr %15, align 4, !tbaa !17
  %270 = add i32 %268, %269
  %271 = zext i32 %270 to i64
  %272 = getelementptr inbounds double, ptr %263, i64 %271
  %273 = load double, ptr %272, align 8, !tbaa !15
  store double %273, ptr %23, align 8, !tbaa !15
  %274 = load ptr, ptr %4, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct._MatNd, ptr %274, i32 0, i32 0
  %276 = load ptr, ptr %275, align 8, !tbaa !18
  %277 = load i32, ptr %12, align 4, !tbaa !17
  %278 = load ptr, ptr %4, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct._MatNd, ptr %278, i32 0, i32 2
  %280 = load i32, ptr %279, align 4, !tbaa !13
  %281 = mul i32 %277, %280
  %282 = load i32, ptr %15, align 4, !tbaa !17
  %283 = add i32 %281, %282
  %284 = zext i32 %283 to i64
  %285 = getelementptr inbounds double, ptr %276, i64 %284
  store double 0.000000e+00, ptr %285, align 8, !tbaa !15
  store i32 0, ptr %13, align 4, !tbaa !17
  br label %286

286:                                              ; preds = %312, %260
  %287 = load i32, ptr %13, align 4, !tbaa !17
  %288 = load i32, ptr %8, align 4, !tbaa !17
  %289 = icmp slt i32 %287, %288
  br i1 %289, label %290, label %315

290:                                              ; preds = %286
  %291 = load ptr, ptr %4, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct._MatNd, ptr %291, i32 0, i32 0
  %293 = load ptr, ptr %292, align 8, !tbaa !18
  %294 = load i32, ptr %15, align 4, !tbaa !17
  %295 = load ptr, ptr %4, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct._MatNd, ptr %295, i32 0, i32 2
  %297 = load i32, ptr %296, align 4, !tbaa !13
  %298 = mul i32 %294, %297
  %299 = load i32, ptr %13, align 4, !tbaa !17
  %300 = add i32 %298, %299
  %301 = zext i32 %300 to i64
  %302 = getelementptr inbounds double, ptr %293, i64 %301
  %303 = load double, ptr %302, align 8, !tbaa !15
  %304 = load double, ptr %23, align 8, !tbaa !15
  %305 = load ptr, ptr %4, align 8, !tbaa !5
  %306 = load i32, ptr %12, align 4, !tbaa !17
  %307 = load i32, ptr %13, align 4, !tbaa !17
  %308 = call ptr @MatNd_getElePtr(ptr noundef %305, i32 noundef %306, i32 noundef %307)
  %309 = load double, ptr %308, align 8, !tbaa !15
  %310 = fneg double %303
  %311 = call double @llvm.fmuladd.f64(double %310, double %304, double %309)
  store double %311, ptr %308, align 8, !tbaa !15
  br label %312

312:                                              ; preds = %290
  %313 = load i32, ptr %13, align 4, !tbaa !17
  %314 = add nsw i32 %313, 1
  store i32 %314, ptr %13, align 4, !tbaa !17
  br label %286, !llvm.loop !26

315:                                              ; preds = %286
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %316

316:                                              ; preds = %315, %256
  br label %317

317:                                              ; preds = %316
  %318 = load i32, ptr %12, align 4, !tbaa !17
  %319 = add nsw i32 %318, 1
  store i32 %319, ptr %12, align 4, !tbaa !17
  br label %252, !llvm.loop !27

320:                                              ; preds = %252
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  store i32 0, ptr %17, align 4
  br label %321

321:                                              ; preds = %320, %166
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  %322 = load i32, ptr %17, align 4
  switch i32 %322, label %327 [
    i32 0, label %323
  ]

323:                                              ; preds = %321
  br label %324

324:                                              ; preds = %323
  %325 = load i32, ptr %16, align 4, !tbaa !17
  %326 = add nsw i32 %325, 1
  store i32 %326, ptr %16, align 4, !tbaa !17
  br label %94, !llvm.loop !28

327:                                              ; preds = %321, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  %328 = load i32, ptr %17, align 4
  switch i32 %328, label %389 [
    i32 4, label %329
  ]

329:                                              ; preds = %327
  %330 = load i32, ptr %8, align 4, !tbaa !17
  %331 = sub nsw i32 %330, 1
  store i32 %331, ptr %12, align 4, !tbaa !17
  br label %332

332:                                              ; preds = %371, %329
  %333 = load i32, ptr %12, align 4, !tbaa !17
  %334 = icmp sge i32 %333, 0
  br i1 %334, label %335, label %374

335:                                              ; preds = %332
  %336 = load ptr, ptr %10, align 8, !tbaa !5
  %337 = load i32, ptr %12, align 4, !tbaa !17
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds i32, ptr %336, i64 %338
  %340 = load i32, ptr %339, align 4, !tbaa !17
  %341 = load ptr, ptr %9, align 8, !tbaa !5
  %342 = load i32, ptr %12, align 4, !tbaa !17
  %343 = sext i32 %342 to i64
  %344 = getelementptr inbounds i32, ptr %341, i64 %343
  %345 = load i32, ptr %344, align 4, !tbaa !17
  %346 = icmp ne i32 %340, %345
  br i1 %346, label %347, label %370

347:                                              ; preds = %335
  store i32 0, ptr %13, align 4, !tbaa !17
  br label %348

348:                                              ; preds = %366, %347
  %349 = load i32, ptr %13, align 4, !tbaa !17
  %350 = load i32, ptr %8, align 4, !tbaa !17
  %351 = icmp slt i32 %349, %350
  br i1 %351, label %352, label %369

352:                                              ; preds = %348
  %353 = load ptr, ptr %4, align 8, !tbaa !5
  %354 = load i32, ptr %13, align 4, !tbaa !17
  %355 = load ptr, ptr %10, align 8, !tbaa !5
  %356 = load i32, ptr %12, align 4, !tbaa !17
  %357 = sext i32 %356 to i64
  %358 = getelementptr inbounds i32, ptr %355, i64 %357
  %359 = load i32, ptr %358, align 4, !tbaa !17
  %360 = load i32, ptr %13, align 4, !tbaa !17
  %361 = load ptr, ptr %9, align 8, !tbaa !5
  %362 = load i32, ptr %12, align 4, !tbaa !17
  %363 = sext i32 %362 to i64
  %364 = getelementptr inbounds i32, ptr %361, i64 %363
  %365 = load i32, ptr %364, align 4, !tbaa !17
  call void @MatNd_swapElements(ptr noundef %353, i32 noundef %354, i32 noundef %359, i32 noundef %360, i32 noundef %365)
  br label %366

366:                                              ; preds = %352
  %367 = load i32, ptr %13, align 4, !tbaa !17
  %368 = add nsw i32 %367, 1
  store i32 %368, ptr %13, align 4, !tbaa !17
  br label %348, !llvm.loop !29

369:                                              ; preds = %348
  br label %370

370:                                              ; preds = %369, %335
  br label %371

371:                                              ; preds = %370
  %372 = load i32, ptr %12, align 4, !tbaa !17
  %373 = add nsw i32 %372, -1
  store i32 %373, ptr %12, align 4, !tbaa !17
  br label %332, !llvm.loop !30

374:                                              ; preds = %332
  %375 = load i8, ptr %6, align 1, !tbaa !14, !range !22, !noundef !23
  %376 = trunc i8 %375 to i1
  br i1 %376, label %377, label %380

377:                                              ; preds = %374
  %378 = load double, ptr %7, align 8, !tbaa !15
  %379 = fneg double %378
  store double %379, ptr %7, align 8, !tbaa !15
  br label %380

380:                                              ; preds = %377, %374
  %381 = load i32, ptr %8, align 4, !tbaa !17
  %382 = icmp sgt i32 %381, 36
  br i1 %382, label %383, label %387

383:                                              ; preds = %380
  %384 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %384) #7
  %385 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %385) #7
  %386 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %386) #7
  br label %387

387:                                              ; preds = %383, %380
  %388 = load double, ptr %7, align 8, !tbaa !15
  store double %388, ptr %3, align 8
  store i32 1, ptr %17, align 4
  br label %389

389:                                              ; preds = %387, %327
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  br label %390

390:                                              ; preds = %389, %49
  %391 = load double, ptr %3, align 8
  ret double %391
}

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

declare void @MatNd_copy(ptr noundef, ptr noundef) #3

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

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

declare void @MatNd_setZero(ptr noundef) #3

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

declare void @MatNd_swapElements(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

declare ptr @MatNd_getElePtr(ptr noundef, i32 noundef, i32 noundef) #3

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

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

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


; 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 = external hidden unnamed_addr constant [74 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [59 x i8], align 1
@__func__.MatNd_gaussInverse = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@Rcs_calloc = external local_unnamed_addr global ptr, align 8

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

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

declare void @print_trace() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local double @MatNd_gaussInverse(ptr noundef %0, ptr noundef %1) local_unnamed_addr #3 {
  %3 = getelementptr inbounds i8, ptr %1, i64 8
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 12
  %6 = load i32, ptr %5, align 4, !tbaa !12
  %.not = icmp eq i32 %4, %6
  br i1 %.not, label %12, label %7

7:                                                ; preds = %2
  %8 = load ptr, ptr @stderr, align 8, !tbaa !13
  %9 = uitofp i32 %4 to double
  %10 = uitofp i32 %6 to double
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.MatNd_gaussInverse, i32 noundef 297, ptr noundef nonnull @.str.8, double noundef %9, ptr noundef nonnull @.str.9, double noundef %10) #7
  tail call void @print_trace() #8
  tail call void @exit(i32 noundef 1) #9
  unreachable

12:                                               ; preds = %2
  %13 = icmp eq i32 %4, 0
  br i1 %13, label %.thread324, label %14

14:                                               ; preds = %12
  %.not181 = icmp eq ptr %0, %1
  br i1 %.not181, label %16, label %15

15:                                               ; preds = %14
  tail call void @MatNd_copy(ptr noundef %0, ptr noundef nonnull %1) #8
  %.pre = load i32, ptr %3, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %15, %14
  %17 = phi i32 [ %.pre, %15 ], [ %4, %14 ]
  %18 = icmp sgt i32 %17, 36
  br i1 %18, label %.thread275, label %26

.thread275:                                       ; preds = %16
  %19 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !13
  %20 = zext nneg i32 %17 to i64
  %21 = tail call ptr %19(i64 noundef %20, i64 noundef 4) #8
  %22 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !13
  %23 = tail call ptr %22(i64 noundef %20, i64 noundef 4) #8
  %24 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !13
  %25 = tail call ptr %24(i64 noundef %20, i64 noundef 4) #8
  %.pre272 = zext nneg i32 %17 to i64
  %.pre273 = shl nuw nsw i64 %.pre272, 2
  tail call void @llvm.memset.p0.i64(ptr align 4 %25, i8 0, i64 %.pre273, i1 false)
  br label %.preheader197.lr.ph

26:                                               ; preds = %16
  %27 = sext i32 %17 to i64
  %28 = shl nsw i64 %27, 2
  %29 = alloca i8, i64 %28, align 16
  %30 = alloca i8, i64 %28, align 16
  %31 = alloca i8, i64 %28, align 16
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %31, i8 0, i64 %28, i1 false)
  %.not185231 = icmp sgt i32 %17, 0
  br i1 %.not185231, label %.preheader197.lr.ph, label %.thread324

.preheader197.lr.ph:                              ; preds = %.thread275, %26
  %.0144287 = phi ptr [ %21, %.thread275 ], [ %29, %26 ]
  %.0171285 = phi ptr [ %25, %.thread275 ], [ %31, %26 ]
  %.0172283 = phi ptr [ %23, %.thread275 ], [ %30, %26 ]
  %.pre-phi282 = phi i64 [ %.pre272, %.thread275 ], [ %27, %26 ]
  %32 = getelementptr inbounds i8, ptr %0, i64 12
  %wide.trip.count266 = zext nneg i32 %17 to i64
  br label %.lr.ph213.preheader

33:                                               ; preds = %.loopexit192
  %indvars.iv.next265 = add nuw nsw i64 %indvars.iv264, 1
  %.not185 = icmp slt i64 %indvars.iv.next265, %.pre-phi282
  %exitcond267.not = icmp eq i64 %indvars.iv.next265, %wide.trip.count266
  br i1 %exitcond267.not, label %.thread, label %.lr.ph213.preheader, !llvm.loop !14

.lr.ph213.preheader:                              ; preds = %33, %.preheader197.lr.ph
  %indvars.iv264 = phi i64 [ 0, %.preheader197.lr.ph ], [ %indvars.iv.next265, %33 ]
  %.not185237 = phi i1 [ true, %.preheader197.lr.ph ], [ %.not185, %33 ]
  %.0135236 = phi i1 [ false, %.preheader197.lr.ph ], [ %.1136, %33 ]
  %.0139235 = phi double [ 1.000000e+00, %.preheader197.lr.ph ], [ %67, %33 ]
  %.0153233 = phi i32 [ 0, %.preheader197.lr.ph ], [ %.5.us, %33 ]
  %.0158232 = phi i32 [ 0, %.preheader197.lr.ph ], [ %.5163.us, %33 ]
  br label %.lr.ph213

.lr.ph213:                                        ; preds = %.lr.ph213.preheader, %..loopexit194_crit_edge.us
  %indvars.iv255 = phi i64 [ 0, %.lr.ph213.preheader ], [ %indvars.iv.next256, %..loopexit194_crit_edge.us ]
  %.0145212.us = phi double [ 0.000000e+00, %.lr.ph213.preheader ], [ %.4149.us, %..loopexit194_crit_edge.us ]
  %.1154211.us = phi i32 [ %.0153233, %.lr.ph213.preheader ], [ %.5.us, %..loopexit194_crit_edge.us ]
  %.1159210.us = phi i32 [ %.0158232, %.lr.ph213.preheader ], [ %.5163.us, %..loopexit194_crit_edge.us ]
  %34 = getelementptr inbounds i32, ptr %.0171285, i64 %indvars.iv255
  %35 = load i32, ptr %34, align 4, !tbaa !16
  %.not187.us = icmp eq i32 %35, 0
  br i1 %.not187.us, label %.preheader193.us.preheader, label %..loopexit194_crit_edge.us

.preheader193.us.preheader:                       ; preds = %.lr.ph213
  %36 = trunc nuw nsw i64 %indvars.iv255 to i32
  br label %.preheader193.us

..loopexit194_crit_edge.us:                       ; preds = %50, %.lr.ph213
  %.5163.us = phi i32 [ %.1159210.us, %.lr.ph213 ], [ %.4162.us, %50 ]
  %.5.us = phi i32 [ %.1154211.us, %.lr.ph213 ], [ %.4157.us, %50 ]
  %.4149.us = phi double [ %.0145212.us, %.lr.ph213 ], [ %.3148.us, %50 ]
  %indvars.iv.next256 = add nuw nsw i64 %indvars.iv255, 1
  %exitcond259.not = icmp eq i64 %indvars.iv.next256, %wide.trip.count266
  br i1 %exitcond259.not, label %._crit_edge.split.us, label %.lr.ph213, !llvm.loop !17

.preheader193.us:                                 ; preds = %.preheader193.us.preheader, %50
  %indvars.iv = phi i64 [ 0, %.preheader193.us.preheader ], [ %indvars.iv.next, %50 ]
  %.1146205.us = phi double [ %.0145212.us, %.preheader193.us.preheader ], [ %.3148.us, %50 ]
  %.2155204.us = phi i32 [ %.1154211.us, %.preheader193.us.preheader ], [ %.4157.us, %50 ]
  %.2160203.us = phi i32 [ %.1159210.us, %.preheader193.us.preheader ], [ %.4162.us, %50 ]
  %37 = getelementptr inbounds i32, ptr %.0171285, i64 %indvars.iv
  %38 = load i32, ptr %37, align 4, !tbaa !16
  %.not188.us = icmp eq i32 %38, 0
  br i1 %.not188.us, label %39, label %50

39:                                               ; preds = %.preheader193.us
  %40 = load ptr, ptr %0, align 8, !tbaa !18
  %41 = load i32, ptr %32, align 4, !tbaa !12
  %42 = mul i32 %41, %36
  %43 = trunc nuw nsw i64 %indvars.iv to i32
  %44 = add i32 %42, %43
  %45 = zext i32 %44 to i64
  %46 = getelementptr inbounds double, ptr %40, i64 %45
  %47 = load double, ptr %46, align 8, !tbaa !19
  %48 = tail call double @llvm.fabs.f64(double %47)
  %49 = fcmp ogt double %48, %.1146205.us
  %.3161.us = select i1 %49, i32 %36, i32 %.2160203.us
  %.3156.us = select i1 %49, i32 %43, i32 %.2155204.us
  %.2147.us = select i1 %49, double %48, double %.1146205.us
  br label %50

50:                                               ; preds = %39, %.preheader193.us
  %.4162.us = phi i32 [ %.2160203.us, %.preheader193.us ], [ %.3161.us, %39 ]
  %.4157.us = phi i32 [ %.2155204.us, %.preheader193.us ], [ %.3156.us, %39 ]
  %.3148.us = phi double [ %.1146205.us, %.preheader193.us ], [ %.2147.us, %39 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count266
  br i1 %exitcond.not, label %..loopexit194_crit_edge.us, label %.preheader193.us, !llvm.loop !21

._crit_edge.split.us:                             ; preds = %..loopexit194_crit_edge.us
  %51 = fcmp une double %.4149.us, 0.000000e+00
  br i1 %51, label %54, label %52

52:                                               ; preds = %._crit_edge.split.us
  tail call void @MatNd_setZero(ptr noundef %0) #8
  br i1 %18, label %53, label %.thread

53:                                               ; preds = %52
  call void @free(ptr noundef %.0144287) #8
  call void @free(ptr noundef %.0172283) #8
  call void @free(ptr noundef nonnull %.0171285) #8
  br i1 %.not185237, label %.thread324, label %.lr.ph248.split.us.preheader

54:                                               ; preds = %._crit_edge.split.us
  %55 = sext i32 %.5.us to i64
  %56 = getelementptr inbounds i32, ptr %.0171285, i64 %55
  store i32 1, ptr %56, align 4, !tbaa !16
  %.not182 = icmp eq i32 %.5163.us, %.5.us
  br i1 %.not182, label %.lr.ph223.preheader, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %54
  %57 = xor i1 %.0135236, true
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.0143219 = phi i32 [ %58, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  tail call void @MatNd_swapElements(ptr noundef %0, i32 noundef %.5163.us, i32 noundef %.0143219, i32 noundef %.5.us, i32 noundef %.0143219) #8
  %58 = add nuw nsw i32 %.0143219, 1
  %exitcond260.not = icmp eq i32 %58, %17
  br i1 %exitcond260.not, label %.lr.ph223.preheader, label %.lr.ph, !llvm.loop !22

.lr.ph223.preheader:                              ; preds = %.lr.ph, %54
  %.1136 = phi i1 [ %.0135236, %54 ], [ %57, %.lr.ph ]
  %59 = getelementptr inbounds i32, ptr %.0172283, i64 %indvars.iv264
  store i32 %.5163.us, ptr %59, align 4, !tbaa !16
  %60 = getelementptr inbounds i32, ptr %.0144287, i64 %indvars.iv264
  store i32 %.5.us, ptr %60, align 4, !tbaa !16
  %61 = load ptr, ptr %0, align 8, !tbaa !18
  %62 = load i32, ptr %32, align 4, !tbaa !12
  %.1154183 = add i32 %62, 1
  %63 = mul i32 %.1154183, %.5.us
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds double, ptr %61, i64 %64
  %66 = load double, ptr %65, align 8, !tbaa !19
  %67 = fmul double %.0139235, %66
  %68 = fdiv double 1.000000e+00, %66
  store double 1.000000e+00, ptr %65, align 8, !tbaa !19
  br label %.lr.ph223

.lr.ph223:                                        ; preds = %.lr.ph223.preheader, %.lr.ph223
  %.1165221 = phi i32 [ %72, %.lr.ph223 ], [ 0, %.lr.ph223.preheader ]
  %69 = tail call ptr @MatNd_getElePtr(ptr noundef nonnull %0, i32 noundef %.5.us, i32 noundef %.1165221) #8
  %70 = load double, ptr %69, align 8, !tbaa !19
  %71 = fmul double %68, %70
  store double %71, ptr %69, align 8, !tbaa !19
  %72 = add nuw nsw i32 %.1165221, 1
  %exitcond261.not = icmp eq i32 %72, %17
  br i1 %exitcond261.not, label %.lr.ph229, label %.lr.ph223, !llvm.loop !23

.lr.ph229:                                        ; preds = %.lr.ph223, %.loopexit192
  %.1169227 = phi i32 [ %93, %.loopexit192 ], [ 0, %.lr.ph223 ]
  %.not184 = icmp eq i32 %.1169227, %.5.us
  br i1 %.not184, label %.loopexit192, label %.lr.ph226

.lr.ph226:                                        ; preds = %.lr.ph229
  %73 = load ptr, ptr %0, align 8, !tbaa !18
  %74 = load i32, ptr %32, align 4, !tbaa !12
  %75 = mul i32 %74, %.1169227
  %76 = add i32 %75, %.5.us
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds double, ptr %73, i64 %77
  %79 = load double, ptr %78, align 8, !tbaa !19
  store double 0.000000e+00, ptr %78, align 8, !tbaa !19
  br label %80

80:                                               ; preds = %.lr.ph226, %80
  %.2166224 = phi i32 [ 0, %.lr.ph226 ], [ %92, %80 ]
  %81 = load ptr, ptr %0, align 8, !tbaa !18
  %82 = load i32, ptr %32, align 4, !tbaa !12
  %83 = mul i32 %82, %.5.us
  %84 = add i32 %83, %.2166224
  %85 = zext i32 %84 to i64
  %86 = getelementptr inbounds double, ptr %81, i64 %85
  %87 = load double, ptr %86, align 8, !tbaa !19
  %88 = tail call ptr @MatNd_getElePtr(ptr noundef nonnull %0, i32 noundef %.1169227, i32 noundef %.2166224) #8
  %89 = load double, ptr %88, align 8, !tbaa !19
  %90 = fneg double %87
  %91 = tail call double @llvm.fmuladd.f64(double %90, double %79, double %89)
  store double %91, ptr %88, align 8, !tbaa !19
  %92 = add nuw nsw i32 %.2166224, 1
  %exitcond262.not = icmp eq i32 %92, %17
  br i1 %exitcond262.not, label %.loopexit192, label %80, !llvm.loop !24

.loopexit192:                                     ; preds = %80, %.lr.ph229
  %93 = add nuw nsw i32 %.1169227, 1
  %exitcond263.not = icmp eq i32 %93, %17
  br i1 %exitcond263.not, label %33, label %.lr.ph229, !llvm.loop !25

.thread:                                          ; preds = %33, %52
  %.not185199 = phi i1 [ %.not185237, %52 ], [ %.not185, %33 ]
  %.2141 = phi double [ %.0139235, %52 ], [ %67, %33 ]
  %.3138 = phi i1 [ %.0135236, %52 ], [ %.1136, %33 ]
  br i1 %.not185199, label %.thread324, label %.lr.ph248.split.us.preheader

.lr.ph248.split.us.preheader:                     ; preds = %.thread, %53
  %.3138303 = phi i1 [ %.3138, %.thread ], [ %.0135236, %53 ]
  %.2141302 = phi double [ %.2141, %.thread ], [ %.0139235, %53 ]
  %94 = zext nneg i32 %17 to i64
  br label %.lr.ph248.split.us

.lr.ph248.split.us:                               ; preds = %.lr.ph248.split.us.preheader, %..loopexit_crit_edge.us
  %indvars.iv269 = phi i64 [ %94, %.lr.ph248.split.us.preheader ], [ %indvars.iv.next270, %..loopexit_crit_edge.us ]
  %indvars.iv.next270 = add nsw i64 %indvars.iv269, -1
  %95 = getelementptr inbounds i32, ptr %.0172283, i64 %indvars.iv.next270
  %96 = load i32, ptr %95, align 4, !tbaa !16
  %97 = getelementptr inbounds i32, ptr %.0144287, i64 %indvars.iv.next270
  %98 = load i32, ptr %97, align 4, !tbaa !16
  %.not186.us = icmp eq i32 %96, %98
  br i1 %.not186.us, label %..loopexit_crit_edge.us, label %.preheader.us

.preheader.us:                                    ; preds = %.lr.ph248.split.us, %.preheader.us
  %.3167244.us = phi i32 [ %101, %.preheader.us ], [ 0, %.lr.ph248.split.us ]
  %99 = load i32, ptr %95, align 4, !tbaa !16
  %100 = load i32, ptr %97, align 4, !tbaa !16
  tail call void @MatNd_swapElements(ptr noundef %0, i32 noundef %.3167244.us, i32 noundef %99, i32 noundef %.3167244.us, i32 noundef %100) #8
  %101 = add nuw nsw i32 %.3167244.us, 1
  %exitcond268.not = icmp eq i32 %101, %17
  br i1 %exitcond268.not, label %..loopexit_crit_edge.us, label %.preheader.us, !llvm.loop !26

..loopexit_crit_edge.us:                          ; preds = %.preheader.us, %.lr.ph248.split.us
  %102 = icmp sgt i64 %indvars.iv269, 1
  br i1 %102, label %.lr.ph248.split.us, label %._crit_edge, !llvm.loop !27

._crit_edge:                                      ; preds = %..loopexit_crit_edge.us
  %103 = fneg double %.2141302
  %cond.fr = freeze i1 %.3138303
  %104 = select i1 %cond.fr, double %103, double %.2141302
  br i1 %18, label %105, label %.thread324

105:                                              ; preds = %._crit_edge
  call void @free(ptr noundef %.0144287) #8
  call void @free(ptr noundef %.0172283) #8
  call void @free(ptr noundef %.0171285) #8
  br label %.thread324

.thread324:                                       ; preds = %26, %53, %.thread, %105, %._crit_edge, %12
  %.4 = phi double [ 1.000000e+00, %12 ], [ 0.000000e+00, %.thread ], [ %104, %105 ], [ %104, %._crit_edge ], [ 0.000000e+00, %53 ], [ 1.000000e+00, %26 ]
  ret double %.4
}

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

declare void @MatNd_copy(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

declare void @MatNd_setZero(ptr noundef) local_unnamed_addr #2

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

declare void @MatNd_swapElements(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare ptr @MatNd_getElePtr(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { cold nounwind }
attributes #8 = { nounwind }
attributes #9 = { noreturn nounwind }

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

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


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