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

; 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::LpSolver" = type { %"class.ipx::Control", %"struct.ipx::Info", %"class.ipx::Model", %"class.std::unique_ptr", %"class.std::unique_ptr.18", %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", %"class.std::vector.4", %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", %"class.std::valarray" }
%"class.ipx::Control" = type { %"struct.ipx::Parameters", ptr, %"class.std::basic_ofstream", %"class.ipx::Timer", %"class.ipx::Timer", %"class.ipx::Multistream", %"class.ipx::Multistream" }
%"struct.ipx::Parameters" = type { %struct.ipx_parameters }
%struct.ipx_parameters = type { i32, ptr, double, double, i8, i32, i32, i32, double, double, double, double, double, i32, double, double, i32, i32, i32, double, i32, double, double, double, i32, i32, i32, i32, i32, i32, i32, double, double, double, i32, i8, i8, ptr }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon.0 }
%union.anon.0 = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"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::Multistream" = type { %"class.std::basic_ostream.base", %"struct.ipx::Multistream::multibuffer", %"class.std::basic_ios" }
%"struct.ipx::Multistream::multibuffer" = type { %"class.std::basic_streambuf", %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::basic_streambuf<char> *, std::allocator<std::basic_streambuf<char> *>>::_Vector_impl" }
%"struct.std::_Vector_base<std::basic_streambuf<char> *, std::allocator<std::basic_streambuf<char> *>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::basic_streambuf<char> *, std::allocator<std::basic_streambuf<char> *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::basic_streambuf<char> *, std::allocator<std::basic_streambuf<char> *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.ipx::Info" = type { %struct.ipx_info }
%struct.ipx_info = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i32, i32, i32, i32, i32, i32, i32, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i32, i32, i32, i32, double, double, double, double }
%"class.ipx::Model" = type { i8, i32, i32, i32, i32, %"class.ipx::SparseMatrix", %"class.ipx::SparseMatrix", %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", double, double, i32, i32, i32, i32, i32, %"class.std::vector.4", %"class.std::vector.14", double, double, double, %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", %"class.ipx::SparseMatrix", %"class.std::vector.4", %"class.std::valarray", %"class.std::valarray" }
%"class.std::vector.14" = type { %"struct.std::_Vector_base.15" }
%"struct.std::_Vector_base.15" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.ipx::SparseMatrix" = type { i32, %"class.std::vector.4", %"class.std::vector.4", %"class.std::vector.9", %"class.std::vector.4", %"class.std::vector.9" }
%"class.std::vector.9" = type { %"struct.std::_Vector_base.10" }
%"struct.std::_Vector_base.10" = 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::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.17" }
%"struct.std::_Head_base.17" = type { ptr }
%"class.std::unique_ptr.18" = type { %"struct.std::__uniq_ptr_data.19" }
%"struct.std::__uniq_ptr_data.19" = type { %"class.std::__uniq_ptr_impl.20" }
%"class.std::__uniq_ptr_impl.20" = type { %"class.std::tuple.21" }
%"class.std::tuple.21" = type { %"struct.std::_Tuple_impl.22" }
%"struct.std::_Tuple_impl.22" = type { %"struct.std::_Head_base.25" }
%"struct.std::_Head_base.25" = type { ptr }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = 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.14 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__._ZN3ipx8LpSolver12GetKKTMatrixEPiS1_PdS2_ = external hidden unnamed_addr constant [66 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [2 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 i32 @_ZNK3ipx5Model4rowsEv(ptr noundef nonnull align 8 dereferenceable(704)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3ipx5Model4colsEv(ptr noundef nonnull align 8 dereferenceable(704)) #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 zeroext i1 @_ZNKSt10unique_ptrIN3ipx7IterateESt14default_deleteIS1_EEcvbEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

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

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

19:                                               ; preds = %5
  store i32 -1, ptr %6, align 4
  br label %132

20:                                               ; preds = %5
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %51

23:                                               ; preds = %20
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %51

26:                                               ; preds = %23
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %51

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %30 = getelementptr inbounds %"class.ipx::LpSolver", ptr %16, i32 0, i32 2
  %31 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNK3ipx5Model2AIEv(ptr noundef nonnull align 8 dereferenceable(704) %30)
  store ptr %31, ptr %12, align 8, !tbaa !5
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = call noundef ptr @_ZNK3ipx12SparseMatrix6colptrEv(ptr noundef nonnull align 8 dereferenceable(128) %32)
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = call noundef i32 @_ZNK3ipx12SparseMatrix4colsEv(ptr noundef nonnull align 8 dereferenceable(128) %34)
  %36 = add nsw i32 %35, 1
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = call noundef ptr @_ZSt6copy_nIPKiiPiET1_T_T0_S3_(ptr noundef %33, i32 noundef %36, ptr noundef %37)
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = call noundef ptr @_ZNK3ipx12SparseMatrix6rowidxEv(ptr noundef nonnull align 8 dereferenceable(128) %39)
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = call noundef i32 @_ZNK3ipx12SparseMatrix7entriesEv(ptr noundef nonnull align 8 dereferenceable(128) %41)
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = call noundef ptr @_ZSt6copy_nIPKiiPiET1_T_T0_S3_(ptr noundef %40, i32 noundef %42, ptr noundef %43)
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = call noundef ptr @_ZNK3ipx12SparseMatrix6valuesEv(ptr noundef nonnull align 8 dereferenceable(128) %45)
  %47 = load ptr, ptr %12, align 8, !tbaa !5
  %48 = call noundef i32 @_ZNK3ipx12SparseMatrix7entriesEv(ptr noundef nonnull align 8 dereferenceable(128) %47)
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = call noundef ptr @_ZSt6copy_nIPKdiPdET1_T_T0_S3_(ptr noundef %46, i32 noundef %48, ptr noundef %49)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %51

51:                                               ; preds = %29, %26, %23, %20
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %131

54:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %55 = getelementptr inbounds %"class.ipx::LpSolver", ptr %16, i32 0, i32 2
  %56 = call noundef i32 @_ZNK3ipx5Model4rowsEv(ptr noundef nonnull align 8 dereferenceable(704) %55)
  store i32 %56, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %57 = getelementptr inbounds %"class.ipx::LpSolver", ptr %16, i32 0, i32 2
  %58 = call noundef i32 @_ZNK3ipx5Model4colsEv(ptr noundef nonnull align 8 dereferenceable(704) %57)
  store i32 %58, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %127, %54
  %60 = load i32, ptr %15, align 4, !tbaa !9
  %61 = load i32, ptr %14, align 4, !tbaa !9
  %62 = load i32, ptr %13, align 4, !tbaa !9
  %63 = add nsw i32 %61, %62
  %64 = icmp slt i32 %60, %63
  br i1 %64, label %66, label %65

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

66:                                               ; preds = %59
  %67 = getelementptr inbounds %"class.ipx::LpSolver", ptr %16, i32 0, i32 3
  %68 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx7IterateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %67) #6
  %69 = load i32, ptr %15, align 4, !tbaa !9
  %70 = call noundef i32 @_ZNK3ipx7Iterate7StateOfEi(ptr noundef nonnull align 8 dereferenceable(296) %68, i32 noundef %69)
  switch i32 %70, label %125 [
    i32 0, label %71
    i32 1, label %76
    i32 2, label %81
  ]

71:                                               ; preds = %66
  %72 = load ptr, ptr %11, align 8, !tbaa !5
  %73 = load i32, ptr %15, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds double, ptr %72, i64 %74
  store double 0x7FF0000000000000, ptr %75, align 8, !tbaa !11
  br label %126

76:                                               ; preds = %66
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = load i32, ptr %15, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds double, ptr %77, i64 %79
  store double 0.000000e+00, ptr %80, align 8, !tbaa !11
  br label %126

81:                                               ; preds = %66
  %82 = getelementptr inbounds %"class.ipx::LpSolver", ptr %16, i32 0, i32 3
  %83 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx7IterateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %82) #6
  %84 = load i32, ptr %15, align 4, !tbaa !9
  %85 = call noundef double @_ZNK3ipx7Iterate2zlEi(ptr noundef nonnull align 8 dereferenceable(296) %83, i32 noundef %84)
  %86 = getelementptr inbounds %"class.ipx::LpSolver", ptr %16, i32 0, i32 3
  %87 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx7IterateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %86) #6
  %88 = load i32, ptr %15, align 4, !tbaa !9
  %89 = call noundef double @_ZNK3ipx7Iterate2xlEi(ptr noundef nonnull align 8 dereferenceable(296) %87, i32 noundef %88)
  %90 = fdiv double %85, %89
  %91 = getelementptr inbounds %"class.ipx::LpSolver", ptr %16, i32 0, i32 3
  %92 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx7IterateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %91) #6
  %93 = load i32, ptr %15, align 4, !tbaa !9
  %94 = call noundef double @_ZNK3ipx7Iterate2zuEi(ptr noundef nonnull align 8 dereferenceable(296) %92, i32 noundef %93)
  %95 = getelementptr inbounds %"class.ipx::LpSolver", ptr %16, i32 0, i32 3
  %96 = call noundef ptr @_ZNKSt10unique_ptrIN3ipx7IterateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %95) #6
  %97 = load i32, ptr %15, align 4, !tbaa !9
  %98 = call noundef double @_ZNK3ipx7Iterate2xuEi(ptr noundef nonnull align 8 dereferenceable(296) %96, i32 noundef %97)
  %99 = fdiv double %94, %98
  %100 = fadd double %90, %99
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = load i32, ptr %15, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds double, ptr %101, i64 %103
  store double %100, ptr %104, align 8, !tbaa !11
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = load i32, ptr %15, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds double, ptr %105, i64 %107
  %109 = load double, ptr %108, align 8, !tbaa !11
  %110 = call noundef zeroext i1 @_ZSt8isfinited(double noundef %109)
  br i1 %110, label %111, label %112

111:                                              ; preds = %81
  br label %114

112:                                              ; preds = %81
  call void @__assert_fail(ptr noundef @.str.20, ptr noundef @.str.14, i32 noundef 324, ptr noundef @__PRETTY_FUNCTION__._ZN3ipx8LpSolver12GetKKTMatrixEPiS1_PdS2_) #7
  unreachable

113:                                              ; No predecessors!
  br label %114

114:                                              ; preds = %113, %111
  %115 = load ptr, ptr %11, align 8, !tbaa !5
  %116 = load i32, ptr %15, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds double, ptr %115, i64 %117
  %119 = load double, ptr %118, align 8, !tbaa !11
  %120 = fcmp ogt double %119, 0.000000e+00
  br i1 %120, label %121, label %122

121:                                              ; preds = %114
  br label %124

122:                                              ; preds = %114
  call void @__assert_fail(ptr noundef @.str.21, ptr noundef @.str.14, i32 noundef 325, ptr noundef @__PRETTY_FUNCTION__._ZN3ipx8LpSolver12GetKKTMatrixEPiS1_PdS2_) #7
  unreachable

123:                                              ; No predecessors!
  br label %124

124:                                              ; preds = %123, %121
  br label %126

125:                                              ; preds = %66
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.14, i32 noundef 328, ptr noundef @__PRETTY_FUNCTION__._ZN3ipx8LpSolver12GetKKTMatrixEPiS1_PdS2_) #7
  unreachable

126:                                              ; preds = %124, %76, %71
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %15, align 4, !tbaa !9
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %15, align 4, !tbaa !9
  br label %59, !llvm.loop !13

130:                                              ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %131

131:                                              ; preds = %130, %51
  store i32 0, ptr %6, align 4
  br label %132

132:                                              ; preds = %131, %19
  %133 = load i32, ptr %6, align 4
  ret i32 %133
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6copy_nIPKiiPiET1_T_T0_S3_(ptr noundef, i32 noundef, ptr noundef) #4

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6copy_nIPKdiPdET1_T_T0_S3_(ptr noundef, i32 noundef, ptr noundef) #4

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSt8isfinited(double noundef) #1

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 = { 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 = { nounwind }
attributes #7 = { noreturn nounwind }

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.14 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__._ZN3ipx8LpSolver12GetKKTMatrixEPiS1_PdS2_ = external hidden unnamed_addr constant [66 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -1, 1) i32 @_ZN3ipx8LpSolver12GetKKTMatrixEPiS1_PdS2_(ptr noundef nonnull align 8 dereferenceable(2864) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #2 align 2 {
  %6 = getelementptr inbounds i8, ptr %0, i64 2664
  %7 = tail call noundef zeroext i1 @_ZNKSt10unique_ptrIN3ipx7IterateESt14default_deleteIS1_EEcvbEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br i1 %7, label %8, label %.loopexit

8:                                                ; preds = %5
  %9 = icmp ne ptr %1, null
  %10 = icmp ne ptr %2, null
  %or.cond = and i1 %9, %10
  %11 = icmp ne ptr %3, null
  %or.cond3 = and i1 %or.cond, %11
  br i1 %or.cond3, label %12, label %25

12:                                               ; preds = %8
  %13 = getelementptr inbounds i8, ptr %0, i64 1960
  %14 = tail call noundef nonnull align 8 dereferenceable(128) ptr @_ZNK3ipx5Model2AIEv(ptr noundef nonnull align 8 dereferenceable(704) %13)
  %15 = tail call noundef ptr @_ZNK3ipx12SparseMatrix6colptrEv(ptr noundef nonnull align 8 dereferenceable(128) %14)
  %16 = tail call noundef i32 @_ZNK3ipx12SparseMatrix4colsEv(ptr noundef nonnull align 8 dereferenceable(128) %14)
  %17 = add nsw i32 %16, 1
  %18 = tail call noundef ptr @_ZSt6copy_nIPKiiPiET1_T_T0_S3_(ptr noundef %15, i32 noundef %17, ptr noundef nonnull %1)
  %19 = tail call noundef ptr @_ZNK3ipx12SparseMatrix6rowidxEv(ptr noundef nonnull align 8 dereferenceable(128) %14)
  %20 = tail call noundef i32 @_ZNK3ipx12SparseMatrix7entriesEv(ptr noundef nonnull align 8 dereferenceable(128) %14)
  %21 = tail call noundef ptr @_ZSt6copy_nIPKiiPiET1_T_T0_S3_(ptr noundef %19, i32 noundef %20, ptr noundef nonnull %2)
  %22 = tail call noundef ptr @_ZNK3ipx12SparseMatrix6valuesEv(ptr noundef nonnull align 8 dereferenceable(128) %14)
  %23 = tail call noundef i32 @_ZNK3ipx12SparseMatrix7entriesEv(ptr noundef nonnull align 8 dereferenceable(128) %14)
  %24 = tail call noundef ptr @_ZSt6copy_nIPKdiPdET1_T_T0_S3_(ptr noundef %22, i32 noundef %23, ptr noundef nonnull %3)
  br label %25

25:                                               ; preds = %12, %8
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %.loopexit, label %26

26:                                               ; preds = %25
  %27 = getelementptr inbounds i8, ptr %0, i64 1960
  %28 = tail call noundef i32 @_ZNK3ipx5Model4rowsEv(ptr noundef nonnull align 8 dereferenceable(704) %27)
  %29 = tail call noundef i32 @_ZNK3ipx5Model4colsEv(ptr noundef nonnull align 8 dereferenceable(704) %27)
  %30 = add nsw i32 %29, %28
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %26
  %wide.trip.count = zext nneg i32 %30 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %61
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %61 ]
  %32 = tail call noundef ptr @_ZNKSt10unique_ptrIN3ipx7IterateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %33 = trunc nuw nsw i64 %indvars.iv to i32
  %34 = tail call noundef i32 @_ZNK3ipx7Iterate7StateOfEi(ptr noundef nonnull align 8 dereferenceable(296) %32, i32 noundef %33)
  switch i32 %34, label %59 [
    i32 0, label %.sink.split
    i32 1, label %35
    i32 2, label %36
  ]

35:                                               ; preds = %.lr.ph
  br label %.sink.split

36:                                               ; preds = %.lr.ph
  %37 = tail call noundef ptr @_ZNKSt10unique_ptrIN3ipx7IterateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %38 = tail call noundef double @_ZNK3ipx7Iterate2zlEi(ptr noundef nonnull align 8 dereferenceable(296) %37, i32 noundef %33)
  %39 = tail call noundef ptr @_ZNKSt10unique_ptrIN3ipx7IterateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %40 = tail call noundef double @_ZNK3ipx7Iterate2xlEi(ptr noundef nonnull align 8 dereferenceable(296) %39, i32 noundef %33)
  %41 = tail call noundef ptr @_ZNKSt10unique_ptrIN3ipx7IterateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %42 = tail call noundef double @_ZNK3ipx7Iterate2zuEi(ptr noundef nonnull align 8 dereferenceable(296) %41, i32 noundef %33)
  %43 = tail call noundef ptr @_ZNKSt10unique_ptrIN3ipx7IterateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %44 = tail call noundef double @_ZNK3ipx7Iterate2xuEi(ptr noundef nonnull align 8 dereferenceable(296) %43, i32 noundef %33)
  %45 = insertelement <2 x double> poison, double %38, i64 0
  %46 = insertelement <2 x double> %45, double %42, i64 1
  %47 = insertelement <2 x double> poison, double %40, i64 0
  %48 = insertelement <2 x double> %47, double %44, i64 1
  %49 = fdiv <2 x double> %46, %48
  %shift = shufflevector <2 x double> %49, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %50 = fadd <2 x double> %49, %shift
  %51 = extractelement <2 x double> %50, i64 0
  %52 = getelementptr inbounds double, ptr %4, i64 %indvars.iv
  store double %51, ptr %52, align 8, !tbaa !5
  %53 = tail call noundef zeroext i1 @_ZSt8isfinited(double noundef %51)
  br i1 %53, label %55, label %54

54:                                               ; preds = %36
  tail call void @__assert_fail(ptr noundef nonnull @.str.20, ptr noundef nonnull @.str.14, i32 noundef 324, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3ipx8LpSolver12GetKKTMatrixEPiS1_PdS2_) #6
  unreachable

55:                                               ; preds = %36
  %56 = load double, ptr %52, align 8, !tbaa !5
  %57 = fcmp ogt double %56, 0.000000e+00
  br i1 %57, label %61, label %58

58:                                               ; preds = %55
  tail call void @__assert_fail(ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.14, i32 noundef 325, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3ipx8LpSolver12GetKKTMatrixEPiS1_PdS2_) #6
  unreachable

59:                                               ; preds = %.lr.ph
  tail call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.14, i32 noundef 328, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3ipx8LpSolver12GetKKTMatrixEPiS1_PdS2_) #6
  unreachable

.sink.split:                                      ; preds = %.lr.ph, %35
  %.sink = phi double [ 0.000000e+00, %35 ], [ 0x7FF0000000000000, %.lr.ph ]
  %60 = getelementptr inbounds double, ptr %4, i64 %indvars.iv
  store double %.sink, ptr %60, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %.sink.split, %55
  %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 %.loopexit, label %.lr.ph, !llvm.loop !9

.loopexit:                                        ; preds = %61, %26, %25, %5
  %.036 = phi i32 [ -1, %5 ], [ 0, %25 ], [ 0, %26 ], [ 0, %61 ]
  ret i32 %.036
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6copy_nIPKiiPiET1_T_T0_S3_(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6copy_nIPKdiPdET1_T_T0_S3_(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSt8isfinited(double noundef) local_unnamed_addr #0

attributes #0 = { 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 #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress 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 = { nounwind }
attributes #6 = { noreturn nounwind }

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

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


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