; LLVM IR from pantor/ruckig :: src/ruckig/brake.ll (ZN6ruckig12BrakeProfile29get_position_brake_trajectoryEddddddd)

; 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.ruckig::BrakeProfile" = type { double, %"struct.std::array", %"struct.std::array", %"struct.std::array", %"struct.std::array", %"struct.std::array" }
%"struct.std::array" = type { [2 x double] }

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ruckig12BrakeProfile18acceleration_brakeEddddddd(ptr noundef nonnull align 8 dereferenceable(88), double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ruckig12BrakeProfile14velocity_brakeEddddddd(ptr noundef nonnull align 8 dereferenceable(88), double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6ruckig12BrakeProfile29get_position_brake_trajectoryEddddddd(ptr noundef nonnull align 8 dereferenceable(88) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7) #0 align 2 {
  %9 = alloca ptr, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store double %1, ptr %10, align 8, !tbaa !9
  store double %2, ptr %11, align 8, !tbaa !9
  store double %3, ptr %12, align 8, !tbaa !9
  store double %4, ptr %13, align 8, !tbaa !9
  store double %5, ptr %14, align 8, !tbaa !9
  store double %6, ptr %15, align 8, !tbaa !9
  store double %7, ptr %16, align 8, !tbaa !9
  %17 = load ptr, ptr %9, align 8
  %18 = getelementptr inbounds %"class.ruckig::BrakeProfile", ptr %17, i32 0, i32 1
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %18, i64 noundef 0) #3
  store double 0.000000e+00, ptr %19, align 8, !tbaa !9
  %20 = getelementptr inbounds %"class.ruckig::BrakeProfile", ptr %17, i32 0, i32 1
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %20, i64 noundef 1) #3
  store double 0.000000e+00, ptr %21, align 8, !tbaa !9
  %22 = getelementptr inbounds %"class.ruckig::BrakeProfile", ptr %17, i32 0, i32 2
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %22, i64 noundef 0) #3
  store double 0.000000e+00, ptr %23, align 8, !tbaa !9
  %24 = getelementptr inbounds %"class.ruckig::BrakeProfile", ptr %17, i32 0, i32 2
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %24, i64 noundef 1) #3
  store double 0.000000e+00, ptr %25, align 8, !tbaa !9
  %26 = load double, ptr %16, align 8, !tbaa !9
  %27 = fcmp oeq double %26, 0.000000e+00
  br i1 %27, label %34, label %28

28:                                               ; preds = %8
  %29 = load double, ptr %14, align 8, !tbaa !9
  %30 = fcmp oeq double %29, 0.000000e+00
  br i1 %30, label %34, label %31

31:                                               ; preds = %28
  %32 = load double, ptr %15, align 8, !tbaa !9
  %33 = fcmp oeq double %32, 0.000000e+00
  br i1 %33, label %34, label %35

34:                                               ; preds = %31, %28, %8
  br label %124

35:                                               ; preds = %31
  %36 = load double, ptr %11, align 8, !tbaa !9
  %37 = load double, ptr %14, align 8, !tbaa !9
  %38 = fcmp ogt double %36, %37
  br i1 %38, label %39, label %47

39:                                               ; preds = %35
  %40 = load double, ptr %10, align 8, !tbaa !9
  %41 = load double, ptr %11, align 8, !tbaa !9
  %42 = load double, ptr %12, align 8, !tbaa !9
  %43 = load double, ptr %13, align 8, !tbaa !9
  %44 = load double, ptr %14, align 8, !tbaa !9
  %45 = load double, ptr %15, align 8, !tbaa !9
  %46 = load double, ptr %16, align 8, !tbaa !9
  call void @_ZN6ruckig12BrakeProfile18acceleration_brakeEddddddd(ptr noundef nonnull align 8 dereferenceable(88) %17, double noundef %40, double noundef %41, double noundef %42, double noundef %43, double noundef %44, double noundef %45, double noundef %46)
  br label %124

47:                                               ; preds = %35
  %48 = load double, ptr %11, align 8, !tbaa !9
  %49 = load double, ptr %15, align 8, !tbaa !9
  %50 = fcmp olt double %48, %49
  br i1 %50, label %51, label %60

51:                                               ; preds = %47
  %52 = load double, ptr %10, align 8, !tbaa !9
  %53 = load double, ptr %11, align 8, !tbaa !9
  %54 = load double, ptr %13, align 8, !tbaa !9
  %55 = load double, ptr %12, align 8, !tbaa !9
  %56 = load double, ptr %15, align 8, !tbaa !9
  %57 = load double, ptr %14, align 8, !tbaa !9
  %58 = load double, ptr %16, align 8, !tbaa !9
  %59 = fneg double %58
  call void @_ZN6ruckig12BrakeProfile18acceleration_brakeEddddddd(ptr noundef nonnull align 8 dereferenceable(88) %17, double noundef %52, double noundef %53, double noundef %54, double noundef %55, double noundef %56, double noundef %57, double noundef %59)
  br label %123

60:                                               ; preds = %47
  %61 = load double, ptr %10, align 8, !tbaa !9
  %62 = load double, ptr %12, align 8, !tbaa !9
  %63 = fcmp ogt double %61, %62
  br i1 %63, label %64, label %72

64:                                               ; preds = %60
  %65 = load double, ptr %10, align 8, !tbaa !9
  %66 = load double, ptr %11, align 8, !tbaa !9
  %67 = load double, ptr %16, align 8, !tbaa !9
  %68 = fneg double %67
  %69 = call noundef double @_ZN6ruckig11v_at_a_zeroEddd(double noundef %65, double noundef %66, double noundef %68)
  %70 = load double, ptr %13, align 8, !tbaa !9
  %71 = fcmp ogt double %69, %70
  br i1 %71, label %82, label %72

72:                                               ; preds = %64, %60
  %73 = load double, ptr %11, align 8, !tbaa !9
  %74 = fcmp ogt double %73, 0.000000e+00
  br i1 %74, label %75, label %90

75:                                               ; preds = %72
  %76 = load double, ptr %10, align 8, !tbaa !9
  %77 = load double, ptr %11, align 8, !tbaa !9
  %78 = load double, ptr %16, align 8, !tbaa !9
  %79 = call noundef double @_ZN6ruckig11v_at_a_zeroEddd(double noundef %76, double noundef %77, double noundef %78)
  %80 = load double, ptr %12, align 8, !tbaa !9
  %81 = fcmp ogt double %79, %80
  br i1 %81, label %82, label %90

82:                                               ; preds = %75, %64
  %83 = load double, ptr %10, align 8, !tbaa !9
  %84 = load double, ptr %11, align 8, !tbaa !9
  %85 = load double, ptr %12, align 8, !tbaa !9
  %86 = load double, ptr %13, align 8, !tbaa !9
  %87 = load double, ptr %14, align 8, !tbaa !9
  %88 = load double, ptr %15, align 8, !tbaa !9
  %89 = load double, ptr %16, align 8, !tbaa !9
  call void @_ZN6ruckig12BrakeProfile14velocity_brakeEddddddd(ptr noundef nonnull align 8 dereferenceable(88) %17, double noundef %83, double noundef %84, double noundef %85, double noundef %86, double noundef %87, double noundef %88, double noundef %89)
  br label %122

90:                                               ; preds = %75, %72
  %91 = load double, ptr %10, align 8, !tbaa !9
  %92 = load double, ptr %13, align 8, !tbaa !9
  %93 = fcmp olt double %91, %92
  br i1 %93, label %94, label %101

94:                                               ; preds = %90
  %95 = load double, ptr %10, align 8, !tbaa !9
  %96 = load double, ptr %11, align 8, !tbaa !9
  %97 = load double, ptr %16, align 8, !tbaa !9
  %98 = call noundef double @_ZN6ruckig11v_at_a_zeroEddd(double noundef %95, double noundef %96, double noundef %97)
  %99 = load double, ptr %12, align 8, !tbaa !9
  %100 = fcmp olt double %98, %99
  br i1 %100, label %112, label %101

101:                                              ; preds = %94, %90
  %102 = load double, ptr %11, align 8, !tbaa !9
  %103 = fcmp olt double %102, 0.000000e+00
  br i1 %103, label %104, label %121

104:                                              ; preds = %101
  %105 = load double, ptr %10, align 8, !tbaa !9
  %106 = load double, ptr %11, align 8, !tbaa !9
  %107 = load double, ptr %16, align 8, !tbaa !9
  %108 = fneg double %107
  %109 = call noundef double @_ZN6ruckig11v_at_a_zeroEddd(double noundef %105, double noundef %106, double noundef %108)
  %110 = load double, ptr %13, align 8, !tbaa !9
  %111 = fcmp olt double %109, %110
  br i1 %111, label %112, label %121

112:                                              ; preds = %104, %94
  %113 = load double, ptr %10, align 8, !tbaa !9
  %114 = load double, ptr %11, align 8, !tbaa !9
  %115 = load double, ptr %13, align 8, !tbaa !9
  %116 = load double, ptr %12, align 8, !tbaa !9
  %117 = load double, ptr %15, align 8, !tbaa !9
  %118 = load double, ptr %14, align 8, !tbaa !9
  %119 = load double, ptr %16, align 8, !tbaa !9
  %120 = fneg double %119
  call void @_ZN6ruckig12BrakeProfile14velocity_brakeEddddddd(ptr noundef nonnull align 8 dereferenceable(88) %17, double noundef %113, double noundef %114, double noundef %115, double noundef %116, double noundef %117, double noundef %118, double noundef %120)
  br label %121

121:                                              ; preds = %112, %104, %101
  br label %122

122:                                              ; preds = %121, %82
  br label %123

123:                                              ; preds = %122, %51
  br label %124

124:                                              ; preds = %123, %39, %34
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN6ruckig11v_at_a_zeroEddd(double noundef, double noundef, double noundef) #2

attributes #0 = { 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 #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 = { 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 #3 = { 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}


; 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: mustprogress uwtable
declare dso_local void @_ZN6ruckig12BrakeProfile18acceleration_brakeEddddddd(ptr noundef nonnull align 8 dereferenceable(88), double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ruckig12BrakeProfile14velocity_brakeEddddddd(ptr noundef nonnull align 8 dereferenceable(88), double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6ruckig12BrakeProfile29get_position_brake_trajectoryEddddddd(ptr noundef nonnull align 8 dereferenceable(88) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7) local_unnamed_addr #0 align 2 {
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef 0) #3
  store double 0.000000e+00, ptr %10, align 8, !tbaa !5
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef 1) #3
  store double 0.000000e+00, ptr %11, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %12, i64 noundef 0) #3
  store double 0.000000e+00, ptr %13, align 8, !tbaa !5
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %12, i64 noundef 1) #3
  store double 0.000000e+00, ptr %14, align 8, !tbaa !5
  %15 = fcmp oeq double %7, 0.000000e+00
  %16 = fcmp oeq double %5, 0.000000e+00
  %or.cond = or i1 %16, %15
  %17 = fcmp oeq double %6, 0.000000e+00
  %or.cond3 = or i1 %17, %or.cond
  br i1 %or.cond3, label %49, label %18

18:                                               ; preds = %8
  %19 = fcmp ogt double %2, %5
  br i1 %19, label %20, label %21

20:                                               ; preds = %18
  tail call void @_ZN6ruckig12BrakeProfile18acceleration_brakeEddddddd(ptr noundef nonnull align 8 dereferenceable(88) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7)
  br label %49

21:                                               ; preds = %18
  %22 = fcmp olt double %2, %6
  br i1 %22, label %23, label %25

23:                                               ; preds = %21
  %24 = fneg double %7
  tail call void @_ZN6ruckig12BrakeProfile18acceleration_brakeEddddddd(ptr noundef nonnull align 8 dereferenceable(88) %0, double noundef %1, double noundef %2, double noundef %4, double noundef %3, double noundef %6, double noundef %5, double noundef %24)
  br label %49

25:                                               ; preds = %21
  %26 = fcmp ogt double %1, %3
  br i1 %26, label %27, label %31

27:                                               ; preds = %25
  %28 = fneg double %7
  %29 = tail call noundef double @_ZN6ruckig11v_at_a_zeroEddd(double noundef %1, double noundef %2, double noundef %28)
  %30 = fcmp ogt double %29, %4
  br i1 %30, label %36, label %31

31:                                               ; preds = %27, %25
  %32 = fcmp ogt double %2, 0.000000e+00
  br i1 %32, label %33, label %37

33:                                               ; preds = %31
  %34 = tail call noundef double @_ZN6ruckig11v_at_a_zeroEddd(double noundef %1, double noundef %2, double noundef %7)
  %35 = fcmp ogt double %34, %3
  br i1 %35, label %36, label %37

36:                                               ; preds = %33, %27
  tail call void @_ZN6ruckig12BrakeProfile14velocity_brakeEddddddd(ptr noundef nonnull align 8 dereferenceable(88) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7)
  br label %49

37:                                               ; preds = %33, %31
  %38 = fcmp olt double %1, %4
  br i1 %38, label %39, label %42

39:                                               ; preds = %37
  %40 = tail call noundef double @_ZN6ruckig11v_at_a_zeroEddd(double noundef %1, double noundef %2, double noundef %7)
  %41 = fcmp olt double %40, %3
  br i1 %41, label %._crit_edge, label %42

._crit_edge:                                      ; preds = %39
  %.pre = fneg double %7
  br label %48

42:                                               ; preds = %39, %37
  %43 = fcmp olt double %2, 0.000000e+00
  br i1 %43, label %44, label %49

44:                                               ; preds = %42
  %45 = fneg double %7
  %46 = tail call noundef double @_ZN6ruckig11v_at_a_zeroEddd(double noundef %1, double noundef %2, double noundef %45)
  %47 = fcmp olt double %46, %4
  br i1 %47, label %48, label %49

48:                                               ; preds = %._crit_edge, %44
  %.pre-phi = phi double [ %.pre, %._crit_edge ], [ %45, %44 ]
  tail call void @_ZN6ruckig12BrakeProfile14velocity_brakeEddddddd(ptr noundef nonnull align 8 dereferenceable(88) %0, double noundef %1, double noundef %2, double noundef %4, double noundef %3, double noundef %6, double noundef %5, double noundef %.pre-phi)
  br label %49

49:                                               ; preds = %23, %42, %44, %48, %36, %8, %20
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN6ruckig11v_at_a_zeroEddd(double noundef, double noundef, double noundef) local_unnamed_addr #2

attributes #0 = { 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 #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 = { 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 #3 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass