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

; 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::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.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] }

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

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

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

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

declare noundef double @_ZNK7SGTELIB6Matrix3getEi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN7SGTELIB20Surrogate_Parameters13get_x_penaltyEv(ptr noundef nonnull align 8 dereferenceable(312) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca double, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %11 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store double 0.000000e+00, ptr %3, align 8, !tbaa !9
  %12 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 3
  %13 = load i32, ptr %12, align 8, !tbaa !11
  %14 = icmp eq i32 %13, 1
  br i1 %14, label %15, label %21

15:                                               ; preds = %1
  %16 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 2
  %17 = load i32, ptr %16, align 4, !tbaa !25
  %18 = sitofp i32 %17 to double
  %19 = load double, ptr %3, align 8, !tbaa !9
  %20 = fadd double %19, %18
  store double %20, ptr %3, align 8, !tbaa !9
  br label %21

21:                                               ; preds = %15, %1
  %22 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 9
  %23 = load i32, ptr %22, align 8, !tbaa !26
  %24 = icmp eq i32 %23, 1
  br i1 %24, label %25, label %31

25:                                               ; preds = %21
  %26 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 8
  %27 = load double, ptr %26, align 8, !tbaa !27
  %28 = call double @log(double noundef %27) #7
  %29 = load double, ptr %3, align 8, !tbaa !9
  %30 = fadd double %29, %28
  store double %30, ptr %3, align 8, !tbaa !9
  br label %31

31:                                               ; preds = %25, %21
  %32 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 7
  %33 = load i32, ptr %32, align 8, !tbaa !28
  %34 = icmp eq i32 %33, 1
  br i1 %34, label %35, label %41

35:                                               ; preds = %31
  %36 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 6
  %37 = load double, ptr %36, align 8, !tbaa !29
  %38 = call double @log(double noundef %37) #7
  %39 = load double, ptr %3, align 8, !tbaa !9
  %40 = fadd double %39, %38
  store double %40, ptr %3, align 8, !tbaa !9
  br label %41

41:                                               ; preds = %35, %31
  %42 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 11
  %43 = load i32, ptr %42, align 8, !tbaa !30
  %44 = icmp eq i32 %43, 1
  br i1 %44, label %45, label %58

45:                                               ; preds = %41
  %46 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 10
  %47 = load i32, ptr %46, align 4, !tbaa !31
  switch i32 %47, label %57 [
    i32 0, label %48
    i32 1, label %51
    i32 2, label %51
    i32 3, label %54
    i32 4, label %54
  ]

48:                                               ; preds = %45
  %49 = load double, ptr %3, align 8, !tbaa !9
  %50 = fadd double %49, 0.000000e+00
  store double %50, ptr %3, align 8, !tbaa !9
  br label %57

51:                                               ; preds = %45, %45
  %52 = load double, ptr %3, align 8, !tbaa !9
  %53 = fadd double %52, 1.000000e+00
  store double %53, ptr %3, align 8, !tbaa !9
  br label %57

54:                                               ; preds = %45, %45
  %55 = load double, ptr %3, align 8, !tbaa !9
  %56 = fadd double %55, 1.000000e+01
  store double %56, ptr %3, align 8, !tbaa !9
  br label %57

57:                                               ; preds = %54, %51, %48, %45
  br label %58

58:                                               ; preds = %57, %41
  %59 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 21
  %60 = load i32, ptr %59, align 8, !tbaa !32
  %61 = icmp eq i32 %60, 1
  br i1 %61, label %62, label %89

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %63 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 20
  %64 = call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_colsEv(ptr noundef nonnull align 8 dereferenceable(56) %63)
  %65 = sdiv i32 %64, 2
  store i32 %65, ptr %4, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !33
  br label %66

66:                                               ; preds = %85, %62
  %67 = load i32, ptr %6, align 4, !tbaa !33
  %68 = load i32, ptr %4, align 4, !tbaa !33
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %88

71:                                               ; preds = %66
  %72 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 20
  %73 = load i32, ptr %5, align 4, !tbaa !33
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %5, align 4, !tbaa !33
  %75 = call noundef double @_ZNK7SGTELIB6Matrix3getEi(ptr noundef nonnull align 8 dereferenceable(56) %72, i32 noundef %73)
  %76 = load double, ptr %3, align 8, !tbaa !9
  %77 = fsub double %76, %75
  store double %77, ptr %3, align 8, !tbaa !9
  %78 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 20
  %79 = load i32, ptr %5, align 4, !tbaa !33
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %5, align 4, !tbaa !33
  %81 = call noundef double @_ZNK7SGTELIB6Matrix3getEi(ptr noundef nonnull align 8 dereferenceable(56) %78, i32 noundef %79)
  %82 = call double @log(double noundef %81) #7
  %83 = load double, ptr %3, align 8, !tbaa !9
  %84 = fadd double %83, %82
  store double %84, ptr %3, align 8, !tbaa !9
  br label %85

85:                                               ; preds = %71
  %86 = load i32, ptr %6, align 4, !tbaa !33
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %6, align 4, !tbaa !33
  br label %66, !llvm.loop !34

88:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %89

89:                                               ; preds = %88, %58
  %90 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 14
  %91 = load i32, ptr %90, align 4, !tbaa !36
  %92 = icmp eq i32 %91, 1
  br i1 %92, label %93, label %124

93:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !33
  br label %94

94:                                               ; preds = %120, %93
  %95 = load i32, ptr %8, align 4, !tbaa !33
  %96 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 12
  %97 = call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56) %96)
  %98 = icmp slt i32 %95, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %94
  store i32 6, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %123

100:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !33
  br label %101

101:                                              ; preds = %116, %100
  %102 = load i32, ptr %10, align 4, !tbaa !33
  %103 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 12
  %104 = call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_colsEv(ptr noundef nonnull align 8 dereferenceable(56) %103)
  %105 = icmp slt i32 %102, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %101
  store i32 9, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %119

107:                                              ; preds = %101
  %108 = getelementptr inbounds %"class.SGTELIB::Surrogate_Parameters", ptr %11, i32 0, i32 12
  %109 = load i32, ptr %8, align 4, !tbaa !33
  %110 = load i32, ptr %10, align 4, !tbaa !33
  %111 = call noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %108, i32 noundef %109, i32 noundef %110)
  store double %111, ptr %7, align 8, !tbaa !9
  %112 = load double, ptr %7, align 8, !tbaa !9
  %113 = load double, ptr %7, align 8, !tbaa !9
  %114 = load double, ptr %3, align 8, !tbaa !9
  %115 = call double @llvm.fmuladd.f64(double %112, double %113, double %114)
  store double %115, ptr %3, align 8, !tbaa !9
  br label %116

116:                                              ; preds = %107
  %117 = load i32, ptr %10, align 4, !tbaa !33
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %10, align 4, !tbaa !33
  br label %101, !llvm.loop !37

119:                                              ; preds = %106
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %8, align 4, !tbaa !33
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %8, align 4, !tbaa !33
  br label %94, !llvm.loop !38

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

124:                                              ; preds = %123, %89
  %125 = load double, ptr %3, align 8, !tbaa !9
  %126 = call noundef zeroext i1 @_ZSt5isinfd(double noundef %125)
  br i1 %126, label %127, label %128

127:                                              ; preds = %124
  store double 0x7FEFFFFFFFFFFFFF, ptr %3, align 8, !tbaa !9
  br label %128

128:                                              ; preds = %127, %124
  %129 = load double, ptr %3, align 8, !tbaa !9
  %130 = call noundef zeroext i1 @_ZSt5isnand(double noundef %129)
  br i1 %130, label %131, label %132

131:                                              ; preds = %128
  store double 0x7FEFFFFFFFFFFFFF, ptr %3, align 8, !tbaa !9
  br label %132

132:                                              ; preds = %131, %128
  %133 = load double, ptr %3, align 8, !tbaa !9
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  ret double %133
}

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !15, i64 16}
!12 = !{!"_ZTSN7SGTELIB20Surrogate_ParametersE", !13, i64 8, !14, i64 12, !15, i64 16, !16, i64 20, !15, i64 24, !10, i64 32, !15, i64 40, !10, i64 48, !15, i64 56, !17, i64 60, !15, i64 64, !18, i64 72, !22, i64 128, !15, i64 132, !23, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !18, i64 176, !15, i64 232, !24, i64 236, !19, i64 240, !19, i64 272, !14, i64 304, !14, i64 308}
!13 = !{!"_ZTSN7SGTELIB7model_tE", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSN7SGTELIB14param_status_tE", !7, i64 0}
!16 = !{!"_ZTSN7SGTELIB8kernel_tE", !7, i64 0}
!17 = !{!"_ZTSN7SGTELIB10distance_tE", !7, i64 0}
!18 = !{!"_ZTSN7SGTELIB6MatrixE", !19, i64 8, !14, i64 40, !14, i64 44, !6, i64 48}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !21, i64 8, !7, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSN7SGTELIB8weight_tE", !7, i64 0}
!23 = !{!"_ZTSN7SGTELIB13uncertainty_tE", !7, i64 0}
!24 = !{!"_ZTSN7SGTELIB8metric_tE", !7, i64 0}
!25 = !{!12, !14, i64 12}
!26 = !{!12, !15, i64 56}
!27 = !{!12, !10, i64 48}
!28 = !{!12, !15, i64 40}
!29 = !{!12, !10, i64 32}
!30 = !{!12, !15, i64 64}
!31 = !{!12, !17, i64 60}
!32 = !{!12, !15, i64 232}
!33 = !{!14, !14, i64 0}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{!12, !15, i64 132}
!37 = distinct !{!37, !35}
!38 = distinct !{!38, !35}


; 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"

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #0 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 #0 align 2

declare noundef double @_ZNK7SGTELIB6Matrix3getEi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN7SGTELIB20Surrogate_Parameters13get_x_penaltyEv(ptr noundef nonnull align 8 dereferenceable(312) %0) local_unnamed_addr #2 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 16
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %4 = icmp eq i32 %3, 1
  %5 = getelementptr inbounds i8, ptr %0, i64 12
  %6 = load i32, ptr %5, align 4
  %7 = sitofp i32 %6 to double
  %.026 = select i1 %4, double %7, double 0.000000e+00
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  %9 = load i32, ptr %8, align 8, !tbaa !23
  %10 = icmp eq i32 %9, 1
  br i1 %10, label %11, label %16

11:                                               ; preds = %1
  %12 = getelementptr inbounds i8, ptr %0, i64 48
  %13 = load double, ptr %12, align 8, !tbaa !24
  %14 = tail call double @log(double noundef %13) #6
  %15 = fadd double %.026, %14
  br label %16

16:                                               ; preds = %11, %1
  %.1 = phi double [ %15, %11 ], [ %.026, %1 ]
  %17 = getelementptr inbounds i8, ptr %0, i64 40
  %18 = load i32, ptr %17, align 8, !tbaa !25
  %19 = icmp eq i32 %18, 1
  br i1 %19, label %20, label %25

20:                                               ; preds = %16
  %21 = getelementptr inbounds i8, ptr %0, i64 32
  %22 = load double, ptr %21, align 8, !tbaa !26
  %23 = tail call double @log(double noundef %22) #6
  %24 = fadd double %.1, %23
  br label %25

25:                                               ; preds = %20, %16
  %.2 = phi double [ %24, %20 ], [ %.1, %16 ]
  %26 = getelementptr inbounds i8, ptr %0, i64 64
  %27 = load i32, ptr %26, align 8, !tbaa !27
  %28 = icmp eq i32 %27, 1
  br i1 %28, label %29, label %38

29:                                               ; preds = %25
  %30 = getelementptr inbounds i8, ptr %0, i64 60
  %31 = load i32, ptr %30, align 4, !tbaa !28
  switch i32 %31, label %38 [
    i32 0, label %32
    i32 1, label %34
    i32 2, label %34
    i32 3, label %36
    i32 4, label %36
  ]

32:                                               ; preds = %29
  %33 = fadd double %.2, 0.000000e+00
  br label %38

34:                                               ; preds = %29, %29
  %35 = fadd double %.2, 1.000000e+00
  br label %38

36:                                               ; preds = %29, %29
  %37 = fadd double %.2, 1.000000e+01
  br label %38

38:                                               ; preds = %29, %32, %34, %36, %25
  %.3 = phi double [ %.2, %29 ], [ %37, %36 ], [ %35, %34 ], [ %33, %32 ], [ %.2, %25 ]
  %39 = getelementptr inbounds i8, ptr %0, i64 232
  %40 = load i32, ptr %39, align 8, !tbaa !29
  %41 = icmp eq i32 %40, 1
  br i1 %41, label %42, label %.loopexit30

42:                                               ; preds = %38
  %43 = getelementptr inbounds i8, ptr %0, i64 176
  %44 = tail call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_colsEv(ptr noundef nonnull align 8 dereferenceable(56) %43)
  %45 = sdiv i32 %44, 2
  %46 = icmp sgt i32 %44, 1
  br i1 %46, label %.lr.ph, label %.loopexit30

.lr.ph:                                           ; preds = %42, %.lr.ph
  %.433 = phi double [ %53, %.lr.ph ], [ %.3, %42 ]
  %.02732 = phi i32 [ %54, %.lr.ph ], [ 0, %42 ]
  %.02831 = phi i32 [ %50, %.lr.ph ], [ 0, %42 ]
  %47 = or disjoint i32 %.02831, 1
  %48 = tail call noundef double @_ZNK7SGTELIB6Matrix3getEi(ptr noundef nonnull align 8 dereferenceable(56) %43, i32 noundef %.02831)
  %49 = fsub double %.433, %48
  %50 = add nuw nsw i32 %.02831, 2
  %51 = tail call noundef double @_ZNK7SGTELIB6Matrix3getEi(ptr noundef nonnull align 8 dereferenceable(56) %43, i32 noundef %47)
  %52 = tail call double @log(double noundef %51) #6
  %53 = fadd double %49, %52
  %54 = add nuw nsw i32 %.02732, 1
  %exitcond.not = icmp eq i32 %54, %45
  br i1 %exitcond.not, label %.loopexit30, label %.lr.ph, !llvm.loop !30

.loopexit30:                                      ; preds = %.lr.ph, %42, %38
  %.5 = phi double [ %.3, %38 ], [ %.3, %42 ], [ %53, %.lr.ph ]
  %55 = getelementptr inbounds i8, ptr %0, i64 132
  %56 = load i32, ptr %55, align 4, !tbaa !32
  %57 = icmp eq i32 %56, 1
  br i1 %57, label %.preheader29, label %.loopexit

.preheader29:                                     ; preds = %.loopexit30
  %58 = getelementptr inbounds i8, ptr %0, i64 72
  %59 = tail call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56) %58)
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %.preheader29, %._crit_edge
  %.02539 = phi i32 [ %63, %._crit_edge ], [ 0, %.preheader29 ]
  %.638 = phi double [ %.7.lcssa, %._crit_edge ], [ %.5, %.preheader29 ]
  %61 = tail call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_colsEv(ptr noundef nonnull align 8 dereferenceable(56) %58)
  %62 = icmp sgt i32 %61, 0
  br i1 %62, label %.lr.ph36, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph36, %.preheader
  %.7.lcssa = phi double [ %.638, %.preheader ], [ %67, %.lr.ph36 ]
  %63 = add nuw nsw i32 %.02539, 1
  %64 = tail call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_rowsEv(ptr noundef nonnull align 8 dereferenceable(56) %58)
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %.preheader, label %.loopexit, !llvm.loop !33

.lr.ph36:                                         ; preds = %.preheader, %.lr.ph36
  %.035 = phi i32 [ %68, %.lr.ph36 ], [ 0, %.preheader ]
  %.734 = phi double [ %67, %.lr.ph36 ], [ %.638, %.preheader ]
  %66 = tail call noundef double @_ZNK7SGTELIB6Matrix3getEii(ptr noundef nonnull align 8 dereferenceable(56) %58, i32 noundef %.02539, i32 noundef %.035)
  %67 = tail call double @llvm.fmuladd.f64(double %66, double %66, double %.734)
  %68 = add nuw nsw i32 %.035, 1
  %69 = tail call noundef i32 @_ZNK7SGTELIB6Matrix11get_nb_colsEv(ptr noundef nonnull align 8 dereferenceable(56) %58)
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %.lr.ph36, label %._crit_edge, !llvm.loop !34

.loopexit:                                        ; preds = %._crit_edge, %.preheader29, %.loopexit30
  %.8 = phi double [ %.5, %.loopexit30 ], [ %.5, %.preheader29 ], [ %.7.lcssa, %._crit_edge ]
  %71 = tail call noundef zeroext i1 @_ZSt5isinfd(double noundef %.8)
  %.9 = select i1 %71, double 0x7FEFFFFFFFFFFFFF, double %.8
  %72 = tail call noundef zeroext i1 @_ZSt5isnand(double noundef %.9)
  %.10 = select i1 %72, double 0x7FEFFFFFFFFFFFFF, double %.9
  ret double %.10
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log(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) #4

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

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

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !11, i64 16}
!6 = !{!"_ZTSN7SGTELIB20Surrogate_ParametersE", !7, i64 8, !10, i64 12, !11, i64 16, !12, i64 20, !11, i64 24, !13, i64 32, !11, i64 40, !13, i64 48, !11, i64 56, !14, i64 60, !11, i64 64, !15, i64 72, !20, i64 128, !11, i64 132, !21, i64 136, !13, i64 144, !13, i64 152, !13, i64 160, !13, i64 168, !15, i64 176, !11, i64 232, !22, i64 236, !16, i64 240, !16, i64 272, !10, i64 304, !10, i64 308}
!7 = !{!"_ZTSN7SGTELIB7model_tE", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTSN7SGTELIB14param_status_tE", !8, i64 0}
!12 = !{!"_ZTSN7SGTELIB8kernel_tE", !8, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!"_ZTSN7SGTELIB10distance_tE", !8, i64 0}
!15 = !{!"_ZTSN7SGTELIB6MatrixE", !16, i64 8, !10, i64 40, !10, i64 44, !18, i64 48}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !17, i64 0, !19, i64 8, !8, i64 16}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !18, i64 0}
!18 = !{!"any pointer", !8, i64 0}
!19 = !{!"long", !8, i64 0}
!20 = !{!"_ZTSN7SGTELIB8weight_tE", !8, i64 0}
!21 = !{!"_ZTSN7SGTELIB13uncertainty_tE", !8, i64 0}
!22 = !{!"_ZTSN7SGTELIB8metric_tE", !8, i64 0}
!23 = !{!6, !11, i64 56}
!24 = !{!6, !13, i64 48}
!25 = !{!6, !11, i64 40}
!26 = !{!6, !13, i64 32}
!27 = !{!6, !11, i64 64}
!28 = !{!6, !14, i64 60}
!29 = !{!6, !11, i64 232}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!6, !11, i64 132}
!33 = distinct !{!33, !31}
!34 = distinct !{!34, !31}


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