; LLVM IR from ERGO-Code/HiGHS :: src/ipm/ipx/sparse_matrix.ll (ZN3ipx14NormestInverseERKNS_12SparseMatrixEPKci)

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

%"class.std::valarray" = type { i64, ptr }

@.str.12 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__._ZN3ipx14NormestInverseERKNS_12SparseMatrixEPKci = external hidden unnamed_addr constant [68 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [22 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3ipx12SparseMatrix4rowsEv(ptr noundef nonnull align 8 dereferenceable(128)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3ipx12SparseMatrix4colsEv(ptr noundef nonnull align 8 dereferenceable(128)) #2 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK3ipx12SparseMatrix5valueEi(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3ipx15TriangularSolveERKNS_12SparseMatrixERSt8valarrayIdEcPKci(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(16), i8 noundef signext, ptr noundef, i32 noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt8valarrayIdEC2Em(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) unnamed_addr #6 align 2

declare noundef double @_ZN3ipx7InfnormERKSt8valarrayIdE(ptr noundef nonnull align 8 dereferenceable(16)) #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt8valarrayIdED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN3ipx14NormestInverseERKNS_12SparseMatrixEPKci(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef %1, i32 noundef %2) #5 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::valarray", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca double, align 8
  %21 = alloca i32, align 4
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = call noundef i32 @_ZNK3ipx12SparseMatrix4rowsEv(ptr noundef nonnull align 8 dereferenceable(128) %26)
  store i32 %27, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #8
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  call void @_ZNSt8valarrayIdEC2Em(ptr noundef nonnull align 8 dereferenceable(16) %8, i64 noundef %29)
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = invoke noundef i32 @_ZNK3ipx12SparseMatrix4rowsEv(ptr noundef nonnull align 8 dereferenceable(128) %30)
          to label %32 unwind label %39

32:                                               ; preds = %3
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = invoke noundef i32 @_ZNK3ipx12SparseMatrix4colsEv(ptr noundef nonnull align 8 dereferenceable(128) %33)
          to label %35 unwind label %39

35:                                               ; preds = %32
  %36 = icmp eq i32 %31, %34
  br i1 %36, label %37, label %38

37:                                               ; preds = %35
  br label %44

38:                                               ; preds = %35
  call void @__assert_fail(ptr noundef @.str.26, ptr noundef @.str.12, i32 noundef 335, ptr noundef @__PRETTY_FUNCTION__._ZN3ipx14NormestInverseERKNS_12SparseMatrixEPKci) #9
  unreachable

39:                                               ; preds = %32, %3
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %9, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %10, align 4
  br label %292

43:                                               ; No predecessors!
  br label %44

44:                                               ; preds = %43, %37
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = load i8, ptr %45, align 1, !tbaa !11
  %47 = sext i8 %46 to i32
  %48 = icmp eq i32 %47, 117
  br i1 %48, label %54, label %49

49:                                               ; preds = %44
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = load i8, ptr %50, align 1, !tbaa !11
  %52 = sext i8 %51 to i32
  %53 = icmp eq i32 %52, 85
  br i1 %53, label %54, label %153

54:                                               ; preds = %49, %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %146, %54
  %56 = load i32, ptr %11, align 4, !tbaa !9
  %57 = load i32, ptr %7, align 4, !tbaa !9
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %152

60:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = load i32, ptr %11, align 4, !tbaa !9
  %63 = invoke noundef i32 @_ZNK3ipx12SparseMatrix5beginEi(ptr noundef nonnull align 8 dereferenceable(128) %61, i32 noundef %62)
          to label %64 unwind label %74

64:                                               ; preds = %60
  store i32 %63, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = load i32, ptr %11, align 4, !tbaa !9
  %67 = invoke noundef i32 @_ZNK3ipx12SparseMatrix3endEi(ptr noundef nonnull align 8 dereferenceable(128) %65, i32 noundef %66)
          to label %68 unwind label %78

68:                                               ; preds = %64
  store i32 %67, ptr %14, align 4, !tbaa !9
  %69 = load i32, ptr %6, align 4, !tbaa !9
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %82, label %71

71:                                               ; preds = %68
  %72 = load i32, ptr %14, align 4, !tbaa !9
  %73 = add nsw i32 %72, -1
  store i32 %73, ptr %14, align 4, !tbaa !9
  br label %82

74:                                               ; preds = %60
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %9, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %10, align 4
  br label %151

78:                                               ; preds = %64
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %9, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %10, align 4
  br label %150

82:                                               ; preds = %71, %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  store double 0.000000e+00, ptr %15, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %83 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %83, ptr %16, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %104, %82
  %85 = load i32, ptr %16, align 4, !tbaa !9
  %86 = load i32, ptr %14, align 4, !tbaa !9
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

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

89:                                               ; preds = %84
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = load i32, ptr %16, align 4, !tbaa !9
  %92 = invoke noundef i32 @_ZNK3ipx12SparseMatrix5indexEi(ptr noundef nonnull align 8 dereferenceable(128) %90, i32 noundef %91)
          to label %93 unwind label %107

93:                                               ; preds = %89
  %94 = sext i32 %92 to i64
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %8, i64 noundef %94) #8
  %96 = load double, ptr %95, align 8, !tbaa !12
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = load i32, ptr %16, align 4, !tbaa !9
  %99 = invoke noundef double @_ZNK3ipx12SparseMatrix5valueEi(ptr noundef nonnull align 8 dereferenceable(128) %97, i32 noundef %98)
          to label %100 unwind label %107

100:                                              ; preds = %93
  %101 = load double, ptr %15, align 8, !tbaa !12
  %102 = fneg double %96
  %103 = call double @llvm.fmuladd.f64(double %102, double %99, double %101)
  store double %103, ptr %15, align 8, !tbaa !12
  br label %104

104:                                              ; preds = %100
  %105 = load i32, ptr %16, align 4, !tbaa !9
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %16, align 4, !tbaa !9
  br label %84, !llvm.loop !14

107:                                              ; preds = %93, %89
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %9, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %149

111:                                              ; preds = %88
  %112 = load double, ptr %15, align 8, !tbaa !12
  %113 = fcmp oge double %112, 0.000000e+00
  %114 = zext i1 %113 to i64
  %115 = select i1 %113, double 1.000000e+00, double -1.000000e+00
  %116 = load double, ptr %15, align 8, !tbaa !12
  %117 = fadd double %116, %115
  store double %117, ptr %15, align 8, !tbaa !12
  %118 = load i32, ptr %6, align 4, !tbaa !9
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %141, label %120

120:                                              ; preds = %111
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = load i32, ptr %14, align 4, !tbaa !9
  %123 = invoke noundef i32 @_ZNK3ipx12SparseMatrix5indexEi(ptr noundef nonnull align 8 dereferenceable(128) %121, i32 noundef %122)
          to label %124 unwind label %129

124:                                              ; preds = %120
  %125 = load i32, ptr %11, align 4, !tbaa !9
  %126 = icmp eq i32 %123, %125
  br i1 %126, label %127, label %128

127:                                              ; preds = %124
  br label %134

128:                                              ; preds = %124
  call void @__assert_fail(ptr noundef @.str.27, ptr noundef @.str.12, i32 noundef 350, ptr noundef @__PRETTY_FUNCTION__._ZN3ipx14NormestInverseERKNS_12SparseMatrixEPKci) #9
  unreachable

129:                                              ; preds = %134, %120
  %130 = landingpad { ptr, i32 }
          cleanup
  %131 = extractvalue { ptr, i32 } %130, 0
  store ptr %131, ptr %9, align 8
  %132 = extractvalue { ptr, i32 } %130, 1
  store i32 %132, ptr %10, align 4
  br label %149

133:                                              ; No predecessors!
  br label %134

134:                                              ; preds = %133, %127
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = load i32, ptr %14, align 4, !tbaa !9
  %137 = invoke noundef double @_ZNK3ipx12SparseMatrix5valueEi(ptr noundef nonnull align 8 dereferenceable(128) %135, i32 noundef %136)
          to label %138 unwind label %129

138:                                              ; preds = %134
  %139 = load double, ptr %15, align 8, !tbaa !12
  %140 = fdiv double %139, %137
  store double %140, ptr %15, align 8, !tbaa !12
  br label %141

141:                                              ; preds = %138, %111
  %142 = load double, ptr %15, align 8, !tbaa !12
  %143 = load i32, ptr %11, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %8, i64 noundef %144) #8
  store double %142, ptr %145, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %146

146:                                              ; preds = %141
  %147 = load i32, ptr %11, align 4, !tbaa !9
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %11, align 4, !tbaa !9
  br label %55, !llvm.loop !16

149:                                              ; preds = %129, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %150

150:                                              ; preds = %149, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %151

151:                                              ; preds = %150, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %292

152:                                              ; preds = %59
  br label %255

153:                                              ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %154 = load i32, ptr %7, align 4, !tbaa !9
  %155 = sub nsw i32 %154, 1
  store i32 %155, ptr %17, align 4, !tbaa !9
  br label %156

156:                                              ; preds = %248, %153
  %157 = load i32, ptr %17, align 4, !tbaa !9
  %158 = icmp sge i32 %157, 0
  br i1 %158, label %160, label %159

159:                                              ; preds = %156
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %254

160:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %161 = load ptr, ptr %4, align 8, !tbaa !5
  %162 = load i32, ptr %17, align 4, !tbaa !9
  %163 = invoke noundef i32 @_ZNK3ipx12SparseMatrix5beginEi(ptr noundef nonnull align 8 dereferenceable(128) %161, i32 noundef %162)
          to label %164 unwind label %174

164:                                              ; preds = %160
  store i32 %163, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = load i32, ptr %17, align 4, !tbaa !9
  %167 = invoke noundef i32 @_ZNK3ipx12SparseMatrix3endEi(ptr noundef nonnull align 8 dereferenceable(128) %165, i32 noundef %166)
          to label %168 unwind label %178

168:                                              ; preds = %164
  store i32 %167, ptr %19, align 4, !tbaa !9
  %169 = load i32, ptr %6, align 4, !tbaa !9
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %182, label %171

171:                                              ; preds = %168
  %172 = load i32, ptr %18, align 4, !tbaa !9
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %18, align 4, !tbaa !9
  br label %182

174:                                              ; preds = %160
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %9, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %10, align 4
  br label %253

178:                                              ; preds = %164
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %9, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %10, align 4
  br label %252

182:                                              ; preds = %171, %168
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  store double 0.000000e+00, ptr %20, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %183 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %183, ptr %21, align 4, !tbaa !9
  br label %184

184:                                              ; preds = %204, %182
  %185 = load i32, ptr %21, align 4, !tbaa !9
  %186 = load i32, ptr %19, align 4, !tbaa !9
  %187 = icmp slt i32 %185, %186
  br i1 %187, label %189, label %188

188:                                              ; preds = %184
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %211

189:                                              ; preds = %184
  %190 = load ptr, ptr %4, align 8, !tbaa !5
  %191 = load i32, ptr %21, align 4, !tbaa !9
  %192 = invoke noundef i32 @_ZNK3ipx12SparseMatrix5indexEi(ptr noundef nonnull align 8 dereferenceable(128) %190, i32 noundef %191)
          to label %193 unwind label %207

193:                                              ; preds = %189
  %194 = sext i32 %192 to i64
  %195 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %8, i64 noundef %194) #8
  %196 = load double, ptr %195, align 8, !tbaa !12
  %197 = load ptr, ptr %4, align 8, !tbaa !5
  %198 = load i32, ptr %21, align 4, !tbaa !9
  %199 = invoke noundef double @_ZNK3ipx12SparseMatrix5valueEi(ptr noundef nonnull align 8 dereferenceable(128) %197, i32 noundef %198)
          to label %200 unwind label %207

200:                                              ; preds = %193
  %201 = load double, ptr %20, align 8, !tbaa !12
  %202 = fneg double %196
  %203 = call double @llvm.fmuladd.f64(double %202, double %199, double %201)
  store double %203, ptr %20, align 8, !tbaa !12
  br label %204

204:                                              ; preds = %200
  %205 = load i32, ptr %21, align 4, !tbaa !9
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %21, align 4, !tbaa !9
  br label %184, !llvm.loop !17

207:                                              ; preds = %193, %189
  %208 = landingpad { ptr, i32 }
          cleanup
  %209 = extractvalue { ptr, i32 } %208, 0
  store ptr %209, ptr %9, align 8
  %210 = extractvalue { ptr, i32 } %208, 1
  store i32 %210, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %251

211:                                              ; preds = %188
  %212 = load double, ptr %20, align 8, !tbaa !12
  %213 = fcmp oge double %212, 0.000000e+00
  %214 = zext i1 %213 to i64
  %215 = select i1 %213, double 1.000000e+00, double -1.000000e+00
  %216 = load double, ptr %20, align 8, !tbaa !12
  %217 = fadd double %216, %215
  store double %217, ptr %20, align 8, !tbaa !12
  %218 = load i32, ptr %6, align 4, !tbaa !9
  %219 = icmp ne i32 %218, 0
  br i1 %219, label %243, label %220

220:                                              ; preds = %211
  %221 = load ptr, ptr %4, align 8, !tbaa !5
  %222 = load i32, ptr %18, align 4, !tbaa !9
  %223 = sub nsw i32 %222, 1
  %224 = invoke noundef i32 @_ZNK3ipx12SparseMatrix5indexEi(ptr noundef nonnull align 8 dereferenceable(128) %221, i32 noundef %223)
          to label %225 unwind label %230

225:                                              ; preds = %220
  %226 = load i32, ptr %17, align 4, !tbaa !9
  %227 = icmp eq i32 %224, %226
  br i1 %227, label %228, label %229

228:                                              ; preds = %225
  br label %235

229:                                              ; preds = %225
  call void @__assert_fail(ptr noundef @.str.28, ptr noundef @.str.12, i32 noundef 366, ptr noundef @__PRETTY_FUNCTION__._ZN3ipx14NormestInverseERKNS_12SparseMatrixEPKci) #9
  unreachable

230:                                              ; preds = %235, %220
  %231 = landingpad { ptr, i32 }
          cleanup
  %232 = extractvalue { ptr, i32 } %231, 0
  store ptr %232, ptr %9, align 8
  %233 = extractvalue { ptr, i32 } %231, 1
  store i32 %233, ptr %10, align 4
  br label %251

234:                                              ; No predecessors!
  br label %235

235:                                              ; preds = %234, %228
  %236 = load ptr, ptr %4, align 8, !tbaa !5
  %237 = load i32, ptr %18, align 4, !tbaa !9
  %238 = sub nsw i32 %237, 1
  %239 = invoke noundef double @_ZNK3ipx12SparseMatrix5valueEi(ptr noundef nonnull align 8 dereferenceable(128) %236, i32 noundef %238)
          to label %240 unwind label %230

240:                                              ; preds = %235
  %241 = load double, ptr %20, align 8, !tbaa !12
  %242 = fdiv double %241, %239
  store double %242, ptr %20, align 8, !tbaa !12
  br label %243

243:                                              ; preds = %240, %211
  %244 = load double, ptr %20, align 8, !tbaa !12
  %245 = load i32, ptr %17, align 4, !tbaa !9
  %246 = sext i32 %245 to i64
  %247 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %8, i64 noundef %246) #8
  store double %244, ptr %247, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %248

248:                                              ; preds = %243
  %249 = load i32, ptr %17, align 4, !tbaa !9
  %250 = add nsw i32 %249, -1
  store i32 %250, ptr %17, align 4, !tbaa !9
  br label %156, !llvm.loop !18

251:                                              ; preds = %230, %207
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %252

252:                                              ; preds = %251, %178
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %253

253:                                              ; preds = %252, %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %292

254:                                              ; preds = %159
  br label %255

255:                                              ; preds = %254, %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %256 = invoke noundef double @_ZN3ipx7OnenormERKSt8valarrayIdE(ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %257 unwind label %273

257:                                              ; preds = %255
  store double %256, ptr %22, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %258 = invoke noundef double @_ZN3ipx7InfnormERKSt8valarrayIdE(ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %259 unwind label %277

259:                                              ; preds = %257
  store double %258, ptr %23, align 8, !tbaa !12
  %260 = load ptr, ptr %4, align 8, !tbaa !5
  %261 = load ptr, ptr %5, align 8, !tbaa !5
  %262 = load i32, ptr %6, align 4, !tbaa !9
  %263 = invoke noundef i32 @_ZN3ipx15TriangularSolveERKNS_12SparseMatrixERSt8valarrayIdEcPKci(ptr noundef nonnull align 8 dereferenceable(128) %260, ptr noundef nonnull align 8 dereferenceable(16) %8, i8 noundef signext 110, ptr noundef %261, i32 noundef %262)
          to label %264 unwind label %277

264:                                              ; preds = %259
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %265 = invoke noundef double @_ZN3ipx7OnenormERKSt8valarrayIdE(ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %266 unwind label %281

266:                                              ; preds = %264
  store double %265, ptr %24, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %267 = load double, ptr %24, align 8, !tbaa !12
  %268 = load double, ptr %22, align 8, !tbaa !12
  %269 = fdiv double %267, %268
  store double %269, ptr %25, align 8, !tbaa !12
  %270 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %271 unwind label %285

271:                                              ; preds = %266
  %272 = load double, ptr %270, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @_ZNSt8valarrayIdED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  ret double %272

273:                                              ; preds = %255
  %274 = landingpad { ptr, i32 }
          cleanup
  %275 = extractvalue { ptr, i32 } %274, 0
  store ptr %275, ptr %9, align 8
  %276 = extractvalue { ptr, i32 } %274, 1
  store i32 %276, ptr %10, align 4
  br label %291

277:                                              ; preds = %259, %257
  %278 = landingpad { ptr, i32 }
          cleanup
  %279 = extractvalue { ptr, i32 } %278, 0
  store ptr %279, ptr %9, align 8
  %280 = extractvalue { ptr, i32 } %278, 1
  store i32 %280, ptr %10, align 4
  br label %290

281:                                              ; preds = %264
  %282 = landingpad { ptr, i32 }
          cleanup
  %283 = extractvalue { ptr, i32 } %282, 0
  store ptr %283, ptr %9, align 8
  %284 = extractvalue { ptr, i32 } %282, 1
  store i32 %284, ptr %10, align 4
  br label %289

285:                                              ; preds = %266
  %286 = landingpad { ptr, i32 }
          cleanup
  %287 = extractvalue { ptr, i32 } %286, 0
  store ptr %287, ptr %9, align 8
  %288 = extractvalue { ptr, i32 } %286, 1
  store i32 %288, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %289

289:                                              ; preds = %285, %281
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  br label %290

290:                                              ; preds = %289, %277
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  br label %291

291:                                              ; preds = %290, %273
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  br label %292

292:                                              ; preds = %291, %253, %151, %39
  call void @_ZNSt8valarrayIdED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %293

293:                                              ; preds = %292
  %294 = load ptr, ptr %9, align 8
  %295 = load i32, ptr %10, align 4
  %296 = insertvalue { ptr, i32 } poison, ptr %294, 0
  %297 = insertvalue { ptr, i32 } %296, i32 %295, 1
  resume { ptr, i32 } %297
}

declare noundef double @_ZN3ipx7OnenormERKSt8valarrayIdE(ptr noundef nonnull align 8 dereferenceable(16)) #7

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}


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

%"class.std::valarray" = type { i64, ptr }

@.str.12 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__._ZN3ipx14NormestInverseERKNS_12SparseMatrixEPKci = external hidden unnamed_addr constant [68 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [22 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3ipx12SparseMatrix4rowsEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3ipx12SparseMatrix4colsEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK3ipx12SparseMatrix5valueEi(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3ipx15TriangularSolveERKNS_12SparseMatrixERSt8valarrayIdEcPKci(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(16), i8 noundef signext, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt8valarrayIdEC2Em(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) unnamed_addr #6 align 2

declare noundef double @_ZN3ipx7InfnormERKSt8valarrayIdE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt8valarrayIdED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN3ipx14NormestInverseERKNS_12SparseMatrixEPKci(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::valarray", align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = tail call noundef i32 @_ZNK3ipx12SparseMatrix4rowsEv(ptr noundef nonnull align 8 dereferenceable(128) %0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #8
  %8 = sext i32 %7 to i64
  call void @_ZNSt8valarrayIdEC2Em(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %8)
  %9 = call noundef i32 @_ZNK3ipx12SparseMatrix4rowsEv(ptr noundef nonnull align 8 dereferenceable(128) %0)
  %10 = call noundef i32 @_ZNK3ipx12SparseMatrix4colsEv(ptr noundef nonnull align 8 dereferenceable(128) %0)
  %11 = icmp eq i32 %9, %10
  br i1 %11, label %13, label %12

12:                                               ; preds = %3
  call void @__assert_fail(ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.12, i32 noundef 335, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3ipx14NormestInverseERKNS_12SparseMatrixEPKci) #9
  unreachable

13:                                               ; preds = %3
  %14 = load i8, ptr %1, align 1, !tbaa !5
  switch i8 %14, label %.preheader [
    i8 117, label %41
    i8 85, label %41
  ]

.preheader:                                       ; preds = %13
  %15 = icmp sgt i32 %7, 0
  br i1 %15, label %.lr.ph101, label %.loopexit

.lr.ph101:                                        ; preds = %.preheader
  %.07799 = add nsw i32 %7, -1
  %.not = icmp eq i32 %2, 0
  %16 = zext i1 %.not to i32
  %17 = zext nneg i32 %.07799 to i64
  br i1 %.not, label %.lr.ph101.split.us, label %.lr.ph101.split

.lr.ph101.split.us:                               ; preds = %.lr.ph101, %25
  %indvars.iv120 = phi i64 [ %indvars.iv.next121, %25 ], [ %17, %.lr.ph101 ]
  %18 = trunc nuw nsw i64 %indvars.iv120 to i32
  %19 = call noundef i32 @_ZNK3ipx12SparseMatrix5beginEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %18)
  %20 = call noundef i32 @_ZNK3ipx12SparseMatrix3endEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %18)
  %spec.select86.us = add nsw i32 %19, %16
  %21 = icmp slt i32 %spec.select86.us, %20
  br i1 %21, label %.lr.ph96.us, label %._crit_edge97.us

._crit_edge97.us:                                 ; preds = %.lr.ph96.us, %.lr.ph101.split.us
  %.073.lcssa.us = phi double [ 0.000000e+00, %.lr.ph101.split.us ], [ %38, %.lr.ph96.us ]
  %22 = call noundef i32 @_ZNK3ipx12SparseMatrix5indexEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %19)
  %23 = zext i32 %22 to i64
  %24 = icmp eq i64 %indvars.iv120, %23
  br i1 %24, label %25, label %.split.us102

25:                                               ; preds = %._crit_edge97.us
  %26 = fcmp oge double %.073.lcssa.us, 0.000000e+00
  %27 = select i1 %26, double 1.000000e+00, double -1.000000e+00
  %28 = fadd double %.073.lcssa.us, %27
  %29 = call noundef double @_ZNK3ipx12SparseMatrix5valueEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %19)
  %30 = fdiv double %28, %29
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %indvars.iv120) #8
  store double %30, ptr %31, align 8, !tbaa !8
  %indvars.iv.next121 = add nsw i64 %indvars.iv120, -1
  %.not129 = icmp eq i64 %indvars.iv120, 0
  br i1 %.not129, label %.loopexit, label %.lr.ph101.split.us, !llvm.loop !10

.lr.ph96.us:                                      ; preds = %.lr.ph101.split.us, %.lr.ph96.us
  %.07294.us = phi i32 [ %39, %.lr.ph96.us ], [ %spec.select86.us, %.lr.ph101.split.us ]
  %.07393.us = phi double [ %38, %.lr.ph96.us ], [ 0.000000e+00, %.lr.ph101.split.us ]
  %32 = call noundef i32 @_ZNK3ipx12SparseMatrix5indexEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %.07294.us)
  %33 = sext i32 %32 to i64
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %33) #8
  %35 = load double, ptr %34, align 8, !tbaa !8
  %36 = call noundef double @_ZNK3ipx12SparseMatrix5valueEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %.07294.us)
  %37 = fneg double %35
  %38 = call double @llvm.fmuladd.f64(double %37, double %36, double %.07393.us)
  %39 = add nsw i32 %.07294.us, 1
  %40 = icmp slt i32 %39, %20
  br i1 %40, label %.lr.ph96.us, label %._crit_edge97.us, !llvm.loop !12

41:                                               ; preds = %13, %13
  %42 = icmp sgt i32 %7, 0
  br i1 %42, label %.lr.ph92, label %.loopexit

.lr.ph92:                                         ; preds = %41
  %.not85 = icmp eq i32 %2, 0
  %wide.trip.count115 = zext nneg i32 %7 to i64
  br i1 %.not85, label %.lr.ph92.split.us, label %.lr.ph92.split

.lr.ph92.split.us:                                ; preds = %.lr.ph92, %51
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %51 ], [ 0, %.lr.ph92 ]
  %43 = trunc nuw nsw i64 %indvars.iv112 to i32
  %44 = call noundef i32 @_ZNK3ipx12SparseMatrix5beginEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %43)
  %45 = call noundef i32 @_ZNK3ipx12SparseMatrix3endEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %43)
  %46 = add nsw i32 %45, -1
  %47 = icmp slt i32 %44, %46
  br i1 %47, label %.lr.ph.us, label %._crit_edge.us

._crit_edge.us:                                   ; preds = %.lr.ph.us, %.lr.ph92.split.us
  %.079.lcssa.us = phi double [ 0.000000e+00, %.lr.ph92.split.us ], [ %64, %.lr.ph.us ]
  %48 = call noundef i32 @_ZNK3ipx12SparseMatrix5indexEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %46)
  %49 = zext i32 %48 to i64
  %50 = icmp eq i64 %indvars.iv112, %49
  br i1 %50, label %51, label %.split.us

51:                                               ; preds = %._crit_edge.us
  %52 = fcmp oge double %.079.lcssa.us, 0.000000e+00
  %53 = select i1 %52, double 1.000000e+00, double -1.000000e+00
  %54 = fadd double %.079.lcssa.us, %53
  %55 = call noundef double @_ZNK3ipx12SparseMatrix5valueEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %46)
  %56 = fdiv double %54, %55
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %indvars.iv112) #8
  store double %56, ptr %57, align 8, !tbaa !8
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %exitcond116.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count115
  br i1 %exitcond116.not, label %.loopexit, label %.lr.ph92.split.us, !llvm.loop !13

.lr.ph.us:                                        ; preds = %.lr.ph92.split.us, %.lr.ph.us
  %.07889.us = phi i32 [ %65, %.lr.ph.us ], [ %44, %.lr.ph92.split.us ]
  %.07988.us = phi double [ %64, %.lr.ph.us ], [ 0.000000e+00, %.lr.ph92.split.us ]
  %58 = call noundef i32 @_ZNK3ipx12SparseMatrix5indexEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %.07889.us)
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %59) #8
  %61 = load double, ptr %60, align 8, !tbaa !8
  %62 = call noundef double @_ZNK3ipx12SparseMatrix5valueEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %.07889.us)
  %63 = fneg double %61
  %64 = call double @llvm.fmuladd.f64(double %63, double %62, double %.07988.us)
  %65 = add i32 %.07889.us, 1
  %exitcond111.not = icmp eq i32 %65, %46
  br i1 %exitcond111.not, label %._crit_edge.us, label %.lr.ph.us, !llvm.loop !14

.lr.ph92.split:                                   ; preds = %.lr.ph92, %._crit_edge
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge ], [ 0, %.lr.ph92 ]
  %66 = trunc nuw nsw i64 %indvars.iv to i32
  %67 = call noundef i32 @_ZNK3ipx12SparseMatrix5beginEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %66)
  %68 = call noundef i32 @_ZNK3ipx12SparseMatrix3endEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %66)
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph92.split
  %.079.lcssa = phi double [ 0.000000e+00, %.lr.ph92.split ], [ %80, %.lr.ph ]
  %70 = fcmp oge double %.079.lcssa, 0.000000e+00
  %71 = select i1 %70, double 1.000000e+00, double -1.000000e+00
  %72 = fadd double %.079.lcssa, %71
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %indvars.iv) #8
  store double %72, ptr %73, align 8, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond110.not = icmp eq i64 %indvars.iv.next, %wide.trip.count115
  br i1 %exitcond110.not, label %.loopexit, label %.lr.ph92.split, !llvm.loop !13

.lr.ph:                                           ; preds = %.lr.ph92.split, %.lr.ph
  %.07889 = phi i32 [ %81, %.lr.ph ], [ %67, %.lr.ph92.split ]
  %.07988 = phi double [ %80, %.lr.ph ], [ 0.000000e+00, %.lr.ph92.split ]
  %74 = call noundef i32 @_ZNK3ipx12SparseMatrix5indexEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %.07889)
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %75) #8
  %77 = load double, ptr %76, align 8, !tbaa !8
  %78 = call noundef double @_ZNK3ipx12SparseMatrix5valueEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %.07889)
  %79 = fneg double %77
  %80 = call double @llvm.fmuladd.f64(double %79, double %78, double %.07988)
  %81 = add i32 %.07889, 1
  %exitcond.not = icmp eq i32 %81, %68
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !14

.split.us:                                        ; preds = %._crit_edge.us
  call void @__assert_fail(ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.12, i32 noundef 350, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3ipx14NormestInverseERKNS_12SparseMatrixEPKci) #9
  unreachable

.lr.ph101.split:                                  ; preds = %.lr.ph101, %._crit_edge97
  %indvars.iv117 = phi i64 [ %indvars.iv.next118, %._crit_edge97 ], [ %17, %.lr.ph101 ]
  %82 = trunc nuw nsw i64 %indvars.iv117 to i32
  %83 = call noundef i32 @_ZNK3ipx12SparseMatrix5beginEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %82)
  %84 = call noundef i32 @_ZNK3ipx12SparseMatrix3endEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %82)
  %spec.select86 = add nsw i32 %83, %16
  %85 = icmp slt i32 %spec.select86, %84
  br i1 %85, label %.lr.ph96, label %._crit_edge97

._crit_edge97:                                    ; preds = %.lr.ph96, %.lr.ph101.split
  %.073.lcssa = phi double [ 0.000000e+00, %.lr.ph101.split ], [ %97, %.lr.ph96 ]
  %86 = fcmp oge double %.073.lcssa, 0.000000e+00
  %87 = select i1 %86, double 1.000000e+00, double -1.000000e+00
  %88 = fadd double %.073.lcssa, %87
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %indvars.iv117) #8
  store double %88, ptr %89, align 8, !tbaa !8
  %indvars.iv.next118 = add nsw i64 %indvars.iv117, -1
  %90 = icmp sgt i64 %indvars.iv117, 0
  br i1 %90, label %.lr.ph101.split, label %.loopexit, !llvm.loop !10

.lr.ph96:                                         ; preds = %.lr.ph101.split, %.lr.ph96
  %.07294 = phi i32 [ %98, %.lr.ph96 ], [ %spec.select86, %.lr.ph101.split ]
  %.07393 = phi double [ %97, %.lr.ph96 ], [ 0.000000e+00, %.lr.ph101.split ]
  %91 = call noundef i32 @_ZNK3ipx12SparseMatrix5indexEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %.07294)
  %92 = sext i32 %91 to i64
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %92) #8
  %94 = load double, ptr %93, align 8, !tbaa !8
  %95 = call noundef double @_ZNK3ipx12SparseMatrix5valueEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %.07294)
  %96 = fneg double %94
  %97 = call double @llvm.fmuladd.f64(double %96, double %95, double %.07393)
  %98 = add nsw i32 %.07294, 1
  %99 = icmp slt i32 %98, %84
  br i1 %99, label %.lr.ph96, label %._crit_edge97, !llvm.loop !12

.split.us102:                                     ; preds = %._crit_edge97.us
  call void @__assert_fail(ptr noundef nonnull @.str.28, ptr noundef nonnull @.str.12, i32 noundef 366, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3ipx14NormestInverseERKNS_12SparseMatrixEPKci) #9
  unreachable

.loopexit:                                        ; preds = %._crit_edge, %51, %._crit_edge97, %25, %41, %.preheader
  %100 = invoke noundef double @_ZN3ipx7OnenormERKSt8valarrayIdE(ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %101 unwind label %111

101:                                              ; preds = %.loopexit
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %102 = invoke noundef double @_ZN3ipx7InfnormERKSt8valarrayIdE(ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %103 unwind label %113

103:                                              ; preds = %101
  store double %102, ptr %5, align 8, !tbaa !8
  %104 = invoke noundef i32 @_ZN3ipx15TriangularSolveERKNS_12SparseMatrixERSt8valarrayIdEcPKci(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(16) %4, i8 noundef signext 110, ptr noundef nonnull %1, i32 noundef %2)
          to label %105 unwind label %113

105:                                              ; preds = %103
  %106 = invoke noundef double @_ZN3ipx7OnenormERKSt8valarrayIdE(ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %107 unwind label %115

107:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %108 = fdiv double %106, %100
  store double %108, ptr %6, align 8, !tbaa !8
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %110 = load double, ptr %109, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @_ZNSt8valarrayIdED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  ret double %110

111:                                              ; preds = %.loopexit
  %112 = landingpad { ptr, i32 }
          cleanup
  br label %118

113:                                              ; preds = %103, %101
  %114 = landingpad { ptr, i32 }
          cleanup
  br label %117

115:                                              ; preds = %105
  %116 = landingpad { ptr, i32 }
          cleanup
  br label %117

117:                                              ; preds = %115, %113
  %.pn = phi { ptr, i32 } [ %116, %115 ], [ %114, %113 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %118

118:                                              ; preds = %117, %111
  %.pn.pn = phi { ptr, i32 } [ %.pn, %117 ], [ %112, %111 ]
  call void @_ZNSt8valarrayIdED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn.pn
}

declare noundef double @_ZN3ipx7OnenormERKSt8valarrayIdE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"double", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}


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