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

; 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::Timer" = type { %"class.std::chrono::time_point" }
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%"class.ipx::Basis" = type { ptr, ptr, %"class.std::vector", %"class.std::vector", %"class.std::unique_ptr", i8, i32, i32, i32, i32, i32, i32, double, double, double, double, %"class.std::vector.5", double, double }
%"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::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.4" }
%"struct.std::_Head_base.4" = type { ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = 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 }

@.str.12 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._ZN3ipx5Basis16ExchangeIfStableEiidiPb = external hidden unnamed_addr constant [64 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [17 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

; 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 @_ZNKSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3ipx5Basis9FactorizeEv(ptr noundef nonnull align 8 dereferenceable(176)) #3 align 2

declare void @_ZN3ipx5TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3ipx5Basis17TightenLuPivotTolEv(ptr noundef nonnull align 8 dereferenceable(176)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3ipx7Control5DebugEi(ptr noundef nonnull align 8 dereferenceable(1496), i32 noundef) #4

declare noundef double @_ZNK3ipx5Timer7ElapsedEv(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ipx5Basis20FactorizationIsFreshEv(ptr noundef nonnull align 8 dereferenceable(176)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3ipx5Basis10PositionOfEi(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ipx5Basis14SolveForUpdateEi(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ipx5Basis7IsBasicEi(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef) #6 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3ipx5Basis16ExchangeIfStableEiidiPb(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %1, i32 noundef %2, double noundef %3, i32 noundef %4, ptr noundef %5) #3 align 2 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.ipx::Timer", align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !9
  store double %3, ptr %11, align 8, !tbaa !11
  store i32 %4, ptr %12, align 4, !tbaa !9
  store ptr %5, ptr %13, align 8, !tbaa !5
  %18 = load ptr, ptr %8, align 8
  %19 = load i32, ptr %9, align 4, !tbaa !9
  %20 = call noundef zeroext i1 @_ZNK3ipx5Basis7IsBasicEi(ptr noundef nonnull align 8 dereferenceable(176) %18, i32 noundef %19)
  br i1 %20, label %21, label %22

21:                                               ; preds = %6
  br label %24

22:                                               ; preds = %6
  call void @__assert_fail(ptr noundef @.str.21, ptr noundef @.str.12, i32 noundef 293, ptr noundef @__PRETTY_FUNCTION__._ZN3ipx5Basis16ExchangeIfStableEiidiPb) #7
  unreachable

23:                                               ; No predecessors!
  br label %24

24:                                               ; preds = %23, %21
  %25 = load i32, ptr %10, align 4, !tbaa !9
  %26 = call noundef zeroext i1 @_ZNK3ipx5Basis10IsNonbasicEi(ptr noundef nonnull align 8 dereferenceable(176) %18, i32 noundef %25)
  br i1 %26, label %27, label %28

27:                                               ; preds = %24
  br label %30

28:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.12, i32 noundef 294, ptr noundef @__PRETTY_FUNCTION__._ZN3ipx5Basis16ExchangeIfStableEiidiPb) #7
  unreachable

29:                                               ; No predecessors!
  br label %30

30:                                               ; preds = %29, %27
  %31 = load i32, ptr %12, align 4, !tbaa !9
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %33, label %35

33:                                               ; preds = %30
  %34 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZN3ipx5Basis14SolveForUpdateEi(ptr noundef nonnull align 8 dereferenceable(176) %18, i32 noundef %34)
  br label %35

35:                                               ; preds = %33, %30
  %36 = load i32, ptr %12, align 4, !tbaa !9
  %37 = icmp slt i32 %36, 0
  br i1 %37, label %38, label %40

38:                                               ; preds = %35
  %39 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN3ipx5Basis14SolveForUpdateEi(ptr noundef nonnull align 8 dereferenceable(176) %18, i32 noundef %39)
  br label %40

40:                                               ; preds = %38, %35
  %41 = load ptr, ptr %13, align 8, !tbaa !5
  store i8 0, ptr %41, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @_ZN3ipx5TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %14)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %42 = getelementptr inbounds %"class.ipx::Basis", ptr %18, i32 0, i32 4
  %43 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %42) #8
  %44 = load double, ptr %11, align 8, !tbaa !11
  %45 = call noundef i32 @_ZN3ipx8LuUpdate6UpdateEd(ptr noundef nonnull align 8 dereferenceable(12) %43, double noundef %44)
  store i32 %45, ptr %15, align 4, !tbaa !9
  %46 = call noundef double @_ZNK3ipx5Timer7ElapsedEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
  %47 = getelementptr inbounds %"class.ipx::Basis", ptr %18, i32 0, i32 14
  %48 = load double, ptr %47, align 8, !tbaa !15
  %49 = fadd double %48, %46
  store double %49, ptr %47, align 8, !tbaa !15
  %50 = load i32, ptr %15, align 4, !tbaa !9
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %69

52:                                               ; preds = %40
  %53 = call noundef zeroext i1 @_ZNK3ipx5Basis20FactorizationIsFreshEv(ptr noundef nonnull align 8 dereferenceable(176) %18)
  br i1 %53, label %54, label %57

54:                                               ; preds = %52
  %55 = call noundef zeroext i1 @_ZN3ipx5Basis17TightenLuPivotTolEv(ptr noundef nonnull align 8 dereferenceable(176) %18)
  br i1 %55, label %57, label %56

56:                                               ; preds = %54
  store i32 306, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %109

57:                                               ; preds = %54, %52
  %58 = getelementptr inbounds %"class.ipx::Basis", ptr %18, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !31
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3ipx7Control5DebugEi(ptr noundef nonnull align 8 dereferenceable(1496) %59, i32 noundef 3)
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef @.str.23)
  %62 = getelementptr inbounds %"class.ipx::Basis", ptr %18, i32 0, i32 4
  %63 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %62) #8
  %64 = call noundef i32 @_ZNK3ipx8LuUpdate7updatesEv(ptr noundef nonnull align 8 dereferenceable(12) %63)
  %65 = sub nsw i32 %64, 1
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %61, i32 noundef %65)
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef @.str.24)
  %68 = call noundef i32 @_ZN3ipx5Basis9FactorizeEv(ptr noundef nonnull align 8 dereferenceable(176) %18)
  store i32 %68, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %109

69:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %70 = load i32, ptr %9, align 4, !tbaa !9
  %71 = call noundef i32 @_ZNK3ipx5Basis10PositionOfEi(ptr noundef nonnull align 8 dereferenceable(176) %18, i32 noundef %70)
  store i32 %71, ptr %17, align 4, !tbaa !9
  %72 = getelementptr inbounds %"class.ipx::Basis", ptr %18, i32 0, i32 2
  %73 = load i32, ptr %17, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %72, i64 noundef %74) #8
  %76 = load i32, ptr %75, align 4, !tbaa !9
  %77 = load i32, ptr %9, align 4, !tbaa !9
  %78 = icmp eq i32 %76, %77
  br i1 %78, label %79, label %80

79:                                               ; preds = %69
  br label %82

80:                                               ; preds = %69
  call void @__assert_fail(ptr noundef @.str.25, ptr noundef @.str.12, i32 noundef 316, ptr noundef @__PRETTY_FUNCTION__._ZN3ipx5Basis16ExchangeIfStableEiidiPb) #7
  unreachable

81:                                               ; No predecessors!
  br label %82

82:                                               ; preds = %81, %79
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = getelementptr inbounds %"class.ipx::Basis", ptr %18, i32 0, i32 2
  %85 = load i32, ptr %17, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %86) #8
  store i32 %83, ptr %87, align 4, !tbaa !9
  %88 = load i32, ptr %17, align 4, !tbaa !9
  %89 = getelementptr inbounds %"class.ipx::Basis", ptr %18, i32 0, i32 3
  %90 = load i32, ptr %10, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %89, i64 noundef %91) #8
  store i32 %88, ptr %92, align 4, !tbaa !9
  %93 = getelementptr inbounds %"class.ipx::Basis", ptr %18, i32 0, i32 3
  %94 = load i32, ptr %9, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %93, i64 noundef %95) #8
  store i32 -1, ptr %96, align 4, !tbaa !9
  %97 = getelementptr inbounds %"class.ipx::Basis", ptr %18, i32 0, i32 7
  %98 = load i32, ptr %97, align 8, !tbaa !32
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %97, align 8, !tbaa !32
  %100 = getelementptr inbounds %"class.ipx::Basis", ptr %18, i32 0, i32 5
  store i8 0, ptr %100, align 8, !tbaa !33
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  store i8 1, ptr %101, align 1, !tbaa !13
  %102 = getelementptr inbounds %"class.ipx::Basis", ptr %18, i32 0, i32 4
  %103 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %102) #8
  %104 = call noundef zeroext i1 @_ZN3ipx8LuUpdate22NeedFreshFactorizationEv(ptr noundef nonnull align 8 dereferenceable(12) %103)
  br i1 %104, label %105, label %107

105:                                              ; preds = %82
  %106 = call noundef i32 @_ZN3ipx5Basis9FactorizeEv(ptr noundef nonnull align 8 dereferenceable(176) %18)
  store i32 %106, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %108

107:                                              ; preds = %82
  store i32 0, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %108

108:                                              ; preds = %107, %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %109

109:                                              ; preds = %108, %57, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  %110 = load i32, ptr %7, align 4
  ret i32 %110
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ipx5Basis10IsNonbasicEi(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef) #6 align 2

declare noundef i32 @_ZN3ipx8LuUpdate6UpdateEd(ptr noundef nonnull align 8 dereferenceable(12), double noundef) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

declare noundef i32 @_ZNK3ipx8LuUpdate7updatesEv(ptr noundef nonnull align 8 dereferenceable(12)) #4

declare noundef zeroext i1 @_ZN3ipx8LuUpdate22NeedFreshFactorizationEv(ptr noundef nonnull align 8 dereferenceable(12)) #4

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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { "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 = { 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 #6 = { 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 #7 = { noreturn nounwind }
attributes #8 = { 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 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !12, i64 120}
!16 = !{!"_ZTSN3ipx5BasisE", !6, i64 0, !6, i64 8, !17, i64 16, !17, i64 40, !21, i64 64, !14, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !27, i64 136, !12, i64 160, !12, i64 168}
!17 = !{!"_ZTSSt6vectorIiSaIiEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EE", !22, i64 0}
!22 = !{!"_ZTSSt15__uniq_ptr_dataIN3ipx8LuUpdateESt14default_deleteIS1_ELb1ELb1EE", !23, i64 0}
!23 = !{!"_ZTSSt15__uniq_ptr_implIN3ipx8LuUpdateESt14default_deleteIS1_EE", !24, i64 0}
!24 = !{!"_ZTSSt5tupleIJPN3ipx8LuUpdateESt14default_deleteIS1_EEE", !25, i64 0}
!25 = !{!"_ZTSSt11_Tuple_implILm0EJPN3ipx8LuUpdateESt14default_deleteIS1_EEE", !26, i64 0}
!26 = !{!"_ZTSSt10_Head_baseILm0EPN3ipx8LuUpdateELb0EE", !6, i64 0}
!27 = !{!"_ZTSSt6vectorIdSaIdEE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!16, !6, i64 0}
!32 = !{!16, !10, i64 80}
!33 = !{!16, !14, i64 72}


; 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.ipx::Timer" = type { %"class.std::chrono::time_point" }
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }

@.str.12 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._ZN3ipx5Basis16ExchangeIfStableEiidiPb = external hidden unnamed_addr constant [64 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [17 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

; 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 @_ZNKSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3ipx5Basis9FactorizeEv(ptr noundef nonnull align 8 dereferenceable(176)) local_unnamed_addr #3 align 2

declare void @_ZN3ipx5TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3ipx5Basis17TightenLuPivotTolEv(ptr noundef nonnull align 8 dereferenceable(176)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3ipx7Control5DebugEi(ptr noundef nonnull align 8 dereferenceable(1496), i32 noundef) local_unnamed_addr #4

declare noundef double @_ZNK3ipx5Timer7ElapsedEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ipx5Basis20FactorizationIsFreshEv(ptr noundef nonnull align 8 dereferenceable(176)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3ipx5Basis10PositionOfEi(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ipx5Basis14SolveForUpdateEi(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ipx5Basis7IsBasicEi(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3ipx5Basis16ExchangeIfStableEiidiPb(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %1, i32 noundef %2, double noundef %3, i32 noundef %4, ptr nocapture noundef writeonly %5) local_unnamed_addr #3 align 2 {
  %7 = alloca %"class.ipx::Timer", align 8
  %8 = tail call noundef zeroext i1 @_ZNK3ipx5Basis7IsBasicEi(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %1)
  br i1 %8, label %10, label %9

9:                                                ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.12, i32 noundef 293, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3ipx5Basis16ExchangeIfStableEiidiPb) #7
  unreachable

10:                                               ; preds = %6
  %11 = tail call noundef zeroext i1 @_ZNK3ipx5Basis10IsNonbasicEi(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %2)
  br i1 %11, label %13, label %12

12:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.12, i32 noundef 294, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3ipx5Basis16ExchangeIfStableEiidiPb) #7
  unreachable

13:                                               ; preds = %10
  %14 = icmp sgt i32 %4, 0
  br i1 %14, label %.sink.split, label %15

15:                                               ; preds = %13
  %16 = icmp slt i32 %4, 0
  br i1 %16, label %.sink.split, label %17

.sink.split:                                      ; preds = %15, %13
  %.sink = phi i32 [ %2, %13 ], [ %1, %15 ]
  tail call void @_ZN3ipx5Basis14SolveForUpdateEi(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %.sink)
  br label %17

17:                                               ; preds = %.sink.split, %15
  store i8 0, ptr %5, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  call void @_ZN3ipx5TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %18 = getelementptr inbounds i8, ptr %0, i64 64
  %19 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  %20 = call noundef i32 @_ZN3ipx8LuUpdate6UpdateEd(ptr noundef nonnull align 8 dereferenceable(12) %19, double noundef %3)
  %21 = call noundef double @_ZNK3ipx5Timer7ElapsedEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %22 = getelementptr inbounds i8, ptr %0, i64 120
  %23 = load double, ptr %22, align 8, !tbaa !9
  %24 = fadd double %21, %23
  store double %24, ptr %22, align 8, !tbaa !9
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %38, label %25

25:                                               ; preds = %17
  %26 = call noundef zeroext i1 @_ZNK3ipx5Basis20FactorizationIsFreshEv(ptr noundef nonnull align 8 dereferenceable(176) %0)
  br i1 %26, label %27, label %29

27:                                               ; preds = %25
  %28 = call noundef zeroext i1 @_ZN3ipx5Basis17TightenLuPivotTolEv(ptr noundef nonnull align 8 dereferenceable(176) %0)
  br i1 %28, label %29, label %60

29:                                               ; preds = %27, %25
  %30 = load ptr, ptr %0, align 8, !tbaa !28
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3ipx7Control5DebugEi(ptr noundef nonnull align 8 dereferenceable(1496) %30, i32 noundef 3)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull @.str.23)
  %33 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  %34 = call noundef i32 @_ZNK3ipx8LuUpdate7updatesEv(ptr noundef nonnull align 8 dereferenceable(12) %33)
  %35 = add nsw i32 %34, -1
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %32, i32 noundef %35)
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef nonnull @.str.24)
  br label %.sink.split20

38:                                               ; preds = %17
  %39 = call noundef i32 @_ZNK3ipx5Basis10PositionOfEi(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %1)
  %40 = getelementptr inbounds i8, ptr %0, i64 16
  %41 = sext i32 %39 to i64
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %41) #8
  %43 = load i32, ptr %42, align 4, !tbaa !29
  %44 = icmp eq i32 %43, %1
  br i1 %44, label %46, label %45

45:                                               ; preds = %38
  call void @__assert_fail(ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.12, i32 noundef 316, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3ipx5Basis16ExchangeIfStableEiidiPb) #7
  unreachable

46:                                               ; preds = %38
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %41) #8
  store i32 %2, ptr %47, align 4, !tbaa !29
  %48 = getelementptr inbounds i8, ptr %0, i64 40
  %49 = sext i32 %2 to i64
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef %49) #8
  store i32 %39, ptr %50, align 4, !tbaa !29
  %51 = sext i32 %1 to i64
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef %51) #8
  store i32 -1, ptr %52, align 4, !tbaa !29
  %53 = getelementptr inbounds i8, ptr %0, i64 80
  %54 = load i32, ptr %53, align 8, !tbaa !30
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %53, align 8, !tbaa !30
  %56 = getelementptr inbounds i8, ptr %0, i64 72
  store i8 0, ptr %56, align 8, !tbaa !31
  store i8 1, ptr %5, align 1, !tbaa !5
  %57 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  %58 = call noundef zeroext i1 @_ZN3ipx8LuUpdate22NeedFreshFactorizationEv(ptr noundef nonnull align 8 dereferenceable(12) %57)
  br i1 %58, label %.sink.split20, label %60

.sink.split20:                                    ; preds = %46, %29
  %59 = call noundef i32 @_ZN3ipx5Basis9FactorizeEv(ptr noundef nonnull align 8 dereferenceable(176) %0)
  br label %60

60:                                               ; preds = %.sink.split20, %46, %27
  %.1 = phi i32 [ 306, %27 ], [ 0, %46 ], [ %59, %.sink.split20 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  ret i32 %.1
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ipx5Basis10IsNonbasicEi(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef) local_unnamed_addr #6 align 2

declare noundef i32 @_ZN3ipx8LuUpdate6UpdateEd(ptr noundef nonnull align 8 dereferenceable(12), double noundef) local_unnamed_addr #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

declare noundef i32 @_ZNK3ipx8LuUpdate7updatesEv(ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #4

declare noundef zeroext i1 @_ZN3ipx8LuUpdate22NeedFreshFactorizationEv(ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #4

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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { "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 = { 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 #6 = { 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 #7 = { noreturn nounwind }
attributes #8 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !23, i64 120}
!10 = !{!"_ZTSN3ipx5BasisE", !11, i64 0, !11, i64 8, !12, i64 16, !12, i64 40, !16, i64 64, !6, i64 72, !22, i64 76, !22, i64 80, !22, i64 84, !22, i64 88, !22, i64 92, !22, i64 96, !23, i64 104, !23, i64 112, !23, i64 120, !23, i64 128, !24, i64 136, !23, i64 160, !23, i64 168}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIiSaIiEE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!16 = !{!"_ZTSSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EE", !17, i64 0}
!17 = !{!"_ZTSSt15__uniq_ptr_dataIN3ipx8LuUpdateESt14default_deleteIS1_ELb1ELb1EE", !18, i64 0}
!18 = !{!"_ZTSSt15__uniq_ptr_implIN3ipx8LuUpdateESt14default_deleteIS1_EE", !19, i64 0}
!19 = !{!"_ZTSSt5tupleIJPN3ipx8LuUpdateESt14default_deleteIS1_EEE", !20, i64 0}
!20 = !{!"_ZTSSt11_Tuple_implILm0EJPN3ipx8LuUpdateESt14default_deleteIS1_EEE", !21, i64 0}
!21 = !{!"_ZTSSt10_Head_baseILm0EPN3ipx8LuUpdateELb0EE", !11, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = !{!"double", !7, i64 0}
!24 = !{!"_ZTSSt6vectorIdSaIdEE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!28 = !{!10, !11, i64 0}
!29 = !{!22, !22, i64 0}
!30 = !{!10, !22, i64 80}
!31 = !{!10, !6, i64 72}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass