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

; 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::ForrestTomlin" = type { %"class.ipx::LuUpdate.base", ptr, i32, %"class.std::unique_ptr", %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.ipx::SparseMatrix", %"class.ipx::SparseMatrix", %"class.ipx::SparseMatrix", %"class.std::vector", i32, i8, i8, double, double, %"class.std::valarray" }
%"class.ipx::LuUpdate.base" = type <{ ptr, i32 }>
%"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.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.ipx::SparseMatrix" = type { i32, %"class.std::vector", %"class.std::vector", %"class.std::vector.5", %"class.std::vector", %"class.std::vector.5" }
%"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 }
%"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::valarray" = type { i64, ptr }

@.str.11 = external hidden unnamed_addr constant [6 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 uwtable
define dso_local void @_ZN3ipx13ForrestTomlin12ComputeSpikeEiPKiPKd(ptr noundef nonnull align 8 dereferenceable(608) %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %14 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %15 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 12
  %16 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #6
  %17 = trunc i64 %16 to i32
  store i32 %17, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store double 0.000000e+00, ptr %10, align 8, !tbaa !11
  %18 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 18
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt8valarrayIdEaSERKd(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %43, %4
  %21 = load i32, ptr %11, align 4, !tbaa !9
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %46

25:                                               ; preds = %20
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = load i32, ptr %11, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds double, ptr %26, i64 %28
  %30 = load double, ptr %29, align 8, !tbaa !11
  %31 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 18
  %32 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 6
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = load i32, ptr %11, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i32, ptr %33, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef %38) #6
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %31, i64 noundef %41) #6
  store double %30, ptr %42, align 8, !tbaa !11
  br label %43

43:                                               ; preds = %25
  %44 = load i32, ptr %11, align 4, !tbaa !9
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %11, align 4, !tbaa !9
  br label %20, !llvm.loop !13

46:                                               ; preds = %24
  %47 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 9
  %48 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 18
  %49 = call noundef i32 @_ZN3ipx15TriangularSolveERKNS_12SparseMatrixERSt8valarrayIdEcPKci(ptr noundef nonnull align 8 dereferenceable(128) %47, ptr noundef nonnull align 8 dereferenceable(16) %48, i8 noundef signext 110, ptr noundef @.str.11, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %85, %46
  %51 = load i32, ptr %12, align 4, !tbaa !9
  %52 = load i32, ptr %9, align 4, !tbaa !9
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %88

55:                                               ; preds = %50
  %56 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 18
  %57 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 12
  %58 = load i32, ptr %12, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef %59) #6
  %61 = load i32, ptr %60, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %56, i64 noundef %62) #6
  %64 = load double, ptr %63, align 8, !tbaa !11
  %65 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 11
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 18
  %68 = call noundef double @_ZN3ipx9DotColumnERKNS_12SparseMatrixEiRKSt8valarrayIdE(ptr noundef nonnull align 8 dereferenceable(128) %65, i32 noundef %66, ptr noundef nonnull align 8 dereferenceable(16) %67)
  %69 = fsub double %64, %68
  %70 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 18
  %71 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 2
  %72 = load i32, ptr %71, align 8, !tbaa !15
  %73 = load i32, ptr %12, align 4, !tbaa !9
  %74 = add nsw i32 %72, %73
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %70, i64 noundef %75) #6
  store double %69, ptr %76, align 8, !tbaa !11
  %77 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 18
  %78 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 12
  %79 = load i32, ptr %12, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %80) #6
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %77, i64 noundef %83) #6
  store double 0.000000e+00, ptr %84, align 8, !tbaa !11
  br label %85

85:                                               ; preds = %55
  %86 = load i32, ptr %12, align 4, !tbaa !9
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %12, align 4, !tbaa !9
  br label %50, !llvm.loop !36

88:                                               ; preds = %54
  %89 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 10
  call void @_ZN3ipx12SparseMatrix11clear_queueEv(ptr noundef nonnull align 8 dereferenceable(128) %89)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %114, %88
  %91 = load i32, ptr %13, align 4, !tbaa !9
  %92 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 2
  %93 = load i32, ptr %92, align 8, !tbaa !15
  %94 = load i32, ptr %9, align 4, !tbaa !9
  %95 = add nsw i32 %93, %94
  %96 = icmp slt i32 %91, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %117

98:                                               ; preds = %90
  %99 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 18
  %100 = load i32, ptr %13, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %99, i64 noundef %101) #6
  %103 = load double, ptr %102, align 8, !tbaa !11
  %104 = fcmp une double %103, 0.000000e+00
  br i1 %104, label %105, label %113

105:                                              ; preds = %98
  %106 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 10
  %107 = load i32, ptr %13, align 4, !tbaa !9
  %108 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 18
  %109 = load i32, ptr %13, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %108, i64 noundef %110) #6
  %112 = load double, ptr %111, align 8, !tbaa !11
  call void @_ZN3ipx12SparseMatrix9push_backEid(ptr noundef nonnull align 8 dereferenceable(128) %106, i32 noundef %107, double noundef %112)
  br label %113

113:                                              ; preds = %105, %98
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %13, align 4, !tbaa !9
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %13, align 4, !tbaa !9
  br label %90, !llvm.loop !37

117:                                              ; preds = %97
  %118 = getelementptr inbounds %"class.ipx::ForrestTomlin", ptr %14, i32 0, i32 15
  store i8 1, ptr %118, align 1, !tbaa !38
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret void
}

declare noundef i32 @_ZN3ipx15TriangularSolveERKNS_12SparseMatrixERSt8valarrayIdEcPKci(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(16), i8 noundef signext, ptr noundef, i32 noundef) #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #4 align 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) #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3ipx9DotColumnERKNS_12SparseMatrixEiRKSt8valarrayIdE(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, ptr noundef nonnull align 8 dereferenceable(16)) #4

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

declare void @_ZN3ipx12SparseMatrix11clear_queueEv(ptr noundef nonnull align 8 dereferenceable(128)) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = { 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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !10, i64 24}
!16 = !{!"_ZTSN3ipx13ForrestTomlinE", !17, i64 0, !6, i64 16, !10, i64 24, !18, i64 32, !24, i64 40, !24, i64 64, !24, i64 88, !24, i64 112, !24, i64 136, !28, i64 160, !28, i64 288, !28, i64 416, !24, i64 544, !10, i64 568, !33, i64 572, !33, i64 573, !12, i64 576, !12, i64 584, !34, i64 592}
!17 = !{!"_ZTSN3ipx8LuUpdateE", !10, i64 8}
!18 = !{!"_ZTSSt10unique_ptrIN3ipx15LuFactorizationESt14default_deleteIS1_EE", !19, i64 0}
!19 = !{!"_ZTSSt15__uniq_ptr_dataIN3ipx15LuFactorizationESt14default_deleteIS1_ELb1ELb1EE", !20, i64 0}
!20 = !{!"_ZTSSt15__uniq_ptr_implIN3ipx15LuFactorizationESt14default_deleteIS1_EE", !21, i64 0}
!21 = !{!"_ZTSSt5tupleIJPN3ipx15LuFactorizationESt14default_deleteIS1_EEE", !22, i64 0}
!22 = !{!"_ZTSSt11_Tuple_implILm0EJPN3ipx15LuFactorizationESt14default_deleteIS1_EEE", !23, i64 0}
!23 = !{!"_ZTSSt10_Head_baseILm0EPN3ipx15LuFactorizationELb0EE", !6, i64 0}
!24 = !{!"_ZTSSt6vectorIiSaIiEE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!"_ZTSN3ipx12SparseMatrixE", !10, i64 0, !24, i64 8, !24, i64 32, !29, i64 56, !24, i64 80, !29, i64 104}
!29 = !{!"_ZTSSt6vectorIdSaIdEE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!"bool", !7, i64 0}
!34 = !{!"_ZTSSt8valarrayIdE", !35, i64 0, !6, i64 8}
!35 = !{!"long", !7, i64 0}
!36 = distinct !{!36, !14}
!37 = distinct !{!37, !14}
!38 = !{!16, !33, i64 573}


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

@.str.11 = external hidden unnamed_addr constant [6 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 uwtable
define dso_local void @_ZN3ipx13ForrestTomlin12ComputeSpikeEiPKiPKd(ptr noundef nonnull align 8 dereferenceable(608) %0, i32 noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3) local_unnamed_addr #1 align 2 {
  %5 = alloca double, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 544
  %7 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  %8 = trunc i64 %7 to i32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  store double 0.000000e+00, ptr %5, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 592
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt8valarrayIdEaSERKd(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %11 = icmp sgt i32 %1, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %4
  %12 = getelementptr inbounds i8, ptr %0, i64 88
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %18

._crit_edge:                                      ; preds = %18, %4
  %13 = getelementptr inbounds i8, ptr %0, i64 160
  %14 = call noundef i32 @_ZN3ipx15TriangularSolveERKNS_12SparseMatrixERSt8valarrayIdEcPKci(ptr noundef nonnull align 8 dereferenceable(128) %13, ptr noundef nonnull align 8 dereferenceable(16) %9, i8 noundef signext 110, ptr noundef nonnull @.str.11, i32 noundef 1)
  %15 = icmp sgt i32 %8, 0
  br i1 %15, label %.lr.ph26, label %._crit_edge27

.lr.ph26:                                         ; preds = %._crit_edge
  %16 = getelementptr inbounds i8, ptr %0, i64 416
  %17 = getelementptr inbounds i8, ptr %0, i64 24
  %wide.trip.count36 = and i64 %7, 2147483647
  br label %33

18:                                               ; preds = %.lr.ph, %18
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %18 ]
  %19 = getelementptr inbounds double, ptr %3, i64 %indvars.iv
  %20 = load double, ptr %19, align 8, !tbaa !5
  %21 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = sext i32 %22 to i64
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %23) #6
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %26) #6
  store double %20, ptr %27, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %18, !llvm.loop !11

._crit_edge27:                                    ; preds = %33, %._crit_edge
  %28 = getelementptr inbounds i8, ptr %0, i64 288
  call void @_ZN3ipx12SparseMatrix11clear_queueEv(ptr noundef nonnull align 8 dereferenceable(128) %28)
  %29 = getelementptr inbounds i8, ptr %0, i64 24
  %30 = load i32, ptr %29, align 8, !tbaa !13
  %31 = add nsw i32 %30, %8
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph30, label %._crit_edge31

33:                                               ; preds = %.lr.ph26, %33
  %indvars.iv33 = phi i64 [ 0, %.lr.ph26 ], [ %indvars.iv.next34, %33 ]
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv33) #6
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %36) #6
  %38 = load double, ptr %37, align 8, !tbaa !5
  %39 = trunc nuw nsw i64 %indvars.iv33 to i32
  %40 = call noundef double @_ZN3ipx9DotColumnERKNS_12SparseMatrixEiRKSt8valarrayIdE(ptr noundef nonnull align 8 dereferenceable(128) %16, i32 noundef %39, ptr noundef nonnull align 8 dereferenceable(16) %9)
  %41 = fsub double %38, %40
  %42 = load i32, ptr %17, align 8, !tbaa !13
  %43 = add nsw i32 %42, %39
  %44 = sext i32 %43 to i64
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %44) #6
  store double %41, ptr %45, align 8, !tbaa !5
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv33) #6
  %47 = load i32, ptr %46, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %48) #6
  store double 0.000000e+00, ptr %49, align 8, !tbaa !5
  %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
  %exitcond37.not = icmp eq i64 %indvars.iv.next34, %wide.trip.count36
  br i1 %exitcond37.not, label %._crit_edge27, label %33, !llvm.loop !35

._crit_edge31:                                    ; preds = %58, %._crit_edge27
  %50 = getelementptr inbounds i8, ptr %0, i64 573
  store i8 1, ptr %50, align 1, !tbaa !36
  ret void

.lr.ph30:                                         ; preds = %._crit_edge27, %58
  %indvars.iv38 = phi i64 [ %indvars.iv.next39, %58 ], [ 0, %._crit_edge27 ]
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %indvars.iv38) #6
  %52 = load double, ptr %51, align 8, !tbaa !5
  %53 = fcmp une double %52, 0.000000e+00
  br i1 %53, label %54, label %58

54:                                               ; preds = %.lr.ph30
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %indvars.iv38) #6
  %56 = load double, ptr %55, align 8, !tbaa !5
  %57 = trunc nuw nsw i64 %indvars.iv38 to i32
  call void @_ZN3ipx12SparseMatrix9push_backEid(ptr noundef nonnull align 8 dereferenceable(128) %28, i32 noundef %57, double noundef %56)
  br label %58

58:                                               ; preds = %.lr.ph30, %54
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %59 = load i32, ptr %29, align 8, !tbaa !13
  %60 = add nsw i32 %59, %8
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next39, %61
  br i1 %62, label %.lr.ph30, label %._crit_edge31, !llvm.loop !37
}

declare noundef i32 @_ZN3ipx15TriangularSolveERKNS_12SparseMatrixERSt8valarrayIdEcPKci(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(16), i8 noundef signext, ptr noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #4 align 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 #3 align 2

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

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

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

declare void @_ZN3ipx12SparseMatrix11clear_queueEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = { 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"}
!13 = !{!14, !10, i64 24}
!14 = !{!"_ZTSN3ipx13ForrestTomlinE", !15, i64 0, !16, i64 16, !10, i64 24, !17, i64 32, !23, i64 40, !23, i64 64, !23, i64 88, !23, i64 112, !23, i64 136, !27, i64 160, !27, i64 288, !27, i64 416, !23, i64 544, !10, i64 568, !32, i64 572, !32, i64 573, !6, i64 576, !6, i64 584, !33, i64 592}
!15 = !{!"_ZTSN3ipx8LuUpdateE", !10, i64 8}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!"_ZTSSt10unique_ptrIN3ipx15LuFactorizationESt14default_deleteIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt15__uniq_ptr_dataIN3ipx15LuFactorizationESt14default_deleteIS1_ELb1ELb1EE", !19, i64 0}
!19 = !{!"_ZTSSt15__uniq_ptr_implIN3ipx15LuFactorizationESt14default_deleteIS1_EE", !20, i64 0}
!20 = !{!"_ZTSSt5tupleIJPN3ipx15LuFactorizationESt14default_deleteIS1_EEE", !21, i64 0}
!21 = !{!"_ZTSSt11_Tuple_implILm0EJPN3ipx15LuFactorizationESt14default_deleteIS1_EEE", !22, i64 0}
!22 = !{!"_ZTSSt10_Head_baseILm0EPN3ipx15LuFactorizationELb0EE", !16, i64 0}
!23 = !{!"_ZTSSt6vectorIiSaIiEE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!27 = !{!"_ZTSN3ipx12SparseMatrixE", !10, i64 0, !23, i64 8, !23, i64 32, !28, i64 56, !23, i64 80, !28, i64 104}
!28 = !{!"_ZTSSt6vectorIdSaIdEE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!32 = !{!"bool", !7, i64 0}
!33 = !{!"_ZTSSt8valarrayIdE", !34, i64 0, !16, i64 8}
!34 = !{!"long", !7, i64 0}
!35 = distinct !{!35, !12}
!36 = !{!14, !32, i64 573}
!37 = distinct !{!37, !12}


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