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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.SGTELIB::Matrix" = type { ptr, %"class.std::__cxx11::basic_string", i32, i32, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"class.SGTELIB::Surrogate" = type <{ ptr, ptr, %"class.SGTELIB::Surrogate_Parameters", i32, i32, i32, i32, i32, i32, i8, [7 x i8], ptr, ptr, ptr, ptr, %"class.std::__cxx11::list", %"class.std::map", double, %"class.std::basic_ofstream", i8, [7 x i8] }>
%"class.SGTELIB::Surrogate_Parameters" = type { ptr, i32, i32, i32, i32, i32, double, i32, double, i32, i32, i32, %"class.SGTELIB::Matrix", i32, i32, i32, double, double, double, double, %"class.SGTELIB::Matrix", i32, i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, i32 }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" }
%"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<SGTELIB::metric_t, std::pair<const SGTELIB::metric_t, SGTELIB::Matrix>, std::_Select1st<std::pair<const SGTELIB::metric_t, SGTELIB::Matrix>>, std::less<SGTELIB::metric_t>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<SGTELIB::metric_t, std::pair<const SGTELIB::metric_t, SGTELIB::Matrix>, std::_Select1st<std::pair<const SGTELIB::metric_t, SGTELIB::Matrix>>, std::less<SGTELIB::metric_t>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon.6 }
%union.anon.6 = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: 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 i32 @__gxx_personality_v0(...)

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 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: nounwind
declare void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7SGTELIB17Surrogate_Kriging25compute_covariance_matrixERKNS_6MatrixE(ptr dead_on_unwind noalias writable sret(%"class.SGTELIB::Matrix") align 8 %0, ptr noundef nonnull align 8 dereferenceable(1336) %1, ptr noundef nonnull align 8 dereferenceable(56) %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.SGTELIB::Matrix", align 8
  %9 = alloca %"class.SGTELIB::Matrix", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.SGTELIB::Matrix", align 8
  %13 = alloca %"class.SGTELIB::Matrix", align 8
  %14 = alloca i1, align 1
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::allocator", align 1
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %22 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56) %23)
  store i32 %24, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 56, ptr %8) #6
  call void @_ZN7SGTELIB9Surrogate13get_matrix_XsEv(ptr dead_on_unwind writable sret(%"class.SGTELIB::Matrix") align 8 %8, ptr noundef nonnull align 8 dereferenceable(985) %22)
  call void @llvm.lifetime.start.p0(i64 56, ptr %9) #6
  %25 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %22, i32 0, i32 2
  invoke void @_ZNK7SGTELIB20Surrogate_Parameters19get_covariance_coefEv(ptr dead_on_unwind writable sret(%"class.SGTELIB::Matrix") align 8 %9, ptr noundef nonnull align 8 dereferenceable(312) %25)
          to label %26 unwind label %45

26:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 56, ptr %12) #6
  %27 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %22, i32 0, i32 1
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %13) #6
  invoke void @_ZN7SGTELIB9Surrogate13get_matrix_XsEv(ptr dead_on_unwind writable sret(%"class.SGTELIB::Matrix") align 8 %13, ptr noundef nonnull align 8 dereferenceable(985) %22)
          to label %30 unwind label %49

30:                                               ; preds = %26
  %31 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %22, i32 0, i32 2
  %32 = invoke noundef i32 @_ZNK7SGTELIB20Surrogate_Parameters17get_distance_typeEv(ptr noundef nonnull align 8 dereferenceable(312) %31)
          to label %33 unwind label %53

33:                                               ; preds = %30
  invoke void @_ZNK7SGTELIB11TrainingSet13get_distancesERKNS_6MatrixES3_NS_10distance_tE(ptr dead_on_unwind writable sret(%"class.SGTELIB::Matrix") align 8 %12, ptr noundef nonnull align 8 dereferenceable(504) %28, ptr noundef nonnull align 8 dereferenceable(56) %29, ptr noundef nonnull align 8 dereferenceable(56) %13, i32 noundef %32)
          to label %34 unwind label %53

34:                                               ; preds = %33
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %13) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %13) #6
  store i1 false, ptr %14, align 1
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef @.str, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %35 unwind label %58

35:                                               ; preds = %34
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %22, i32 0, i32 7
  %38 = load i32, ptr %37, align 8, !tbaa !48
  invoke void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %36, i32 noundef %38)
          to label %39 unwind label %62

39:                                               ; preds = %35
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %111, %39
  %41 = load i32, ptr %19, align 4, !tbaa !9
  %42 = load i32, ptr %7, align 4, !tbaa !9
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %67, label %44

44:                                               ; preds = %40
  store i32 2, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %114

45:                                               ; preds = %3
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %10, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %11, align 4
  br label %120

49:                                               ; preds = %26
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %10, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %11, align 4
  br label %57

53:                                               ; preds = %33, %30
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %10, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %11, align 4
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %13) #6
  br label %57

57:                                               ; preds = %53, %49
  call void @llvm.lifetime.end.p0(i64 56, ptr %13) #6
  br label %119

58:                                               ; preds = %34
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %10, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %11, align 4
  br label %66

62:                                               ; preds = %35
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %10, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  br label %66

66:                                               ; preds = %62, %58
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #6
  br label %118

67:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %107, %67
  %69 = load i32, ptr %21, align 4, !tbaa !9
  %70 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %22, i32 0, i32 7
  %71 = load i32, ptr %70, align 8, !tbaa !48
  %72 = icmp slt i32 %69, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %68
  store i32 5, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %110

74:                                               ; preds = %68
  %75 = load i32, ptr %19, align 4, !tbaa !9
  %76 = load i32, ptr %21, align 4, !tbaa !9
  %77 = invoke noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %12, i32 noundef %75, i32 noundef %76)
          to label %78 unwind label %98

78:                                               ; preds = %74
  store double %77, ptr %17, align 8, !tbaa !49
  %79 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7SGTELIB6MatrixixEi(ptr noundef nonnull align 8 dereferenceable(56) %9, i32 noundef 1)
          to label %80 unwind label %98

80:                                               ; preds = %78
  %81 = load double, ptr %79, align 8, !tbaa !49
  %82 = load double, ptr %17, align 8, !tbaa !49
  %83 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7SGTELIB6MatrixixEi(ptr noundef nonnull align 8 dereferenceable(56) %9, i32 noundef 0)
          to label %84 unwind label %98

84:                                               ; preds = %80
  %85 = load double, ptr %83, align 8, !tbaa !49
  %86 = call double @pow(double noundef %82, double noundef %85) #6
  %87 = fmul double %81, %86
  store double %87, ptr %18, align 8, !tbaa !49
  %88 = load double, ptr %18, align 8, !tbaa !49
  %89 = fneg double %88
  %90 = call double @exp(double noundef %89) #6
  store double %90, ptr %18, align 8, !tbaa !49
  %91 = load double, ptr %17, align 8, !tbaa !49
  %92 = fcmp oeq double %91, 0.000000e+00
  br i1 %92, label %93, label %102

93:                                               ; preds = %84
  %94 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %22, i32 0, i32 2
  %95 = invoke noundef double @_ZNK7SGTELIB20Surrogate_Parameters9get_ridgeEv(ptr noundef nonnull align 8 dereferenceable(312) %94)
          to label %96 unwind label %98

96:                                               ; preds = %93
  %97 = fadd double 1.000000e+00, %95
  store double %97, ptr %18, align 8, !tbaa !49
  br label %102

98:                                               ; preds = %102, %93, %80, %78, %74
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %10, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #6
  br label %118

102:                                              ; preds = %96, %84
  %103 = load i32, ptr %19, align 4, !tbaa !9
  %104 = load i32, ptr %21, align 4, !tbaa !9
  %105 = load double, ptr %18, align 8, !tbaa !49
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %103, i32 noundef %104, double noundef %105)
          to label %106 unwind label %98

106:                                              ; preds = %102
  br label %107

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

110:                                              ; preds = %73
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %19, align 4, !tbaa !9
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %19, align 4, !tbaa !9
  br label %40, !llvm.loop !52

114:                                              ; preds = %44
  store i1 true, ptr %14, align 1
  store i32 1, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  %115 = load i1, ptr %14, align 1
  br i1 %115, label %117, label %116

116:                                              ; preds = %114
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #6
  br label %117

117:                                              ; preds = %116, %114
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %12) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %12) #6
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %9) #6
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  ret void

118:                                              ; preds = %98, %66
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %12) #6
  br label %119

119:                                              ; preds = %118, %57
  call void @llvm.lifetime.end.p0(i64 56, ptr %12) #6
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #6
  br label %120

120:                                              ; preds = %119, %45
  call void @llvm.lifetime.end.p0(i64 56, ptr %9) #6
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %121

121:                                              ; preds = %120
  %122 = load ptr, ptr %10, align 8
  %123 = load i32, ptr %11, align 4
  %124 = insertvalue { ptr, i32 } poison, ptr %122, 0
  %125 = insertvalue { ptr, i32 } %124, i32 %123, 1
  resume { ptr, i32 } %125
}

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

; 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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7SGTELIB20Surrogate_Parameters19get_covariance_coefEv(ptr dead_on_unwind noalias writable sret(%"class.SGTELIB::Matrix") align 8, ptr noundef nonnull align 8 dereferenceable(312)) #2 align 2

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

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

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

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

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

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

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


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

%"class.SGTELIB::Matrix" = type { ptr, %"class.std::__cxx11::basic_string", i32, i32, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: mustprogress 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 i32 @__gxx_personality_v0(...)

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 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: nounwind
declare void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7SGTELIB17Surrogate_Kriging25compute_covariance_matrixERKNS_6MatrixE(ptr dead_on_unwind noalias writable sret(%"class.SGTELIB::Matrix") align 8 %0, ptr noundef nonnull align 8 dereferenceable(1336) %1, ptr noundef nonnull align 8 dereferenceable(56) %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.SGTELIB::Matrix", align 8
  %5 = alloca %"class.SGTELIB::Matrix", align 8
  %6 = alloca %"class.SGTELIB::Matrix", align 8
  %7 = alloca %"class.SGTELIB::Matrix", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::allocator", align 1
  %10 = tail call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56) %2)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #7
  call void @_ZN7SGTELIB9Surrogate13get_matrix_XsEv(ptr dead_on_unwind nonnull writable sret(%"class.SGTELIB::Matrix") align 8 %4, ptr noundef nonnull align 8 dereferenceable(985) %1)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %5) #7
  %11 = getelementptr inbounds i8, ptr %1, i64 16
  invoke void @_ZNK7SGTELIB20Surrogate_Parameters19get_covariance_coefEv(ptr dead_on_unwind nonnull writable sret(%"class.SGTELIB::Matrix") align 8 %5, ptr noundef nonnull align 8 dereferenceable(312) %11)
          to label %12 unwind label %27

12:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %6) #7
  %13 = getelementptr inbounds i8, ptr %1, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %7) #7
  invoke void @_ZN7SGTELIB9Surrogate13get_matrix_XsEv(ptr dead_on_unwind nonnull writable sret(%"class.SGTELIB::Matrix") align 8 %7, ptr noundef nonnull align 8 dereferenceable(985) %1)
          to label %15 unwind label %29

15:                                               ; preds = %12
  %16 = call noundef i32 @_ZNK7SGTELIB20Surrogate_Parameters17get_distance_typeEv(ptr noundef nonnull align 8 dereferenceable(312) %11)
  invoke void @_ZNK7SGTELIB11TrainingSet13get_distancesERKNS_6MatrixES3_NS_10distance_tE(ptr dead_on_unwind nonnull writable sret(%"class.SGTELIB::Matrix") align 8 %6, ptr noundef nonnull align 8 dereferenceable(504) %14, ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %16)
          to label %17 unwind label %31

17:                                               ; preds = %15
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %7) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull @.str, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %18 unwind label %34

18:                                               ; preds = %17
  %19 = getelementptr inbounds i8, ptr %1, i64 344
  %20 = load i32, ptr %19, align 8, !tbaa !46
  invoke void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %10, i32 noundef %20)
          to label %21 unwind label %36

21:                                               ; preds = %18
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #7
  %22 = icmp sgt i32 %10, 0
  %23 = load i32, ptr %19, align 8
  %24 = icmp sgt i32 %23, 0
  %or.cond = select i1 %22, i1 %24, i1 false
  br i1 %or.cond, label %.preheader, label %._crit_edge36

.preheader:                                       ; preds = %21, %._crit_edge
  %25 = phi i32 [ %39, %._crit_edge ], [ %23, %21 ]
  %.01935 = phi i32 [ %40, %._crit_edge ], [ 0, %21 ]
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph, label %._crit_edge

27:                                               ; preds = %3
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %65

29:                                               ; preds = %12
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %33

31:                                               ; preds = %15
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %7) #7
  br label %33

33:                                               ; preds = %31, %29
  %.pn = phi { ptr, i32 } [ %32, %31 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7) #7
  br label %64

34:                                               ; preds = %17
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %38

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

38:                                               ; preds = %36, %34
  %.pn28 = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #7
  br label %63

._crit_edge:                                      ; preds = %59, %.preheader
  %39 = phi i32 [ %25, %.preheader ], [ %61, %59 ]
  %40 = add nuw nsw i32 %.01935, 1
  %exitcond.not = icmp eq i32 %40, %10
  br i1 %exitcond.not, label %._crit_edge36, label %.preheader, !llvm.loop !47

.lr.ph:                                           ; preds = %.preheader, %59
  %.034 = phi i32 [ %60, %59 ], [ 0, %.preheader ]
  %41 = call noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %6, i32 noundef %.01935, i32 noundef %.034)
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7SGTELIB6MatrixixEi(ptr noundef nonnull align 8 dereferenceable(56) %5, i32 noundef 1)
          to label %43 unwind label %56

43:                                               ; preds = %.lr.ph
  %44 = load double, ptr %42, align 8, !tbaa !50
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK7SGTELIB6MatrixixEi(ptr noundef nonnull align 8 dereferenceable(56) %5, i32 noundef 0)
          to label %46 unwind label %56

46:                                               ; preds = %43
  %47 = load double, ptr %45, align 8, !tbaa !50
  %48 = call double @pow(double noundef %41, double noundef %47) #7
  %49 = fneg double %44
  %50 = fmul double %48, %49
  %51 = call double @exp(double noundef %50) #7
  %52 = fcmp oeq double %41, 0.000000e+00
  br i1 %52, label %53, label %58

53:                                               ; preds = %46
  %54 = call noundef double @_ZNK7SGTELIB20Surrogate_Parameters9get_ridgeEv(ptr noundef nonnull align 8 dereferenceable(312) %11)
  %55 = fadd double %54, 1.000000e+00
  br label %58

56:                                               ; preds = %58, %43, %.lr.ph
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #7
  br label %63

58:                                               ; preds = %53, %46
  %.020 = phi double [ %55, %53 ], [ %51, %46 ]
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %.01935, i32 noundef %.034, double noundef %.020)
          to label %59 unwind label %56

59:                                               ; preds = %58
  %60 = add nuw nsw i32 %.034, 1
  %61 = load i32, ptr %19, align 8, !tbaa !46
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %.lr.ph, label %._crit_edge, !llvm.loop !51

._crit_edge36:                                    ; preds = %._crit_edge, %21
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %6) #7
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %5) #7
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #7
  ret void

63:                                               ; preds = %56, %38
  %.pn30 = phi { ptr, i32 } [ %57, %56 ], [ %.pn28, %38 ]
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #7
  br label %64

64:                                               ; preds = %63, %33
  %.pn30.pn = phi { ptr, i32 } [ %.pn30, %63 ], [ %.pn, %33 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %6) #7
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #7
  br label %65

65:                                               ; preds = %64, %27
  %.pn30.pn.pn = phi { ptr, i32 } [ %.pn30.pn, %64 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %5) #7
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn30.pn.pn
}

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

; 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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7SGTELIB20Surrogate_Parameters19get_covariance_coefEv(ptr dead_on_unwind noalias writable sret(%"class.SGTELIB::Matrix") align 8, ptr noundef nonnull align 8 dereferenceable(312)) local_unnamed_addr #2 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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 nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"_ZTSN7SGTELIB9SurrogateE", !7, i64 8, !10, i64 16, !12, i64 328, !12, i64 332, !12, i64 336, !12, i64 340, !12, i64 344, !12, i64 348, !24, i64 352, !7, i64 360, !7, i64 368, !7, i64 376, !7, i64 384, !25, i64 392, !30, i64 416, !15, i64 464, !38, i64 472, !24, i64 984}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN7SGTELIB20Surrogate_ParametersE", !11, i64 8, !12, i64 12, !13, i64 16, !14, i64 20, !13, i64 24, !15, i64 32, !13, i64 40, !15, i64 48, !13, i64 56, !16, i64 60, !13, i64 64, !17, i64 72, !21, i64 128, !13, i64 132, !22, i64 136, !15, i64 144, !15, i64 152, !15, i64 160, !15, i64 168, !17, i64 176, !13, i64 232, !23, i64 236, !18, i64 240, !18, i64 272, !12, i64 304, !12, i64 308}
!11 = !{!"_ZTSN7SGTELIB7model_tE", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_ZTSN7SGTELIB14param_status_tE", !8, i64 0}
!14 = !{!"_ZTSN7SGTELIB8kernel_tE", !8, i64 0}
!15 = !{!"double", !8, i64 0}
!16 = !{!"_ZTSN7SGTELIB10distance_tE", !8, i64 0}
!17 = !{!"_ZTSN7SGTELIB6MatrixE", !18, i64 8, !12, i64 40, !12, i64 44, !7, i64 48}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !19, i64 0, !20, i64 8, !8, i64 16}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!20 = !{!"long", !8, i64 0}
!21 = !{!"_ZTSN7SGTELIB8weight_tE", !8, i64 0}
!22 = !{!"_ZTSN7SGTELIB13uncertainty_tE", !8, i64 0}
!23 = !{!"_ZTSN7SGTELIB8metric_tE", !8, i64 0}
!24 = !{!"bool", !8, i64 0}
!25 = !{!"_ZTSNSt7__cxx114listIiSaIiEEE", !26, i64 0}
!26 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEEE", !27, i64 0}
!27 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEE10_List_implE", !28, i64 0}
!28 = !{!"_ZTSNSt8__detail17_List_node_headerE", !29, i64 0, !20, i64 16}
!29 = !{!"_ZTSNSt8__detail15_List_node_baseE", !7, i64 0, !7, i64 8}
!30 = !{!"_ZTSSt3mapIN7SGTELIB8metric_tENS0_6MatrixESt4lessIS1_ESaISt4pairIKS1_S2_EEE", !31, i64 0}
!31 = !{!"_ZTSSt8_Rb_treeIN7SGTELIB8metric_tESt4pairIKS1_NS0_6MatrixEESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE", !32, i64 0}
!32 = !{!"_ZTSNSt8_Rb_treeIN7SGTELIB8metric_tESt4pairIKS1_NS0_6MatrixEESt10_Select1stIS5_ESt4lessIS1_ESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !33, i64 0, !35, i64 8}
!33 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN7SGTELIB8metric_tEEE", !34, i64 0}
!34 = !{!"_ZTSSt4lessIN7SGTELIB8metric_tEE"}
!35 = !{!"_ZTSSt15_Rb_tree_header", !36, i64 0, !20, i64 32}
!36 = !{!"_ZTSSt18_Rb_tree_node_base", !37, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!37 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!38 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !39, i64 0, !40, i64 8}
!39 = !{!"_ZTSSo"}
!40 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !41, i64 0, !8, i64 64, !43, i64 104, !44, i64 120, !45, i64 124, !45, i64 132, !45, i64 140, !7, i64 152, !20, i64 160, !24, i64 168, !24, i64 169, !24, i64 170, !8, i64 171, !7, i64 176, !7, i64 184, !24, i64 192, !7, i64 200, !7, i64 208, !20, i64 216, !7, i64 224, !7, i64 232}
!41 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !42, i64 56}
!42 = !{!"_ZTSSt6locale", !7, i64 0}
!43 = !{!"_ZTSSt12__basic_fileIcE", !7, i64 0, !24, i64 8}
!44 = !{!"_ZTSSt13_Ios_Openmode", !8, i64 0}
!45 = !{!"_ZTS11__mbstate_t", !12, i64 0, !8, i64 4}
!46 = !{!6, !12, i64 344}
!47 = distinct !{!47, !48, !49}
!48 = !{!"llvm.loop.mustprogress"}
!49 = !{!"llvm.loop.unswitch.partial.disable"}
!50 = !{!15, !15, i64 0}
!51 = distinct !{!51, !48}


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