; LLVM IR from Rhoban/IKWalk :: CubicSpline.ll (ZN4Leph11CubicSpline14computeSplinesEv)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%class.anon = type { i8 }
%"struct.Leph::Spline::Spline_t" = type { %"class.Leph::Polynom", double, double }
%"class.Leph::Polynom" = type { %"class.std::vector.5" }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Leph::Spline" = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Leph::Spline::Spline_t, std::allocator<Leph::Spline::Spline_t>>::_Vector_impl" }
%"struct.std::_Vector_base<Leph::Spline::Spline_t, std::allocator<Leph::Spline::Spline_t>>::_Vector_impl" = type { %"struct.std::_Vector_base<Leph::Spline::Spline_t, std::allocator<Leph::Spline::Spline_t>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Leph::Spline::Spline_t, std::allocator<Leph::Spline::Spline_t>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Leph::CubicSpline" = type { %"class.Leph::Spline", %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Leph::CubicSpline::Point, std::allocator<Leph::CubicSpline::Point>>::_Vector_impl" }
%"struct.std::_Vector_base<Leph::CubicSpline::Point, std::allocator<Leph::CubicSpline::Point>>::_Vector_impl" = type { %"struct.std::_Vector_base<Leph::CubicSpline::Point, std::allocator<Leph::CubicSpline::Point>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Leph::CubicSpline::Point, std::allocator<Leph::CubicSpline::Point>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.Leph::CubicSpline::Point" = type { double, double, double }

; 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: mustprogress uwtable
define dso_local void @_ZN4Leph11CubicSpline14computeSplinesEv(ptr noundef nonnull align 8 dereferenceable(48) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %class.anon, align 1
  %6 = alloca i64, align 8
  %7 = alloca double, align 8
  %8 = alloca %"struct.Leph::Spline::Spline_t", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %11 = load ptr, ptr %2, align 8
  %12 = getelementptr inbounds %"class.Leph::Spline", ptr %11, i32 0, i32 0
  call void @_ZNSt6vectorIN4Leph6Spline8Spline_tESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  %13 = getelementptr inbounds %"class.Leph::CubicSpline", ptr %11, i32 0, i32 1
  %14 = call noundef i64 @_ZNKSt6vectorIN4Leph11CubicSpline5PointESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %15 = icmp ult i64 %14, 2
  br i1 %15, label %16, label %17

16:                                               ; preds = %1
  br label %97

17:                                               ; preds = %1
  %18 = getelementptr inbounds %"class.Leph::CubicSpline", ptr %11, i32 0, i32 1
  %19 = call ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  %20 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %3, i32 0, i32 0
  store ptr %19, ptr %20, align 8
  %21 = getelementptr inbounds %"class.Leph::CubicSpline", ptr %11, i32 0, i32 1
  %22 = call ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  %23 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  %24 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %3, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8
  %26 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8
  call void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPN4Leph11CubicSpline5PointESt6vectorIS4_SaIS4_EEEEZNS3_14computeSplinesEvE3$_0EvT_SB_T0_"(ptr %25, ptr %27)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 1, ptr %6, align 8, !tbaa !9
  br label %28

28:                                               ; preds = %94, %17
  %29 = load i64, ptr %6, align 8, !tbaa !9
  %30 = getelementptr inbounds %"class.Leph::CubicSpline", ptr %11, i32 0, i32 1
  %31 = call noundef i64 @_ZNKSt6vectorIN4Leph11CubicSpline5PointESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #5
  %32 = icmp ult i64 %29, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %97

34:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %35 = getelementptr inbounds %"class.Leph::CubicSpline", ptr %11, i32 0, i32 1
  %36 = load i64, ptr %6, align 8, !tbaa !9
  %37 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %36) #5
  %38 = getelementptr inbounds %"struct.Leph::CubicSpline::Point", ptr %37, i32 0, i32 0
  %39 = load double, ptr %38, align 8, !tbaa !11
  %40 = getelementptr inbounds %"class.Leph::CubicSpline", ptr %11, i32 0, i32 1
  %41 = load i64, ptr %6, align 8, !tbaa !9
  %42 = sub i64 %41, 1
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %42) #5
  %44 = getelementptr inbounds %"struct.Leph::CubicSpline::Point", ptr %43, i32 0, i32 0
  %45 = load double, ptr %44, align 8, !tbaa !11
  %46 = fsub double %39, %45
  store double %46, ptr %7, align 8, !tbaa !14
  %47 = load double, ptr %7, align 8, !tbaa !14
  %48 = fcmp ogt double %47, 1.000000e-05
  br i1 %48, label %49, label %93

49:                                               ; preds = %34
  %50 = getelementptr inbounds %"class.Leph::Spline", ptr %11, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #5
  %51 = getelementptr inbounds %"struct.Leph::Spline::Spline_t", ptr %8, i32 0, i32 0
  %52 = load double, ptr %7, align 8, !tbaa !14
  %53 = getelementptr inbounds %"class.Leph::CubicSpline", ptr %11, i32 0, i32 1
  %54 = load i64, ptr %6, align 8, !tbaa !9
  %55 = sub i64 %54, 1
  %56 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %55) #5
  %57 = getelementptr inbounds %"struct.Leph::CubicSpline::Point", ptr %56, i32 0, i32 1
  %58 = load double, ptr %57, align 8, !tbaa !15
  %59 = getelementptr inbounds %"class.Leph::CubicSpline", ptr %11, i32 0, i32 1
  %60 = load i64, ptr %6, align 8, !tbaa !9
  %61 = sub i64 %60, 1
  %62 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %59, i64 noundef %61) #5
  %63 = getelementptr inbounds %"struct.Leph::CubicSpline::Point", ptr %62, i32 0, i32 2
  %64 = load double, ptr %63, align 8, !tbaa !16
  %65 = getelementptr inbounds %"class.Leph::CubicSpline", ptr %11, i32 0, i32 1
  %66 = load i64, ptr %6, align 8, !tbaa !9
  %67 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef %66) #5
  %68 = getelementptr inbounds %"struct.Leph::CubicSpline::Point", ptr %67, i32 0, i32 1
  %69 = load double, ptr %68, align 8, !tbaa !15
  %70 = getelementptr inbounds %"class.Leph::CubicSpline", ptr %11, i32 0, i32 1
  %71 = load i64, ptr %6, align 8, !tbaa !9
  %72 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %70, i64 noundef %71) #5
  %73 = getelementptr inbounds %"struct.Leph::CubicSpline::Point", ptr %72, i32 0, i32 2
  %74 = load double, ptr %73, align 8, !tbaa !16
  call void @_ZNK4Leph11CubicSpline10polynomFitEddddd(ptr dead_on_unwind writable sret(%"class.Leph::Polynom") align 8 %51, ptr noundef nonnull align 8 dereferenceable(48) %11, double noundef %52, double noundef %58, double noundef %64, double noundef %69, double noundef %74)
  %75 = getelementptr inbounds %"struct.Leph::Spline::Spline_t", ptr %8, i32 0, i32 1
  %76 = getelementptr inbounds %"class.Leph::CubicSpline", ptr %11, i32 0, i32 1
  %77 = load i64, ptr %6, align 8, !tbaa !9
  %78 = sub i64 %77, 1
  %79 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %76, i64 noundef %78) #5
  %80 = getelementptr inbounds %"struct.Leph::CubicSpline::Point", ptr %79, i32 0, i32 0
  %81 = load double, ptr %80, align 8, !tbaa !11
  store double %81, ptr %75, align 8, !tbaa !17
  %82 = getelementptr inbounds %"struct.Leph::Spline::Spline_t", ptr %8, i32 0, i32 2
  %83 = getelementptr inbounds %"class.Leph::CubicSpline", ptr %11, i32 0, i32 1
  %84 = load i64, ptr %6, align 8, !tbaa !9
  %85 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %83, i64 noundef %84) #5
  %86 = getelementptr inbounds %"struct.Leph::CubicSpline::Point", ptr %85, i32 0, i32 0
  %87 = load double, ptr %86, align 8, !tbaa !11
  store double %87, ptr %82, align 8, !tbaa !24
  invoke void @_ZNSt6vectorIN4Leph6Spline8Spline_tESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef nonnull align 8 dereferenceable(40) %8)
          to label %88 unwind label %89

88:                                               ; preds = %49
  call void @_ZN4Leph6Spline8Spline_tD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #5
  br label %93

89:                                               ; preds = %49
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %9, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %10, align 4
  call void @_ZN4Leph6Spline8Spline_tD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %98

93:                                               ; preds = %88, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %94

94:                                               ; preds = %93
  %95 = load i64, ptr %6, align 8, !tbaa !9
  %96 = add i64 %95, 1
  store i64 %96, ptr %6, align 8, !tbaa !9
  br label %28, !llvm.loop !25

97:                                               ; preds = %33, %16
  ret void

98:                                               ; preds = %89
  %99 = load ptr, ptr %9, align 8
  %100 = load i32, ptr %10, align 4
  %101 = insertvalue { ptr, i32 } poison, ptr %99, 0
  %102 = insertvalue { ptr, i32 } %101, i32 %100, 1
  resume { ptr, i32 } %102
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4Leph11CubicSpline10polynomFitEddddd(ptr dead_on_unwind noalias writable sret(%"class.Leph::Polynom") align 8, ptr noundef nonnull align 8 dereferenceable(48), double noundef, double noundef, double noundef, double noundef, double noundef) #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPN4Leph11CubicSpline5PointESt6vectorIS4_SaIS4_EEEEZNS3_14computeSplinesEvE3$_0EvT_SB_T0_"(ptr, ptr) #3

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { inlinehint 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 = { 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 #5 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSN4Leph11CubicSpline5PointE", !13, i64 0, !13, i64 8, !13, i64 16}
!13 = !{!"double", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !13, i64 8}
!16 = !{!12, !13, i64 16}
!17 = !{!18, !13, i64 24}
!18 = !{!"_ZTSN4Leph6Spline8Spline_tE", !19, i64 0, !13, i64 24, !13, i64 32}
!19 = !{!"_ZTSN4Leph7PolynomE", !20, i64 0}
!20 = !{!"_ZTSSt6vectorIdSaIdEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!18, !13, i64 32}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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

%"struct.Leph::Spline::Spline_t" = type { %"class.Leph::Polynom", double, double }
%"class.Leph::Polynom" = type { %"class.std::vector.5" }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Leph11CubicSpline14computeSplinesEv(ptr noundef nonnull align 8 dereferenceable(48) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"struct.Leph::Spline::Spline_t", align 8
  tail call void @_ZNSt6vectorIN4Leph6Spline8Spline_tESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  %4 = tail call noundef i64 @_ZNKSt6vectorIN4Leph11CubicSpline5PointESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %5 = icmp ult i64 %4, 2
  br i1 %5, label %.loopexit, label %6

6:                                                ; preds = %1
  %7 = tail call ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %8 = tail call ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  tail call void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPN4Leph11CubicSpline5PointESt6vectorIS4_SaIS4_EEEEZNS3_14computeSplinesEvE3$_0EvT_SB_T0_"(ptr %7, ptr %8)
  %9 = tail call noundef i64 @_ZNKSt6vectorIN4Leph11CubicSpline5PointESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %10 = icmp ugt i64 %9, 1
  br i1 %10, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %6
  %11 = getelementptr inbounds i8, ptr %2, i64 24
  %12 = getelementptr inbounds i8, ptr %2, i64 32
  br label %13

13:                                               ; preds = %.lr.ph, %41
  %.016 = phi i64 [ 1, %.lr.ph ], [ %42, %41 ]
  %14 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.016) #5
  %15 = load double, ptr %14, align 8, !tbaa !5
  %16 = add i64 %.016, -1
  %17 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %16) #5
  %18 = load double, ptr %17, align 8, !tbaa !5
  %19 = fsub double %15, %18
  %20 = fcmp ogt double %19, 1.000000e-05
  br i1 %20, label %21, label %41

21:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %2) #5
  %22 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %16) #5
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %24 = load double, ptr %23, align 8, !tbaa !10
  %25 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %16) #5
  %26 = getelementptr inbounds i8, ptr %25, i64 16
  %27 = load double, ptr %26, align 8, !tbaa !11
  %28 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.016) #5
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = load double, ptr %29, align 8, !tbaa !10
  %31 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.016) #5
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  %33 = load double, ptr %32, align 8, !tbaa !11
  call void @_ZNK4Leph11CubicSpline10polynomFitEddddd(ptr dead_on_unwind nonnull writable sret(%"class.Leph::Polynom") align 8 %2, ptr noundef nonnull align 8 dereferenceable(48) %0, double noundef %19, double noundef %24, double noundef %27, double noundef %30, double noundef %33)
  %34 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %16) #5
  %35 = load double, ptr %34, align 8, !tbaa !5
  store double %35, ptr %11, align 8, !tbaa !12
  %36 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN4Leph11CubicSpline5PointESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.016) #5
  %37 = load double, ptr %36, align 8, !tbaa !5
  store double %37, ptr %12, align 8, !tbaa !20
  invoke void @_ZNSt6vectorIN4Leph6Spline8Spline_tESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(40) %2)
          to label %38 unwind label %39

38:                                               ; preds = %21
  call void @_ZN4Leph6Spline8Spline_tD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %2) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #5
  br label %41

39:                                               ; preds = %21
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4Leph6Spline8Spline_tD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %2) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #5
  resume { ptr, i32 } %40

41:                                               ; preds = %38, %13
  %42 = add nuw i64 %.016, 1
  %43 = call noundef i64 @_ZNKSt6vectorIN4Leph11CubicSpline5PointESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %44 = icmp ult i64 %42, %43
  br i1 %44, label %13, label %.loopexit, !llvm.loop !21

.loopexit:                                        ; preds = %41, %6, %1
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4Leph11CubicSpline10polynomFitEddddd(ptr dead_on_unwind noalias writable sret(%"class.Leph::Polynom") align 8, ptr noundef nonnull align 8 dereferenceable(48), double noundef, double noundef, double noundef, double noundef, double noundef) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPN4Leph11CubicSpline5PointESt6vectorIS4_SaIS4_EEEEZNS3_14computeSplinesEvE3$_0EvT_SB_T0_"(ptr, ptr) local_unnamed_addr #3

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { inlinehint 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 = { 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 #5 = { 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 0}
!6 = !{!"_ZTSN4Leph11CubicSpline5PointE", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!6, !7, i64 16}
!12 = !{!13, !7, i64 24}
!13 = !{!"_ZTSN4Leph6Spline8Spline_tE", !14, i64 0, !7, i64 24, !7, i64 32}
!14 = !{!"_ZTSN4Leph7PolynomE", !15, i64 0}
!15 = !{!"_ZTSSt6vectorIdSaIdEE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!19 = !{!"any pointer", !8, i64 0}
!20 = !{!13, !7, i64 32}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass