; LLVM IR from ERGO-Code/HiGHS :: src/model/HighsHessianUtils.ll (Z24extractTriangularHessianRK12HighsOptionsR12HighsHessian)

; 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.HighsHessian = type { i32, i32, %"class.std::vector.3", %"class.std::vector.3", %"class.std::vector.8" }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = 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 }
%struct.HighsOptionsStruct = type { ptr, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", double, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, %"class.std::__cxx11::basic_string", double, double, double, double, double, double, double, double, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %"class.std::__cxx11::basic_string", i8, i8, i8, i32, i32, %"class.std::__cxx11::basic_string", i8, i8, i8, i32, i8, i8, i32, i32, double, i32, i32, i32, i8, i32, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, double, double, double, double, double, double, double, double, double, double, double, i8, i8, i8, i8, i32, double, i8, i8, %"class.std::__cxx11::basic_string", double, i32, i32, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, double, double, double, double, double, i8, i8, %"class.std::__cxx11::basic_string", i8, i32, %struct.HighsLogOptions }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.HighsLogOptions = type <{ ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::function", ptr, i8, [7 x i8] }>
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }

@.str.60 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__._Z24extractTriangularHessianRK12HighsOptionsR12HighsHessian = external hidden unnamed_addr constant [75 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [27 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 nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

declare void @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89), i32 noundef, ptr noundef, ...) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z24extractTriangularHessianRK12HighsOptionsR12HighsHessian(ptr noundef nonnull align 8 dereferenceable(1020) %0, ptr noundef nonnull align 8 dereferenceable(80) %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %class.HighsHessian, ptr %14, i32 0, i32 0
  %16 = load i32, ptr %15, align 8, !tbaa !11
  store i32 %16, ptr %6, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !23
  br label %17

17:                                               ; preds = %133, %2
  %18 = load i32, ptr %8, align 4, !tbaa !23
  %19 = load i32, ptr %6, align 4, !tbaa !23
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %136

22:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %23 = load i32, ptr %7, align 4, !tbaa !23
  store i32 %23, ptr %10, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %class.HighsHessian, ptr %24, i32 0, i32 2
  %26 = load i32, ptr %8, align 4, !tbaa !23
  %27 = sext i32 %26 to i64
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %27) #5
  %29 = load i32, ptr %28, align 4, !tbaa !23
  store i32 %29, ptr %11, align 4, !tbaa !23
  br label %30

30:                                               ; preds = %123, %22
  %31 = load i32, ptr %11, align 4, !tbaa !23
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %class.HighsHessian, ptr %32, i32 0, i32 2
  %34 = load i32, ptr %8, align 4, !tbaa !23
  %35 = add nsw i32 %34, 1
  %36 = sext i32 %35 to i64
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %36) #5
  %38 = load i32, ptr %37, align 4, !tbaa !23
  %39 = icmp slt i32 %31, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %30
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %126

41:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %class.HighsHessian, ptr %42, i32 0, i32 3
  %44 = load i32, ptr %11, align 4, !tbaa !23
  %45 = sext i32 %44 to i64
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %43, i64 noundef %45) #5
  %47 = load i32, ptr %46, align 4, !tbaa !23
  store i32 %47, ptr %12, align 4, !tbaa !23
  %48 = load i32, ptr %12, align 4, !tbaa !23
  %49 = load i32, ptr %8, align 4, !tbaa !23
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %41
  store i32 7, ptr %9, align 4
  br label %120

52:                                               ; preds = %41
  %53 = load i32, ptr %12, align 4, !tbaa !23
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %class.HighsHessian, ptr %54, i32 0, i32 3
  %56 = load i32, ptr %7, align 4, !tbaa !23
  %57 = sext i32 %56 to i64
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %57) #5
  store i32 %53, ptr %58, align 4, !tbaa !23
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %class.HighsHessian, ptr %59, i32 0, i32 4
  %61 = load i32, ptr %11, align 4, !tbaa !23
  %62 = sext i32 %61 to i64
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %62) #5
  %64 = load double, ptr %63, align 8, !tbaa !24
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %class.HighsHessian, ptr %65, i32 0, i32 4
  %67 = load i32, ptr %7, align 4, !tbaa !23
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %68) #5
  store double %64, ptr %69, align 8, !tbaa !24
  %70 = load i32, ptr %12, align 4, !tbaa !23
  %71 = load i32, ptr %8, align 4, !tbaa !23
  %72 = icmp eq i32 %70, %71
  br i1 %72, label %73, label %117

73:                                               ; preds = %52
  %74 = load i32, ptr %7, align 4, !tbaa !23
  %75 = load i32, ptr %10, align 4, !tbaa !23
  %76 = icmp sgt i32 %74, %75
  br i1 %76, label %77, label %117

77:                                               ; preds = %73
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %class.HighsHessian, ptr %78, i32 0, i32 3
  %80 = load i32, ptr %10, align 4, !tbaa !23
  %81 = sext i32 %80 to i64
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %79, i64 noundef %81) #5
  %83 = load i32, ptr %82, align 4, !tbaa !23
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %class.HighsHessian, ptr %84, i32 0, i32 3
  %86 = load i32, ptr %7, align 4, !tbaa !23
  %87 = sext i32 %86 to i64
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %85, i64 noundef %87) #5
  store i32 %83, ptr %88, align 4, !tbaa !23
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %class.HighsHessian, ptr %89, i32 0, i32 4
  %91 = load i32, ptr %10, align 4, !tbaa !23
  %92 = sext i32 %91 to i64
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %90, i64 noundef %92) #5
  %94 = load double, ptr %93, align 8, !tbaa !24
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %class.HighsHessian, ptr %95, i32 0, i32 4
  %97 = load i32, ptr %7, align 4, !tbaa !23
  %98 = sext i32 %97 to i64
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %96, i64 noundef %98) #5
  store double %94, ptr %99, align 8, !tbaa !24
  %100 = load i32, ptr %12, align 4, !tbaa !23
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %class.HighsHessian, ptr %101, i32 0, i32 3
  %103 = load i32, ptr %10, align 4, !tbaa !23
  %104 = sext i32 %103 to i64
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %102, i64 noundef %104) #5
  store i32 %100, ptr %105, align 4, !tbaa !23
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %class.HighsHessian, ptr %106, i32 0, i32 4
  %108 = load i32, ptr %11, align 4, !tbaa !23
  %109 = sext i32 %108 to i64
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %107, i64 noundef %109) #5
  %111 = load double, ptr %110, align 8, !tbaa !24
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %class.HighsHessian, ptr %112, i32 0, i32 4
  %114 = load i32, ptr %10, align 4, !tbaa !23
  %115 = sext i32 %114 to i64
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %113, i64 noundef %115) #5
  store double %111, ptr %116, align 8, !tbaa !24
  br label %117

117:                                              ; preds = %77, %73, %52
  %118 = load i32, ptr %7, align 4, !tbaa !23
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %7, align 4, !tbaa !23
  store i32 0, ptr %9, align 4
  br label %120

120:                                              ; preds = %117, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %121 = load i32, ptr %9, align 4
  switch i32 %121, label %185 [
    i32 0, label %122
    i32 7, label %123
  ]

122:                                              ; preds = %120
  br label %123

123:                                              ; preds = %122, %120
  %124 = load i32, ptr %11, align 4, !tbaa !23
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %11, align 4, !tbaa !23
  br label %30, !llvm.loop !26

126:                                              ; preds = %40
  %127 = load i32, ptr %10, align 4, !tbaa !23
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %class.HighsHessian, ptr %128, i32 0, i32 2
  %130 = load i32, ptr %8, align 4, !tbaa !23
  %131 = sext i32 %130 to i64
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %129, i64 noundef %131) #5
  store i32 %127, ptr %132, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %133

133:                                              ; preds = %126
  %134 = load i32, ptr %8, align 4, !tbaa !23
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %8, align 4, !tbaa !23
  br label %17, !llvm.loop !28

136:                                              ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds %class.HighsHessian, ptr %137, i32 0, i32 2
  %139 = load i32, ptr %6, align 4, !tbaa !23
  %140 = sext i32 %139 to i64
  %141 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %138, i64 noundef %140) #5
  %142 = load i32, ptr %141, align 4, !tbaa !23
  %143 = load i32, ptr %7, align 4, !tbaa !23
  %144 = sub nsw i32 %142, %143
  store i32 %144, ptr %13, align 4, !tbaa !23
  %145 = load i32, ptr %13, align 4, !tbaa !23
  %146 = icmp sge i32 %145, 0
  br i1 %146, label %147, label %148

147:                                              ; preds = %136
  br label %150

148:                                              ; preds = %136
  call void @__assert_fail(ptr noundef @.str.67, ptr noundef @.str.60, i32 noundef 253, ptr noundef @__PRETTY_FUNCTION__._Z24extractTriangularHessianRK12HighsOptionsR12HighsHessian) #6
  unreachable

149:                                              ; No predecessors!
  br label %150

150:                                              ; preds = %149, %147
  %151 = load i32, ptr %13, align 4, !tbaa !23
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %153, label %169

153:                                              ; preds = %150
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %class.HighsHessian, ptr %154, i32 0, i32 1
  %156 = load i32, ptr %155, align 4, !tbaa !29
  %157 = icmp eq i32 %156, 1
  br i1 %157, label %158, label %162

158:                                              ; preds = %153
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.HighsOptionsStruct, ptr %159, i32 0, i32 130
  %161 = load i32, ptr %13, align 4, !tbaa !23
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %160, i32 noundef 4, ptr noundef @.str.68, i32 noundef %161)
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %162

162:                                              ; preds = %158, %153
  %163 = load i32, ptr %7, align 4, !tbaa !23
  %164 = load ptr, ptr %4, align 8, !tbaa !5
  %165 = getelementptr inbounds %class.HighsHessian, ptr %164, i32 0, i32 2
  %166 = load i32, ptr %6, align 4, !tbaa !23
  %167 = sext i32 %166 to i64
  %168 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %165, i64 noundef %167) #5
  store i32 %163, ptr %168, align 4, !tbaa !23
  br label %169

169:                                              ; preds = %162, %150
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = getelementptr inbounds %class.HighsHessian, ptr %170, i32 0, i32 2
  %172 = load i32, ptr %6, align 4, !tbaa !23
  %173 = sext i32 %172 to i64
  %174 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %171, i64 noundef %173) #5
  %175 = load i32, ptr %174, align 4, !tbaa !23
  %176 = load i32, ptr %7, align 4, !tbaa !23
  %177 = icmp eq i32 %175, %176
  br i1 %177, label %178, label %179

178:                                              ; preds = %169
  br label %181

179:                                              ; preds = %169
  call void @__assert_fail(ptr noundef @.str.69, ptr noundef @.str.60, i32 noundef 264, ptr noundef @__PRETTY_FUNCTION__._Z24extractTriangularHessianRK12HighsOptionsR12HighsHessian) #6
  unreachable

180:                                              ; No predecessors!
  br label %181

181:                                              ; preds = %180, %178
  %182 = load ptr, ptr %4, align 8, !tbaa !5
  %183 = getelementptr inbounds %class.HighsHessian, ptr %182, i32 0, i32 1
  store i32 1, ptr %183, align 4, !tbaa !29
  %184 = load i32, ptr %5, align 4, !tbaa !9
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret i32 %184

185:                                              ; preds = %120
  unreachable
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_ZTS11HighsStatus", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS12HighsHessian", !13, i64 0, !14, i64 4, !15, i64 8, !15, i64 32, !19, i64 56}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS13HessianFormat", !7, i64 0}
!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 = !{!"_ZTSSt6vectorIdSaIdEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!13, !13, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"double", !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}
!29 = !{!12, !14, i64 4}


; 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.60 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__._Z24extractTriangularHessianRK12HighsOptionsR12HighsHessian = external hidden unnamed_addr constant [75 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [27 x i8], align 1

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

declare void @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89), i32 noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_Z24extractTriangularHessianRK12HighsOptionsR12HighsHessian(ptr noundef nonnull align 8 dereferenceable(1020) %0, ptr noundef nonnull align 8 dereferenceable(80) %1) local_unnamed_addr #2 {
  %3 = load i32, ptr %1, align 8, !tbaa !5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph73, label %._crit_edge74

.lr.ph73:                                         ; preds = %2
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = getelementptr inbounds i8, ptr %1, i64 32
  %7 = getelementptr inbounds i8, ptr %1, i64 56
  %wide.trip.count = zext nneg i32 %3 to i64
  br label %14

._crit_edge74:                                    ; preds = %._crit_edge, %2
  %.060.lcssa = phi i32 [ 0, %2 ], [ %.161.lcssa, %._crit_edge ]
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = sext i32 %3 to i64
  %10 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %9) #4
  %11 = load i32, ptr %10, align 4, !tbaa !20
  %12 = sub nsw i32 %11, %.060.lcssa
  %13 = icmp sgt i32 %12, -1
  br i1 %13, label %56, label %55

14:                                               ; preds = %.lr.ph73, %._crit_edge
  %indvars.iv77 = phi i64 [ 0, %.lr.ph73 ], [ %indvars.iv.next78, %._crit_edge ]
  %.06071 = phi i32 [ 0, %.lr.ph73 ], [ %.161.lcssa, %._crit_edge ]
  %15 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv77) #4
  %16 = load i32, ptr %15, align 4, !tbaa !20
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %17 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv.next78) #4
  %18 = load i32, ptr %17, align 4, !tbaa !20
  %19 = icmp slt i32 %16, %18
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %14
  %20 = sext i32 %.06071 to i64
  %21 = sext i32 %16 to i64
  br label %23

._crit_edge:                                      ; preds = %50, %14
  %.161.lcssa = phi i32 [ %.06071, %14 ], [ %.2, %50 ]
  %22 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv77) #4
  store i32 %.06071, ptr %22, align 4, !tbaa !20
  %exitcond.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge74, label %14, !llvm.loop !21

23:                                               ; preds = %.lr.ph, %50
  %indvars.iv = phi i64 [ %21, %.lr.ph ], [ %indvars.iv.next, %50 ]
  %.16168 = phi i32 [ %.06071, %.lr.ph ], [ %.2, %50 ]
  %24 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv) #4
  %25 = load i32, ptr %24, align 4, !tbaa !20
  %26 = sext i32 %25 to i64
  %27 = icmp sgt i64 %indvars.iv77, %26
  br i1 %27, label %50, label %28

28:                                               ; preds = %23
  %29 = sext i32 %.16168 to i64
  %30 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %29) #4
  store i32 %25, ptr %30, align 4, !tbaa !20
  %31 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv) #4
  %32 = load double, ptr %31, align 8, !tbaa !23
  %33 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %29) #4
  store double %32, ptr %33, align 8, !tbaa !23
  %34 = zext i32 %25 to i64
  %35 = icmp eq i64 %indvars.iv77, %34
  %36 = icmp sgt i32 %.16168, %.06071
  %or.cond = select i1 %35, i1 %36, i1 false
  br i1 %or.cond, label %37, label %48

37:                                               ; preds = %28
  %38 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %20) #4
  %39 = load i32, ptr %38, align 4, !tbaa !20
  %40 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %29) #4
  store i32 %39, ptr %40, align 4, !tbaa !20
  %41 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %20) #4
  %42 = load double, ptr %41, align 8, !tbaa !23
  %43 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %29) #4
  store double %42, ptr %43, align 8, !tbaa !23
  %44 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %20) #4
  store i32 %25, ptr %44, align 4, !tbaa !20
  %45 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv) #4
  %46 = load double, ptr %45, align 8, !tbaa !23
  %47 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %20) #4
  store double %46, ptr %47, align 8, !tbaa !23
  br label %48

48:                                               ; preds = %37, %28
  %49 = add nsw i32 %.16168, 1
  br label %50

50:                                               ; preds = %23, %48
  %.2 = phi i32 [ %49, %48 ], [ %.16168, %23 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %51 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv.next78) #4
  %52 = load i32, ptr %51, align 4, !tbaa !20
  %53 = sext i32 %52 to i64
  %54 = icmp slt i64 %indvars.iv.next, %53
  br i1 %54, label %23, label %._crit_edge, !llvm.loop !25

55:                                               ; preds = %._crit_edge74
  tail call void @__assert_fail(ptr noundef nonnull @.str.67, ptr noundef nonnull @.str.60, i32 noundef 253, ptr noundef nonnull @__PRETTY_FUNCTION__._Z24extractTriangularHessianRK12HighsOptionsR12HighsHessian) #5
  unreachable

56:                                               ; preds = %._crit_edge74
  %.not = icmp eq i32 %11, %.060.lcssa
  br i1 %.not, label %65, label %57

57:                                               ; preds = %56
  %58 = getelementptr inbounds i8, ptr %1, i64 4
  %59 = load i32, ptr %58, align 4, !tbaa !26
  %60 = icmp eq i32 %59, 1
  br i1 %60, label %61, label %63

61:                                               ; preds = %57
  %62 = getelementptr inbounds i8, ptr %0, i64 896
  tail call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %62, i32 noundef 4, ptr noundef nonnull @.str.68, i32 noundef %12)
  br label %63

63:                                               ; preds = %61, %57
  %.0 = phi i32 [ 1, %61 ], [ 0, %57 ]
  %64 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %9) #4
  store i32 %.060.lcssa, ptr %64, align 4, !tbaa !20
  br label %65

65:                                               ; preds = %63, %56
  %.1 = phi i32 [ %.0, %63 ], [ 0, %56 ]
  %66 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %9) #4
  %67 = load i32, ptr %66, align 4, !tbaa !20
  %68 = icmp eq i32 %67, %.060.lcssa
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  tail call void @__assert_fail(ptr noundef nonnull @.str.69, ptr noundef nonnull @.str.60, i32 noundef 264, ptr noundef nonnull @__PRETTY_FUNCTION__._Z24extractTriangularHessianRK12HighsOptionsR12HighsHessian) #5
  unreachable

70:                                               ; preds = %65
  %71 = getelementptr inbounds i8, ptr %1, i64 4
  store i32 1, ptr %71, align 4, !tbaa !26
  ret i32 %.1
}

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

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

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 = { "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 = { 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 #4 = { nounwind }
attributes #5 = { 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, !7, i64 0}
!6 = !{!"_ZTS12HighsHessian", !7, i64 0, !10, i64 4, !11, i64 8, !11, i64 32, !16, i64 56}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS13HessianFormat", !8, i64 0}
!11 = !{!"_ZTSSt6vectorIiSaIiEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"_ZTSSt6vectorIdSaIdEE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !24, i64 0}
!24 = !{!"double", !8, i64 0}
!25 = distinct !{!25, !22}
!26 = !{!6, !10, i64 4}


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