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

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

%struct.MatrixFrame = type { double, i32, i32, i32, i32, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, i32, i32, ptr, ptr, i64, ptr, i32, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i8, i32, double, i32, i32, i32, i32, i32, i32, %struct.MatrixElement, ptr, i32, ptr, i32, ptr, i32, ptr, ptr }
%struct.MatrixElement = type { double, i32, i32, ptr, ptr, ptr }

@stdout = external global ptr, align 8
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [66 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [123 x i8], align 1
@spcMatrixIsNotValid = external global [0 x i8], align 1
@spcErrorsMustBeCleared = external global [0 x i8], align 1
@spcMatrixMustNotBeFactored = external global [0 x i8], align 1

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

21:                                               ; preds = %5
  %22 = load ptr, ptr %12, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.MatrixFrame, ptr %22, i32 0, i32 17
  %24 = load i64, ptr %23, align 8, !tbaa !13
  %25 = icmp eq i64 %24, 3735928559
  br i1 %25, label %33, label %26

26:                                               ; preds = %21, %5
  %27 = load ptr, ptr @stdout, align 8, !tbaa !5
  %28 = call i32 @fflush(ptr noundef %27)
  %29 = load ptr, ptr @stderr, align 8, !tbaa !5
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 205, ptr noundef @spcMatrixIsNotValid) #5
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  %32 = call i32 @fflush(ptr noundef %31)
  call void @abort() #6
  unreachable

33:                                               ; preds = %21
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.MatrixFrame, ptr %34, i32 0, i32 9
  %36 = load i32, ptr %35, align 4, !tbaa !17
  %37 = icmp sge i32 %36, 0
  br i1 %37, label %38, label %43

38:                                               ; preds = %33
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.MatrixFrame, ptr %39, i32 0, i32 9
  %41 = load i32, ptr %40, align 4, !tbaa !17
  %42 = icmp slt i32 %41, 2
  br i1 %42, label %50, label %43

43:                                               ; preds = %38, %33
  %44 = load ptr, ptr @stdout, align 8, !tbaa !5
  %45 = call i32 @fflush(ptr noundef %44)
  %46 = load ptr, ptr @stderr, align 8, !tbaa !5
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 206, ptr noundef @spcErrorsMustBeCleared) #5
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  %49 = call i32 @fflush(ptr noundef %48)
  call void @abort() #6
  unreachable

50:                                               ; preds = %38
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.MatrixFrame, ptr %51, i32 0, i32 13
  %53 = load i32, ptr %52, align 8, !tbaa !18
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %62

55:                                               ; preds = %50
  %56 = load ptr, ptr @stdout, align 8, !tbaa !5
  %57 = call i32 @fflush(ptr noundef %56)
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 207, ptr noundef @spcMatrixMustNotBeFactored) #5
  %60 = load ptr, ptr @stderr, align 8, !tbaa !5
  %61 = call i32 @fflush(ptr noundef %60)
  call void @abort() #6
  unreachable

62:                                               ; preds = %50
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.MatrixFrame, ptr %63, i32 0, i32 9
  store i32 0, ptr %64, align 4, !tbaa !17
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.MatrixFrame, ptr %65, i32 0, i32 39
  %67 = load i32, ptr %66, align 4, !tbaa !19
  store i32 %67, ptr %15, align 4, !tbaa !11
  %68 = load double, ptr %9, align 8, !tbaa !9
  %69 = fcmp ole double %68, 0.000000e+00
  br i1 %69, label %70, label %74

70:                                               ; preds = %62
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.MatrixFrame, ptr %71, i32 0, i32 33
  %73 = load double, ptr %72, align 8, !tbaa !20
  store double %73, ptr %9, align 8, !tbaa !9
  br label %74

74:                                               ; preds = %70, %62
  %75 = load double, ptr %9, align 8, !tbaa !9
  %76 = fcmp ogt double %75, 1.000000e+00
  br i1 %76, label %77, label %81

77:                                               ; preds = %74
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.MatrixFrame, ptr %78, i32 0, i32 33
  %80 = load double, ptr %79, align 8, !tbaa !20
  store double %80, ptr %9, align 8, !tbaa !9
  br label %81

81:                                               ; preds = %77, %74
  %82 = load double, ptr %9, align 8, !tbaa !9
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.MatrixFrame, ptr %83, i32 0, i32 33
  store double %82, ptr %84, align 8, !tbaa !20
  %85 = load double, ptr %10, align 8, !tbaa !9
  %86 = fcmp olt double %85, 0.000000e+00
  br i1 %86, label %87, label %91

87:                                               ; preds = %81
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.MatrixFrame, ptr %88, i32 0, i32 0
  %90 = load double, ptr %89, align 8, !tbaa !21
  store double %90, ptr %10, align 8, !tbaa !9
  br label %91

91:                                               ; preds = %87, %81
  %92 = load double, ptr %10, align 8, !tbaa !9
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.MatrixFrame, ptr %93, i32 0, i32 0
  store double %92, ptr %94, align 8, !tbaa !21
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.MatrixFrame, ptr %95, i32 0, i32 26
  %97 = load i32, ptr %96, align 4, !tbaa !22
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %153, label %99

99:                                               ; preds = %91
  store i32 1, ptr %14, align 4, !tbaa !11
  br label %100

100:                                              ; preds = %142, %99
  %101 = load i32, ptr %14, align 4, !tbaa !11
  %102 = load i32, ptr %15, align 4, !tbaa !11
  %103 = icmp sle i32 %101, %102
  br i1 %103, label %104, label %145

104:                                              ; preds = %100
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.MatrixFrame, ptr %105, i32 0, i32 5
  %107 = load ptr, ptr %106, align 8, !tbaa !23
  %108 = load i32, ptr %14, align 4, !tbaa !11
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds ptr, ptr %107, i64 %109
  %111 = load ptr, ptr %110, align 8, !tbaa !5
  store ptr %111, ptr %13, align 8, !tbaa !5
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.MatrixElement, ptr %112, i32 0, i32 4
  %114 = load ptr, ptr %113, align 8, !tbaa !24
  %115 = call double @FindLargestInCol(ptr noundef %114)
  store double %115, ptr %16, align 8, !tbaa !9
  %116 = load double, ptr %16, align 8, !tbaa !9
  %117 = load double, ptr %9, align 8, !tbaa !9
  %118 = fmul double %116, %117
  %119 = load ptr, ptr %13, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.MatrixElement, ptr %119, i32 0, i32 0
  %121 = load double, ptr %120, align 8, !tbaa !25
  %122 = fcmp olt double %121, 0.000000e+00
  br i1 %122, label %123, label %128

123:                                              ; preds = %104
  %124 = load ptr, ptr %13, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.MatrixElement, ptr %124, i32 0, i32 0
  %126 = load double, ptr %125, align 8, !tbaa !25
  %127 = fneg double %126
  br label %132

128:                                              ; preds = %104
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.MatrixElement, ptr %129, i32 0, i32 0
  %131 = load double, ptr %130, align 8, !tbaa !25
  br label %132

132:                                              ; preds = %128, %123
  %133 = phi double [ %127, %123 ], [ %131, %128 ]
  %134 = fcmp olt double %118, %133
  br i1 %134, label %135, label %138

135:                                              ; preds = %132
  %136 = load ptr, ptr %12, align 8, !tbaa !5
  %137 = load ptr, ptr %13, align 8, !tbaa !5
  call void @RealRowColElimination(ptr noundef %136, ptr noundef %137)
  br label %141

138:                                              ; preds = %132
  %139 = load ptr, ptr %12, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.MatrixFrame, ptr %139, i32 0, i32 26
  store i32 1, ptr %140, align 4, !tbaa !22
  br label %145

141:                                              ; preds = %135
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %14, align 4, !tbaa !11
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %14, align 4, !tbaa !11
  br label %100, !llvm.loop !26

145:                                              ; preds = %138, %100
  %146 = load ptr, ptr %12, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.MatrixFrame, ptr %146, i32 0, i32 26
  %148 = load i32, ptr %147, align 4, !tbaa !22
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %151, label %150

150:                                              ; preds = %145
  br label %227

151:                                              ; preds = %145
  br label %152

152:                                              ; preds = %151
  br label %177

153:                                              ; preds = %91
  store i32 1, ptr %14, align 4, !tbaa !11
  %154 = load ptr, ptr %12, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.MatrixFrame, ptr %154, i32 0, i32 35
  %156 = load i32, ptr %155, align 4, !tbaa !28
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %160, label %158

158:                                              ; preds = %153
  %159 = load ptr, ptr %12, align 8, !tbaa !5
  call void @spcLinkRows(ptr noundef %159)
  br label %160

160:                                              ; preds = %158, %153
  %161 = load ptr, ptr %12, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.MatrixFrame, ptr %161, i32 0, i32 19
  %163 = load i32, ptr %162, align 8, !tbaa !29
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %167, label %165

165:                                              ; preds = %160
  %166 = load ptr, ptr %12, align 8, !tbaa !5
  call void @spcCreateInternalVectors(ptr noundef %166)
  br label %167

167:                                              ; preds = %165, %160
  %168 = load ptr, ptr %12, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.MatrixFrame, ptr %168, i32 0, i32 9
  %170 = load i32, ptr %169, align 4, !tbaa !17
  %171 = icmp sge i32 %170, 2
  br i1 %171, label %172, label %176

172:                                              ; preds = %167
  %173 = load ptr, ptr %12, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.MatrixFrame, ptr %173, i32 0, i32 9
  %175 = load i32, ptr %174, align 4, !tbaa !17
  store i32 %175, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %237

176:                                              ; preds = %167
  br label %177

177:                                              ; preds = %176, %152
  %178 = load ptr, ptr %12, align 8, !tbaa !5
  %179 = load ptr, ptr %8, align 8, !tbaa !5
  %180 = load i32, ptr %14, align 4, !tbaa !11
  call void @CountMarkowitz(ptr noundef %178, ptr noundef %179, i32 noundef %180)
  %181 = load ptr, ptr %12, align 8, !tbaa !5
  %182 = load i32, ptr %14, align 4, !tbaa !11
  call void @MarkowitzProducts(ptr noundef %181, i32 noundef %182)
  %183 = load ptr, ptr %12, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.MatrixFrame, ptr %183, i32 0, i32 25
  store i32 -1, ptr %184, align 8, !tbaa !30
  br label %185

185:                                              ; preds = %223, %177
  %186 = load i32, ptr %14, align 4, !tbaa !11
  %187 = load i32, ptr %15, align 4, !tbaa !11
  %188 = icmp sle i32 %186, %187
  br i1 %188, label %189, label %226

189:                                              ; preds = %185
  %190 = load ptr, ptr %12, align 8, !tbaa !5
  %191 = load i32, ptr %14, align 4, !tbaa !11
  %192 = load i32, ptr %11, align 4, !tbaa !11
  %193 = call ptr @SearchForPivot(ptr noundef %190, i32 noundef %191, i32 noundef %192)
  store ptr %193, ptr %13, align 8, !tbaa !5
  %194 = load ptr, ptr %13, align 8, !tbaa !5
  %195 = icmp eq ptr %194, null
  br i1 %195, label %196, label %200

196:                                              ; preds = %189
  %197 = load ptr, ptr %12, align 8, !tbaa !5
  %198 = load i32, ptr %14, align 4, !tbaa !11
  %199 = call i32 @MatrixIsSingular(ptr noundef %197, i32 noundef %198)
  store i32 %199, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %237

200:                                              ; preds = %189
  %201 = load ptr, ptr %12, align 8, !tbaa !5
  %202 = load ptr, ptr %13, align 8, !tbaa !5
  %203 = load i32, ptr %14, align 4, !tbaa !11
  call void @ExchangeRowsAndCols(ptr noundef %201, ptr noundef %202, i32 noundef %203)
  %204 = load ptr, ptr %12, align 8, !tbaa !5
  %205 = load ptr, ptr %13, align 8, !tbaa !5
  call void @RealRowColElimination(ptr noundef %204, ptr noundef %205)
  %206 = load ptr, ptr %12, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.MatrixFrame, ptr %206, i32 0, i32 9
  %208 = load i32, ptr %207, align 4, !tbaa !17
  %209 = icmp sgt i32 %208, 2
  br i1 %209, label %210, label %211

210:                                              ; preds = %200
  store i32 0, ptr %15, align 4, !tbaa !11
  br label %211

211:                                              ; preds = %210, %200
  %212 = load ptr, ptr %12, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.MatrixFrame, ptr %212, i32 0, i32 9
  %214 = load i32, ptr %213, align 4, !tbaa !17
  %215 = icmp sge i32 %214, 2
  br i1 %215, label %216, label %220

216:                                              ; preds = %211
  %217 = load ptr, ptr %12, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.MatrixFrame, ptr %217, i32 0, i32 9
  %219 = load i32, ptr %218, align 4, !tbaa !17
  store i32 %219, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %237

220:                                              ; preds = %211
  %221 = load ptr, ptr %12, align 8, !tbaa !5
  %222 = load ptr, ptr %13, align 8, !tbaa !5
  call void @UpdateMarkowitzNumbers(ptr noundef %221, ptr noundef %222)
  br label %223

223:                                              ; preds = %220
  %224 = load i32, ptr %14, align 4, !tbaa !11
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %14, align 4, !tbaa !11
  br label %185, !llvm.loop !31

226:                                              ; preds = %185
  br label %227

227:                                              ; preds = %226, %150
  %228 = load ptr, ptr %12, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.MatrixFrame, ptr %228, i32 0, i32 26
  store i32 0, ptr %229, align 4, !tbaa !22
  %230 = load ptr, ptr %12, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.MatrixFrame, ptr %230, i32 0, i32 34
  store i32 1, ptr %231, align 8, !tbaa !32
  %232 = load ptr, ptr %12, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.MatrixFrame, ptr %232, i32 0, i32 13
  store i32 1, ptr %233, align 8, !tbaa !18
  %234 = load ptr, ptr %12, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.MatrixFrame, ptr %234, i32 0, i32 9
  %236 = load i32, ptr %235, align 4, !tbaa !17
  store i32 %236, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %237

237:                                              ; preds = %227, %216, %196, %172
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  %238 = load i32, ptr %6, align 4
  ret i32 %238
}

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

declare i32 @fflush(ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
declare hidden double @FindLargestInCol(ptr noundef) #0

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

declare void @spcLinkRows(ptr noundef) #2

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

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

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

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

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

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { 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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !15, i64 104}
!14 = !{!"MatrixFrame", !10, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !12, i64 48, !12, i64 52, !12, i64 56, !6, i64 64, !6, i64 72, !12, i64 80, !12, i64 84, !6, i64 88, !6, i64 96, !15, i64 104, !6, i64 112, !12, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !12, i64 168, !12, i64 172, !12, i64 176, !12, i64 180, !12, i64 184, !12, i64 188, !7, i64 192, !12, i64 196, !10, i64 200, !12, i64 208, !12, i64 212, !12, i64 216, !12, i64 220, !12, i64 224, !12, i64 228, !16, i64 232, !6, i64 272, !12, i64 280, !6, i64 288, !12, i64 296, !6, i64 304, !12, i64 312, !6, i64 320, !6, i64 328}
!15 = !{!"long", !7, i64 0}
!16 = !{!"MatrixElement", !10, i64 0, !12, i64 8, !12, i64 12, !6, i64 16, !6, i64 24, !6, i64 32}
!17 = !{!14, !12, i64 52}
!18 = !{!14, !12, i64 80}
!19 = !{!14, !12, i64 228}
!20 = !{!14, !10, i64 200}
!21 = !{!14, !10, i64 0}
!22 = !{!14, !12, i64 172}
!23 = !{!14, !6, i64 24}
!24 = !{!16, !6, i64 24}
!25 = !{!16, !10, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!14, !12, i64 212}
!29 = !{!14, !12, i64 120}
!30 = !{!14, !12, i64 168}
!31 = distinct !{!31, !27}
!32 = !{!14, !12, i64 208}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@stdout = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [66 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [123 x i8], align 1
@spcMatrixIsNotValid = external global [0 x i8], align 1
@spcErrorsMustBeCleared = external global [0 x i8], align 1
@spcMatrixMustNotBeFactored = external global [0 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @spOrderAndFactor(ptr noundef %0, ptr noundef %1, double noundef %2, double noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %10, label %6

6:                                                ; preds = %5
  %7 = getelementptr inbounds i8, ptr %0, i64 104
  %8 = load i64, ptr %7, align 8, !tbaa !5
  %9 = icmp eq i64 %8, 3735928559
  br i1 %9, label %17, label %10

10:                                               ; preds = %6, %5
  %11 = load ptr, ptr @stdout, align 8, !tbaa !14
  %12 = tail call i32 @fflush(ptr noundef %11)
  %13 = load ptr, ptr @stderr, align 8, !tbaa !14
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 205, ptr noundef nonnull @spcMatrixIsNotValid) #4
  %15 = load ptr, ptr @stderr, align 8, !tbaa !14
  %16 = tail call i32 @fflush(ptr noundef %15)
  tail call void @abort() #5
  unreachable

17:                                               ; preds = %6
  %18 = getelementptr inbounds i8, ptr %0, i64 52
  %19 = load i32, ptr %18, align 4, !tbaa !15
  %or.cond = icmp ult i32 %19, 2
  br i1 %or.cond, label %27, label %20

20:                                               ; preds = %17
  %21 = load ptr, ptr @stdout, align 8, !tbaa !14
  %22 = tail call i32 @fflush(ptr noundef %21)
  %23 = load ptr, ptr @stderr, align 8, !tbaa !14
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 206, ptr noundef nonnull @spcErrorsMustBeCleared) #4
  %25 = load ptr, ptr @stderr, align 8, !tbaa !14
  %26 = tail call i32 @fflush(ptr noundef %25)
  tail call void @abort() #5
  unreachable

27:                                               ; preds = %17
  %28 = getelementptr inbounds i8, ptr %0, i64 80
  %29 = load i32, ptr %28, align 8, !tbaa !16
  %.not84 = icmp eq i32 %29, 0
  br i1 %.not84, label %37, label %30

30:                                               ; preds = %27
  %31 = load ptr, ptr @stdout, align 8, !tbaa !14
  %32 = tail call i32 @fflush(ptr noundef %31)
  %33 = load ptr, ptr @stderr, align 8, !tbaa !14
  %34 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 207, ptr noundef nonnull @spcMatrixMustNotBeFactored) #4
  %35 = load ptr, ptr @stderr, align 8, !tbaa !14
  %36 = tail call i32 @fflush(ptr noundef %35)
  tail call void @abort() #5
  unreachable

37:                                               ; preds = %27
  store i32 0, ptr %18, align 4, !tbaa !15
  %38 = getelementptr inbounds i8, ptr %0, i64 228
  %39 = load i32, ptr %38, align 4, !tbaa !17
  %40 = fcmp ugt double %2, 0.000000e+00
  br i1 %40, label %44, label %41

41:                                               ; preds = %37
  %42 = getelementptr inbounds i8, ptr %0, i64 200
  %43 = load double, ptr %42, align 8, !tbaa !18
  br label %44

44:                                               ; preds = %41, %37
  %.072 = phi double [ %43, %41 ], [ %2, %37 ]
  %45 = fcmp ogt double %.072, 1.000000e+00
  br i1 %45, label %46, label %49

46:                                               ; preds = %44
  %47 = getelementptr inbounds i8, ptr %0, i64 200
  %48 = load double, ptr %47, align 8, !tbaa !18
  br label %49

49:                                               ; preds = %46, %44
  %.173 = phi double [ %48, %46 ], [ %.072, %44 ]
  %50 = getelementptr inbounds i8, ptr %0, i64 200
  store double %.173, ptr %50, align 8, !tbaa !18
  %51 = fcmp olt double %3, 0.000000e+00
  br i1 %51, label %52, label %54

52:                                               ; preds = %49
  %53 = load double, ptr %0, align 8, !tbaa !19
  br label %54

54:                                               ; preds = %52, %49
  %.074 = phi double [ %53, %52 ], [ %3, %49 ]
  store double %.074, ptr %0, align 8, !tbaa !19
  %55 = getelementptr inbounds i8, ptr %0, i64 172
  %56 = load i32, ptr %55, align 4, !tbaa !20
  %.not85 = icmp eq i32 %56, 0
  br i1 %.not85, label %.preheader, label %75

.preheader:                                       ; preds = %54
  %.not8696 = icmp slt i32 %39, 1
  br i1 %.not8696, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %57 = getelementptr inbounds i8, ptr %0, i64 24
  %58 = add nuw i32 %39, 1
  %wide.trip.count = zext i32 %58 to i64
  br label %59

59:                                               ; preds = %.lr.ph, %72
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %72 ]
  %60 = load ptr, ptr %57, align 8, !tbaa !21
  %61 = getelementptr inbounds ptr, ptr %60, i64 %indvars.iv
  %62 = load ptr, ptr %61, align 8, !tbaa !14
  %63 = getelementptr inbounds i8, ptr %62, i64 24
  %64 = load ptr, ptr %63, align 8, !tbaa !22
  %65 = tail call double @FindLargestInCol(ptr noundef %64)
  %66 = fmul double %.173, %65
  %67 = load double, ptr %62, align 8, !tbaa !23
  %68 = fcmp olt double %67, 0.000000e+00
  %69 = fneg double %67
  %70 = select i1 %68, double %69, double %67
  %71 = fcmp olt double %66, %70
  br i1 %71, label %72, label %.thread

72:                                               ; preds = %59
  tail call void @RealRowColElimination(ptr noundef nonnull %0, ptr noundef nonnull %62)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %59, !llvm.loop !24

.thread:                                          ; preds = %59
  %73 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 1, ptr %55, align 4, !tbaa !20
  br label %86

._crit_edge:                                      ; preds = %72
  %.pr.pre = load i32, ptr %55, align 4, !tbaa !20
  %74 = icmp eq i32 %.pr.pre, 0
  br i1 %74, label %.loopexit, label %86

75:                                               ; preds = %54
  %76 = getelementptr inbounds i8, ptr %0, i64 212
  %77 = load i32, ptr %76, align 4, !tbaa !26
  %.not88 = icmp eq i32 %77, 0
  br i1 %.not88, label %78, label %79

78:                                               ; preds = %75
  tail call void @spcLinkRows(ptr noundef nonnull %0) #6
  br label %79

79:                                               ; preds = %78, %75
  %80 = getelementptr inbounds i8, ptr %0, i64 120
  %81 = load i32, ptr %80, align 8, !tbaa !27
  %.not89 = icmp eq i32 %81, 0
  br i1 %.not89, label %82, label %83

82:                                               ; preds = %79
  tail call void @spcCreateInternalVectors(ptr noundef nonnull %0)
  br label %83

83:                                               ; preds = %82, %79
  %84 = load i32, ptr %18, align 4, !tbaa !15
  %85 = icmp sgt i32 %84, 1
  br i1 %85, label %.loopexit92, label %86

86:                                               ; preds = %.thread, %83, %._crit_edge
  %.171 = phi i32 [ 1, %83 ], [ %58, %._crit_edge ], [ %73, %.thread ]
  tail call void @CountMarkowitz(ptr noundef nonnull %0, ptr noundef %1, i32 noundef %.171)
  tail call void @MarkowitzProducts(ptr noundef nonnull %0, i32 noundef %.171)
  %87 = getelementptr inbounds i8, ptr %0, i64 168
  store i32 -1, ptr %87, align 8, !tbaa !28
  %.not9098 = icmp sgt i32 %.171, %39
  br i1 %.not9098, label %.loopexit, label %.lr.ph101

.lr.ph101:                                        ; preds = %86, %95
  %.299 = phi i32 [ %96, %95 ], [ %.171, %86 ]
  %88 = tail call ptr @SearchForPivot(ptr noundef nonnull %0, i32 noundef %.299, i32 noundef %4)
  %89 = icmp eq ptr %88, null
  br i1 %89, label %90, label %92

90:                                               ; preds = %.lr.ph101
  %91 = tail call i32 @MatrixIsSingular(ptr noundef nonnull %0, i32 noundef %.299)
  br label %.loopexit92

92:                                               ; preds = %.lr.ph101
  tail call void @ExchangeRowsAndCols(ptr noundef nonnull %0, ptr noundef nonnull %88, i32 noundef %.299)
  tail call void @RealRowColElimination(ptr noundef nonnull %0, ptr noundef nonnull %88)
  %93 = load i32, ptr %18, align 4, !tbaa !15
  %94 = icmp sgt i32 %93, 1
  br i1 %94, label %.loopexit92, label %95

95:                                               ; preds = %92
  tail call void @UpdateMarkowitzNumbers(ptr noundef nonnull %0, ptr noundef nonnull %88)
  %96 = add i32 %.299, 1
  %exitcond108.not = icmp eq i32 %.299, %39
  br i1 %exitcond108.not, label %.loopexit, label %.lr.ph101, !llvm.loop !29

.loopexit:                                        ; preds = %95, %.preheader, %86, %._crit_edge
  store i32 0, ptr %55, align 4, !tbaa !20
  %97 = getelementptr inbounds i8, ptr %0, i64 208
  store i32 1, ptr %97, align 8, !tbaa !30
  store i32 1, ptr %28, align 8, !tbaa !16
  %98 = load i32, ptr %18, align 4, !tbaa !15
  br label %.loopexit92

.loopexit92:                                      ; preds = %92, %83, %.loopexit, %90
  %.0 = phi i32 [ %91, %90 ], [ %98, %.loopexit ], [ %84, %83 ], [ %93, %92 ]
  ret i32 %.0
}

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

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

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

; Function Attrs: nounwind uwtable
declare hidden double @FindLargestInCol(ptr noundef) local_unnamed_addr #0

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

declare void @spcLinkRows(ptr noundef) local_unnamed_addr #3

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !12, i64 104}
!6 = !{!"MatrixFrame", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !11, i64 24, !11, i64 32, !11, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !11, i64 64, !11, i64 72, !10, i64 80, !10, i64 84, !11, i64 88, !11, i64 96, !12, i64 104, !11, i64 112, !10, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !8, i64 192, !10, i64 196, !7, i64 200, !10, i64 208, !10, i64 212, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !13, i64 232, !11, i64 272, !10, i64 280, !11, i64 288, !10, i64 296, !11, i64 304, !10, i64 312, !11, i64 320, !11, i64 328}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!"MatrixElement", !7, i64 0, !10, i64 8, !10, i64 12, !11, i64 16, !11, i64 24, !11, i64 32}
!14 = !{!11, !11, i64 0}
!15 = !{!6, !10, i64 52}
!16 = !{!6, !10, i64 80}
!17 = !{!6, !10, i64 228}
!18 = !{!6, !7, i64 200}
!19 = !{!6, !7, i64 0}
!20 = !{!6, !10, i64 172}
!21 = !{!6, !11, i64 24}
!22 = !{!13, !11, i64 24}
!23 = !{!13, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!6, !10, i64 212}
!27 = !{!6, !10, i64 120}
!28 = !{!6, !10, i64 168}
!29 = distinct !{!29, !25}
!30 = !{!6, !10, i64 208}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass