; LLVM IR from Squishy47/Schroeder-All-Pass-Filter :: CircularBuffer.ll (ZN14CircularBuffer18cubicInterpolationEddddd)

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

; 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
define dso_local noundef float @_ZN14CircularBuffer18cubicInterpolationEddddd(ptr noundef nonnull align 8 dereferenceable(36) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5) #1 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca double, 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
  %17 = alloca double, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !9
  store double %2, ptr %9, align 8, !tbaa !9
  store double %3, ptr %10, align 8, !tbaa !9
  store double %4, ptr %11, align 8, !tbaa !9
  store double %5, ptr %12, align 8, !tbaa !9
  %18 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %19 = load double, ptr %12, align 8, !tbaa !9
  %20 = load double, ptr %12, align 8, !tbaa !9
  %21 = fmul double %19, %20
  store double %21, ptr %17, align 8, !tbaa !9
  %22 = load double, ptr %8, align 8, !tbaa !9
  %23 = load double, ptr %9, align 8, !tbaa !9
  %24 = fmul double 1.500000e+00, %23
  %25 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %22, double %24)
  %26 = load double, ptr %10, align 8, !tbaa !9
  %27 = call double @llvm.fmuladd.f64(double -1.500000e+00, double %26, double %25)
  %28 = load double, ptr %11, align 8, !tbaa !9
  %29 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %28, double %27)
  store double %29, ptr %13, align 8, !tbaa !9
  %30 = load double, ptr %8, align 8, !tbaa !9
  %31 = load double, ptr %9, align 8, !tbaa !9
  %32 = call double @llvm.fmuladd.f64(double -2.500000e+00, double %31, double %30)
  %33 = load double, ptr %10, align 8, !tbaa !9
  %34 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %33, double %32)
  %35 = load double, ptr %11, align 8, !tbaa !9
  %36 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %35, double %34)
  store double %36, ptr %14, align 8, !tbaa !9
  %37 = load double, ptr %8, align 8, !tbaa !9
  %38 = load double, ptr %10, align 8, !tbaa !9
  %39 = fmul double 5.000000e-01, %38
  %40 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %37, double %39)
  store double %40, ptr %15, align 8, !tbaa !9
  %41 = load double, ptr %9, align 8, !tbaa !9
  store double %41, ptr %16, align 8, !tbaa !9
  %42 = load double, ptr %13, align 8, !tbaa !9
  %43 = load double, ptr %12, align 8, !tbaa !9
  %44 = fmul double %42, %43
  %45 = load double, ptr %17, align 8, !tbaa !9
  %46 = load double, ptr %14, align 8, !tbaa !9
  %47 = load double, ptr %17, align 8, !tbaa !9
  %48 = fmul double %46, %47
  %49 = call double @llvm.fmuladd.f64(double %44, double %45, double %48)
  %50 = load double, ptr %15, align 8, !tbaa !9
  %51 = load double, ptr %12, align 8, !tbaa !9
  %52 = call double @llvm.fmuladd.f64(double %50, double %51, double %49)
  %53 = load double, ptr %16, align 8, !tbaa !9
  %54 = fadd double %52, %53
  %55 = fptrunc double %54 to float
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  ret float %55
}

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

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local noundef float @_ZN14CircularBuffer18cubicInterpolationEddddd(ptr nocapture noundef nonnull readnone align 8 dereferenceable(36) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5) local_unnamed_addr #0 align 2 {
  %7 = fmul double %5, %5
  %8 = fmul double %2, 1.500000e+00
  %9 = tail call double @llvm.fmuladd.f64(double %1, double -5.000000e-01, double %8)
  %10 = tail call double @llvm.fmuladd.f64(double %3, double -1.500000e+00, double %9)
  %11 = tail call double @llvm.fmuladd.f64(double %4, double 5.000000e-01, double %10)
  %12 = tail call double @llvm.fmuladd.f64(double %2, double -2.500000e+00, double %1)
  %13 = tail call double @llvm.fmuladd.f64(double %3, double 2.000000e+00, double %12)
  %14 = tail call double @llvm.fmuladd.f64(double %4, double -5.000000e-01, double %13)
  %15 = fmul double %3, 5.000000e-01
  %16 = tail call double @llvm.fmuladd.f64(double %1, double -5.000000e-01, double %15)
  %17 = fmul double %11, %5
  %18 = fmul double %14, %7
  %19 = tail call double @llvm.fmuladd.f64(double %17, double %7, double %18)
  %20 = tail call double @llvm.fmuladd.f64(double %16, double %5, double %19)
  %21 = fadd double %20, %2
  %22 = fptrunc double %21 to float
  ret float %22
}

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

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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)"}


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,TailCallElimPass