; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_MatNd)

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

@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [26 x i8], align 1
@__func__.MatNd_MillerPinv = external hidden unnamed_addr constant [17 x i8], align 1
@.str.130 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.131 = external hidden unnamed_addr constant [50 x i8], align 1

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

declare void @print_trace() #1

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_destroy(ptr noundef) #4

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_subSelf(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_transpose(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_mul(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_postMulSelf(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_postMulDiagSelf(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local void @MatNd_MillerPinv(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #4 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %struct._MatNd, align 8
  %20 = alloca double, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._MatNd, ptr %23, i32 0, i32 1
  %25 = load i32, ptr %24, align 8, !tbaa !9
  store i32 %25, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._MatNd, ptr %26, i32 0, i32 2
  %28 = load i32, ptr %27, align 4, !tbaa !14
  store i32 %28, ptr %10, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store ptr null, ptr %11, align 8, !tbaa !5
  %29 = load i32, ptr %10, align 4, !tbaa !13
  %30 = load i32, ptr %10, align 4, !tbaa !13
  %31 = mul i32 %29, %30
  %32 = icmp ugt i32 %31, 1296
  br i1 %32, label %33, label %37

33:                                               ; preds = %4
  %34 = load i32, ptr %10, align 4, !tbaa !13
  %35 = load i32, ptr %10, align 4, !tbaa !13
  %36 = call ptr @MatNd_create(i32 noundef %34, i32 noundef %35)
  store ptr %36, ptr %11, align 8, !tbaa !5
  br label %75

37:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %38 = load i32, ptr %10, align 4, !tbaa !13
  %39 = load i32, ptr %10, align 4, !tbaa !13
  %40 = mul i32 %38, %39
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %37
  br label %47

43:                                               ; preds = %37
  %44 = load i32, ptr %10, align 4, !tbaa !13
  %45 = load i32, ptr %10, align 4, !tbaa !13
  %46 = mul i32 %44, %45
  br label %47

47:                                               ; preds = %43, %42
  %48 = phi i32 [ 1, %42 ], [ %46, %43 ]
  store i32 %48, ptr %12, align 4, !tbaa !13
  %49 = load i32, ptr %12, align 4, !tbaa !13
  %50 = zext i32 %49 to i64
  %51 = mul i64 %50, 8
  %52 = add i64 24, %51
  %53 = alloca i8, i64 %52, align 16
  store ptr %53, ptr %11, align 8, !tbaa !5
  %54 = load ptr, ptr %11, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._MatNd, ptr %54, i64 1
  %56 = load ptr, ptr %11, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._MatNd, ptr %56, i32 0, i32 0
  store ptr %55, ptr %57, align 8, !tbaa !15
  %58 = load i32, ptr %10, align 4, !tbaa !13
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._MatNd, ptr %59, i32 0, i32 1
  store i32 %58, ptr %60, align 8, !tbaa !9
  %61 = load i32, ptr %10, align 4, !tbaa !13
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._MatNd, ptr %62, i32 0, i32 2
  store i32 %61, ptr %63, align 4, !tbaa !14
  %64 = load i32, ptr %12, align 4, !tbaa !13
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._MatNd, ptr %65, i32 0, i32 3
  store i32 %64, ptr %66, align 8, !tbaa !16
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._MatNd, ptr %67, i32 0, i32 4
  store i8 1, ptr %68, align 4, !tbaa !17
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._MatNd, ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !15
  %72 = load i32, ptr %12, align 4, !tbaa !13
  %73 = zext i32 %72 to i64
  %74 = mul i64 %73, 8
  call void @llvm.memset.p0.i64(ptr align 8 %71, i8 0, i64 %74, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %75

75:                                               ; preds = %47, %33
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._MatNd, ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 8, !tbaa !9
  %79 = icmp eq i32 %78, 1
  br i1 %79, label %80, label %93

80:                                               ; preds = %75
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct._MatNd, ptr %81, i32 0, i32 2
  %83 = load i32, ptr %82, align 4, !tbaa !14
  %84 = icmp eq i32 %83, 1
  br i1 %84, label %85, label %93

85:                                               ; preds = %80
  %86 = load ptr, ptr %11, align 8, !tbaa !5
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._MatNd, ptr %87, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8, !tbaa !15
  %90 = getelementptr inbounds double, ptr %89, i64 0
  %91 = load double, ptr %90, align 8, !tbaa !18
  %92 = fdiv double 1.000000e+00, %91
  call void @MatNd_addConstToDiag(ptr noundef %86, double noundef %92)
  br label %145

93:                                               ; preds = %80, %75
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._MatNd, ptr %94, i32 0, i32 1
  %96 = load i32, ptr %95, align 8, !tbaa !9
  %97 = load i32, ptr %10, align 4, !tbaa !13
  %98 = icmp eq i32 %96, %97
  br i1 %98, label %99, label %126

99:                                               ; preds = %93
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._MatNd, ptr %100, i32 0, i32 2
  %102 = load i32, ptr %101, align 4, !tbaa !14
  %103 = icmp eq i32 %102, 1
  br i1 %103, label %104, label %126

104:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !13
  br label %105

105:                                              ; preds = %122, %104
  %106 = load i32, ptr %13, align 4, !tbaa !13
  %107 = load i32, ptr %10, align 4, !tbaa !13
  %108 = icmp ult i32 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %125

110:                                              ; preds = %105
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = load i32, ptr %13, align 4, !tbaa !13
  %113 = load i32, ptr %13, align 4, !tbaa !13
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._MatNd, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !15
  %117 = load i32, ptr %13, align 4, !tbaa !13
  %118 = zext i32 %117 to i64
  %119 = getelementptr inbounds double, ptr %116, i64 %118
  %120 = load double, ptr %119, align 8, !tbaa !18
  %121 = fdiv double 1.000000e+00, %120
  call void @MatNd_set(ptr noundef %111, i32 noundef %112, i32 noundef %113, double noundef %121)
  br label %122

122:                                              ; preds = %110
  %123 = load i32, ptr %13, align 4, !tbaa !13
  %124 = add i32 %123, 1
  store i32 %124, ptr %13, align 4, !tbaa !13
  br label %105, !llvm.loop !20

125:                                              ; preds = %109
  br label %144

126:                                              ; preds = %99, %93
  br label %127

127:                                              ; preds = %126
  %128 = load ptr, ptr @stderr, align 8, !tbaa !5
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %128, ptr noundef @.str.91, ptr noundef @.str.1, ptr noundef @__func__.MatNd_MillerPinv, i32 noundef 2075) #6
  %130 = load ptr, ptr @stderr, align 8, !tbaa !5
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._MatNd, ptr %131, i32 0, i32 1
  %133 = load i32, ptr %132, align 8, !tbaa !9
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._MatNd, ptr %134, i32 0, i32 2
  %136 = load i32, ptr %135, align 4, !tbaa !14
  %137 = load i32, ptr %9, align 4, !tbaa !13
  %138 = load i32, ptr %10, align 4, !tbaa !13
  %139 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef @.str.130, i32 noundef %133, i32 noundef %136, i32 noundef %137, i32 noundef %138) #6
  %140 = load ptr, ptr @stderr, align 8, !tbaa !5
  %141 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %140, ptr noundef @.str.4) #6
  call void @print_trace()
  call void @exit(i32 noundef 1) #7
  unreachable

142:                                              ; No predecessors!
  br label %143

143:                                              ; preds = %142
  br label %144

144:                                              ; preds = %143, %125
  br label %145

145:                                              ; preds = %144, %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store ptr null, ptr %14, align 8, !tbaa !5
  %146 = load i32, ptr %10, align 4, !tbaa !13
  %147 = load i32, ptr %10, align 4, !tbaa !13
  %148 = mul i32 %146, %147
  %149 = icmp ugt i32 %148, 1296
  br i1 %149, label %150, label %154

150:                                              ; preds = %145
  %151 = load i32, ptr %10, align 4, !tbaa !13
  %152 = load i32, ptr %10, align 4, !tbaa !13
  %153 = call ptr @MatNd_create(i32 noundef %151, i32 noundef %152)
  store ptr %153, ptr %14, align 8, !tbaa !5
  br label %192

154:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %155 = load i32, ptr %10, align 4, !tbaa !13
  %156 = load i32, ptr %10, align 4, !tbaa !13
  %157 = mul i32 %155, %156
  %158 = icmp eq i32 %157, 0
  br i1 %158, label %159, label %160

159:                                              ; preds = %154
  br label %164

160:                                              ; preds = %154
  %161 = load i32, ptr %10, align 4, !tbaa !13
  %162 = load i32, ptr %10, align 4, !tbaa !13
  %163 = mul i32 %161, %162
  br label %164

164:                                              ; preds = %160, %159
  %165 = phi i32 [ 1, %159 ], [ %163, %160 ]
  store i32 %165, ptr %15, align 4, !tbaa !13
  %166 = load i32, ptr %15, align 4, !tbaa !13
  %167 = zext i32 %166 to i64
  %168 = mul i64 %167, 8
  %169 = add i64 24, %168
  %170 = alloca i8, i64 %169, align 16
  store ptr %170, ptr %14, align 8, !tbaa !5
  %171 = load ptr, ptr %14, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct._MatNd, ptr %171, i64 1
  %173 = load ptr, ptr %14, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct._MatNd, ptr %173, i32 0, i32 0
  store ptr %172, ptr %174, align 8, !tbaa !15
  %175 = load i32, ptr %10, align 4, !tbaa !13
  %176 = load ptr, ptr %14, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct._MatNd, ptr %176, i32 0, i32 1
  store i32 %175, ptr %177, align 8, !tbaa !9
  %178 = load i32, ptr %10, align 4, !tbaa !13
  %179 = load ptr, ptr %14, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct._MatNd, ptr %179, i32 0, i32 2
  store i32 %178, ptr %180, align 4, !tbaa !14
  %181 = load i32, ptr %15, align 4, !tbaa !13
  %182 = load ptr, ptr %14, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct._MatNd, ptr %182, i32 0, i32 3
  store i32 %181, ptr %183, align 8, !tbaa !16
  %184 = load ptr, ptr %14, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct._MatNd, ptr %184, i32 0, i32 4
  store i8 1, ptr %185, align 4, !tbaa !17
  %186 = load ptr, ptr %14, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct._MatNd, ptr %186, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !15
  %189 = load i32, ptr %15, align 4, !tbaa !13
  %190 = zext i32 %189 to i64
  %191 = mul i64 %190, 8
  call void @llvm.memset.p0.i64(ptr align 8 %188, i8 0, i64 %191, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %192

192:                                              ; preds = %164, %150
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store ptr null, ptr %16, align 8, !tbaa !5
  %193 = load i32, ptr %10, align 4, !tbaa !13
  %194 = load i32, ptr %10, align 4, !tbaa !13
  %195 = mul i32 %193, %194
  %196 = icmp ugt i32 %195, 1296
  br i1 %196, label %197, label %201

197:                                              ; preds = %192
  %198 = load i32, ptr %10, align 4, !tbaa !13
  %199 = load i32, ptr %10, align 4, !tbaa !13
  %200 = call ptr @MatNd_create(i32 noundef %198, i32 noundef %199)
  store ptr %200, ptr %16, align 8, !tbaa !5
  br label %239

201:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %202 = load i32, ptr %10, align 4, !tbaa !13
  %203 = load i32, ptr %10, align 4, !tbaa !13
  %204 = mul i32 %202, %203
  %205 = icmp eq i32 %204, 0
  br i1 %205, label %206, label %207

206:                                              ; preds = %201
  br label %211

207:                                              ; preds = %201
  %208 = load i32, ptr %10, align 4, !tbaa !13
  %209 = load i32, ptr %10, align 4, !tbaa !13
  %210 = mul i32 %208, %209
  br label %211

211:                                              ; preds = %207, %206
  %212 = phi i32 [ 1, %206 ], [ %210, %207 ]
  store i32 %212, ptr %17, align 4, !tbaa !13
  %213 = load i32, ptr %17, align 4, !tbaa !13
  %214 = zext i32 %213 to i64
  %215 = mul i64 %214, 8
  %216 = add i64 24, %215
  %217 = alloca i8, i64 %216, align 16
  store ptr %217, ptr %16, align 8, !tbaa !5
  %218 = load ptr, ptr %16, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct._MatNd, ptr %218, i64 1
  %220 = load ptr, ptr %16, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct._MatNd, ptr %220, i32 0, i32 0
  store ptr %219, ptr %221, align 8, !tbaa !15
  %222 = load i32, ptr %10, align 4, !tbaa !13
  %223 = load ptr, ptr %16, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct._MatNd, ptr %223, i32 0, i32 1
  store i32 %222, ptr %224, align 8, !tbaa !9
  %225 = load i32, ptr %10, align 4, !tbaa !13
  %226 = load ptr, ptr %16, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct._MatNd, ptr %226, i32 0, i32 2
  store i32 %225, ptr %227, align 4, !tbaa !14
  %228 = load i32, ptr %17, align 4, !tbaa !13
  %229 = load ptr, ptr %16, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct._MatNd, ptr %229, i32 0, i32 3
  store i32 %228, ptr %230, align 8, !tbaa !16
  %231 = load ptr, ptr %16, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct._MatNd, ptr %231, i32 0, i32 4
  store i8 1, ptr %232, align 4, !tbaa !17
  %233 = load ptr, ptr %16, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct._MatNd, ptr %233, i32 0, i32 0
  %235 = load ptr, ptr %234, align 8, !tbaa !15
  %236 = load i32, ptr %17, align 4, !tbaa !13
  %237 = zext i32 %236 to i64
  %238 = mul i64 %237, 8
  call void @llvm.memset.p0.i64(ptr align 8 %235, i8 0, i64 %238, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %239

239:                                              ; preds = %211, %197
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !13
  br label %240

240:                                              ; preds = %311, %239
  %241 = load i32, ptr %18, align 4, !tbaa !13
  %242 = load ptr, ptr %6, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct._MatNd, ptr %242, i32 0, i32 1
  %244 = load i32, ptr %243, align 8, !tbaa !9
  %245 = icmp ult i32 %241, %244
  br i1 %245, label %247, label %246

246:                                              ; preds = %240
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %314

247:                                              ; preds = %240
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #6
  %248 = load ptr, ptr %6, align 8, !tbaa !5
  %249 = load i32, ptr %18, align 4, !tbaa !13
  call void @MatNd_getRowView(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %19, ptr noundef %248, i32 noundef %249)
  %250 = load ptr, ptr %14, align 8, !tbaa !5
  call void @MatNd_sqrMulAtBA(ptr noundef %250, ptr noundef %19, ptr noundef null)
  %251 = load ptr, ptr %7, align 8, !tbaa !5
  %252 = icmp ne ptr %251, null
  br i1 %252, label %253, label %297

253:                                              ; preds = %247
  %254 = load ptr, ptr %7, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct._MatNd, ptr %254, i32 0, i32 2
  %256 = load i32, ptr %255, align 4, !tbaa !14
  %257 = icmp eq i32 %256, 1
  br i1 %257, label %258, label %263

258:                                              ; preds = %253
  %259 = load ptr, ptr %14, align 8, !tbaa !5
  %260 = load ptr, ptr %7, align 8, !tbaa !5
  %261 = load i32, ptr %18, align 4, !tbaa !13
  %262 = call double @MatNd_get(ptr noundef %260, i32 noundef %261, i32 noundef 0)
  call void @MatNd_constMulSelf(ptr noundef %259, double noundef %262)
  br label %296

263:                                              ; preds = %253
  %264 = load ptr, ptr %7, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct._MatNd, ptr %264, i32 0, i32 2
  %266 = load i32, ptr %265, align 4, !tbaa !14
  %267 = load ptr, ptr %7, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct._MatNd, ptr %267, i32 0, i32 1
  %269 = load i32, ptr %268, align 8, !tbaa !9
  %270 = icmp eq i32 %266, %269
  br i1 %270, label %271, label %277

271:                                              ; preds = %263
  %272 = load ptr, ptr %14, align 8, !tbaa !5
  %273 = load ptr, ptr %7, align 8, !tbaa !5
  %274 = load i32, ptr %18, align 4, !tbaa !13
  %275 = load i32, ptr %18, align 4, !tbaa !13
  %276 = call double @MatNd_get(ptr noundef %273, i32 noundef %274, i32 noundef %275)
  call void @MatNd_constMulSelf(ptr noundef %272, double noundef %276)
  br label %295

277:                                              ; preds = %263
  br label %278

278:                                              ; preds = %277
  %279 = load ptr, ptr @stderr, align 8, !tbaa !5
  %280 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %279, ptr noundef @.str.91, ptr noundef @.str.1, ptr noundef @__func__.MatNd_MillerPinv, i32 noundef 2105) #6
  %281 = load ptr, ptr @stderr, align 8, !tbaa !5
  %282 = load ptr, ptr %7, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct._MatNd, ptr %282, i32 0, i32 1
  %284 = load i32, ptr %283, align 8, !tbaa !9
  %285 = load ptr, ptr %7, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct._MatNd, ptr %285, i32 0, i32 2
  %287 = load i32, ptr %286, align 4, !tbaa !14
  %288 = load i32, ptr %9, align 4, !tbaa !13
  %289 = load i32, ptr %10, align 4, !tbaa !13
  %290 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %281, ptr noundef @.str.131, i32 noundef %284, i32 noundef %287, i32 noundef %288, i32 noundef %289) #6
  %291 = load ptr, ptr @stderr, align 8, !tbaa !5
  %292 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %291, ptr noundef @.str.4) #6
  call void @print_trace()
  call void @exit(i32 noundef 1) #7
  unreachable

293:                                              ; No predecessors!
  br label %294

294:                                              ; preds = %293
  br label %295

295:                                              ; preds = %294, %271
  br label %296

296:                                              ; preds = %295, %258
  br label %297

297:                                              ; preds = %296, %247
  %298 = load ptr, ptr %16, align 8, !tbaa !5
  %299 = load ptr, ptr %11, align 8, !tbaa !5
  %300 = load ptr, ptr %14, align 8, !tbaa !5
  call void @MatNd_mul(ptr noundef %298, ptr noundef %299, ptr noundef %300)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %301 = load ptr, ptr %16, align 8, !tbaa !5
  %302 = call double @MatNd_trace(ptr noundef %301)
  %303 = fadd double 1.000000e+00, %302
  %304 = fdiv double 1.000000e+00, %303
  store double %304, ptr %20, align 8, !tbaa !18
  %305 = load ptr, ptr %16, align 8, !tbaa !5
  %306 = load ptr, ptr %11, align 8, !tbaa !5
  call void @MatNd_postMulSelf(ptr noundef %305, ptr noundef %306)
  %307 = load ptr, ptr %16, align 8, !tbaa !5
  %308 = load double, ptr %20, align 8, !tbaa !18
  call void @MatNd_constMulSelf(ptr noundef %307, double noundef %308)
  %309 = load ptr, ptr %11, align 8, !tbaa !5
  %310 = load ptr, ptr %16, align 8, !tbaa !5
  call void @MatNd_subSelf(ptr noundef %309, ptr noundef %310)
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #6
  br label %311

311:                                              ; preds = %297
  %312 = load i32, ptr %18, align 4, !tbaa !13
  %313 = add i32 %312, 1
  store i32 %313, ptr %18, align 4, !tbaa !13
  br label %240, !llvm.loop !22

314:                                              ; preds = %246
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  store ptr null, ptr %21, align 8, !tbaa !5
  %315 = load i32, ptr %10, align 4, !tbaa !13
  %316 = load i32, ptr %9, align 4, !tbaa !13
  %317 = mul i32 %315, %316
  %318 = icmp ugt i32 %317, 1296
  br i1 %318, label %319, label %323

319:                                              ; preds = %314
  %320 = load i32, ptr %10, align 4, !tbaa !13
  %321 = load i32, ptr %9, align 4, !tbaa !13
  %322 = call ptr @MatNd_create(i32 noundef %320, i32 noundef %321)
  store ptr %322, ptr %21, align 8, !tbaa !5
  br label %361

323:                                              ; preds = %314
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %324 = load i32, ptr %10, align 4, !tbaa !13
  %325 = load i32, ptr %9, align 4, !tbaa !13
  %326 = mul i32 %324, %325
  %327 = icmp eq i32 %326, 0
  br i1 %327, label %328, label %329

328:                                              ; preds = %323
  br label %333

329:                                              ; preds = %323
  %330 = load i32, ptr %10, align 4, !tbaa !13
  %331 = load i32, ptr %9, align 4, !tbaa !13
  %332 = mul i32 %330, %331
  br label %333

333:                                              ; preds = %329, %328
  %334 = phi i32 [ 1, %328 ], [ %332, %329 ]
  store i32 %334, ptr %22, align 4, !tbaa !13
  %335 = load i32, ptr %22, align 4, !tbaa !13
  %336 = zext i32 %335 to i64
  %337 = mul i64 %336, 8
  %338 = add i64 24, %337
  %339 = alloca i8, i64 %338, align 16
  store ptr %339, ptr %21, align 8, !tbaa !5
  %340 = load ptr, ptr %21, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct._MatNd, ptr %340, i64 1
  %342 = load ptr, ptr %21, align 8, !tbaa !5
  %343 = getelementptr inbounds %struct._MatNd, ptr %342, i32 0, i32 0
  store ptr %341, ptr %343, align 8, !tbaa !15
  %344 = load i32, ptr %10, align 4, !tbaa !13
  %345 = load ptr, ptr %21, align 8, !tbaa !5
  %346 = getelementptr inbounds %struct._MatNd, ptr %345, i32 0, i32 1
  store i32 %344, ptr %346, align 8, !tbaa !9
  %347 = load i32, ptr %9, align 4, !tbaa !13
  %348 = load ptr, ptr %21, align 8, !tbaa !5
  %349 = getelementptr inbounds %struct._MatNd, ptr %348, i32 0, i32 2
  store i32 %347, ptr %349, align 4, !tbaa !14
  %350 = load i32, ptr %22, align 4, !tbaa !13
  %351 = load ptr, ptr %21, align 8, !tbaa !5
  %352 = getelementptr inbounds %struct._MatNd, ptr %351, i32 0, i32 3
  store i32 %350, ptr %352, align 8, !tbaa !16
  %353 = load ptr, ptr %21, align 8, !tbaa !5
  %354 = getelementptr inbounds %struct._MatNd, ptr %353, i32 0, i32 4
  store i8 1, ptr %354, align 4, !tbaa !17
  %355 = load ptr, ptr %21, align 8, !tbaa !5
  %356 = getelementptr inbounds %struct._MatNd, ptr %355, i32 0, i32 0
  %357 = load ptr, ptr %356, align 8, !tbaa !15
  %358 = load i32, ptr %22, align 4, !tbaa !13
  %359 = zext i32 %358 to i64
  %360 = mul i64 %359, 8
  call void @llvm.memset.p0.i64(ptr align 8 %357, i8 0, i64 %360, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %361

361:                                              ; preds = %333, %319
  %362 = load ptr, ptr %21, align 8, !tbaa !5
  %363 = load ptr, ptr %6, align 8, !tbaa !5
  call void @MatNd_transpose(ptr noundef %362, ptr noundef %363)
  %364 = load ptr, ptr %7, align 8, !tbaa !5
  %365 = icmp ne ptr %364, null
  br i1 %365, label %366, label %378

366:                                              ; preds = %361
  %367 = load ptr, ptr %7, align 8, !tbaa !5
  %368 = getelementptr inbounds %struct._MatNd, ptr %367, i32 0, i32 2
  %369 = load i32, ptr %368, align 4, !tbaa !14
  %370 = icmp eq i32 %369, 1
  br i1 %370, label %371, label %374

371:                                              ; preds = %366
  %372 = load ptr, ptr %21, align 8, !tbaa !5
  %373 = load ptr, ptr %7, align 8, !tbaa !5
  call void @MatNd_postMulDiagSelf(ptr noundef %372, ptr noundef %373)
  br label %377

374:                                              ; preds = %366
  %375 = load ptr, ptr %21, align 8, !tbaa !5
  %376 = load ptr, ptr %7, align 8, !tbaa !5
  call void @MatNd_postMulSelf(ptr noundef %375, ptr noundef %376)
  br label %377

377:                                              ; preds = %374, %371
  br label %378

378:                                              ; preds = %377, %361
  %379 = load ptr, ptr %5, align 8, !tbaa !5
  %380 = load i32, ptr %10, align 4, !tbaa !13
  %381 = load i32, ptr %9, align 4, !tbaa !13
  call void @MatNd_reshape(ptr noundef %379, i32 noundef %380, i32 noundef %381)
  %382 = load ptr, ptr %5, align 8, !tbaa !5
  %383 = load ptr, ptr %11, align 8, !tbaa !5
  %384 = load ptr, ptr %21, align 8, !tbaa !5
  call void @MatNd_mul(ptr noundef %382, ptr noundef %383, ptr noundef %384)
  %385 = load ptr, ptr %14, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %385)
  %386 = load ptr, ptr %11, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %386)
  %387 = load ptr, ptr %16, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %387)
  %388 = load ptr, ptr %21, align 8, !tbaa !5
  call void @MatNd_destroy(ptr noundef %388)
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_getRowView(ptr dead_on_unwind noalias writable sret(%struct._MatNd) align 8, ptr noundef, i32 noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_sqrMulAtBA(ptr noundef, ptr noundef, ptr noundef) #4

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

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

attributes #0 = { 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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { 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 = !{!11, !11, i64 0}
!14 = !{!10, !11, i64 12}
!15 = !{!10, !6, i64 0}
!16 = !{!10, !11, i64 16}
!17 = !{!10, !12, i64 20}
!18 = !{!19, !19, i64 0}
!19 = !{!"double", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


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

%struct._MatNd = type { ptr, i32, i32, i32, i8 }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [26 x i8], align 1
@__func__.MatNd_MillerPinv = external hidden unnamed_addr constant [17 x i8], align 1
@.str.130 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.131 = external hidden unnamed_addr constant [50 x i8], align 1

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

declare void @print_trace() local_unnamed_addr #1

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

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

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

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

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

; 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: nounwind uwtable
declare dso_local void @MatNd_destroy(ptr noundef) local_unnamed_addr #4

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_subSelf(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_transpose(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_mul(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_postMulSelf(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_postMulDiagSelf(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local void @MatNd_MillerPinv(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef readonly %3) local_unnamed_addr #4 {
  %5 = alloca %struct._MatNd, align 8
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %1, i64 12
  %9 = load i32, ptr %8, align 4, !tbaa !12
  %10 = mul i32 %9, %9
  %11 = icmp ugt i32 %10, 1296
  br i1 %11, label %12, label %14

12:                                               ; preds = %4
  %13 = tail call ptr @MatNd_create(i32 noundef %9, i32 noundef %9)
  br label %25

14:                                               ; preds = %4
  %15 = tail call i32 @llvm.umax.i32(i32 %10, i32 1)
  %16 = shl nuw nsw i32 %15, 3
  %17 = zext nneg i32 %16 to i64
  %18 = add nuw nsw i64 %17, 24
  %19 = alloca i8, i64 %18, align 16
  %20 = getelementptr inbounds i8, ptr %19, i64 24
  store ptr %20, ptr %19, align 16, !tbaa !13
  %21 = getelementptr inbounds i8, ptr %19, i64 8
  store i32 %9, ptr %21, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %19, i64 12
  store i32 %9, ptr %22, align 4, !tbaa !12
  %23 = getelementptr inbounds i8, ptr %19, i64 16
  store i32 %15, ptr %23, align 16, !tbaa !14
  %24 = getelementptr inbounds i8, ptr %19, i64 20
  store i8 1, ptr %24, align 4, !tbaa !15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %20, i8 0, i64 %17, i1 false)
  br label %25

25:                                               ; preds = %14, %12
  %.0 = phi ptr [ %13, %12 ], [ %19, %14 ]
  %26 = getelementptr inbounds i8, ptr %3, i64 8
  %27 = load i32, ptr %26, align 8, !tbaa !5
  %28 = icmp eq i32 %27, 1
  br i1 %28, label %29, label %37

29:                                               ; preds = %25
  %30 = getelementptr inbounds i8, ptr %3, i64 12
  %31 = load i32, ptr %30, align 4, !tbaa !12
  %32 = icmp eq i32 %31, 1
  br i1 %32, label %33, label %37

33:                                               ; preds = %29
  %34 = load ptr, ptr %3, align 8, !tbaa !13
  %35 = load double, ptr %34, align 8, !tbaa !16
  %36 = fdiv double 1.000000e+00, %35
  call void @MatNd_addConstToDiag(ptr noundef %.0, double noundef %36)
  br label %.loopexit

37:                                               ; preds = %29, %25
  %38 = icmp eq i32 %27, %9
  br i1 %38, label %39, label %48

39:                                               ; preds = %37
  %40 = getelementptr inbounds i8, ptr %3, i64 12
  %41 = load i32, ptr %40, align 4, !tbaa !12
  %42 = icmp eq i32 %41, 1
  br i1 %42, label %.preheader, label %48

.preheader:                                       ; preds = %39
  %.not168 = icmp eq i32 %9, 0
  br i1 %.not168, label %.loopexit.thread, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = zext i32 %9 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %43 = load ptr, ptr %3, align 8, !tbaa !13
  %44 = getelementptr inbounds double, ptr %43, i64 %indvars.iv
  %45 = load double, ptr %44, align 8, !tbaa !16
  %46 = fdiv double 1.000000e+00, %45
  %47 = trunc nuw i64 %indvars.iv to i32
  call void @MatNd_set(ptr noundef %.0, i32 noundef %47, i32 noundef %47, double noundef %46)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !18

48:                                               ; preds = %37, %39
  %49 = load ptr, ptr @stderr, align 8, !tbaa !20
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str.91, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_MillerPinv, i32 noundef 2075) #7
  %51 = load ptr, ptr @stderr, align 8, !tbaa !20
  %52 = load i32, ptr %26, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %3, i64 12
  %54 = load i32, ptr %53, align 4, !tbaa !12
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.130, i32 noundef %52, i32 noundef %54, i32 noundef %7, i32 noundef %9) #7
  %56 = load ptr, ptr @stderr, align 8, !tbaa !20
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef nonnull @.str.4) #7
  call void @print_trace() #8
  call void @exit(i32 noundef 1) #9
  unreachable

.loopexit:                                        ; preds = %.lr.ph, %33
  br i1 %11, label %58, label %.loopexit.thread

58:                                               ; preds = %.loopexit
  %59 = call ptr @MatNd_create(i32 noundef %9, i32 noundef %9)
  %60 = call ptr @MatNd_create(i32 noundef %9, i32 noundef %9)
  br label %77

.loopexit.thread:                                 ; preds = %.preheader, %.loopexit
  %61 = call i32 @llvm.umax.i32(i32 %10, i32 1)
  %62 = shl nuw nsw i32 %61, 3
  %63 = zext nneg i32 %62 to i64
  %64 = add nuw nsw i64 %63, 24
  %65 = alloca i8, i64 %64, align 16
  %66 = getelementptr inbounds i8, ptr %65, i64 24
  store ptr %66, ptr %65, align 16, !tbaa !13
  %67 = getelementptr inbounds i8, ptr %65, i64 8
  store i32 %9, ptr %67, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %65, i64 12
  store i32 %9, ptr %68, align 4, !tbaa !12
  %69 = getelementptr inbounds i8, ptr %65, i64 16
  store i32 %61, ptr %69, align 16, !tbaa !14
  %70 = getelementptr inbounds i8, ptr %65, i64 20
  store i8 1, ptr %70, align 4, !tbaa !15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %66, i8 0, i64 %63, i1 false)
  %71 = alloca i8, i64 %64, align 16
  %72 = getelementptr inbounds i8, ptr %71, i64 24
  store ptr %72, ptr %71, align 16, !tbaa !13
  %73 = getelementptr inbounds i8, ptr %71, i64 8
  store i32 %9, ptr %73, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %71, i64 12
  store i32 %9, ptr %74, align 4, !tbaa !12
  %75 = getelementptr inbounds i8, ptr %71, i64 16
  store i32 %61, ptr %75, align 16, !tbaa !14
  %76 = getelementptr inbounds i8, ptr %71, i64 20
  store i8 1, ptr %76, align 4, !tbaa !15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %72, i8 0, i64 %63, i1 false)
  br label %77

77:                                               ; preds = %.loopexit.thread, %58
  %.0152162 = phi ptr [ %59, %58 ], [ %65, %.loopexit.thread ]
  %.0153 = phi ptr [ %60, %58 ], [ %71, %.loopexit.thread ]
  %78 = load i32, ptr %6, align 8, !tbaa !5
  %.not169 = icmp eq i32 %78, 0
  br i1 %.not169, label %._crit_edge, label %.lr.ph167

.lr.ph167:                                        ; preds = %77
  %.not160 = icmp eq ptr %2, null
  %79 = getelementptr inbounds i8, ptr %2, i64 12
  %80 = getelementptr inbounds i8, ptr %2, i64 8
  br i1 %.not160, label %.lr.ph167.split.us, label %.lr.ph167.split

.lr.ph167.split.us:                               ; preds = %.lr.ph167, %.lr.ph167.split.us
  %.0151166.us = phi i32 [ %84, %.lr.ph167.split.us ], [ 0, %.lr.ph167 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #8
  call void @MatNd_getRowView(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %5, ptr noundef nonnull %1, i32 noundef %.0151166.us)
  call void @MatNd_sqrMulAtBA(ptr noundef %.0152162, ptr noundef nonnull %5, ptr noundef null)
  call void @MatNd_mul(ptr noundef %.0153, ptr noundef %.0, ptr noundef %.0152162)
  %81 = call double @MatNd_trace(ptr noundef %.0153)
  %82 = fadd double %81, 1.000000e+00
  %83 = fdiv double 1.000000e+00, %82
  call void @MatNd_postMulSelf(ptr noundef %.0153, ptr noundef %.0)
  call void @MatNd_constMulSelf(ptr noundef %.0153, double noundef %83)
  call void @MatNd_subSelf(ptr noundef %.0, ptr noundef %.0153)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #8
  %84 = add nuw i32 %.0151166.us, 1
  %85 = load i32, ptr %6, align 8, !tbaa !5
  %86 = icmp ult i32 %84, %85
  br i1 %86, label %.lr.ph167.split.us, label %._crit_edge, !llvm.loop !21

._crit_edge:                                      ; preds = %103, %.lr.ph167.split.us, %77
  %87 = mul i32 %9, %7
  %88 = icmp ugt i32 %87, 1296
  br i1 %88, label %111, label %113

.lr.ph167.split:                                  ; preds = %.lr.ph167, %103
  %.0151166 = phi i32 [ %108, %103 ], [ 0, %.lr.ph167 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #8
  call void @MatNd_getRowView(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %5, ptr noundef nonnull %1, i32 noundef %.0151166)
  call void @MatNd_sqrMulAtBA(ptr noundef %.0152162, ptr noundef nonnull %5, ptr noundef null)
  %89 = load i32, ptr %79, align 4, !tbaa !12
  %90 = icmp eq i32 %89, 1
  br i1 %90, label %103, label %91

91:                                               ; preds = %.lr.ph167.split
  %92 = load i32, ptr %80, align 8, !tbaa !5
  %93 = icmp eq i32 %89, %92
  br i1 %93, label %103, label %94

94:                                               ; preds = %91
  %95 = load ptr, ptr @stderr, align 8, !tbaa !20
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef nonnull @.str.91, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_MillerPinv, i32 noundef 2105) #7
  %97 = load ptr, ptr @stderr, align 8, !tbaa !20
  %98 = load i32, ptr %80, align 8, !tbaa !5
  %99 = load i32, ptr %79, align 4, !tbaa !12
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef nonnull @.str.131, i32 noundef %98, i32 noundef %99, i32 noundef %7, i32 noundef %9) #7
  %101 = load ptr, ptr @stderr, align 8, !tbaa !20
  %102 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %101, ptr noundef nonnull @.str.4) #7
  call void @print_trace() #8
  call void @exit(i32 noundef 1) #9
  unreachable

103:                                              ; preds = %91, %.lr.ph167.split
  %.sink173 = phi i32 [ 0, %.lr.ph167.split ], [ %.0151166, %91 ]
  %104 = call double @MatNd_get(ptr noundef nonnull %2, i32 noundef %.0151166, i32 noundef %.sink173)
  call void @MatNd_constMulSelf(ptr noundef %.0152162, double noundef %104)
  call void @MatNd_mul(ptr noundef %.0153, ptr noundef %.0, ptr noundef %.0152162)
  %105 = call double @MatNd_trace(ptr noundef %.0153)
  %106 = fadd double %105, 1.000000e+00
  %107 = fdiv double 1.000000e+00, %106
  call void @MatNd_postMulSelf(ptr noundef %.0153, ptr noundef %.0)
  call void @MatNd_constMulSelf(ptr noundef %.0153, double noundef %107)
  call void @MatNd_subSelf(ptr noundef %.0, ptr noundef %.0153)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #8
  %108 = add nuw i32 %.0151166, 1
  %109 = load i32, ptr %6, align 8, !tbaa !5
  %110 = icmp ult i32 %108, %109
  br i1 %110, label %.lr.ph167.split, label %._crit_edge, !llvm.loop !21

111:                                              ; preds = %._crit_edge
  %112 = call ptr @MatNd_create(i32 noundef %9, i32 noundef %7)
  br label %124

113:                                              ; preds = %._crit_edge
  %114 = call i32 @llvm.umax.i32(i32 %87, i32 1)
  %115 = shl nuw nsw i32 %114, 3
  %116 = zext nneg i32 %115 to i64
  %117 = add nuw nsw i64 %116, 24
  %118 = alloca i8, i64 %117, align 16
  %119 = getelementptr inbounds i8, ptr %118, i64 24
  store ptr %119, ptr %118, align 16, !tbaa !13
  %120 = getelementptr inbounds i8, ptr %118, i64 8
  store i32 %9, ptr %120, align 8, !tbaa !5
  %121 = getelementptr inbounds i8, ptr %118, i64 12
  store i32 %7, ptr %121, align 4, !tbaa !12
  %122 = getelementptr inbounds i8, ptr %118, i64 16
  store i32 %114, ptr %122, align 16, !tbaa !14
  %123 = getelementptr inbounds i8, ptr %118, i64 20
  store i8 1, ptr %123, align 4, !tbaa !15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %119, i8 0, i64 %116, i1 false)
  br label %124

124:                                              ; preds = %113, %111
  %.0149 = phi ptr [ %112, %111 ], [ %118, %113 ]
  call void @MatNd_transpose(ptr noundef %.0149, ptr noundef nonnull %1)
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %131, label %125

125:                                              ; preds = %124
  %126 = getelementptr inbounds i8, ptr %2, i64 12
  %127 = load i32, ptr %126, align 4, !tbaa !12
  %128 = icmp eq i32 %127, 1
  br i1 %128, label %129, label %130

129:                                              ; preds = %125
  call void @MatNd_postMulDiagSelf(ptr noundef %.0149, ptr noundef nonnull %2)
  br label %131

130:                                              ; preds = %125
  call void @MatNd_postMulSelf(ptr noundef %.0149, ptr noundef nonnull %2)
  br label %131

131:                                              ; preds = %129, %130, %124
  call void @MatNd_reshape(ptr noundef %0, i32 noundef %9, i32 noundef %7)
  call void @MatNd_mul(ptr noundef %0, ptr noundef %.0, ptr noundef %.0149)
  call void @MatNd_destroy(ptr noundef %.0152162)
  call void @MatNd_destroy(ptr noundef %.0)
  call void @MatNd_destroy(ptr noundef %.0153)
  call void @MatNd_destroy(ptr noundef %.0149)
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_getRowView(ptr dead_on_unwind noalias writable sret(%struct._MatNd) align 8, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @MatNd_sqrMulAtBA(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

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

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 = { "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!6, !7, i64 0}
!14 = !{!6, !10, i64 16}
!15 = !{!6, !11, i64 20}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !8, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !19}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass