; LLVM IR from pantor/ruckig :: src/ruckig/position_third_step1.ll (ZN6ruckig23PositionThirdOrderStep1C2Eddddddddddd)

; 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::PositionThirdOrderStep1" = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, %"struct.std::array" }
%"struct.std::array" = type { [6 x %"class.ruckig::Profile"] }
%"class.ruckig::Profile" = type <{ %"struct.std::array.0", %"struct.std::array.0", %"struct.std::array.0", %"struct.std::array.1", %"struct.std::array.1", %"struct.std::array.1", %"class.ruckig::BrakeProfile", %"class.ruckig::BrakeProfile", double, double, double, i32, i32, i32, [4 x i8] }>
%"struct.std::array.0" = type { [7 x double] }
%"struct.std::array.1" = type { [8 x double] }
%"class.ruckig::BrakeProfile" = type { double, %"struct.std::array.2", %"struct.std::array.2", %"struct.std::array.2", %"struct.std::array.2", %"struct.std::array.2" }
%"struct.std::array.2" = type { [2 x double] }

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6ruckig23PositionThirdOrderStep1C2Eddddddddddd(ptr noundef nonnull align 8 dereferenceable(3608) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7, double noundef %8, double noundef %9, double noundef %10, double noundef %11) unnamed_addr #0 align 2 {
  %13 = alloca ptr, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  store ptr %0, ptr %13, align 8, !tbaa !5
  store double %1, ptr %14, align 8, !tbaa !9
  store double %2, ptr %15, align 8, !tbaa !9
  store double %3, ptr %16, align 8, !tbaa !9
  store double %4, ptr %17, align 8, !tbaa !9
  store double %5, ptr %18, align 8, !tbaa !9
  store double %6, ptr %19, align 8, !tbaa !9
  store double %7, ptr %20, align 8, !tbaa !9
  store double %8, ptr %21, align 8, !tbaa !9
  store double %9, ptr %22, align 8, !tbaa !9
  store double %10, ptr %23, align 8, !tbaa !9
  store double %11, ptr %24, align 8, !tbaa !9
  %25 = load ptr, ptr %13, align 8
  %26 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 0
  %27 = load double, ptr %15, align 8, !tbaa !9
  store double %27, ptr %26, align 8, !tbaa !11
  %28 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 1
  %29 = load double, ptr %16, align 8, !tbaa !9
  store double %29, ptr %28, align 8, !tbaa !14
  %30 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 2
  %31 = load double, ptr %18, align 8, !tbaa !9
  store double %31, ptr %30, align 8, !tbaa !15
  %32 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 3
  %33 = load double, ptr %19, align 8, !tbaa !9
  store double %33, ptr %32, align 8, !tbaa !16
  %34 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 4
  %35 = load double, ptr %20, align 8, !tbaa !9
  store double %35, ptr %34, align 8, !tbaa !17
  %36 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 5
  %37 = load double, ptr %21, align 8, !tbaa !9
  store double %37, ptr %36, align 8, !tbaa !18
  %38 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 6
  %39 = load double, ptr %22, align 8, !tbaa !9
  store double %39, ptr %38, align 8, !tbaa !19
  %40 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 7
  %41 = load double, ptr %23, align 8, !tbaa !9
  store double %41, ptr %40, align 8, !tbaa !20
  %42 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 8
  %43 = load double, ptr %24, align 8, !tbaa !9
  store double %43, ptr %42, align 8, !tbaa !21
  %44 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 19
  call void @_ZNSt5arrayIN6ruckig7ProfileELm6EEC2Ev(ptr noundef nonnull align 8 dereferenceable(3456) %44) #2
  %45 = load double, ptr %17, align 8, !tbaa !9
  %46 = load double, ptr %14, align 8, !tbaa !9
  %47 = fsub double %45, %46
  %48 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 9
  store double %47, ptr %48, align 8, !tbaa !22
  %49 = load double, ptr %15, align 8, !tbaa !9
  %50 = load double, ptr %15, align 8, !tbaa !9
  %51 = fmul double %49, %50
  %52 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 10
  store double %51, ptr %52, align 8, !tbaa !23
  %53 = load double, ptr %18, align 8, !tbaa !9
  %54 = load double, ptr %18, align 8, !tbaa !9
  %55 = fmul double %53, %54
  %56 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 11
  store double %55, ptr %56, align 8, !tbaa !24
  %57 = load double, ptr %16, align 8, !tbaa !9
  %58 = load double, ptr %16, align 8, !tbaa !9
  %59 = fmul double %57, %58
  %60 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 12
  store double %59, ptr %60, align 8, !tbaa !25
  %61 = load double, ptr %19, align 8, !tbaa !9
  %62 = load double, ptr %19, align 8, !tbaa !9
  %63 = fmul double %61, %62
  %64 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 15
  store double %63, ptr %64, align 8, !tbaa !26
  %65 = load double, ptr %16, align 8, !tbaa !9
  %66 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 12
  %67 = load double, ptr %66, align 8, !tbaa !25
  %68 = fmul double %65, %67
  %69 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 13
  store double %68, ptr %69, align 8, !tbaa !27
  %70 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 12
  %71 = load double, ptr %70, align 8, !tbaa !25
  %72 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 12
  %73 = load double, ptr %72, align 8, !tbaa !25
  %74 = fmul double %71, %73
  %75 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 14
  store double %74, ptr %75, align 8, !tbaa !28
  %76 = load double, ptr %19, align 8, !tbaa !9
  %77 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 15
  %78 = load double, ptr %77, align 8, !tbaa !26
  %79 = fmul double %76, %78
  %80 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 16
  store double %79, ptr %80, align 8, !tbaa !29
  %81 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 15
  %82 = load double, ptr %81, align 8, !tbaa !26
  %83 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 15
  %84 = load double, ptr %83, align 8, !tbaa !26
  %85 = fmul double %82, %84
  %86 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 17
  store double %85, ptr %86, align 8, !tbaa !30
  %87 = load double, ptr %24, align 8, !tbaa !9
  %88 = load double, ptr %24, align 8, !tbaa !9
  %89 = fmul double %87, %88
  %90 = getelementptr inbounds %"class.ruckig::PositionThirdOrderStep1", ptr %25, i32 0, i32 18
  store double %89, ptr %90, align 8, !tbaa !31
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5arrayIN6ruckig7ProfileELm6EEC2Ev(ptr noundef nonnull align 8 dereferenceable(3456)) unnamed_addr #1 align 2

attributes #0 = { 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 = { 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 = { 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, !10, i64 0}
!12 = !{!"_ZTSN6ruckig23PositionThirdOrderStep1E", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !13, i64 152}
!13 = !{!"_ZTSSt5arrayIN6ruckig7ProfileELm6EE", !7, i64 0}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !10, i64 16}
!16 = !{!12, !10, i64 24}
!17 = !{!12, !10, i64 32}
!18 = !{!12, !10, i64 40}
!19 = !{!12, !10, i64 48}
!20 = !{!12, !10, i64 56}
!21 = !{!12, !10, i64 64}
!22 = !{!12, !10, i64 72}
!23 = !{!12, !10, i64 80}
!24 = !{!12, !10, i64 88}
!25 = !{!12, !10, i64 96}
!26 = !{!12, !10, i64 120}
!27 = !{!12, !10, i64 104}
!28 = !{!12, !10, i64 112}
!29 = !{!12, !10, i64 128}
!30 = !{!12, !10, i64 136}
!31 = !{!12, !10, i64 144}


; 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 nounwind uwtable
define dso_local void @_ZN6ruckig23PositionThirdOrderStep1C2Eddddddddddd(ptr noundef nonnull align 8 dereferenceable(3608) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7, double noundef %8, double noundef %9, double noundef %10, double noundef %11) unnamed_addr #0 align 2 {
  store double %2, ptr %0, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  store double %3, ptr %13, align 8, !tbaa !11
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  store double %5, ptr %14, align 8, !tbaa !12
  %15 = getelementptr inbounds i8, ptr %0, i64 24
  store double %6, ptr %15, align 8, !tbaa !13
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  store double %7, ptr %16, align 8, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %0, i64 40
  store double %8, ptr %17, align 8, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %0, i64 48
  store double %9, ptr %18, align 8, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %0, i64 56
  store double %10, ptr %19, align 8, !tbaa !17
  %20 = getelementptr inbounds i8, ptr %0, i64 64
  store double %11, ptr %20, align 8, !tbaa !18
  %21 = getelementptr inbounds i8, ptr %0, i64 152
  tail call void @_ZNSt5arrayIN6ruckig7ProfileELm6EEC2Ev(ptr noundef nonnull align 8 dereferenceable(3456) %21) #2
  %22 = fsub double %4, %1
  %23 = getelementptr inbounds i8, ptr %0, i64 72
  store double %22, ptr %23, align 8, !tbaa !19
  %24 = insertelement <2 x double> poison, double %2, i64 0
  %25 = insertelement <2 x double> %24, double %5, i64 1
  %26 = fmul <2 x double> %25, %25
  %27 = getelementptr inbounds i8, ptr %0, i64 80
  store <2 x double> %26, ptr %27, align 8, !tbaa !20
  %28 = fmul double %3, %3
  %29 = getelementptr inbounds i8, ptr %0, i64 96
  store double %28, ptr %29, align 8, !tbaa !21
  %30 = fmul double %28, %3
  %31 = getelementptr inbounds i8, ptr %0, i64 104
  store double %30, ptr %31, align 8, !tbaa !22
  %32 = getelementptr inbounds i8, ptr %0, i64 112
  %33 = insertelement <2 x double> poison, double %28, i64 0
  %34 = insertelement <2 x double> %33, double %6, i64 1
  %35 = fmul <2 x double> %34, %34
  store <2 x double> %35, ptr %32, align 8, !tbaa !20
  %36 = getelementptr inbounds i8, ptr %0, i64 128
  %37 = shufflevector <2 x double> %35, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %38 = insertelement <2 x double> %35, double %6, i64 0
  %39 = fmul <2 x double> %37, %38
  store <2 x double> %39, ptr %36, align 8, !tbaa !20
  %40 = fmul double %11, %11
  %41 = getelementptr inbounds i8, ptr %0, i64 144
  store double %40, ptr %41, align 8, !tbaa !23
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5arrayIN6ruckig7ProfileELm6EEC2Ev(ptr noundef nonnull align 8 dereferenceable(3456)) unnamed_addr #1 align 2

attributes #0 = { 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 = { 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 = { 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 = !{!"_ZTSN6ruckig23PositionThirdOrderStep1E", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !10, i64 152}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt5arrayIN6ruckig7ProfileELm6EE", !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = !{!6, !7, i64 16}
!13 = !{!6, !7, i64 24}
!14 = !{!6, !7, i64 32}
!15 = !{!6, !7, i64 40}
!16 = !{!6, !7, i64 48}
!17 = !{!6, !7, i64 56}
!18 = !{!6, !7, i64 64}
!19 = !{!6, !7, i64 72}
!20 = !{!7, !7, i64 0}
!21 = !{!6, !7, i64 96}
!22 = !{!6, !7, i64 104}
!23 = !{!6, !7, i64 144}


; Effective O3 passes: EarlyCSEPass,InstCombinePass,ReassociatePass,SLPVectorizerPass,SROAPass,TailCallElimPass