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

; 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.std::vector.11" = type { %"struct.std::_Vector_base.12" }
%"struct.std::_Vector_base.12" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.16" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"struct.std::_Bit_reference" = type { ptr, i64 }
%"class.SGTELIB::Surrogate_Ensemble" = type { %"class.SGTELIB::Surrogate.base", i32, i32, %"class.std::vector", ptr, ptr }
%"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.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.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 }
%"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] }>

@.str = external hidden unnamed_addr constant [2 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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SGTELIB20Surrogate_Parameters10set_weightERKNS_6MatrixE(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef nonnull align 8 dereferenceable(56)) #2 align 2

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

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

; 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 @_ZN7SGTELIB18Surrogate_Ensemble22compute_W_by_select_nbEi(ptr noundef nonnull align 8 dereferenceable(1040) %0, i32 noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %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 ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca %"class.std::vector.11", align 8
  %18 = alloca %"class.std::vector.16", align 8
  %19 = alloca double, align 8
  %20 = alloca i32, align 4
  %21 = alloca i8, align 1
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::_Bit_reference", align 8
  %24 = alloca %"struct.std::_Bit_reference", align 8
  %25 = alloca %"struct.std::_Bit_reference", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %26 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %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 @.str, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %27 unwind label %77

27:                                               ; preds = %2
  %28 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble", ptr %26, i32 0, i32 1
  %29 = load i32, ptr %28, align 4, !tbaa !11
  %30 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %26, i32 0, i32 4
  %31 = load i32, ptr %30, align 4, !tbaa !53
  invoke void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56) %5, ptr noundef nonnull align 8 dereferenceable(32) %6, i32 noundef %29, i32 noundef %31)
          to label %32 unwind label %81

32:                                               ; preds = %27
  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 %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #7
  invoke void @_ZN7SGTELIB6Matrix4fillEd(ptr noundef nonnull align 8 dereferenceable(56) %5, double noundef 0.000000e+00)
          to label %33 unwind label %86

33:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %374, %33
  %35 = load i32, ptr %10, align 4, !tbaa !9
  %36 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %26, i32 0, i32 4
  %37 = load i32, ptr %36, align 4, !tbaa !53
  %38 = icmp slt i32 %35, %37
  br i1 %38, label %39, label %377

39:                                               ; preds = %34
  %40 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %26, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !54
  %42 = load i32, ptr %10, align 4, !tbaa !9
  %43 = invoke noundef i32 @_ZNK7SGTELIB11TrainingSet7get_bboEi(ptr noundef nonnull align 8 dereferenceable(504) %41, i32 noundef %42)
          to label %44 unwind label %90

44:                                               ; preds = %39
  %45 = icmp ne i32 %43, 2
  br i1 %45, label %46, label %373

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #7
  call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr %18) #7
  call void @_ZNSt6vectorIbSaIbEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %18) #7
  store double 0x7FEFFFFFFFFFFFFF, ptr %14, align 8, !tbaa !55
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %107, %46
  %48 = load i32, ptr %11, align 4, !tbaa !9
  %49 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble", ptr %26, i32 0, i32 1
  %50 = load i32, ptr %49, align 4, !tbaa !11
  %51 = icmp slt i32 %48, %50
  br i1 %51, label %52, label %110

52:                                               ; preds = %47
  %53 = load i32, ptr %11, align 4, !tbaa !9
  %54 = invoke noundef zeroext i1 @_ZNK7SGTELIB18Surrogate_Ensemble8is_readyEi(ptr noundef nonnull align 8 dereferenceable(1040) %26, i32 noundef %53)
          to label %55 unwind label %94

55:                                               ; preds = %52
  br i1 %54, label %56, label %99

56:                                               ; preds = %55
  %57 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble", ptr %26, i32 0, i32 3
  %58 = load i32, ptr %11, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7SGTELIB9SurrogateESaIS2_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef %59)
          to label %61 unwind label %94

61:                                               ; preds = %56
  %62 = load ptr, ptr %60, align 8, !tbaa !5
  %63 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %26, i32 0, i32 2
  %64 = invoke noundef i32 @_ZNK7SGTELIB20Surrogate_Parameters15get_metric_typeEv(ptr noundef nonnull align 8 dereferenceable(312) %63)
          to label %65 unwind label %94

65:                                               ; preds = %61
  %66 = load i32, ptr %10, align 4, !tbaa !9
  %67 = invoke noundef double @_ZN7SGTELIB9Surrogate10get_metricENS_8metric_tEi(ptr noundef nonnull align 8 dereferenceable(985) %62, i32 noundef %64, i32 noundef %66)
          to label %68 unwind label %94

68:                                               ; preds = %65
  store double %67, ptr %13, align 8, !tbaa !55
  invoke void @_ZNSt6vectorIdSaIdEE9push_backERKd(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %69 unwind label %94

69:                                               ; preds = %68
  %70 = load double, ptr %13, align 8, !tbaa !55
  %71 = invoke noundef zeroext i1 @_ZSt5isnand(double noundef %70)
          to label %72 unwind label %94

72:                                               ; preds = %69
  br i1 %71, label %98, label %73

73:                                               ; preds = %72
  %74 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %75 unwind label %94

75:                                               ; preds = %73
  %76 = load double, ptr %74, align 8, !tbaa !55
  store double %76, ptr %14, align 8, !tbaa !55
  br label %98

77:                                               ; preds = %2
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %8, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %9, align 4
  br label %85

81:                                               ; preds = %27
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %8, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %9, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  br label %85

85:                                               ; preds = %81, %77
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #7
  br label %382

86:                                               ; preds = %32
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %8, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %9, align 4
  br label %381

90:                                               ; preds = %377, %39
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %8, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %9, align 4
  br label %380

94:                                               ; preds = %169, %163, %159, %138, %129, %125, %120, %116, %105, %73, %69, %68, %65, %61, %56, %52
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %8, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %9, align 4
  br label %372

98:                                               ; preds = %75, %72
  br label %105

99:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store double 0.000000e+00, ptr %19, align 8, !tbaa !55
  invoke void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %100 unwind label %101

100:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %105

101:                                              ; preds = %99
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %8, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %372

105:                                              ; preds = %100, %98
  invoke void @_ZNSt6vectorIbSaIbEE9push_backEb(ptr noundef nonnull align 8 dereferenceable(40) %18, i1 noundef zeroext false)
          to label %106 unwind label %94

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %11, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %11, align 4, !tbaa !9
  br label %47, !llvm.loop !56

110:                                              ; preds = %47
  store i32 0, ptr %12, align 4, !tbaa !9
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %111

111:                                              ; preds = %146, %110
  %112 = load i32, ptr %11, align 4, !tbaa !9
  %113 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble", ptr %26, i32 0, i32 1
  %114 = load i32, ptr %113, align 4, !tbaa !11
  %115 = icmp slt i32 %112, %114
  br i1 %115, label %116, label %149

116:                                              ; preds = %111
  %117 = load i32, ptr %11, align 4, !tbaa !9
  %118 = invoke noundef zeroext i1 @_ZNK7SGTELIB18Surrogate_Ensemble8is_readyEi(ptr noundef nonnull align 8 dereferenceable(1040) %26, i32 noundef %117)
          to label %119 unwind label %94

119:                                              ; preds = %116
  br i1 %118, label %120, label %145

120:                                              ; preds = %119
  %121 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble", ptr %26, i32 0, i32 3
  %122 = load i32, ptr %11, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7SGTELIB9SurrogateESaIS2_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %121, i64 noundef %123)
          to label %125 unwind label %94

125:                                              ; preds = %120
  %126 = load ptr, ptr %124, align 8, !tbaa !5
  %127 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %26, i32 0, i32 2
  %128 = invoke noundef i32 @_ZNK7SGTELIB20Surrogate_Parameters15get_metric_typeEv(ptr noundef nonnull align 8 dereferenceable(312) %127)
          to label %129 unwind label %94

129:                                              ; preds = %125
  %130 = load i32, ptr %10, align 4, !tbaa !9
  %131 = invoke noundef double @_ZN7SGTELIB9Surrogate10get_metricENS_8metric_tEi(ptr noundef nonnull align 8 dereferenceable(985) %126, i32 noundef %128, i32 noundef %130)
          to label %132 unwind label %94

132:                                              ; preds = %129
  store double %131, ptr %13, align 8, !tbaa !55
  %133 = load double, ptr %13, align 8, !tbaa !55
  %134 = load double, ptr %14, align 8, !tbaa !55
  %135 = fsub double %133, %134
  %136 = call double @llvm.fabs.f64(double %135)
  %137 = fcmp olt double %136, 1.000000e-13
  br i1 %137, label %138, label %144

138:                                              ; preds = %132
  %139 = load i32, ptr %11, align 4, !tbaa !9
  %140 = load i32, ptr %10, align 4, !tbaa !9
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %5, i32 noundef %139, i32 noundef %140, double noundef 1.000000e+00)
          to label %141 unwind label %94

141:                                              ; preds = %138
  %142 = load i32, ptr %12, align 4, !tbaa !9
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %12, align 4, !tbaa !9
  br label %144

144:                                              ; preds = %141, %132
  br label %145

145:                                              ; preds = %144, %119
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %11, align 4, !tbaa !9
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %11, align 4, !tbaa !9
  br label %111, !llvm.loop !58

149:                                              ; preds = %111
  %150 = load i32, ptr %12, align 4, !tbaa !9
  %151 = load i32, ptr %4, align 4, !tbaa !9
  %152 = icmp sge i32 %150, %151
  br i1 %152, label %153, label %182

153:                                              ; preds = %149
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %154

154:                                              ; preds = %178, %153
  %155 = load i32, ptr %11, align 4, !tbaa !9
  %156 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble", ptr %26, i32 0, i32 1
  %157 = load i32, ptr %156, align 4, !tbaa !11
  %158 = icmp slt i32 %155, %157
  br i1 %158, label %159, label %181

159:                                              ; preds = %154
  %160 = load i32, ptr %11, align 4, !tbaa !9
  %161 = invoke noundef zeroext i1 @_ZNK7SGTELIB18Surrogate_Ensemble8is_readyEi(ptr noundef nonnull align 8 dereferenceable(1040) %26, i32 noundef %160)
          to label %162 unwind label %94

162:                                              ; preds = %159
  br i1 %161, label %163, label %177

163:                                              ; preds = %162
  %164 = load i32, ptr %11, align 4, !tbaa !9
  %165 = load i32, ptr %10, align 4, !tbaa !9
  %166 = invoke noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %5, i32 noundef %164, i32 noundef %165)
          to label %167 unwind label %94

167:                                              ; preds = %163
  %168 = fcmp ogt double %166, 1.000000e-13
  br i1 %168, label %169, label %176

169:                                              ; preds = %167
  %170 = load i32, ptr %11, align 4, !tbaa !9
  %171 = load i32, ptr %10, align 4, !tbaa !9
  %172 = load i32, ptr %12, align 4, !tbaa !9
  %173 = sitofp i32 %172 to double
  %174 = fdiv double 1.000000e+00, %173
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %5, i32 noundef %170, i32 noundef %171, double noundef %174)
          to label %175 unwind label %94

175:                                              ; preds = %169
  br label %176

176:                                              ; preds = %175, %167
  br label %177

177:                                              ; preds = %176, %162
  br label %178

178:                                              ; preds = %177
  %179 = load i32, ptr %11, align 4, !tbaa !9
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %11, align 4, !tbaa !9
  br label %154, !llvm.loop !59

181:                                              ; preds = %154
  br label %371

182:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 -1, ptr %20, align 4, !tbaa !9
  store double 0.000000e+00, ptr %15, align 8, !tbaa !55
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %183

183:                                              ; preds = %265, %182
  %184 = load i32, ptr %22, align 4, !tbaa !9
  %185 = load i32, ptr %4, align 4, !tbaa !9
  %186 = icmp slt i32 %184, %185
  br i1 %186, label %188, label %187

187:                                              ; preds = %183
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %269

188:                                              ; preds = %183
  store double 0x7FEFFFFFFFFFFFFF, ptr %14, align 8, !tbaa !55
  store i8 0, ptr %21, align 1, !tbaa !60
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %189

189:                                              ; preds = %241, %188
  %190 = load i32, ptr %11, align 4, !tbaa !9
  %191 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble", ptr %26, i32 0, i32 1
  %192 = load i32, ptr %191, align 4, !tbaa !11
  %193 = icmp slt i32 %190, %192
  br i1 %193, label %194, label %244

194:                                              ; preds = %189
  %195 = load i32, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #7
  %196 = invoke noundef zeroext i1 @_ZNK7SGTELIB18Surrogate_Ensemble8is_readyEi(ptr noundef nonnull align 8 dereferenceable(1040) %26, i32 noundef %195)
          to label %197 unwind label %231

197:                                              ; preds = %194
  br i1 %196, label %198, label %209

198:                                              ; preds = %197
  %199 = load i32, ptr %11, align 4, !tbaa !9
  %200 = sext i32 %199 to i64
  %201 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %18, i64 noundef %200)
          to label %202 unwind label %235

202:                                              ; preds = %198
  %203 = getelementptr inbounds { ptr, i64 }, ptr %23, i32 0, i32 0
  %204 = extractvalue { ptr, i64 } %201, 0
  store ptr %204, ptr %203, align 8
  %205 = getelementptr inbounds { ptr, i64 }, ptr %23, i32 0, i32 1
  %206 = extractvalue { ptr, i64 } %201, 1
  store i64 %206, ptr %205, align 8
  %207 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %23) #7
  %208 = xor i1 %207, true
  br label %209

209:                                              ; preds = %202, %197
  %210 = phi i1 [ false, %197 ], [ %208, %202 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  br i1 %210, label %211, label %240

211:                                              ; preds = %209
  %212 = load i32, ptr %11, align 4, !tbaa !9
  %213 = sext i32 %212 to i64
  %214 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %213) #7
  %215 = load double, ptr %214, align 8, !tbaa !55
  %216 = invoke noundef zeroext i1 @_ZN7SGTELIB5isdefEd(double noundef %215)
          to label %217 unwind label %231

217:                                              ; preds = %211
  br i1 %216, label %218, label %239

218:                                              ; preds = %217
  %219 = load i32, ptr %11, align 4, !tbaa !9
  %220 = sext i32 %219 to i64
  %221 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %220) #7
  %222 = load double, ptr %221, align 8, !tbaa !55
  %223 = load double, ptr %14, align 8, !tbaa !55
  %224 = fcmp olt double %222, %223
  br i1 %224, label %225, label %239

225:                                              ; preds = %218
  %226 = load i32, ptr %11, align 4, !tbaa !9
  %227 = sext i32 %226 to i64
  %228 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %227) #7
  %229 = load double, ptr %228, align 8, !tbaa !55
  store double %229, ptr %14, align 8, !tbaa !55
  %230 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %230, ptr %20, align 4, !tbaa !9
  store i8 1, ptr %21, align 1, !tbaa !60
  br label %239

231:                                              ; preds = %211, %194
  %232 = landingpad { ptr, i32 }
          cleanup
  %233 = extractvalue { ptr, i32 } %232, 0
  store ptr %233, ptr %8, align 8
  %234 = extractvalue { ptr, i32 } %232, 1
  store i32 %234, ptr %9, align 4
  br label %268

235:                                              ; preds = %198
  %236 = landingpad { ptr, i32 }
          cleanup
  %237 = extractvalue { ptr, i32 } %236, 0
  store ptr %237, ptr %8, align 8
  %238 = extractvalue { ptr, i32 } %236, 1
  store i32 %238, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  br label %268

239:                                              ; preds = %225, %218, %217
  br label %240

240:                                              ; preds = %239, %209
  br label %241

241:                                              ; preds = %240
  %242 = load i32, ptr %11, align 4, !tbaa !9
  %243 = add nsw i32 %242, 1
  store i32 %243, ptr %11, align 4, !tbaa !9
  br label %189, !llvm.loop !61

244:                                              ; preds = %189
  %245 = load i8, ptr %21, align 1, !tbaa !60, !range !62, !noundef !63
  %246 = trunc i8 %245 to i1
  br i1 %246, label %247, label %264

247:                                              ; preds = %244
  %248 = load double, ptr %14, align 8, !tbaa !55
  %249 = load double, ptr %15, align 8, !tbaa !55
  %250 = fadd double %249, %248
  store double %250, ptr %15, align 8, !tbaa !55
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  %251 = load i32, ptr %20, align 4, !tbaa !9
  %252 = sext i32 %251 to i64
  %253 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %18, i64 noundef %252)
          to label %254 unwind label %260

254:                                              ; preds = %247
  %255 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 0
  %256 = extractvalue { ptr, i64 } %253, 0
  store ptr %256, ptr %255, align 8
  %257 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 1
  %258 = extractvalue { ptr, i64 } %253, 1
  store i64 %258, ptr %257, align 8
  %259 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %24, i1 noundef zeroext true) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  br label %264

260:                                              ; preds = %247
  %261 = landingpad { ptr, i32 }
          cleanup
  %262 = extractvalue { ptr, i32 } %261, 0
  store ptr %262, ptr %8, align 8
  %263 = extractvalue { ptr, i32 } %261, 1
  store i32 %263, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  br label %268

264:                                              ; preds = %254, %244
  br label %265

265:                                              ; preds = %264
  %266 = load i32, ptr %22, align 4, !tbaa !9
  %267 = add nsw i32 %266, 1
  store i32 %267, ptr %22, align 4, !tbaa !9
  br label %183, !llvm.loop !64

268:                                              ; preds = %260, %235, %231
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %370

269:                                              ; preds = %187
  %270 = load double, ptr %15, align 8, !tbaa !55
  %271 = fcmp ogt double %270, 1.000000e-13
  br i1 %271, label %272, label %330

272:                                              ; preds = %269
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %273

273:                                              ; preds = %326, %272
  %274 = load i32, ptr %11, align 4, !tbaa !9
  %275 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble", ptr %26, i32 0, i32 1
  %276 = load i32, ptr %275, align 4, !tbaa !11
  %277 = icmp slt i32 %274, %276
  br i1 %277, label %278, label %329

278:                                              ; preds = %273
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #7
  %279 = load i32, ptr %11, align 4, !tbaa !9
  %280 = sext i32 %279 to i64
  %281 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %18, i64 noundef %280)
          to label %282 unwind label %301

282:                                              ; preds = %278
  %283 = getelementptr inbounds { ptr, i64 }, ptr %25, i32 0, i32 0
  %284 = extractvalue { ptr, i64 } %281, 0
  store ptr %284, ptr %283, align 8
  %285 = getelementptr inbounds { ptr, i64 }, ptr %25, i32 0, i32 1
  %286 = extractvalue { ptr, i64 } %281, 1
  store i64 %286, ptr %285, align 8
  %287 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %25) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #7
  br i1 %287, label %288, label %321

288:                                              ; preds = %282
  %289 = load i32, ptr %11, align 4, !tbaa !9
  %290 = sext i32 %289 to i64
  %291 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %290) #7
  %292 = load double, ptr %291, align 8, !tbaa !55
  %293 = load double, ptr %15, align 8, !tbaa !55
  %294 = fsub double %292, %293
  %295 = call double @llvm.fabs.f64(double %294)
  %296 = fcmp olt double %295, 1.000000e-13
  br i1 %296, label %297, label %309

297:                                              ; preds = %288
  %298 = load i32, ptr %11, align 4, !tbaa !9
  %299 = load i32, ptr %10, align 4, !tbaa !9
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %5, i32 noundef %298, i32 noundef %299, double noundef 1.000000e-01)
          to label %300 unwind label %305

300:                                              ; preds = %297
  br label %320

301:                                              ; preds = %278
  %302 = landingpad { ptr, i32 }
          cleanup
  %303 = extractvalue { ptr, i32 } %302, 0
  store ptr %303, ptr %8, align 8
  %304 = extractvalue { ptr, i32 } %302, 1
  store i32 %304, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #7
  br label %370

305:                                              ; preds = %365, %355, %340, %336, %321, %309, %297
  %306 = landingpad { ptr, i32 }
          cleanup
  %307 = extractvalue { ptr, i32 } %306, 0
  store ptr %307, ptr %8, align 8
  %308 = extractvalue { ptr, i32 } %306, 1
  store i32 %308, ptr %9, align 4
  br label %370

309:                                              ; preds = %288
  %310 = load i32, ptr %11, align 4, !tbaa !9
  %311 = load i32, ptr %10, align 4, !tbaa !9
  %312 = load i32, ptr %11, align 4, !tbaa !9
  %313 = sext i32 %312 to i64
  %314 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %313) #7
  %315 = load double, ptr %314, align 8, !tbaa !55
  %316 = load double, ptr %15, align 8, !tbaa !55
  %317 = fdiv double %315, %316
  %318 = fsub double 1.000000e+00, %317
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %5, i32 noundef %310, i32 noundef %311, double noundef %318)
          to label %319 unwind label %305

319:                                              ; preds = %309
  br label %320

320:                                              ; preds = %319, %300
  br label %325

321:                                              ; preds = %282
  %322 = load i32, ptr %11, align 4, !tbaa !9
  %323 = load i32, ptr %10, align 4, !tbaa !9
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %5, i32 noundef %322, i32 noundef %323, double noundef 0.000000e+00)
          to label %324 unwind label %305

324:                                              ; preds = %321
  br label %325

325:                                              ; preds = %324, %320
  br label %326

326:                                              ; preds = %325
  %327 = load i32, ptr %11, align 4, !tbaa !9
  %328 = add nsw i32 %327, 1
  store i32 %328, ptr %11, align 4, !tbaa !9
  br label %273, !llvm.loop !65

329:                                              ; preds = %273
  br label %349

330:                                              ; preds = %269
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %331

331:                                              ; preds = %345, %330
  %332 = load i32, ptr %11, align 4, !tbaa !9
  %333 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble", ptr %26, i32 0, i32 1
  %334 = load i32, ptr %333, align 4, !tbaa !11
  %335 = icmp slt i32 %332, %334
  br i1 %335, label %336, label %348

336:                                              ; preds = %331
  %337 = load i32, ptr %11, align 4, !tbaa !9
  %338 = invoke noundef zeroext i1 @_ZNK7SGTELIB18Surrogate_Ensemble8is_readyEi(ptr noundef nonnull align 8 dereferenceable(1040) %26, i32 noundef %337)
          to label %339 unwind label %305

339:                                              ; preds = %336
  br i1 %338, label %340, label %344

340:                                              ; preds = %339
  %341 = load i32, ptr %11, align 4, !tbaa !9
  %342 = load i32, ptr %10, align 4, !tbaa !9
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %5, i32 noundef %341, i32 noundef %342, double noundef 1.000000e+00)
          to label %343 unwind label %305

343:                                              ; preds = %340
  br label %344

344:                                              ; preds = %343, %339
  br label %345

345:                                              ; preds = %344
  %346 = load i32, ptr %11, align 4, !tbaa !9
  %347 = add nsw i32 %346, 1
  store i32 %347, ptr %11, align 4, !tbaa !9
  br label %331, !llvm.loop !66

348:                                              ; preds = %331
  br label %349

349:                                              ; preds = %348, %329
  store double 0.000000e+00, ptr %16, align 8, !tbaa !55
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %350

350:                                              ; preds = %362, %349
  %351 = load i32, ptr %11, align 4, !tbaa !9
  %352 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble", ptr %26, i32 0, i32 1
  %353 = load i32, ptr %352, align 4, !tbaa !11
  %354 = icmp slt i32 %351, %353
  br i1 %354, label %355, label %365

355:                                              ; preds = %350
  %356 = load i32, ptr %11, align 4, !tbaa !9
  %357 = load i32, ptr %10, align 4, !tbaa !9
  %358 = invoke noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %5, i32 noundef %356, i32 noundef %357)
          to label %359 unwind label %305

359:                                              ; preds = %355
  %360 = load double, ptr %16, align 8, !tbaa !55
  %361 = fadd double %360, %358
  store double %361, ptr %16, align 8, !tbaa !55
  br label %362

362:                                              ; preds = %359
  %363 = load i32, ptr %11, align 4, !tbaa !9
  %364 = add nsw i32 %363, 1
  store i32 %364, ptr %11, align 4, !tbaa !9
  br label %350, !llvm.loop !67

365:                                              ; preds = %350
  %366 = load double, ptr %16, align 8, !tbaa !55
  %367 = fdiv double 1.000000e+00, %366
  %368 = load i32, ptr %10, align 4, !tbaa !9
  invoke void @_ZN7SGTELIB6Matrix12multiply_colEdi(ptr noundef nonnull align 8 dereferenceable(56) %5, double noundef %367, i32 noundef %368)
          to label %369 unwind label %305

369:                                              ; preds = %365
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %371

370:                                              ; preds = %305, %301, %268
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %372

371:                                              ; preds = %369, %181
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %18) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #7
  br label %373

372:                                              ; preds = %370, %101, %94
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %18) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #7
  br label %380

373:                                              ; preds = %371, %44
  br label %374

374:                                              ; preds = %373
  %375 = load i32, ptr %10, align 4, !tbaa !9
  %376 = add nsw i32 %375, 1
  store i32 %376, ptr %10, align 4, !tbaa !9
  br label %34, !llvm.loop !68

377:                                              ; preds = %34
  %378 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %26, i32 0, i32 2
  invoke void @_ZN7SGTELIB20Surrogate_Parameters10set_weightERKNS_6MatrixE(ptr noundef nonnull align 8 dereferenceable(312) %378, ptr noundef nonnull align 8 dereferenceable(56) %5)
          to label %379 unwind label %90

379:                                              ; preds = %377
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %5) #7
  ret void

380:                                              ; preds = %372, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %381

381:                                              ; preds = %380, %86
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  br label %382

382:                                              ; preds = %381, %85
  call void @llvm.lifetime.end.p0(i64 56, ptr %5) #7
  br label %383

383:                                              ; preds = %382
  %384 = load ptr, ptr %8, align 8
  %385 = load i32, ptr %9, align 4
  %386 = insertvalue { ptr, i32 } poison, ptr %384, 0
  %387 = insertvalue { ptr, i32 } %386, i32 %385, 1
  resume { ptr, i32 } %387
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7SGTELIB18Surrogate_Ensemble8is_readyEi(ptr noundef nonnull align 8 dereferenceable(1040), i32 noundef) #2 align 2

declare noundef double @_ZN7SGTELIB9Surrogate10get_metricENS_8metric_tEi(ptr noundef nonnull align 8 dereferenceable(985), i32 noundef, i32 noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK7SGTELIB11TrainingSet7get_bboEi(ptr noundef nonnull align 8 dereferenceable(504), i32 noundef) #2 align 2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #6

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEE9push_backEb(ptr noundef nonnull align 8 dereferenceable(40), i1 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #2 align 2

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

declare noundef zeroext i1 @_ZN7SGTELIB5isdefEd(double noundef) #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) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !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, !10, i64 988}
!12 = !{!"_ZTSN7SGTELIB18Surrogate_EnsembleE", !13, i64 0, !10, i64 988, !10, i64 992, !49, i64 1000, !6, i64 1024, !6, i64 1032}
!13 = !{!"_ZTSN7SGTELIB9SurrogateE", !6, i64 8, !14, i64 16, !10, i64 328, !10, i64 332, !10, i64 336, !10, i64 340, !10, i64 344, !10, i64 348, !27, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !28, i64 392, !33, i64 416, !18, i64 464, !41, i64 472, !27, i64 984}
!14 = !{!"_ZTSN7SGTELIB20Surrogate_ParametersE", !15, i64 8, !10, i64 12, !16, i64 16, !17, i64 20, !16, i64 24, !18, i64 32, !16, i64 40, !18, i64 48, !16, i64 56, !19, i64 60, !16, i64 64, !20, i64 72, !24, i64 128, !16, i64 132, !25, i64 136, !18, i64 144, !18, i64 152, !18, i64 160, !18, i64 168, !20, i64 176, !16, i64 232, !26, i64 236, !21, i64 240, !21, i64 272, !10, i64 304, !10, i64 308}
!15 = !{!"_ZTSN7SGTELIB7model_tE", !7, i64 0}
!16 = !{!"_ZTSN7SGTELIB14param_status_tE", !7, i64 0}
!17 = !{!"_ZTSN7SGTELIB8kernel_tE", !7, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!"_ZTSN7SGTELIB10distance_tE", !7, i64 0}
!20 = !{!"_ZTSN7SGTELIB6MatrixE", !21, i64 8, !10, i64 40, !10, i64 44, !6, i64 48}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !22, i64 0, !23, i64 8, !7, i64 16}
!22 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = !{!"_ZTSN7SGTELIB8weight_tE", !7, i64 0}
!25 = !{!"_ZTSN7SGTELIB13uncertainty_tE", !7, i64 0}
!26 = !{!"_ZTSN7SGTELIB8metric_tE", !7, i64 0}
!27 = !{!"bool", !7, i64 0}
!28 = !{!"_ZTSNSt7__cxx114listIiSaIiEEE", !29, i64 0}
!29 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEEE", !30, i64 0}
!30 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEE10_List_implE", !31, i64 0}
!31 = !{!"_ZTSNSt8__detail17_List_node_headerE", !32, i64 0, !23, i64 16}
!32 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!33 = !{!"_ZTSSt3mapIN7SGTELIB8metric_tENS0_6MatrixESt4lessIS1_ESaISt4pairIKS1_S2_EEE", !34, i64 0}
!34 = !{!"_ZTSSt8_Rb_treeIN7SGTELIB8metric_tESt4pairIKS1_NS0_6MatrixEESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE", !35, i64 0}
!35 = !{!"_ZTSNSt8_Rb_treeIN7SGTELIB8metric_tESt4pairIKS1_NS0_6MatrixEESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !36, i64 0, !38, i64 8}
!36 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN7SGTELIB8metric_tEEE", !37, i64 0}
!37 = !{!"_ZTSSt4lessIN7SGTELIB8metric_tEE"}
!38 = !{!"_ZTSSt15_Rb_tree_header", !39, i64 0, !23, i64 32}
!39 = !{!"_ZTSSt18_Rb_tree_node_base", !40, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!40 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!41 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !42, i64 0, !43, i64 8}
!42 = !{!"_ZTSSo"}
!43 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !44, i64 0, !7, i64 64, !46, i64 104, !47, i64 120, !48, i64 124, !48, i64 132, !48, i64 140, !6, i64 152, !23, i64 160, !27, i64 168, !27, i64 169, !27, i64 170, !7, i64 171, !6, i64 176, !6, i64 184, !27, i64 192, !6, i64 200, !6, i64 208, !23, i64 216, !6, i64 224, !6, i64 232}
!44 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !45, i64 56}
!45 = !{!"_ZTSSt6locale", !6, i64 0}
!46 = !{!"_ZTSSt12__basic_fileIcE", !6, i64 0, !27, i64 8}
!47 = !{!"_ZTSSt13_Ios_Openmode", !7, i64 0}
!48 = !{!"_ZTS11__mbstate_t", !10, i64 0, !7, i64 4}
!49 = !{!"_ZTSSt6vectorIPN7SGTELIB9SurrogateESaIS2_EE", !50, i64 0}
!50 = !{!"_ZTSSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE", !51, i64 0}
!51 = !{!"_ZTSNSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE12_Vector_implE", !52, i64 0}
!52 = !{!"_ZTSNSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!53 = !{!13, !10, i64 332}
!54 = !{!13, !6, i64 8}
!55 = !{!18, !18, i64 0}
!56 = distinct !{!56, !57}
!57 = !{!"llvm.loop.mustprogress"}
!58 = distinct !{!58, !57}
!59 = distinct !{!59, !57}
!60 = !{!27, !27, i64 0}
!61 = distinct !{!61, !57}
!62 = !{i8 0, i8 2}
!63 = !{}
!64 = distinct !{!64, !57}
!65 = distinct !{!65, !57}
!66 = distinct !{!66, !57}
!67 = distinct !{!67, !57}
!68 = distinct !{!68, !57}


; 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 }
%"class.std::vector.11" = type { %"struct.std::_Vector_base.12" }
%"struct.std::_Vector_base.12" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.16" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"struct.std::_Bit_reference" = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [2 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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SGTELIB20Surrogate_Parameters10set_weightERKNS_6MatrixE(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2 align 2

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

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

; 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 @_ZN7SGTELIB18Surrogate_Ensemble22compute_W_by_select_nbEi(ptr noundef nonnull align 8 dereferenceable(1040) %0, i32 noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %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 double, align 8
  %7 = alloca double, align 8
  %8 = alloca %"class.std::vector.11", align 8
  %9 = alloca %"class.std::vector.16", align 8
  %10 = alloca double, align 8
  %11 = alloca %"struct.std::_Bit_reference", align 8
  %12 = alloca %"struct.std::_Bit_reference", align 8
  %13 = alloca %"struct.std::_Bit_reference", align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %14 unwind label %54

14:                                               ; preds = %2
  %15 = getelementptr inbounds i8, ptr %0, i64 988
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 332
  %18 = load i32, ptr %17, align 4, !tbaa !51
  invoke void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56) %3, ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef %16, i32 noundef %18)
          to label %19 unwind label %56

19:                                               ; preds = %14
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  invoke void @_ZN7SGTELIB6Matrix4fillEd(ptr noundef nonnull align 8 dereferenceable(56) %3, double noundef 0.000000e+00)
          to label %20 unwind label %59

20:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %21 = load i32, ptr %17, align 4, !tbaa !51
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph169, label %._crit_edge170

.lr.ph169:                                        ; preds = %20
  %23 = getelementptr inbounds i8, ptr %0, i64 8
  %24 = getelementptr inbounds i8, ptr %0, i64 1000
  %25 = getelementptr inbounds i8, ptr %0, i64 16
  %26 = icmp sgt i32 %1, 0
  %27 = getelementptr inbounds i8, ptr %11, i64 8
  %28 = getelementptr inbounds i8, ptr %12, i64 8
  %29 = getelementptr inbounds i8, ptr %13, i64 8
  br label %30

30:                                               ; preds = %.lr.ph169, %194
  %.079164 = phi i32 [ 0, %.lr.ph169 ], [ %195, %194 ]
  %31 = load ptr, ptr %23, align 8, !tbaa !52
  %32 = invoke noundef i32 @_ZNK7SGTELIB11TrainingSet7get_bboEi(ptr noundef nonnull align 8 dereferenceable(504) %31, i32 noundef %.079164)
          to label %33 unwind label %.loopexit122

33:                                               ; preds = %30
  %.not = icmp eq i32 %32, 2
  br i1 %.not, label %194, label %34

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #7
  call void @_ZNSt6vectorIbSaIbEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #7
  store double 0x7FEFFFFFFFFFFFFF, ptr %7, align 8, !tbaa !53
  %35 = load i32, ptr %15, align 4, !tbaa !5
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %.lr.ph, label %._crit_edge

.preheader118:                                    ; preds = %66
  %37 = icmp sgt i32 %67, 0
  br i1 %37, label %.lr.ph137, label %._crit_edge

.lr.ph:                                           ; preds = %34, %66
  %indvars.iv = phi i64 [ %indvars.iv.next, %66 ], [ 0, %34 ]
  %38 = trunc nuw nsw i64 %indvars.iv to i32
  %39 = invoke noundef zeroext i1 @_ZNK7SGTELIB18Surrogate_Ensemble8is_readyEi(ptr noundef nonnull align 8 dereferenceable(1040) %0, i32 noundef %38)
          to label %40 unwind label %.loopexit.split-lp115.loopexit.split-lp

40:                                               ; preds = %.lr.ph
  br i1 %39, label %41, label %61

41:                                               ; preds = %40
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7SGTELIB9SurrogateESaIS2_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %indvars.iv)
          to label %43 unwind label %.loopexit.split-lp115.loopexit.split-lp

43:                                               ; preds = %41
  %44 = load ptr, ptr %42, align 8, !tbaa !54
  %45 = call noundef i32 @_ZNK7SGTELIB20Surrogate_Parameters15get_metric_typeEv(ptr noundef nonnull align 8 dereferenceable(312) %25)
  %46 = invoke noundef double @_ZN7SGTELIB9Surrogate10get_metricENS_8metric_tEi(ptr noundef nonnull align 8 dereferenceable(985) %44, i32 noundef %45, i32 noundef %.079164)
          to label %47 unwind label %.loopexit.split-lp115.loopexit.split-lp

47:                                               ; preds = %43
  store double %46, ptr %6, align 8, !tbaa !53
  invoke void @_ZNSt6vectorIdSaIdEE9push_backERKd(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %48 unwind label %.loopexit.split-lp115.loopexit.split-lp

48:                                               ; preds = %47
  %49 = load double, ptr %6, align 8, !tbaa !53
  %50 = call noundef zeroext i1 @_ZSt5isnand(double noundef %49)
  br i1 %50, label %65, label %51

51:                                               ; preds = %48
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %53 = load double, ptr %52, align 8, !tbaa !53
  store double %53, ptr %7, align 8, !tbaa !53
  br label %65

54:                                               ; preds = %2
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %58

56:                                               ; preds = %14
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  br label %58

58:                                               ; preds = %56, %54
  %.pn = phi { ptr, i32 } [ %57, %56 ], [ %55, %54 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  br label %202

59:                                               ; preds = %19
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %201

.loopexit122:                                     ; preds = %30
  %lpad.loopexit124 = landingpad { ptr, i32 }
          cleanup
  br label %200

.loopexit.split-lp123:                            ; preds = %._crit_edge170
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %200

.loopexit114:                                     ; preds = %95, %101
  %lpad.loopexit116 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp115

.loopexit.split-lp115.loopexit:                   ; preds = %84, %75, %73, %.lr.ph137
  %lpad.loopexit119 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp115

.loopexit.split-lp115.loopexit.split-lp:          ; preds = %65, %47, %43, %41, %.lr.ph
  %lpad.loopexit.split-lp120 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp115

61:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  store double 0.000000e+00, ptr %10, align 8, !tbaa !53
  invoke void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %62 unwind label %63

62:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br label %65

63:                                               ; preds = %61
  %64 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br label %.loopexit.split-lp115

65:                                               ; preds = %48, %51, %62
  invoke void @_ZNSt6vectorIbSaIbEE9push_backEb(ptr noundef nonnull align 8 dereferenceable(40) %9, i1 noundef zeroext false)
          to label %66 unwind label %.loopexit.split-lp115.loopexit.split-lp

66:                                               ; preds = %65
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %67 = load i32, ptr %15, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next, %68
  br i1 %69, label %.lr.ph, label %.preheader118, !llvm.loop !55

.lr.ph137:                                        ; preds = %.preheader118, %87
  %indvars.iv173 = phi i64 [ %indvars.iv.next174, %87 ], [ 0, %.preheader118 ]
  %.074136 = phi i32 [ %.175, %87 ], [ 0, %.preheader118 ]
  %70 = trunc nuw nsw i64 %indvars.iv173 to i32
  %71 = invoke noundef zeroext i1 @_ZNK7SGTELIB18Surrogate_Ensemble8is_readyEi(ptr noundef nonnull align 8 dereferenceable(1040) %0, i32 noundef %70)
          to label %72 unwind label %.loopexit.split-lp115.loopexit

72:                                               ; preds = %.lr.ph137
  br i1 %71, label %73, label %87

73:                                               ; preds = %72
  %74 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7SGTELIB9SurrogateESaIS2_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %indvars.iv173)
          to label %75 unwind label %.loopexit.split-lp115.loopexit

75:                                               ; preds = %73
  %76 = load ptr, ptr %74, align 8, !tbaa !54
  %77 = call noundef i32 @_ZNK7SGTELIB20Surrogate_Parameters15get_metric_typeEv(ptr noundef nonnull align 8 dereferenceable(312) %25)
  %78 = invoke noundef double @_ZN7SGTELIB9Surrogate10get_metricENS_8metric_tEi(ptr noundef nonnull align 8 dereferenceable(985) %76, i32 noundef %77, i32 noundef %.079164)
          to label %79 unwind label %.loopexit.split-lp115.loopexit

79:                                               ; preds = %75
  store double %78, ptr %6, align 8, !tbaa !53
  %80 = load double, ptr %7, align 8, !tbaa !53
  %81 = fsub double %78, %80
  %82 = call double @llvm.fabs.f64(double %81)
  %83 = fcmp olt double %82, 1.000000e-13
  br i1 %83, label %84, label %87

84:                                               ; preds = %79
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %3, i32 noundef %70, i32 noundef %.079164, double noundef 1.000000e+00)
          to label %85 unwind label %.loopexit.split-lp115.loopexit

85:                                               ; preds = %84
  %86 = add nsw i32 %.074136, 1
  br label %87

87:                                               ; preds = %72, %85, %79
  %.175 = phi i32 [ %86, %85 ], [ %.074136, %79 ], [ %.074136, %72 ]
  %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
  %88 = load i32, ptr %15, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = icmp slt i64 %indvars.iv.next174, %89
  br i1 %90, label %.lr.ph137, label %._crit_edge, !llvm.loop !57

._crit_edge:                                      ; preds = %87, %34, %.preheader118
  %91 = phi i32 [ %67, %.preheader118 ], [ %35, %34 ], [ %88, %87 ]
  %.074.lcssa = phi i32 [ 0, %.preheader118 ], [ 0, %34 ], [ %.175, %87 ]
  %.not96 = icmp slt i32 %.074.lcssa, %1
  br i1 %.not96, label %.preheader111, label %.preheader112

.preheader112:                                    ; preds = %._crit_edge
  %92 = icmp sgt i32 %91, 0
  br i1 %92, label %.lr.ph139, label %.loopexit113

.lr.ph139:                                        ; preds = %.preheader112
  %93 = sitofp i32 %.074.lcssa to double
  %94 = fdiv double 1.000000e+00, %93
  br label %95

.preheader111:                                    ; preds = %._crit_edge
  br i1 %26, label %.lr.ph151, label %.preheader106

95:                                               ; preds = %.lr.ph139, %102
  %.278138 = phi i32 [ 0, %.lr.ph139 ], [ %103, %102 ]
  %96 = invoke noundef zeroext i1 @_ZNK7SGTELIB18Surrogate_Ensemble8is_readyEi(ptr noundef nonnull align 8 dereferenceable(1040) %0, i32 noundef %.278138)
          to label %97 unwind label %.loopexit114

97:                                               ; preds = %95
  br i1 %96, label %98, label %102

98:                                               ; preds = %97
  %99 = call noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %3, i32 noundef %.278138, i32 noundef %.079164)
  %100 = fcmp ogt double %99, 1.000000e-13
  br i1 %100, label %101, label %102

101:                                              ; preds = %98
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %3, i32 noundef %.278138, i32 noundef %.079164, double noundef %94)
          to label %102 unwind label %.loopexit114

102:                                              ; preds = %97, %101, %98
  %103 = add nuw nsw i32 %.278138, 1
  %104 = load i32, ptr %15, align 4, !tbaa !5
  %105 = icmp slt i32 %103, %104
  br i1 %105, label %95, label %.loopexit113, !llvm.loop !58

._crit_edge152:                                   ; preds = %._crit_edge145.thread
  %106 = fcmp ogt double %.173, 1.000000e-13
  br i1 %106, label %.preheader, label %.preheader106

.preheader106:                                    ; preds = %.preheader111, %._crit_edge152
  %107 = load i32, ptr %15, align 4, !tbaa !5
  %108 = icmp sgt i32 %107, 0
  br i1 %108, label %.lr.ph155, label %._crit_edge162

.preheader:                                       ; preds = %._crit_edge152
  %109 = load i32, ptr %15, align 4, !tbaa !5
  %110 = icmp sgt i32 %109, 0
  br i1 %110, label %.lr.ph157, label %._crit_edge162

.lr.ph151:                                        ; preds = %.preheader111, %._crit_edge145.thread
  %.0150 = phi i32 [ %154, %._crit_edge145.thread ], [ 0, %.preheader111 ]
  %.069149 = phi i32 [ %.170.lcssa184, %._crit_edge145.thread ], [ -1, %.preheader111 ]
  %.072148 = phi double [ %.173, %._crit_edge145.thread ], [ 0.000000e+00, %.preheader111 ]
  store double 0x7FEFFFFFFFFFFFFF, ptr %7, align 8, !tbaa !53
  %111 = load i32, ptr %15, align 4, !tbaa !5
  %112 = icmp sgt i32 %111, 0
  br i1 %112, label %.lr.ph144, label %._crit_edge145.thread

.lr.ph144:                                        ; preds = %.lr.ph151, %139
  %indvars.iv176 = phi i64 [ %indvars.iv.next177, %139 ], [ 0, %.lr.ph151 ]
  %.068142 = phi i1 [ %.1, %139 ], [ false, %.lr.ph151 ]
  %.170141 = phi i32 [ %.2, %139 ], [ %.069149, %.lr.ph151 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  %113 = trunc nuw nsw i64 %indvars.iv176 to i32
  %114 = invoke noundef zeroext i1 @_ZNK7SGTELIB18Surrogate_Ensemble8is_readyEi(ptr noundef nonnull align 8 dereferenceable(1040) %0, i32 noundef %113)
          to label %115 unwind label %135

115:                                              ; preds = %.lr.ph144
  br i1 %114, label %116, label %.critedge

116:                                              ; preds = %115
  %117 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %9, i64 noundef %indvars.iv176)
          to label %118 unwind label %137

118:                                              ; preds = %116
  %119 = extractvalue { ptr, i64 } %117, 0
  store ptr %119, ptr %11, align 8
  %120 = extractvalue { ptr, i64 } %117, 1
  store i64 %120, ptr %27, align 8
  %121 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  br i1 %121, label %139, label %122

122:                                              ; preds = %118
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv176) #7
  %124 = load double, ptr %123, align 8, !tbaa !53
  %125 = invoke noundef zeroext i1 @_ZN7SGTELIB5isdefEd(double noundef %124)
          to label %126 unwind label %135

126:                                              ; preds = %122
  br i1 %125, label %127, label %139

127:                                              ; preds = %126
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv176) #7
  %129 = load double, ptr %128, align 8, !tbaa !53
  %130 = load double, ptr %7, align 8, !tbaa !53
  %131 = fcmp olt double %129, %130
  br i1 %131, label %132, label %139

132:                                              ; preds = %127
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv176) #7
  %134 = load double, ptr %133, align 8, !tbaa !53
  store double %134, ptr %7, align 8, !tbaa !53
  br label %139

135:                                              ; preds = %122, %.lr.ph144
  %136 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp115

137:                                              ; preds = %116
  %138 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  br label %.loopexit.split-lp115

.critedge:                                        ; preds = %115
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  br label %139

139:                                              ; preds = %118, %.critedge, %132, %127, %126
  %.2 = phi i32 [ %113, %132 ], [ %.170141, %127 ], [ %.170141, %126 ], [ %.170141, %118 ], [ %.170141, %.critedge ]
  %.1 = phi i1 [ true, %132 ], [ %.068142, %127 ], [ %.068142, %126 ], [ %.068142, %118 ], [ %.068142, %.critedge ]
  %indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1
  %140 = load i32, ptr %15, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = icmp slt i64 %indvars.iv.next177, %141
  br i1 %142, label %.lr.ph144, label %._crit_edge145, !llvm.loop !59

._crit_edge145:                                   ; preds = %139
  br i1 %.1, label %143, label %._crit_edge145.thread

143:                                              ; preds = %._crit_edge145
  %144 = load double, ptr %7, align 8, !tbaa !53
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #7
  %145 = sext i32 %.2 to i64
  %146 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %9, i64 noundef %145)
          to label %147 unwind label %152

147:                                              ; preds = %143
  %148 = fadd double %.072148, %144
  %149 = extractvalue { ptr, i64 } %146, 0
  store ptr %149, ptr %12, align 8
  %150 = extractvalue { ptr, i64 } %146, 1
  store i64 %150, ptr %28, align 8
  %151 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %12, i1 noundef zeroext true) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  br label %._crit_edge145.thread

152:                                              ; preds = %143
  %153 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  br label %.loopexit.split-lp115

._crit_edge145.thread:                            ; preds = %.lr.ph151, %._crit_edge145, %147
  %.170.lcssa184 = phi i32 [ %.2, %147 ], [ %.2, %._crit_edge145 ], [ %.069149, %.lr.ph151 ]
  %.173 = phi double [ %148, %147 ], [ %.072148, %._crit_edge145 ], [ %.072148, %.lr.ph151 ]
  %154 = add nuw nsw i32 %.0150, 1
  %exitcond.not = icmp eq i32 %154, %1
  br i1 %exitcond.not, label %._crit_edge152, label %.lr.ph151, !llvm.loop !60

.lr.ph157:                                        ; preds = %.preheader, %175
  %indvars.iv178 = phi i64 [ %indvars.iv.next179, %175 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #7
  %155 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %9, i64 noundef %indvars.iv178)
          to label %156 unwind label %168

156:                                              ; preds = %.lr.ph157
  %157 = extractvalue { ptr, i64 } %155, 0
  store ptr %157, ptr %13, align 8
  %158 = extractvalue { ptr, i64 } %155, 1
  store i64 %158, ptr %29, align 8
  %159 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  br i1 %159, label %160, label %.invoke

160:                                              ; preds = %156
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv178) #7
  %162 = load double, ptr %161, align 8, !tbaa !53
  %163 = fsub double %162, %.173
  %164 = call double @llvm.fabs.f64(double %163)
  %165 = fcmp olt double %164, 1.000000e-13
  br i1 %165, label %.invoke, label %170

.invoke:                                          ; preds = %160, %156, %170
  %166 = phi double [ %174, %170 ], [ 0.000000e+00, %156 ], [ 1.000000e-01, %160 ]
  %167 = trunc nuw nsw i64 %indvars.iv178 to i32
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %3, i32 noundef %167, i32 noundef %.079164, double noundef %166)
          to label %175 unwind label %.loopexit105

168:                                              ; preds = %.lr.ph157
  %169 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  br label %.loopexit.split-lp115

.loopexit105:                                     ; preds = %.invoke
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp115

.loopexit.split-lp.loopexit:                      ; preds = %181, %.lr.ph155
  %lpad.loopexit108 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp115

.loopexit.split-lp.loopexit.split-lp:             ; preds = %._crit_edge162
  %lpad.loopexit.split-lp109 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp115

170:                                              ; preds = %160
  %171 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv178) #7
  %172 = load double, ptr %171, align 8, !tbaa !53
  %173 = fdiv double %172, %.173
  %174 = fsub double 1.000000e+00, %173
  br label %.invoke

175:                                              ; preds = %.invoke
  %indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1
  %176 = load i32, ptr %15, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = icmp slt i64 %indvars.iv.next179, %177
  br i1 %178, label %.lr.ph157, label %.loopexit, !llvm.loop !61

.lr.ph155:                                        ; preds = %.preheader106, %182
  %.5154 = phi i32 [ %183, %182 ], [ 0, %.preheader106 ]
  %179 = invoke noundef zeroext i1 @_ZNK7SGTELIB18Surrogate_Ensemble8is_readyEi(ptr noundef nonnull align 8 dereferenceable(1040) %0, i32 noundef %.5154)
          to label %180 unwind label %.loopexit.split-lp.loopexit

180:                                              ; preds = %.lr.ph155
  br i1 %179, label %181, label %182

181:                                              ; preds = %180
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %3, i32 noundef %.5154, i32 noundef %.079164, double noundef 1.000000e+00)
          to label %182 unwind label %.loopexit.split-lp.loopexit

182:                                              ; preds = %180, %181
  %183 = add nuw nsw i32 %.5154, 1
  %184 = load i32, ptr %15, align 4, !tbaa !5
  %185 = icmp slt i32 %183, %184
  br i1 %185, label %.lr.ph155, label %.loopexit, !llvm.loop !62

.loopexit:                                        ; preds = %182, %175
  %186 = phi i32 [ %176, %175 ], [ %184, %182 ]
  %187 = icmp sgt i32 %186, 0
  br i1 %187, label %.lr.ph161, label %._crit_edge162

.lr.ph161:                                        ; preds = %.loopexit, %.lr.ph161
  %.071159 = phi double [ %189, %.lr.ph161 ], [ 0.000000e+00, %.loopexit ]
  %.6158 = phi i32 [ %190, %.lr.ph161 ], [ 0, %.loopexit ]
  %188 = call noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %3, i32 noundef %.6158, i32 noundef %.079164)
  %189 = fadd double %.071159, %188
  %190 = add nuw nsw i32 %.6158, 1
  %191 = load i32, ptr %15, align 4, !tbaa !5
  %192 = icmp slt i32 %190, %191
  br i1 %192, label %.lr.ph161, label %._crit_edge162, !llvm.loop !63

._crit_edge162:                                   ; preds = %.lr.ph161, %.preheader, %.preheader106, %.loopexit
  %.071.lcssa = phi double [ 0.000000e+00, %.loopexit ], [ 0.000000e+00, %.preheader106 ], [ 0.000000e+00, %.preheader ], [ %189, %.lr.ph161 ]
  %193 = fdiv double 1.000000e+00, %.071.lcssa
  invoke void @_ZN7SGTELIB6Matrix12multiply_colEdi(ptr noundef nonnull align 8 dereferenceable(56) %3, double noundef %193, i32 noundef %.079164)
          to label %.loopexit113 unwind label %.loopexit.split-lp.loopexit.split-lp

.loopexit113:                                     ; preds = %102, %.preheader112, %._crit_edge162
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  br label %194

.loopexit.split-lp115:                            ; preds = %.loopexit105, %.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit, %.loopexit114, %.loopexit.split-lp115.loopexit.split-lp, %.loopexit.split-lp115.loopexit, %168, %152, %137, %135, %63
  %.pn100 = phi { ptr, i32 } [ %64, %63 ], [ %169, %168 ], [ %136, %135 ], [ %138, %137 ], [ %153, %152 ], [ %lpad.loopexit116, %.loopexit114 ], [ %lpad.loopexit119, %.loopexit.split-lp115.loopexit ], [ %lpad.loopexit.split-lp120, %.loopexit.split-lp115.loopexit.split-lp ], [ %lpad.loopexit, %.loopexit105 ], [ %lpad.loopexit108, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp109, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #7
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  br label %200

194:                                              ; preds = %33, %.loopexit113
  %195 = add nuw nsw i32 %.079164, 1
  %196 = load i32, ptr %17, align 4, !tbaa !51
  %197 = icmp slt i32 %195, %196
  br i1 %197, label %30, label %._crit_edge170, !llvm.loop !64

._crit_edge170:                                   ; preds = %194, %20
  %198 = getelementptr inbounds i8, ptr %0, i64 16
  invoke void @_ZN7SGTELIB20Surrogate_Parameters10set_weightERKNS_6MatrixE(ptr noundef nonnull align 8 dereferenceable(312) %198, ptr noundef nonnull align 8 dereferenceable(56) %3)
          to label %199 unwind label %.loopexit.split-lp123

199:                                              ; preds = %._crit_edge170
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #7
  ret void

200:                                              ; preds = %.loopexit122, %.loopexit.split-lp123, %.loopexit.split-lp115
  %.pn100.pn = phi { ptr, i32 } [ %.pn100, %.loopexit.split-lp115 ], [ %lpad.loopexit124, %.loopexit122 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp123 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %201

201:                                              ; preds = %200, %59
  %.pn100.pn.pn = phi { ptr, i32 } [ %.pn100.pn, %200 ], [ %60, %59 ]
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #7
  br label %202

202:                                              ; preds = %201, %58
  %.pn100.pn.pn.pn = phi { ptr, i32 } [ %.pn100.pn.pn, %201 ], [ %.pn, %58 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn100.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7SGTELIB18Surrogate_Ensemble8is_readyEi(ptr noundef nonnull align 8 dereferenceable(1040), i32 noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK7SGTELIB11TrainingSet7get_bboEi(ptr noundef nonnull align 8 dereferenceable(504), i32 noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #6

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEE9push_backEb(ptr noundef nonnull align 8 dereferenceable(40), i1 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #2 align 2

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

declare noundef zeroext i1 @_ZN7SGTELIB5isdefEd(double 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 #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !13, i64 988}
!6 = !{!"_ZTSN7SGTELIB18Surrogate_EnsembleE", !7, i64 0, !13, i64 988, !13, i64 992, !47, i64 1000, !8, i64 1024, !8, i64 1032}
!7 = !{!"_ZTSN7SGTELIB9SurrogateE", !8, 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, !8, i64 360, !8, i64 368, !8, i64 376, !8, i64 384, !26, i64 392, !31, i64 416, !16, i64 464, !39, i64 472, !25, i64 984}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!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", !9, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!"_ZTSN7SGTELIB14param_status_tE", !9, i64 0}
!15 = !{!"_ZTSN7SGTELIB8kernel_tE", !9, i64 0}
!16 = !{!"double", !9, i64 0}
!17 = !{!"_ZTSN7SGTELIB10distance_tE", !9, i64 0}
!18 = !{!"_ZTSN7SGTELIB6MatrixE", !19, i64 8, !13, i64 40, !13, i64 44, !8, i64 48}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !21, i64 8, !9, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !8, i64 0}
!21 = !{!"long", !9, i64 0}
!22 = !{!"_ZTSN7SGTELIB8weight_tE", !9, i64 0}
!23 = !{!"_ZTSN7SGTELIB13uncertainty_tE", !9, i64 0}
!24 = !{!"_ZTSN7SGTELIB8metric_tE", !9, i64 0}
!25 = !{!"bool", !9, 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", !8, i64 0, !8, 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, !8, i64 8, !8, i64 16, !8, i64 24}
!38 = !{!"_ZTSSt14_Rb_tree_color", !9, i64 0}
!39 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !40, i64 0, !41, i64 8}
!40 = !{!"_ZTSSo"}
!41 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !42, i64 0, !9, i64 64, !44, i64 104, !45, i64 120, !46, i64 124, !46, i64 132, !46, i64 140, !8, i64 152, !21, i64 160, !25, i64 168, !25, i64 169, !25, i64 170, !9, i64 171, !8, i64 176, !8, i64 184, !25, i64 192, !8, i64 200, !8, i64 208, !21, i64 216, !8, i64 224, !8, i64 232}
!42 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !43, i64 56}
!43 = !{!"_ZTSSt6locale", !8, i64 0}
!44 = !{!"_ZTSSt12__basic_fileIcE", !8, i64 0, !25, i64 8}
!45 = !{!"_ZTSSt13_Ios_Openmode", !9, i64 0}
!46 = !{!"_ZTS11__mbstate_t", !13, i64 0, !9, i64 4}
!47 = !{!"_ZTSSt6vectorIPN7SGTELIB9SurrogateESaIS2_EE", !48, i64 0}
!48 = !{!"_ZTSSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE", !49, i64 0}
!49 = !{!"_ZTSNSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE12_Vector_implE", !50, i64 0}
!50 = !{!"_ZTSNSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!51 = !{!7, !13, i64 332}
!52 = !{!7, !8, i64 8}
!53 = !{!16, !16, i64 0}
!54 = !{!8, !8, i64 0}
!55 = distinct !{!55, !56}
!56 = !{!"llvm.loop.mustprogress"}
!57 = distinct !{!57, !56}
!58 = distinct !{!58, !56}
!59 = distinct !{!59, !56}
!60 = distinct !{!60, !56}
!61 = distinct !{!61, !56}
!62 = distinct !{!62, !56}
!63 = distinct !{!63, !56}
!64 = distinct !{!64, !56}


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