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

@.str.15 = external hidden unnamed_addr constant [4 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: 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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7SGTELIB20Surrogate_Parameters10get_weightEv(ptr dead_on_unwind noalias writable sret(%"class.SGTELIB::Matrix") align 8, ptr noundef nonnull align 8 dereferenceable(312)) #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) #6 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7SGTELIB18Surrogate_Ensemble15predict_privateERKNS_6MatrixEPS1_(ptr noundef nonnull align 8 dereferenceable(1040) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef %2) unnamed_addr #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 %"class.SGTELIB::Matrix", align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator", align 1
  %14 = alloca i1, align 1
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr %7) #9
  %21 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %20, i32 0, i32 2
  call void @_ZNK7SGTELIB20Surrogate_Parameters10get_weightEv(ptr dead_on_unwind writable sret(%"class.SGTELIB::Matrix") align 8 %7, ptr noundef nonnull align 8 dereferenceable(312) %21)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = invoke noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56) %22)
          to label %24 unwind label %40

24:                                               ; preds = %3
  store i32 %23, ptr %8, align 4, !tbaa !9
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN7SGTELIB6Matrix4fillEd(ptr noundef nonnull align 8 dereferenceable(56) %25, double noundef 0.000000e+00)
          to label %26 unwind label %40

26:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %27 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 56) #10
          to label %28 unwind label %44

28:                                               ; preds = %26
  store i1 true, ptr %14, align 1
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.15, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %29 unwind label %48

29:                                               ; preds = %28
  %30 = load i32, ptr %8, align 4, !tbaa !9
  %31 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %20, i32 0, i32 4
  %32 = load i32, ptr %31, align 4, !tbaa !11
  invoke void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull align 8 dereferenceable(32) %12, i32 noundef %30, i32 noundef %32)
          to label %33 unwind label %52

33:                                               ; preds = %29
  store i1 false, ptr %14, align 1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #9
  store ptr %27, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %136, %33
  %35 = load i32, ptr %16, align 4, !tbaa !9
  %36 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble", ptr %20, i32 0, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !48
  %38 = icmp slt i32 %35, %37
  br i1 %38, label %60, label %39

39:                                               ; preds = %34
  store i32 2, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  br label %140

40:                                               ; preds = %24, %3
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %9, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %10, align 4
  br label %149

44:                                               ; preds = %26
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %9, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %10, align 4
  br label %148

48:                                               ; preds = %28
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %9, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %10, align 4
  br label %56

52:                                               ; preds = %29
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %9, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %10, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  br label %56

56:                                               ; preds = %52, %48
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #9
  %57 = load i1, ptr %14, align 1
  br i1 %57, label %58, label %59

58:                                               ; preds = %56
  call void @_ZdlPvm(ptr noundef %27, i64 noundef 56) #11
  br label %59

59:                                               ; preds = %58, %56
  br label %148

60:                                               ; preds = %34
  %61 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble", ptr %20, i32 0, i32 4
  %62 = load ptr, ptr %61, align 8, !tbaa !54
  %63 = load i32, ptr %16, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i8, ptr %62, i64 %64
  %66 = load i8, ptr %65, align 1, !tbaa !55, !range !56, !noundef !57
  %67 = trunc i8 %66 to i1
  br i1 %67, label %68, label %135

68:                                               ; preds = %60
  %69 = getelementptr inbounds %"class.SGTELIB::Surrogate_Ensemble", ptr %20, i32 0, i32 3
  %70 = load i32, ptr %16, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7SGTELIB9SurrogateESaIS2_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %71)
          to label %73 unwind label %87

73:                                               ; preds = %68
  %74 = load ptr, ptr %72, align 8, !tbaa !5
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = load ptr, ptr %74, align 8, !tbaa !58
  %78 = getelementptr inbounds ptr, ptr %77, i64 4
  %79 = load ptr, ptr %78, align 8
  invoke void %79(ptr noundef nonnull align 8 dereferenceable(985) %74, ptr noundef nonnull align 8 dereferenceable(56) %75, ptr noundef %76)
          to label %80 unwind label %87

80:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %130, %80
  %82 = load i32, ptr %18, align 4, !tbaa !9
  %83 = getelementptr inbounds %"class.SGTELIB::Surrogate", ptr %20, i32 0, i32 4
  %84 = load i32, ptr %83, align 4, !tbaa !11
  %85 = icmp slt i32 %82, %84
  br i1 %85, label %91, label %86

86:                                               ; preds = %81
  store i32 5, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  br label %134

87:                                               ; preds = %73, %68
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %9, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %10, align 4
  br label %139

91:                                               ; preds = %81
  %92 = load i32, ptr %16, align 4, !tbaa !9
  %93 = load i32, ptr %18, align 4, !tbaa !9
  %94 = invoke noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %92, i32 noundef %93)
          to label %95 unwind label %101

95:                                               ; preds = %91
  store double %94, ptr %15, align 8, !tbaa !60
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %96

96:                                               ; preds = %122, %95
  %97 = load i32, ptr %19, align 4, !tbaa !9
  %98 = load i32, ptr %8, align 4, !tbaa !9
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %105, label %100

100:                                              ; preds = %96
  store i32 8, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %129

101:                                              ; preds = %91
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %9, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %10, align 4
  br label %133

105:                                              ; preds = %96
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = load i32, ptr %19, align 4, !tbaa !9
  %108 = load i32, ptr %18, align 4, !tbaa !9
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = load i32, ptr %19, align 4, !tbaa !9
  %111 = load i32, ptr %18, align 4, !tbaa !9
  %112 = invoke noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %109, i32 noundef %110, i32 noundef %111)
          to label %113 unwind label %125

113:                                              ; preds = %105
  %114 = load double, ptr %15, align 8, !tbaa !60
  %115 = load ptr, ptr %11, align 8, !tbaa !5
  %116 = load i32, ptr %19, align 4, !tbaa !9
  %117 = load i32, ptr %18, align 4, !tbaa !9
  %118 = invoke noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %115, i32 noundef %116, i32 noundef %117)
          to label %119 unwind label %125

119:                                              ; preds = %113
  %120 = call double @llvm.fmuladd.f64(double %114, double %118, double %112)
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %106, i32 noundef %107, i32 noundef %108, double noundef %120)
          to label %121 unwind label %125

121:                                              ; preds = %119
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %19, align 4, !tbaa !9
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %19, align 4, !tbaa !9
  br label %96, !llvm.loop !61

125:                                              ; preds = %119, %113, %105
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %9, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %133

129:                                              ; preds = %100
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %18, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %18, align 4, !tbaa !9
  br label %81, !llvm.loop !63

133:                                              ; preds = %125, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  br label %139

134:                                              ; preds = %86
  br label %135

135:                                              ; preds = %134, %60
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %16, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %16, align 4, !tbaa !9
  br label %34, !llvm.loop !64

139:                                              ; preds = %133, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  br label %148

140:                                              ; preds = %39
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = icmp eq ptr %141, null
  br i1 %142, label %147, label %143

143:                                              ; preds = %140
  %144 = load ptr, ptr %141, align 8, !tbaa !58
  %145 = getelementptr inbounds ptr, ptr %144, i64 1
  %146 = load ptr, ptr %145, align 8
  call void %146(ptr noundef nonnull align 8 dereferenceable(56) %141) #9
  br label %147

147:                                              ; preds = %143, %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %7) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr %7) #9
  ret void

148:                                              ; preds = %139, %59, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  br label %149

149:                                              ; preds = %148, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %7) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr %7) #9
  br label %150

150:                                              ; preds = %149
  %151 = load ptr, ptr %9, align 8
  %152 = load i32, ptr %10, align 4
  %153 = insertvalue { ptr, i32 } poison, ptr %151, 0
  %154 = insertvalue { ptr, i32 } %153, i32 %152, 1
  resume { ptr, i32 } %154
}

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #8

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 = { nobuiltin 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 #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nobuiltin allocsize(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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin 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 332}
!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 = !{!49, !10, i64 988}
!49 = !{!"_ZTSN7SGTELIB18Surrogate_EnsembleE", !12, i64 0, !10, i64 988, !10, i64 992, !50, i64 1000, !6, i64 1024, !6, i64 1032}
!50 = !{!"_ZTSSt6vectorIPN7SGTELIB9SurrogateESaIS2_EE", !51, i64 0}
!51 = !{!"_ZTSSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE", !52, i64 0}
!52 = !{!"_ZTSNSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE12_Vector_implE", !53, i64 0}
!53 = !{!"_ZTSNSt12_Vector_baseIPN7SGTELIB9SurrogateESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!54 = !{!49, !6, i64 1024}
!55 = !{!26, !26, i64 0}
!56 = !{i8 0, i8 2}
!57 = !{}
!58 = !{!59, !59, i64 0}
!59 = !{!"vtable pointer", !8, i64 0}
!60 = !{!17, !17, i64 0}
!61 = distinct !{!61, !62}
!62 = !{!"llvm.loop.mustprogress"}
!63 = distinct !{!63, !62}
!64 = distinct !{!64, !62}


; 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.15 = external hidden unnamed_addr constant [4 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: 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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7SGTELIB20Surrogate_Parameters10get_weightEv(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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7SGTELIB18Surrogate_Ensemble15predict_privateERKNS_6MatrixEPS1_(ptr noundef nonnull align 8 dereferenceable(1040) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.SGTELIB::Matrix", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #9
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  call void @_ZNK7SGTELIB20Surrogate_Parameters10get_weightEv(ptr dead_on_unwind nonnull writable sret(%"class.SGTELIB::Matrix") align 8 %4, ptr noundef nonnull align 8 dereferenceable(312) %7)
  %8 = call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  invoke void @_ZN7SGTELIB6Matrix4fillEd(ptr noundef nonnull align 8 dereferenceable(56) %2, double noundef 0.000000e+00)
          to label %9 unwind label %51

9:                                                ; preds = %3
  %10 = invoke noalias noundef nonnull dereferenceable(56) ptr @_Znwm(i64 noundef 56) #10
          to label %11 unwind label %53

11:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.15, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %12 unwind label %55

12:                                               ; preds = %11
  %13 = getelementptr inbounds i8, ptr %0, i64 332
  %14 = load i32, ptr %13, align 4, !tbaa !5
  invoke void @_ZN7SGTELIB6MatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(56) %10, ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef %8, i32 noundef %14)
          to label %15 unwind label %57

15:                                               ; preds = %12
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  %16 = getelementptr inbounds i8, ptr %0, i64 988
  %17 = load i32, ptr %16, align 4, !tbaa !46
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %15
  %19 = getelementptr inbounds i8, ptr %0, i64 1024
  %20 = getelementptr inbounds i8, ptr %0, i64 1000
  %21 = icmp sgt i32 %8, 0
  br i1 %21, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.loopexit.us
  %indvars.iv52 = phi i64 [ %indvars.iv.next53, %.loopexit.us ], [ 0, %.lr.ph ]
  %22 = load ptr, ptr %19, align 8, !tbaa !52
  %23 = getelementptr inbounds i8, ptr %22, i64 %indvars.iv52
  %24 = load i8, ptr %23, align 1, !tbaa !53, !range !54, !noundef !55
  %25 = trunc nuw i8 %24 to i1
  br i1 %25, label %26, label %.loopexit.us

26:                                               ; preds = %.lr.ph.split.us
  %27 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7SGTELIB9SurrogateESaIS2_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %indvars.iv52)
          to label %28 unwind label %.split.us48

28:                                               ; preds = %26
  %29 = load ptr, ptr %27, align 8, !tbaa !56
  %30 = load ptr, ptr %29, align 8, !tbaa !57
  %31 = getelementptr inbounds i8, ptr %30, i64 32
  %32 = load ptr, ptr %31, align 8
  invoke void %32(ptr noundef nonnull align 8 dereferenceable(985) %29, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull %10)
          to label %.preheader.us unwind label %.split.us48

.loopexit.us:                                     ; preds = %._crit_edge.us.us, %.preheader.us, %.lr.ph.split.us
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %33 = load i32, ptr %16, align 4, !tbaa !46
  %34 = sext i32 %33 to i64
  %35 = icmp slt i64 %indvars.iv.next53, %34
  br i1 %35, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !59

.preheader.us:                                    ; preds = %28
  %36 = load i32, ptr %13, align 4, !tbaa !5
  %37 = icmp sgt i32 %36, 0
  br i1 %37, label %.lr.ph.us.us.preheader, label %.loopexit.us

.lr.ph.us.us.preheader:                           ; preds = %.preheader.us
  %38 = trunc nuw nsw i64 %indvars.iv52 to i32
  br label %.lr.ph.us.us

.lr.ph.us.us:                                     ; preds = %.lr.ph.us.us.preheader, %._crit_edge.us.us
  %.03043.us.us = phi i32 [ %46, %._crit_edge.us.us ], [ 0, %.lr.ph.us.us.preheader ]
  %39 = call noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %38, i32 noundef %.03043.us.us)
  br label %40

40:                                               ; preds = %44, %.lr.ph.us.us
  %.042.us.us = phi i32 [ 0, %.lr.ph.us.us ], [ %45, %44 ]
  %41 = call noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %2, i32 noundef %.042.us.us, i32 noundef %.03043.us.us)
  %42 = call noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %10, i32 noundef %.042.us.us, i32 noundef %.03043.us.us)
  %43 = call double @llvm.fmuladd.f64(double %39, double %42, double %41)
  invoke void @_ZN7SGTELIB6Matrix3setEiid(ptr noundef nonnull align 8 dereferenceable(56) %2, i32 noundef %.042.us.us, i32 noundef %.03043.us.us, double noundef %43)
          to label %44 unwind label %.split.us.split.us

44:                                               ; preds = %40
  %45 = add nuw nsw i32 %.042.us.us, 1
  %exitcond.not = icmp eq i32 %45, %8
  br i1 %exitcond.not, label %._crit_edge.us.us, label %40, !llvm.loop !61

._crit_edge.us.us:                                ; preds = %44
  %46 = add nuw nsw i32 %.03043.us.us, 1
  %47 = load i32, ptr %13, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %.lr.ph.us.us, label %.loopexit.us, !llvm.loop !62

.split.us48:                                      ; preds = %28, %26
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %85

.split.us.split.us:                               ; preds = %40
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %85

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

53:                                               ; preds = %9
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %85

55:                                               ; preds = %11
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %59

57:                                               ; preds = %12
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  br label %59

59:                                               ; preds = %57, %55
  %.pn = phi { ptr, i32 } [ %58, %57 ], [ %56, %55 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  call void @_ZdlPvm(ptr noundef nonnull %10, i64 noundef 56) #11
  br label %85

.lr.ph.split:                                     ; preds = %.lr.ph, %.loopexit
  %indvars.iv = phi i64 [ %indvars.iv.next, %.loopexit ], [ 0, %.lr.ph ]
  %60 = load ptr, ptr %19, align 8, !tbaa !52
  %61 = getelementptr inbounds i8, ptr %60, i64 %indvars.iv
  %62 = load i8, ptr %61, align 1, !tbaa !53, !range !54, !noundef !55
  %63 = trunc nuw i8 %62 to i1
  br i1 %63, label %64, label %.loopexit

64:                                               ; preds = %.lr.ph.split
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7SGTELIB9SurrogateESaIS2_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %indvars.iv)
          to label %66 unwind label %.split

66:                                               ; preds = %64
  %67 = load ptr, ptr %65, align 8, !tbaa !56
  %68 = load ptr, ptr %67, align 8, !tbaa !57
  %69 = getelementptr inbounds i8, ptr %68, i64 32
  %70 = load ptr, ptr %69, align 8
  invoke void %70(ptr noundef nonnull align 8 dereferenceable(985) %67, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull %10)
          to label %.preheader unwind label %.split

.preheader:                                       ; preds = %66
  %71 = load i32, ptr %13, align 4, !tbaa !5
  %72 = icmp sgt i32 %71, 0
  br i1 %72, label %.lr.ph44.preheader, label %.loopexit

.lr.ph44.preheader:                               ; preds = %.preheader
  %73 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.lr.ph44

.split:                                           ; preds = %66, %64
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %85

.lr.ph44:                                         ; preds = %.lr.ph44.preheader, %.lr.ph44
  %.03043 = phi i32 [ %76, %.lr.ph44 ], [ 0, %.lr.ph44.preheader ]
  %75 = call noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %73, i32 noundef %.03043)
  %76 = add nuw nsw i32 %.03043, 1
  %77 = load i32, ptr %13, align 4, !tbaa !5
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %.lr.ph44, label %.loopexit, !llvm.loop !62

.loopexit:                                        ; preds = %.lr.ph44, %.preheader, %.lr.ph.split
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %79 = load i32, ptr %16, align 4, !tbaa !46
  %80 = sext i32 %79 to i64
  %81 = icmp slt i64 %indvars.iv.next, %80
  br i1 %81, label %.lr.ph.split, label %._crit_edge, !llvm.loop !59

._crit_edge:                                      ; preds = %.loopexit, %.loopexit.us, %15
  %82 = load ptr, ptr %10, align 8, !tbaa !57
  %83 = getelementptr inbounds i8, ptr %82, i64 8
  %84 = load ptr, ptr %83, align 8
  call void %84(ptr noundef nonnull align 8 dereferenceable(56) %10) #9
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #9
  ret void

85:                                               ; preds = %.split, %.split.us48, %53, %59, %.split.us.split.us, %51
  %.pn38.pn.pn = phi { ptr, i32 } [ %52, %51 ], [ %.pn, %59 ], [ %54, %53 ], [ %50, %.split.us.split.us ], [ %74, %.split ], [ %49, %.split.us48 ]
  call void @_ZN7SGTELIB6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #9
  resume { ptr, i32 } %.pn38.pn.pn
}

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #8

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 = { nobuiltin 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 #6 = { 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 #7 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nobuiltin allocsize(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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin nounwind }

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass