; LLVM IR from buresjan/optim_lbm :: nomad/ext/sgtelib/src (Surrogate_Ensemble_Stat)

; 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.SGTELIB::Matrix" = type { ptr, %"class.std::__cxx11::basic_string", i32, i32, ptr }
%"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] }
%"class.std::allocator" = type { i8 }
%"class.SGTELIB::Surrogate" = type <{ ptr, ptr, %"class.SGTELIB::Surrogate_Parameters", i32, i32, i32, i32, i32, i32, i8, [7 x i8], ptr, ptr, ptr, ptr, %"class.std::__cxx11::list", %"class.std::map", double, %"class.std::basic_ofstream", i8, [7 x i8] }>
%"class.SGTELIB::Surrogate_Parameters" = type { ptr, i32, i32, i32, i32, i32, double, i32, double, i32, i32, i32, %"class.SGTELIB::Matrix", i32, i32, i32, double, double, double, double, %"class.SGTELIB::Matrix", i32, i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, i32 }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" }
%"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<SGTELIB::metric_t, std::pair<const SGTELIB::metric_t, SGTELIB::Matrix>, std::_Select1st<std::pair<const SGTELIB::metric_t, SGTELIB::Matrix>>, std::less<SGTELIB::metric_t>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<SGTELIB::metric_t, std::pair<const SGTELIB::metric_t, SGTELIB::Matrix>, std::_Select1st<std::pair<const SGTELIB::metric_t, SGTELIB::Matrix>>, std::less<SGTELIB::metric_t>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, 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.6 }
%union.anon.6 = 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.SGTELIB::Surrogate_Ensemble_Stat" = type { %"class.SGTELIB::Surrogate.base", i32, i32, %"class.std::vector", ptr, ptr, %"class.SGTELIB::Matrix", i32, double, double, double, double }
%"class.SGTELIB::Surrogate.base" = type <{ ptr, ptr, %"class.SGTELIB::Surrogate_Parameters", i32, i32, i32, i32, i32, i32, i8, [7 x i8], ptr, ptr, ptr, ptr, %"class.std::__cxx11::list", %"class.std::map", double, %"class.std::basic_ofstream", i8 }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<SGTELIB::Surrogate *, std::allocator<SGTELIB::Surrogate *>>::_Vector_impl" }
%"struct.std::_Vector_base<SGTELIB::Surrogate *, std::allocator<SGTELIB::Surrogate *>>::_Vector_impl" = type { %"struct.std::_Vector_base<SGTELIB::Surrogate *, std::allocator<SGTELIB::Surrogate *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SGTELIB::Surrogate *, std::allocator<SGTELIB::Surrogate *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.20 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

declare void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) unnamed_addr #3

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

; Function Attrs: nounwind
declare void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7SGTELIB23Surrogate_Ensemble_Stat21build_simplex_privateEv(ptr noundef nonnull align 8 dereferenceable(1136) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.SGTELIB::Matrix", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.SGTELIB::Matrix", align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca double, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.SGTELIB::Matrix", align 8
  %14 = alloca %"class.SGTELIB::Matrix", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %15 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef @.str.20, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %16 unwind label %53

16:                                               ; preds = %1
  %17 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %15, i32 0, i32 3
  %18 = load i32, ptr %17, align 8, !tbaa !9
  %19 = add nsw i32 %18, 1
  %20 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %15, i32 0, i32 3
  %21 = load i32, ptr %20, align 8, !tbaa !9
  invoke void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56) %3, ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef %19, i32 noundef %21)
          to label %22 unwind label %57

22:                                               ; preds = %16
  %23 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble_Stat", ptr %15, i32 0, i32 6
  %24 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZN7SGTELIB6MatrixaSERKS0_(ptr noundef nonnull align 8 dereferenceable(56) %23, ptr noundef nonnull align 8 dereferenceable(56) %3)
          to label %25 unwind label %61

25:                                               ; preds = %22
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 56, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef @.str.21, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %26 unwind label %67

26:                                               ; preds = %25
  %27 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %15, i32 0, i32 3
  %28 = load i32, ptr %27, align 8, !tbaa !9
  invoke void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef nonnull align 8 dereferenceable(32) %9, i32 noundef 1, i32 noundef %28)
          to label %29 unwind label %71

29:                                               ; preds = %26
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #6
  invoke void @_ZN7SGTELIB6Matrix7set_rowEdi(ptr noundef nonnull align 8 dereferenceable(56) %8, double noundef 1.000000e+00, i32 noundef 0)
          to label %30 unwind label %76

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %31 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %15, i32 0, i32 3
  %32 = load i32, ptr %31, align 8, !tbaa !9
  %33 = add nsw i32 %32, 1
  %34 = sitofp i32 %33 to double
  %35 = call double @sqrt(double noundef %34) #6
  %36 = fdiv double 1.000000e+00, %35
  %37 = fadd double 1.000000e+00, %36
  %38 = fneg double %37
  %39 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %15, i32 0, i32 3
  %40 = load i32, ptr %39, align 8, !tbaa !9
  %41 = sitofp i32 %40 to double
  %42 = fdiv double %38, %41
  store double %42, ptr %11, align 8, !tbaa !47
  %43 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %15, i32 0, i32 2
  %44 = invoke noundef double @_ZNK7SGTELIB20Surrogate_Parameters14get_size_paramEv(ptr noundef nonnull align 8 dereferenceable(312) %43)
          to label %45 unwind label %80

45:                                               ; preds = %30
  %46 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble_Stat", ptr %15, i32 0, i32 8
  store double %44, ptr %46, align 8, !tbaa !48
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !54
  br label %47

47:                                               ; preds = %105, %45
  %48 = load i32, ptr %12, align 4, !tbaa !54
  %49 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %15, i32 0, i32 3
  %50 = load i32, ptr %49, align 8, !tbaa !9
  %51 = icmp slt i32 %48, %50
  br i1 %51, label %84, label %52

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

53:                                               ; preds = %1
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %6, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %7, align 4
  br label %66

57:                                               ; preds = %16
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %6, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %7, align 4
  br label %65

61:                                               ; preds = %22
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %6, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %7, align 4
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #6
  br label %65

65:                                               ; preds = %61, %57
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  br label %66

66:                                               ; preds = %65, %53
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %3) #6
  br label %153

67:                                               ; preds = %25
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %6, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %7, align 4
  br label %75

71:                                               ; preds = %26
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %6, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  br label %75

75:                                               ; preds = %71, %67
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #6
  br label %152

76:                                               ; preds = %29
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %6, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %7, align 4
  br label %151

80:                                               ; preds = %136, %30
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %6, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %7, align 4
  br label %150

84:                                               ; preds = %47
  %85 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble_Stat", ptr %15, i32 0, i32 6
  call void @llvm.lifetime.start.p0(i64 56, ptr %13) #6
  %86 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble_Stat", ptr %15, i32 0, i32 8
  %87 = load double, ptr %86, align 8, !tbaa !48
  %88 = load double, ptr %11, align 8, !tbaa !47
  %89 = fmul double %87, %88
  invoke void @_ZmldRKN7SGTELIB6MatrixE(ptr dead_on_unwind writable sret(%"class.SGTELIB::Matrix") align 8 %13, double noundef %89, ptr noundef nonnull align 8 dereferenceable(56) %8)
          to label %90 unwind label %108

90:                                               ; preds = %84
  %91 = load i32, ptr %12, align 4, !tbaa !54
  invoke void @_ZN7SGTELIB6Matrix7set_rowERKS0_i(ptr noundef nonnull align 8 dereferenceable(56) %85, ptr noundef nonnull align 8 dereferenceable(56) %13, i32 noundef %91)
          to label %92 unwind label %112

92:                                               ; preds = %90
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %13) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %13) #6
  %93 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble_Stat", ptr %15, i32 0, i32 6
  %94 = load i32, ptr %12, align 4, !tbaa !54
  %95 = load i32, ptr %12, align 4, !tbaa !54
  %96 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble_Stat", ptr %15, i32 0, i32 6
  %97 = load i32, ptr %12, align 4, !tbaa !54
  %98 = load i32, ptr %12, align 4, !tbaa !54
  %99 = invoke noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %96, i32 noundef %97, i32 noundef %98)
          to label %100 unwind label %117

100:                                              ; preds = %92
  %101 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble_Stat", ptr %15, i32 0, i32 8
  %102 = load double, ptr %101, align 8, !tbaa !48
  %103 = fadd double %99, %102
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %93, i32 noundef %94, i32 noundef %95, double noundef %103)
          to label %104 unwind label %117

104:                                              ; preds = %100
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %12, align 4, !tbaa !54
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %12, align 4, !tbaa !54
  br label %47, !llvm.loop !55

108:                                              ; preds = %84
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %6, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %7, align 4
  br label %116

112:                                              ; preds = %90
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %6, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %7, align 4
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %13) #6
  br label %116

116:                                              ; preds = %112, %108
  call void @llvm.lifetime.end.p0(i64 56, ptr %13) #6
  br label %121

117:                                              ; preds = %100, %92
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %6, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %7, align 4
  br label %121

121:                                              ; preds = %117, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %150

122:                                              ; preds = %52
  %123 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble_Stat", ptr %15, i32 0, i32 6
  call void @llvm.lifetime.start.p0(i64 56, ptr %14) #6
  %124 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble_Stat", ptr %15, i32 0, i32 8
  %125 = load double, ptr %124, align 8, !tbaa !48
  %126 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %15, i32 0, i32 3
  %127 = load i32, ptr %126, align 8, !tbaa !9
  %128 = mul nsw i32 2, %127
  %129 = add nsw i32 %128, 2
  %130 = sitofp i32 %129 to double
  %131 = call double @sqrt(double noundef %130) #6
  %132 = fdiv double %125, %131
  invoke void @_ZmldRKN7SGTELIB6MatrixE(ptr dead_on_unwind writable sret(%"class.SGTELIB::Matrix") align 8 %14, double noundef %132, ptr noundef nonnull align 8 dereferenceable(56) %8)
          to label %133 unwind label %141

133:                                              ; preds = %122
  %134 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %15, i32 0, i32 3
  %135 = load i32, ptr %134, align 8, !tbaa !9
  invoke void @_ZN7SGTELIB6Matrix7set_rowERKS0_i(ptr noundef nonnull align 8 dereferenceable(56) %123, ptr noundef nonnull align 8 dereferenceable(56) %14, i32 noundef %135)
          to label %136 unwind label %145

136:                                              ; preds = %133
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %14) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %14) #6
  %137 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble_Stat", ptr %15, i32 0, i32 6
  %138 = invoke noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56) %137)
          to label %139 unwind label %80

139:                                              ; preds = %136
  %140 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble_Stat", ptr %15, i32 0, i32 7
  store i32 %138, ptr %140, align 8, !tbaa !57
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %8) #6
  ret void

141:                                              ; preds = %122
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %6, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %7, align 4
  br label %149

145:                                              ; preds = %133
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %6, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %7, align 4
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %14) #6
  br label %149

149:                                              ; preds = %145, %141
  call void @llvm.lifetime.end.p0(i64 56, ptr %14) #6
  br label %150

150:                                              ; preds = %149, %121, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %151

151:                                              ; preds = %150, %76
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #6
  br label %152

152:                                              ; preds = %151, %75
  call void @llvm.lifetime.end.p0(i64 56, ptr %8) #6
  br label %153

153:                                              ; preds = %152, %66
  %154 = load ptr, ptr %6, align 8
  %155 = load i32, ptr %7, align 4
  %156 = insertvalue { ptr, i32 } poison, ptr %154, 0
  %157 = insertvalue { ptr, i32 } %156, i32 %155, 1
  resume { ptr, i32 } %157
}

declare void @_ZN7SGTELIB6Matrix7set_rowEdi(ptr noundef nonnull align 8 dereferenceable(56), double noundef, i32 noundef) #3

declare noundef nonnull align 8 dereferenceable(56) ptr @_ZN7SGTELIB6MatrixaSERKS0_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) #3

; Function Attrs: nounwind
declare double @sqrt(double noundef) #4

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

declare void @_ZN7SGTELIB6Matrix7set_rowERKS0_i(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #3

declare void @_ZmldRKN7SGTELIB6MatrixE(ptr dead_on_unwind writable sret(%"class.SGTELIB::Matrix") align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(56)) #3

declare void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef, double noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56)) #5 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 = { 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 = { "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 "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 }

!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, !13, i64 328}
!10 = !{!"_ZTSN7SGTELIB9SurrogateE", !6, i64 8, !11, i64 16, !13, i64 328, !13, i64 332, !13, i64 336, !13, i64 340, !13, i64 344, !13, i64 348, !25, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !26, i64 392, !31, i64 416, !16, i64 464, !39, i64 472, !25, i64 984}
!11 = !{!"_ZTSN7SGTELIB20Surrogate_ParametersE", !12, i64 8, !13, i64 12, !14, i64 16, !15, i64 20, !14, i64 24, !16, i64 32, !14, i64 40, !16, i64 48, !14, i64 56, !17, i64 60, !14, i64 64, !18, i64 72, !22, i64 128, !14, i64 132, !23, i64 136, !16, i64 144, !16, i64 152, !16, i64 160, !16, i64 168, !18, i64 176, !14, i64 232, !24, i64 236, !19, i64 240, !19, i64 272, !13, i64 304, !13, i64 308}
!12 = !{!"_ZTSN7SGTELIB7model_tE", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSN7SGTELIB14param_status_tE", !7, i64 0}
!15 = !{!"_ZTSN7SGTELIB8kernel_tE", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!"_ZTSN7SGTELIB10distance_tE", !7, i64 0}
!18 = !{!"_ZTSN7SGTELIB6MatrixE", !19, i64 8, !13, i64 40, !13, i64 44, !6, i64 48}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !21, i64 8, !7, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSN7SGTELIB8weight_tE", !7, i64 0}
!23 = !{!"_ZTSN7SGTELIB13uncertainty_tE", !7, i64 0}
!24 = !{!"_ZTSN7SGTELIB8metric_tE", !7, i64 0}
!25 = !{!"bool", !7, i64 0}
!26 = !{!"_ZTSNSt7__cxx114listIiSaIiEEE", !27, i64 0}
!27 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEEE", !28, i64 0}
!28 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEE10_List_implE", !29, i64 0}
!29 = !{!"_ZTSNSt8__detail17_List_node_headerE", !30, i64 0, !21, i64 16}
!30 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!31 = !{!"_ZTSSt3mapIN7SGTELIB8metric_tENS0_6MatrixESt4lessIS1_ESaISt4pairIKS1_S2_EEE", !32, i64 0}
!32 = !{!"_ZTSSt8_Rb_treeIN7SGTELIB8metric_tESt4pairIKS1_NS0_6MatrixEESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE", !33, i64 0}
!33 = !{!"_ZTSNSt8_Rb_treeIN7SGTELIB8metric_tESt4pairIKS1_NS0_6MatrixEESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !34, i64 0, !36, i64 8}
!34 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN7SGTELIB8metric_tEEE", !35, i64 0}
!35 = !{!"_ZTSSt4lessIN7SGTELIB8metric_tEE"}
!36 = !{!"_ZTSSt15_Rb_tree_header", !37, i64 0, !21, i64 32}
!37 = !{!"_ZTSSt18_Rb_tree_node_base", !38, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!38 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!39 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !40, i64 0, !41, i64 8}
!40 = !{!"_ZTSSo"}
!41 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !42, i64 0, !7, i64 64, !44, i64 104, !45, i64 120, !46, i64 124, !46, i64 132, !46, i64 140, !6, i64 152, !21, i64 160, !25, i64 168, !25, i64 169, !25, i64 170, !7, i64 171, !6, i64 176, !6, i64 184, !25, i64 192, !6, i64 200, !6, i64 208, !21, i64 216, !6, i64 224, !6, i64 232}
!42 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !43, i64 56}
!43 = !{!"_ZTSSt6locale", !6, i64 0}
!44 = !{!"_ZTSSt12__basic_fileIcE", !6, i64 0, !25, i64 8}
!45 = !{!"_ZTSSt13_Ios_Openmode", !7, i64 0}
!46 = !{!"_ZTS11__mbstate_t", !13, i64 0, !7, i64 4}
!47 = !{!16, !16, i64 0}
!48 = !{!49, !16, i64 1104}
!49 = !{!"_ZTSN7SGTELIB23Surrogate_Ensemble_StatE", !10, i64 0, !13, i64 988, !13, i64 992, !50, i64 1000, !6, i64 1024, !6, i64 1032, !18, i64 1040, !13, i64 1096, !16, i64 1104, !16, i64 1112, !16, i64 1120, !16, i64 1128}
!50 = !{!"_ZTSSt6vectorIPN7SGTELIB9SurrogateESaIS2_EE", !51, i64 0}
!51 = !{!"_ZTSSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE", !52, i64 0}
!52 = !{!"_ZTSNSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE12_Vector_implE", !53, i64 0}
!53 = !{!"_ZTSNSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!54 = !{!13, !13, i64 0}
!55 = distinct !{!55, !56}
!56 = !{!"llvm.loop.mustprogress"}
!57 = !{!49, !13, i64 1096}


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

%"class.SGTELIB::Matrix" = type { ptr, %"class.std::__cxx11::basic_string", i32, i32, ptr }
%"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] }
%"class.std::allocator" = type { i8 }

@.str.20 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

declare void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) unnamed_addr #3

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

; Function Attrs: nounwind
declare void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7SGTELIB23Surrogate_Ensemble_Stat21build_simplex_privateEv(ptr noundef nonnull align 8 dereferenceable(1136) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.SGTELIB::Matrix", align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %"class.SGTELIB::Matrix", align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca %"class.SGTELIB::Matrix", align 8
  %9 = alloca %"class.SGTELIB::Matrix", align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.20, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %10 unwind label %43

10:                                               ; preds = %1
  %11 = getelementptr inbounds i8, ptr %0, i64 328
  %12 = load i32, ptr %11, align 8, !tbaa !5
  %13 = add nsw i32 %12, 1
  invoke void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %13, i32 noundef %12)
          to label %14 unwind label %45

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 1040
  %16 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZN7SGTELIB6MatrixaSERKS0_(ptr noundef nonnull align 8 dereferenceable(56) %15, ptr noundef nonnull align 8 dereferenceable(56) %2)
          to label %17 unwind label %47

17:                                               ; preds = %14
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.21, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %18 unwind label %51

18:                                               ; preds = %17
  %19 = load i32, ptr %11, align 8, !tbaa !5
  invoke void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56) %5, ptr noundef nonnull align 8 dereferenceable(32) %6, i32 noundef 1, i32 noundef %19)
          to label %20 unwind label %53

20:                                               ; preds = %18
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  invoke void @_ZN7SGTELIB6Matrix7set_rowEdi(ptr noundef nonnull align 8 dereferenceable(56) %5, double noundef 1.000000e+00, i32 noundef 0)
          to label %21 unwind label %56

21:                                               ; preds = %20
  %22 = load i32, ptr %11, align 8, !tbaa !5
  %23 = add nsw i32 %22, 1
  %24 = sitofp i32 %23 to double
  %25 = call double @sqrt(double noundef %24) #7
  %26 = fdiv double 1.000000e+00, %25
  %27 = fadd double %26, 1.000000e+00
  %28 = fneg double %27
  %29 = load i32, ptr %11, align 8, !tbaa !5
  %30 = sitofp i32 %29 to double
  %31 = fdiv double %28, %30
  %32 = getelementptr inbounds i8, ptr %0, i64 16
  %33 = call noundef double @_ZNK7SGTELIB20Surrogate_Parameters14get_size_paramEv(ptr noundef nonnull align 8 dereferenceable(312) %32)
  %34 = getelementptr inbounds i8, ptr %0, i64 1104
  store double %33, ptr %34, align 8, !tbaa !46
  %35 = load i32, ptr %11, align 8, !tbaa !5
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %.lr.ph, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %65
  %.pre = load double, ptr %34, align 8, !tbaa !46
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %21
  %37 = phi double [ %33, %21 ], [ %.pre, %._crit_edge.loopexit ]
  %.lcssa = phi i32 [ %35, %21 ], [ %67, %._crit_edge.loopexit ]
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %9) #7
  %38 = shl nsw i32 %.lcssa, 1
  %39 = add nsw i32 %38, 2
  %40 = sitofp i32 %39 to double
  %41 = call double @sqrt(double noundef %40) #7
  %42 = fdiv double %37, %41
  invoke void @_ZmldRKN7SGTELIB6MatrixE(ptr dead_on_unwind nonnull writable sret(%"class.SGTELIB::Matrix") align 8 %9, double noundef %42, ptr noundef nonnull align 8 dereferenceable(56) %5)
          to label %76 unwind label %81

43:                                               ; preds = %1
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %50

45:                                               ; preds = %10
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %49

47:                                               ; preds = %14
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #7
  br label %49

49:                                               ; preds = %47, %45
  %.pn = phi { ptr, i32 } [ %48, %47 ], [ %46, %45 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  br label %50

50:                                               ; preds = %49, %43
  %.pn.pn = phi { ptr, i32 } [ %.pn, %49 ], [ %44, %43 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %2) #7
  br label %88

51:                                               ; preds = %17
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %55

53:                                               ; preds = %18
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  br label %55

55:                                               ; preds = %53, %51
  %.pn23 = phi { ptr, i32 } [ %54, %53 ], [ %52, %51 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  br label %87

56:                                               ; preds = %20
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %86

.lr.ph:                                           ; preds = %21, %65
  %.038 = phi i32 [ %66, %65 ], [ 0, %21 ]
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %8) #7
  %58 = load double, ptr %34, align 8, !tbaa !46
  %59 = fmul double %31, %58
  invoke void @_ZmldRKN7SGTELIB6MatrixE(ptr dead_on_unwind nonnull writable sret(%"class.SGTELIB::Matrix") align 8 %8, double noundef %59, ptr noundef nonnull align 8 dereferenceable(56) %5)
          to label %60 unwind label %69

60:                                               ; preds = %.lr.ph
  invoke void @_ZN7SGTELIB6Matrix7set_rowERKS0_i(ptr noundef nonnull align 8 dereferenceable(56) %15, ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %.038)
          to label %61 unwind label %71

61:                                               ; preds = %60
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #7
  %62 = call noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %15, i32 noundef %.038, i32 noundef %.038)
  %63 = load double, ptr %34, align 8, !tbaa !46
  %64 = fadd double %62, %63
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %15, i32 noundef %.038, i32 noundef %.038, double noundef %64)
          to label %65 unwind label %74

65:                                               ; preds = %61
  %66 = add nuw nsw i32 %.038, 1
  %67 = load i32, ptr %11, align 8, !tbaa !5
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !52

69:                                               ; preds = %.lr.ph
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %73

71:                                               ; preds = %60
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #7
  br label %73

73:                                               ; preds = %71, %69
  %.pn27 = phi { ptr, i32 } [ %72, %71 ], [ %70, %69 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #7
  br label %86

74:                                               ; preds = %61
  %75 = landingpad { ptr, i32 }
          cleanup
  br label %86

76:                                               ; preds = %._crit_edge
  %77 = load i32, ptr %11, align 8, !tbaa !5
  invoke void @_ZN7SGTELIB6Matrix7set_rowERKS0_i(ptr noundef nonnull align 8 dereferenceable(56) %15, ptr noundef nonnull align 8 dereferenceable(56) %9, i32 noundef %77)
          to label %78 unwind label %83

78:                                               ; preds = %76
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %9) #7
  %79 = call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56) %15)
  %80 = getelementptr inbounds i8, ptr %0, i64 1096
  store i32 %79, ptr %80, align 8, !tbaa !54
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %5) #7
  ret void

81:                                               ; preds = %._crit_edge
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %85

83:                                               ; preds = %76
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #7
  br label %85

85:                                               ; preds = %83, %81
  %.pn25 = phi { ptr, i32 } [ %84, %83 ], [ %82, %81 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %9) #7
  br label %86

86:                                               ; preds = %85, %74, %73, %56
  %.pn29.pn.pn = phi { ptr, i32 } [ %57, %56 ], [ %.pn25, %85 ], [ %75, %74 ], [ %.pn27, %73 ]
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  br label %87

87:                                               ; preds = %86, %55
  %.pn29.pn.pn.pn = phi { ptr, i32 } [ %.pn29.pn.pn, %86 ], [ %.pn23, %55 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %5) #7
  br label %88

88:                                               ; preds = %87, %50
  %.pn29.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn29.pn.pn.pn, %87 ], [ %.pn.pn, %50 ]
  resume { ptr, i32 } %.pn29.pn.pn.pn.pn
}

declare void @_ZN7SGTELIB6Matrix7set_rowEdi(ptr noundef nonnull align 8 dereferenceable(56), double noundef, i32 noundef) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(56) ptr @_ZN7SGTELIB6MatrixaSERKS0_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #6

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

declare void @_ZN7SGTELIB6Matrix7set_rowERKS0_i(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #3

declare void @_ZmldRKN7SGTELIB6MatrixE(ptr dead_on_unwind writable sret(%"class.SGTELIB::Matrix") align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3

declare void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef, double noundef) local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { "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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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, !12, i64 328}
!6 = !{!"_ZTSN7SGTELIB9SurrogateE", !7, i64 8, !10, i64 16, !12, i64 328, !12, i64 332, !12, i64 336, !12, i64 340, !12, i64 344, !12, i64 348, !24, i64 352, !7, i64 360, !7, i64 368, !7, i64 376, !7, i64 384, !25, i64 392, !30, i64 416, !15, i64 464, !38, i64 472, !24, i64 984}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN7SGTELIB20Surrogate_ParametersE", !11, i64 8, !12, i64 12, !13, i64 16, !14, i64 20, !13, i64 24, !15, i64 32, !13, i64 40, !15, i64 48, !13, i64 56, !16, i64 60, !13, i64 64, !17, i64 72, !21, i64 128, !13, i64 132, !22, i64 136, !15, i64 144, !15, i64 152, !15, i64 160, !15, i64 168, !17, i64 176, !13, i64 232, !23, i64 236, !18, i64 240, !18, i64 272, !12, i64 304, !12, i64 308}
!11 = !{!"_ZTSN7SGTELIB7model_tE", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_ZTSN7SGTELIB14param_status_tE", !8, i64 0}
!14 = !{!"_ZTSN7SGTELIB8kernel_tE", !8, i64 0}
!15 = !{!"double", !8, i64 0}
!16 = !{!"_ZTSN7SGTELIB10distance_tE", !8, i64 0}
!17 = !{!"_ZTSN7SGTELIB6MatrixE", !18, i64 8, !12, i64 40, !12, i64 44, !7, i64 48}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !19, i64 0, !20, i64 8, !8, i64 16}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!20 = !{!"long", !8, i64 0}
!21 = !{!"_ZTSN7SGTELIB8weight_tE", !8, i64 0}
!22 = !{!"_ZTSN7SGTELIB13uncertainty_tE", !8, i64 0}
!23 = !{!"_ZTSN7SGTELIB8metric_tE", !8, i64 0}
!24 = !{!"bool", !8, i64 0}
!25 = !{!"_ZTSNSt7__cxx114listIiSaIiEEE", !26, i64 0}
!26 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEEE", !27, i64 0}
!27 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEE10_List_implE", !28, i64 0}
!28 = !{!"_ZTSNSt8__detail17_List_node_headerE", !29, i64 0, !20, i64 16}
!29 = !{!"_ZTSNSt8__detail15_List_node_baseE", !7, i64 0, !7, i64 8}
!30 = !{!"_ZTSSt3mapIN7SGTELIB8metric_tENS0_6MatrixESt4lessIS1_ESaISt4pairIKS1_S2_EEE", !31, i64 0}
!31 = !{!"_ZTSSt8_Rb_treeIN7SGTELIB8metric_tESt4pairIKS1_NS0_6MatrixEESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE", !32, i64 0}
!32 = !{!"_ZTSNSt8_Rb_treeIN7SGTELIB8metric_tESt4pairIKS1_NS0_6MatrixEESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !33, i64 0, !35, i64 8}
!33 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN7SGTELIB8metric_tEEE", !34, i64 0}
!34 = !{!"_ZTSSt4lessIN7SGTELIB8metric_tEE"}
!35 = !{!"_ZTSSt15_Rb_tree_header", !36, i64 0, !20, i64 32}
!36 = !{!"_ZTSSt18_Rb_tree_node_base", !37, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!37 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!38 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !39, i64 0, !40, i64 8}
!39 = !{!"_ZTSSo"}
!40 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !41, i64 0, !8, i64 64, !43, i64 104, !44, i64 120, !45, i64 124, !45, i64 132, !45, i64 140, !7, i64 152, !20, i64 160, !24, i64 168, !24, i64 169, !24, i64 170, !8, i64 171, !7, i64 176, !7, i64 184, !24, i64 192, !7, i64 200, !7, i64 208, !20, i64 216, !7, i64 224, !7, i64 232}
!41 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !42, i64 56}
!42 = !{!"_ZTSSt6locale", !7, i64 0}
!43 = !{!"_ZTSSt12__basic_fileIcE", !7, i64 0, !24, i64 8}
!44 = !{!"_ZTSSt13_Ios_Openmode", !8, i64 0}
!45 = !{!"_ZTS11__mbstate_t", !12, i64 0, !8, i64 4}
!46 = !{!47, !15, i64 1104}
!47 = !{!"_ZTSN7SGTELIB23Surrogate_Ensemble_StatE", !6, i64 0, !12, i64 988, !12, i64 992, !48, i64 1000, !7, i64 1024, !7, i64 1032, !17, i64 1040, !12, i64 1096, !15, i64 1104, !15, i64 1112, !15, i64 1120, !15, i64 1128}
!48 = !{!"_ZTSSt6vectorIPN7SGTELIB9SurrogateESaIS2_EE", !49, i64 0}
!49 = !{!"_ZTSSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE", !50, i64 0}
!50 = !{!"_ZTSNSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE12_Vector_implE", !51, i64 0}
!51 = !{!"_ZTSNSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!52 = distinct !{!52, !53}
!53 = !{!"llvm.loop.mustprogress"}
!54 = !{!47, !12, i64 1096}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass