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

; 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
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [17 x i8], align 1
@__PRETTY_FUNCTION__._ZN3ipx5Basis13CrashExchangeEiidiPi = external hidden unnamed_addr constant [61 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [46 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

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

; 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) #4

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

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

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

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

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

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

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

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

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

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

19:                                               ; preds = %6
  br label %22

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

21:                                               ; No predecessors!
  br label %22

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

25:                                               ; preds = %22
  br label %28

26:                                               ; preds = %22
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.12, i32 noundef 653, ptr noundef @__PRETTY_FUNCTION__._ZN3ipx5Basis13CrashExchangeEiidiPi) #7
  unreachable

27:                                               ; No predecessors!
  br label %28

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

31:                                               ; preds = %28
  %32 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN3ipx5Basis14SolveForUpdateEi(ptr noundef nonnull align 8 dereferenceable(176) %16, i32 noundef %32)
  br label %33

33:                                               ; preds = %31, %28
  %34 = load i32, ptr %11, align 4, !tbaa !9
  %35 = icmp slt i32 %34, 0
  br i1 %35, label %36, label %38

36:                                               ; preds = %33
  %37 = load i32, ptr %8, align 4, !tbaa !9
  call void @_ZN3ipx5Basis14SolveForUpdateEi(ptr noundef nonnull align 8 dereferenceable(176) %16, i32 noundef %37)
  br label %38

38:                                               ; preds = %36, %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = call noundef i32 @_ZNK3ipx5Basis10PositionOfEi(ptr noundef nonnull align 8 dereferenceable(176) %16, i32 noundef %39)
  store i32 %40, ptr %13, align 4, !tbaa !9
  %41 = getelementptr inbounds %"class.ipx::Basis", ptr %16, i32 0, i32 2
  %42 = load i32, ptr %13, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %43) #8
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = load i32, ptr %8, align 4, !tbaa !9
  %47 = icmp eq i32 %45, %46
  br i1 %47, label %48, label %49

48:                                               ; preds = %38
  br label %51

49:                                               ; preds = %38
  call void @__assert_fail(ptr noundef @.str.25, ptr noundef @.str.12, i32 noundef 661, ptr noundef @__PRETTY_FUNCTION__._ZN3ipx5Basis13CrashExchangeEiidiPi) #7
  unreachable

50:                                               ; No predecessors!
  br label %51

51:                                               ; preds = %50, %48
  %52 = load i32, ptr %9, align 4, !tbaa !9
  %53 = getelementptr inbounds %"class.ipx::Basis", ptr %16, i32 0, i32 2
  %54 = load i32, ptr %13, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %55) #8
  store i32 %52, ptr %56, align 4, !tbaa !9
  %57 = load i32, ptr %13, align 4, !tbaa !9
  %58 = getelementptr inbounds %"class.ipx::Basis", ptr %16, i32 0, i32 3
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %60) #8
  store i32 %57, ptr %61, align 4, !tbaa !9
  %62 = getelementptr inbounds %"class.ipx::Basis", ptr %16, i32 0, i32 3
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %62, i64 noundef %64) #8
  store i32 -1, ptr %65, align 4, !tbaa !9
  %66 = getelementptr inbounds %"class.ipx::Basis", ptr %16, i32 0, i32 7
  %67 = load i32, ptr %66, align 8, !tbaa !13
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %66, align 8, !tbaa !13
  %69 = getelementptr inbounds %"class.ipx::Basis", ptr %16, i32 0, i32 5
  store i8 0, ptr %69, align 8, !tbaa !30
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %74

72:                                               ; preds = %51
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 0, ptr %73, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %72, %51
  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
  %75 = getelementptr inbounds %"class.ipx::Basis", ptr %16, i32 0, i32 4
  %76 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %75) #8
  %77 = load double, ptr %10, align 8, !tbaa !11
  %78 = call noundef i32 @_ZN3ipx8LuUpdate6UpdateEd(ptr noundef nonnull align 8 dereferenceable(12) %76, double noundef %77)
  store i32 %78, ptr %15, align 4, !tbaa !9
  %79 = call noundef double @_ZNK3ipx5Timer7ElapsedEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
  %80 = getelementptr inbounds %"class.ipx::Basis", ptr %16, i32 0, i32 14
  %81 = load double, ptr %80, align 8, !tbaa !31
  %82 = fadd double %81, %79
  store double %82, ptr %80, align 8, !tbaa !31
  %83 = load i32, ptr %15, align 4, !tbaa !9
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %89, label %85

85:                                               ; preds = %74
  %86 = getelementptr inbounds %"class.ipx::Basis", ptr %16, i32 0, i32 4
  %87 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %86) #8
  %88 = call noundef zeroext i1 @_ZN3ipx8LuUpdate22NeedFreshFactorizationEv(ptr noundef nonnull align 8 dereferenceable(12) %87)
  br i1 %88, label %89, label %95

89:                                               ; preds = %85, %74
  %90 = getelementptr inbounds %"class.ipx::Basis", ptr %16, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8, !tbaa !32
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3ipx7Control5DebugEi(ptr noundef nonnull align 8 dereferenceable(1496) %91, i32 noundef 3)
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef @.str.37)
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN3ipx5Basis14CrashFactorizeEPi(ptr noundef nonnull align 8 dereferenceable(176) %16, ptr noundef %94)
  br label %95

95:                                               ; preds = %89, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  ret void
}

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 = { "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 = { 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 #5 = { 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 #6 = { 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 = { 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, !10, i64 80}
!14 = !{!"_ZTSN3ipx5BasisE", !6, i64 0, !6, i64 8, !15, i64 16, !15, i64 40, !19, i64 64, !25, 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, !26, i64 136, !12, i64 160, !12, i64 168}
!15 = !{!"_ZTSSt6vectorIiSaIiEE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"_ZTSSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EE", !20, i64 0}
!20 = !{!"_ZTSSt15__uniq_ptr_dataIN3ipx8LuUpdateESt14default_deleteIS1_ELb1ELb1EE", !21, i64 0}
!21 = !{!"_ZTSSt15__uniq_ptr_implIN3ipx8LuUpdateESt14default_deleteIS1_EE", !22, i64 0}
!22 = !{!"_ZTSSt5tupleIJPN3ipx8LuUpdateESt14default_deleteIS1_EEE", !23, i64 0}
!23 = !{!"_ZTSSt11_Tuple_implILm0EJPN3ipx8LuUpdateESt14default_deleteIS1_EEE", !24, i64 0}
!24 = !{!"_ZTSSt10_Head_baseILm0EPN3ipx8LuUpdateELb0EE", !6, i64 0}
!25 = !{!"bool", !7, i64 0}
!26 = !{!"_ZTSSt6vectorIdSaIdEE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!14, !25, i64 72}
!31 = !{!14, !12, i64 120}
!32 = !{!14, !6, i64 0}


; 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
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [17 x i8], align 1
@__PRETTY_FUNCTION__._ZN3ipx5Basis13CrashExchangeEiidiPi = external hidden unnamed_addr constant [61 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [46 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

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

; 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 #4

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ipx5Basis14SolveForUpdateEi(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef) local_unnamed_addr #6 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 #5 align 2

; 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 #5 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3ipx5Basis13CrashExchangeEiidiPi(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %1, i32 noundef %2, double noundef %3, i32 noundef %4, ptr noundef %5) local_unnamed_addr #6 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 652, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3ipx5Basis13CrashExchangeEiidiPi) #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 653, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3ipx5Basis13CrashExchangeEiidiPi) #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
  %18 = tail call noundef i32 @_ZNK3ipx5Basis10PositionOfEi(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %1)
  %19 = getelementptr inbounds i8, ptr %0, i64 16
  %20 = sext i32 %18 to i64
  %21 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %20) #8
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = icmp eq i32 %22, %1
  br i1 %23, label %25, label %24

24:                                               ; preds = %17
  tail call void @__assert_fail(ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.12, i32 noundef 661, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3ipx5Basis13CrashExchangeEiidiPi) #7
  unreachable

25:                                               ; preds = %17
  %26 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %20) #8
  store i32 %2, ptr %26, align 4, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 40
  %28 = sext i32 %2 to i64
  %29 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %28) #8
  store i32 %18, ptr %29, align 4, !tbaa !5
  %30 = sext i32 %1 to i64
  %31 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %30) #8
  store i32 -1, ptr %31, align 4, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %0, i64 80
  %33 = load i32, ptr %32, align 8, !tbaa !9
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %32, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %0, i64 72
  store i8 0, ptr %35, align 8, !tbaa !28
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %37, label %36

36:                                               ; preds = %25
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %36, %25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  call void @_ZN3ipx5TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %38 = getelementptr inbounds i8, ptr %0, i64 64
  %39 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %38) #8
  %40 = call noundef i32 @_ZN3ipx8LuUpdate6UpdateEd(ptr noundef nonnull align 8 dereferenceable(12) %39, double noundef %3)
  %41 = call noundef double @_ZNK3ipx5Timer7ElapsedEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %42 = getelementptr inbounds i8, ptr %0, i64 120
  %43 = load double, ptr %42, align 8, !tbaa !29
  %44 = fadd double %41, %43
  store double %44, ptr %42, align 8, !tbaa !29
  %.not20 = icmp eq i32 %40, 0
  br i1 %.not20, label %45, label %48

45:                                               ; preds = %37
  %46 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx8LuUpdateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %38) #8
  %47 = call noundef zeroext i1 @_ZN3ipx8LuUpdate22NeedFreshFactorizationEv(ptr noundef nonnull align 8 dereferenceable(12) %46)
  br i1 %47, label %48, label %52

48:                                               ; preds = %45, %37
  %49 = load ptr, ptr %0, align 8, !tbaa !30
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3ipx7Control5DebugEi(ptr noundef nonnull align 8 dereferenceable(1496) %49, i32 noundef 3)
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef nonnull @.str.37)
  call void @_ZN3ipx5Basis14CrashFactorizeEPi(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef %5)
  br label %52

52:                                               ; preds = %48, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  ret void
}

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 = { "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 = { 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 #5 = { 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 #6 = { 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 80}
!10 = !{!"_ZTSN3ipx5BasisE", !11, i64 0, !11, i64 8, !12, i64 16, !12, i64 40, !16, i64 64, !22, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, 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 = !{!"bool", !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, !22, i64 72}
!29 = !{!10, !23, i64 120}
!30 = !{!10, !11, i64 0}


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