; LLVM IR from ERGO-Code/HiGHS :: src/ipm/ipx (basiclu_wrapper)

; 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.ipx::BasicLu" = type { %"class.ipx::LuUpdate.base", ptr, %"class.std::vector", %"class.std::vector.3", %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector.3", %"class.std::vector.3", %"class.std::vector.3", double }
%"class.ipx::LuUpdate.base" = type <{ ptr, i32 }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZTISt11logic_error = external constant ptr
@.str.16 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [80 x i8], align 1
@__PRETTY_FUNCTION__._ZN3ipx7BasicLu11_GetFactorsEPNS_12SparseMatrixES2_PiS3_PSt6vectorIiSaIiEE = external hidden unnamed_addr constant [105 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: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIiSaIiEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIdSaIdEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt11logic_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #2

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZNSt11logic_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3ipx7BasicLu11_GetFactorsEPNS_12SparseMatrixES2_PiS3_PSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(224) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  %28 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store ptr null, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store ptr null, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %29 = getelementptr inbounds %"class.ipx::BasicLu", ptr %28, i32 0, i32 3
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef 64) #6
  %31 = load double, ptr %30, align 8, !tbaa !9
  %32 = fptosi double %31 to i32
  store i32 %32, ptr %19, align 4, !tbaa !11
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %52

35:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %36 = getelementptr inbounds %"class.ipx::BasicLu", ptr %28, i32 0, i32 3
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %36, i64 noundef 76) #6
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = fptosi double %38 to i32
  store i32 %39, ptr %20, align 4, !tbaa !11
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = load i32, ptr %19, align 4, !tbaa !11
  %42 = load i32, ptr %19, align 4, !tbaa !11
  %43 = load i32, ptr %19, align 4, !tbaa !11
  %44 = load i32, ptr %20, align 4, !tbaa !11
  %45 = add nsw i32 %43, %44
  call void @_ZN3ipx12SparseMatrix6resizeEiii(ptr noundef nonnull align 8 dereferenceable(128) %40, i32 noundef %41, i32 noundef %42, i32 noundef %45)
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = call noundef ptr @_ZN3ipx12SparseMatrix6colptrEv(ptr noundef nonnull align 8 dereferenceable(128) %46)
  store ptr %47, ptr %13, align 8, !tbaa !5
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = call noundef ptr @_ZN3ipx12SparseMatrix6rowidxEv(ptr noundef nonnull align 8 dereferenceable(128) %48)
  store ptr %49, ptr %15, align 8, !tbaa !5
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = call noundef ptr @_ZN3ipx12SparseMatrix6valuesEv(ptr noundef nonnull align 8 dereferenceable(128) %50)
  store ptr %51, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %52

52:                                               ; preds = %35, %6
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %72

55:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %56 = getelementptr inbounds %"class.ipx::BasicLu", ptr %28, i32 0, i32 3
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef 77) #6
  %58 = load double, ptr %57, align 8, !tbaa !9
  %59 = fptosi double %58 to i32
  store i32 %59, ptr %21, align 4, !tbaa !11
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = load i32, ptr %19, align 4, !tbaa !11
  %62 = load i32, ptr %19, align 4, !tbaa !11
  %63 = load i32, ptr %19, align 4, !tbaa !11
  %64 = load i32, ptr %21, align 4, !tbaa !11
  %65 = add nsw i32 %63, %64
  call void @_ZN3ipx12SparseMatrix6resizeEiii(ptr noundef nonnull align 8 dereferenceable(128) %60, i32 noundef %61, i32 noundef %62, i32 noundef %65)
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = call noundef ptr @_ZN3ipx12SparseMatrix6colptrEv(ptr noundef nonnull align 8 dereferenceable(128) %66)
  store ptr %67, ptr %14, align 8, !tbaa !5
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = call noundef ptr @_ZN3ipx12SparseMatrix6rowidxEv(ptr noundef nonnull align 8 dereferenceable(128) %68)
  store ptr %69, ptr %16, align 8, !tbaa !5
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = call noundef ptr @_ZN3ipx12SparseMatrix6valuesEv(ptr noundef nonnull align 8 dereferenceable(128) %70)
  store ptr %71, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %72

72:                                               ; preds = %55, %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %73 = getelementptr inbounds %"class.ipx::BasicLu", ptr %28, i32 0, i32 2
  %74 = call noundef ptr @_ZNSt6vectorIiSaIiEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %73) #6
  %75 = getelementptr inbounds %"class.ipx::BasicLu", ptr %28, i32 0, i32 3
  %76 = call noundef ptr @_ZNSt6vectorIdSaIdEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #6
  %77 = getelementptr inbounds %"class.ipx::BasicLu", ptr %28, i32 0, i32 4
  %78 = call noundef ptr @_ZNSt6vectorIiSaIiEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #6
  %79 = getelementptr inbounds %"class.ipx::BasicLu", ptr %28, i32 0, i32 7
  %80 = call noundef ptr @_ZNSt6vectorIdSaIdEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %79) #6
  %81 = getelementptr inbounds %"class.ipx::BasicLu", ptr %28, i32 0, i32 5
  %82 = call noundef ptr @_ZNSt6vectorIiSaIiEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %81) #6
  %83 = getelementptr inbounds %"class.ipx::BasicLu", ptr %28, i32 0, i32 8
  %84 = call noundef ptr @_ZNSt6vectorIdSaIdEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #6
  %85 = getelementptr inbounds %"class.ipx::BasicLu", ptr %28, i32 0, i32 6
  %86 = call noundef ptr @_ZNSt6vectorIiSaIiEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %85) #6
  %87 = getelementptr inbounds %"class.ipx::BasicLu", ptr %28, i32 0, i32 9
  %88 = call noundef ptr @_ZNSt6vectorIdSaIdEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %87) #6
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = load ptr, ptr %13, align 8, !tbaa !5
  %92 = load ptr, ptr %15, align 8, !tbaa !5
  %93 = load ptr, ptr %17, align 8, !tbaa !5
  %94 = load ptr, ptr %14, align 8, !tbaa !5
  %95 = load ptr, ptr %16, align 8, !tbaa !5
  %96 = load ptr, ptr %18, align 8, !tbaa !5
  %97 = call i32 @basiclu_get_factors(ptr noundef %74, ptr noundef %76, ptr noundef %78, ptr noundef %80, ptr noundef %82, ptr noundef %84, ptr noundef %86, ptr noundef %88, ptr noundef %89, ptr noundef %90, ptr noundef %91, ptr noundef %92, ptr noundef %93, ptr noundef %94, ptr noundef %95, ptr noundef %96)
  store i32 %97, ptr %22, align 4, !tbaa !11
  %98 = load i32, ptr %22, align 4, !tbaa !11
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %107

100:                                              ; preds = %72
  %101 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt11logic_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %101, ptr noundef @.str.16)
          to label %102 unwind label %103

102:                                              ; preds = %100
  call void @__cxa_throw(ptr %101, ptr @_ZTISt11logic_error, ptr @_ZNSt11logic_errorD1Ev) #7
  unreachable

103:                                              ; preds = %100
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %23, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %24, align 4
  call void @__cxa_free_exception(ptr %101) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %142

107:                                              ; preds = %72
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %120

110:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = call noundef i32 @_ZN3ipx14RemoveDiagonalERNS_12SparseMatrixEPd(ptr noundef nonnull align 8 dereferenceable(128) %111, ptr noundef null)
  store i32 %112, ptr %25, align 4, !tbaa !11
  %113 = load i32, ptr %25, align 4, !tbaa !11
  %114 = load i32, ptr %19, align 4, !tbaa !11
  %115 = icmp eq i32 %113, %114
  br i1 %115, label %116, label %117

116:                                              ; preds = %110
  br label %119

117:                                              ; preds = %110
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.18, i32 noundef 113, ptr noundef @__PRETTY_FUNCTION__._ZN3ipx7BasicLu11_GetFactorsEPNS_12SparseMatrixES2_PiS3_PSt6vectorIiSaIiEE) #8
  unreachable

118:                                              ; No predecessors!
  br label %119

119:                                              ; preds = %118, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %120

120:                                              ; preds = %119, %107
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = icmp ne ptr %121, null
  br i1 %122, label %123, label %141

123:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %124 = getelementptr inbounds %"class.ipx::BasicLu", ptr %28, i32 0, i32 3
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %124, i64 noundef 101) #6
  %126 = load double, ptr %125, align 8, !tbaa !9
  %127 = fptosi double %126 to i32
  store i32 %127, ptr %26, align 4, !tbaa !11
  %128 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %128) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %129 = load i32, ptr %26, align 4, !tbaa !11
  store i32 %129, ptr %27, align 4, !tbaa !11
  br label %130

130:                                              ; preds = %137, %123
  %131 = load i32, ptr %27, align 4, !tbaa !11
  %132 = load i32, ptr %19, align 4, !tbaa !11
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %140

135:                                              ; preds = %130
  %136 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %136, ptr noundef nonnull align 4 dereferenceable(4) %27)
  br label %137

137:                                              ; preds = %135
  %138 = load i32, ptr %27, align 4, !tbaa !11
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %27, align 4, !tbaa !11
  br label %130, !llvm.loop !13

140:                                              ; preds = %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %141

141:                                              ; preds = %140, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  ret void

142:                                              ; preds = %103
  %143 = load ptr, ptr %23, align 8
  %144 = load i32, ptr %24, align 4
  %145 = insertvalue { ptr, i32 } poison, ptr %143, 0
  %146 = insertvalue { ptr, i32 } %145, i32 %144, 1
  resume { ptr, i32 } %146
}

declare void @_ZN3ipx12SparseMatrix6resizeEiii(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef, i32 noundef) #2

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

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

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

declare i32 @basiclu_get_factors(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare noundef i32 @_ZN3ipx14RemoveDiagonalERNS_12SparseMatrixEPd(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

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

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

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


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

@_ZTISt11logic_error = external constant ptr
@.str.16 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [80 x i8], align 1
@__PRETTY_FUNCTION__._ZN3ipx7BasicLu11_GetFactorsEPNS_12SparseMatrixES2_PiS3_PSt6vectorIiSaIiEE = external hidden unnamed_addr constant [105 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: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIiSaIiEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIdSaIdEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt11logic_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #2

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZNSt11logic_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3ipx7BasicLu11_GetFactorsEPNS_12SparseMatrixES2_PiS3_PSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(224) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca i32, align 4
  %8 = getelementptr inbounds i8, ptr %0, i64 48
  %9 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 64) #6
  %10 = load double, ptr %9, align 8, !tbaa !5
  %11 = fptosi double %10 to i32
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %20, label %12

12:                                               ; preds = %6
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 76) #6
  %14 = load double, ptr %13, align 8, !tbaa !5
  %15 = fptosi double %14 to i32
  %16 = add nsw i32 %15, %11
  tail call void @_ZN3ipx12SparseMatrix6resizeEiii(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef %11, i32 noundef %11, i32 noundef %16)
  %17 = tail call noundef ptr @_ZN3ipx12SparseMatrix6colptrEv(ptr noundef nonnull align 8 dereferenceable(128) %1)
  %18 = tail call noundef ptr @_ZN3ipx12SparseMatrix6rowidxEv(ptr noundef nonnull align 8 dereferenceable(128) %1)
  %19 = tail call noundef ptr @_ZN3ipx12SparseMatrix6valuesEv(ptr noundef nonnull align 8 dereferenceable(128) %1)
  br label %20

20:                                               ; preds = %12, %6
  %.041 = phi ptr [ %19, %12 ], [ null, %6 ]
  %.039 = phi ptr [ %18, %12 ], [ null, %6 ]
  %.0 = phi ptr [ %17, %12 ], [ null, %6 ]
  %.not46 = icmp eq ptr %2, null
  br i1 %.not46, label %29, label %21

21:                                               ; preds = %20
  %22 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 77) #6
  %23 = load double, ptr %22, align 8, !tbaa !5
  %24 = fptosi double %23 to i32
  %25 = add nsw i32 %24, %11
  tail call void @_ZN3ipx12SparseMatrix6resizeEiii(ptr noundef nonnull align 8 dereferenceable(128) %2, i32 noundef %11, i32 noundef %11, i32 noundef %25)
  %26 = tail call noundef ptr @_ZN3ipx12SparseMatrix6colptrEv(ptr noundef nonnull align 8 dereferenceable(128) %2)
  %27 = tail call noundef ptr @_ZN3ipx12SparseMatrix6rowidxEv(ptr noundef nonnull align 8 dereferenceable(128) %2)
  %28 = tail call noundef ptr @_ZN3ipx12SparseMatrix6valuesEv(ptr noundef nonnull align 8 dereferenceable(128) %2)
  br label %29

29:                                               ; preds = %21, %20
  %.042 = phi ptr [ %28, %21 ], [ null, %20 ]
  %.040 = phi ptr [ %27, %21 ], [ null, %20 ]
  %.038 = phi ptr [ %26, %21 ], [ null, %20 ]
  %30 = getelementptr inbounds i8, ptr %0, i64 24
  %31 = tail call noundef ptr @_ZNSt6vectorIiSaIiEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #6
  %32 = tail call noundef ptr @_ZNSt6vectorIdSaIdEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  %33 = getelementptr inbounds i8, ptr %0, i64 72
  %34 = tail call noundef ptr @_ZNSt6vectorIiSaIiEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #6
  %35 = getelementptr inbounds i8, ptr %0, i64 144
  %36 = tail call noundef ptr @_ZNSt6vectorIdSaIdEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #6
  %37 = getelementptr inbounds i8, ptr %0, i64 96
  %38 = tail call noundef ptr @_ZNSt6vectorIiSaIiEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #6
  %39 = getelementptr inbounds i8, ptr %0, i64 168
  %40 = tail call noundef ptr @_ZNSt6vectorIdSaIdEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %39) #6
  %41 = getelementptr inbounds i8, ptr %0, i64 120
  %42 = tail call noundef ptr @_ZNSt6vectorIiSaIiEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #6
  %43 = getelementptr inbounds i8, ptr %0, i64 192
  %44 = tail call noundef ptr @_ZNSt6vectorIdSaIdEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %43) #6
  %45 = tail call i32 @basiclu_get_factors(ptr noundef %31, ptr noundef %32, ptr noundef %34, ptr noundef %36, ptr noundef %38, ptr noundef %40, ptr noundef %42, ptr noundef %44, ptr noundef %3, ptr noundef %4, ptr noundef %.0, ptr noundef %.039, ptr noundef %.041, ptr noundef %.038, ptr noundef %.040, ptr noundef %.042)
  %.not47 = icmp eq i32 %45, 0
  br i1 %.not47, label %51, label %46

46:                                               ; preds = %29
  %47 = tail call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt11logic_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %47, ptr noundef nonnull @.str.16)
          to label %48 unwind label %49

48:                                               ; preds = %46
  tail call void @__cxa_throw(ptr nonnull %47, ptr nonnull @_ZTISt11logic_error, ptr nonnull @_ZNSt11logic_errorD1Ev) #7
  unreachable

49:                                               ; preds = %46
  %50 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_free_exception(ptr %47) #6
  resume { ptr, i32 } %50

51:                                               ; preds = %29
  br i1 %.not, label %56, label %52

52:                                               ; preds = %51
  %53 = tail call noundef i32 @_ZN3ipx14RemoveDiagonalERNS_12SparseMatrixEPd(ptr noundef nonnull align 8 dereferenceable(128) %1, ptr noundef null)
  %54 = icmp eq i32 %53, %11
  br i1 %54, label %56, label %55

55:                                               ; preds = %52
  tail call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.18, i32 noundef 113, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3ipx7BasicLu11_GetFactorsEPNS_12SparseMatrixES2_PiS3_PSt6vectorIiSaIiEE) #8
  unreachable

56:                                               ; preds = %52, %51
  %.not48 = icmp eq ptr %5, null
  br i1 %.not48, label %65, label %57

57:                                               ; preds = %56
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 101) #6
  %59 = load double, ptr %58, align 8, !tbaa !5
  %60 = fptosi double %59 to i32
  tail call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 %60, ptr %7, align 4, !tbaa !9
  %61 = icmp slt i32 %60, %11
  br i1 %61, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  br label %65

.lr.ph:                                           ; preds = %57, %.lr.ph
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %7, align 4, !tbaa !9
  %64 = icmp slt i32 %63, %11
  br i1 %64, label %.lr.ph, label %._crit_edge, !llvm.loop !11

65:                                               ; preds = %._crit_edge, %56
  ret void
}

declare void @_ZN3ipx12SparseMatrix6resizeEiii(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

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

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

declare noundef i32 @_ZN3ipx14RemoveDiagonalERNS_12SparseMatrixEPd(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass