; LLVM IR from vectozavr/3dzavr :: engine/animation/Interpolation.ll (ZN13Interpolation8BouncingEd)

; 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: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN13Interpolation6LinearEd(double noundef) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN13Interpolation8BouncingEd(double noundef %0) #0 {
  %2 = alloca double, align 8
  store double %0, ptr %2, align 8, !tbaa !5
  %3 = load double, ptr %2, align 8, !tbaa !5
  %4 = call noundef double @_ZN13Interpolation6LinearEd(double noundef %3)
  store double %4, ptr %2, align 8, !tbaa !5
  %5 = load double, ptr %2, align 8, !tbaa !5
  %6 = call double @llvm.fmuladd.f64(double -4.000000e+00, double %5, double 8.000000e-01)
  %7 = fmul double 1.000000e+01, %6
  %8 = call double @exp(double noundef %7) #3
  %9 = fadd double 1.000000e+00, %8
  %10 = fdiv double 1.000000e+00, %9
  %11 = load double, ptr %2, align 8, !tbaa !5
  %12 = fsub double %11, 0x3FD5555555555555
  %13 = fmul double 5.000000e+01, %12
  %14 = call double @sin(double noundef %13) #3
  %15 = fmul double 2.500000e+00, %14
  %16 = load double, ptr %2, align 8, !tbaa !5
  %17 = fmul double -7.000000e+00, %16
  %18 = call double @exp(double noundef %17) #3
  %19 = call double @llvm.fmuladd.f64(double %15, double %18, double 1.000000e+00)
  %20 = load double, ptr %2, align 8, !tbaa !5
  %21 = call double @llvm.fmuladd.f64(double -1.500000e+01, double %20, double 3.100000e+00)
  %22 = fmul double 1.000000e+01, %21
  %23 = call double @exp(double noundef %22) #3
  %24 = fadd double 1.000000e+00, %23
  %25 = fdiv double %19, %24
  %26 = fadd double %10, %25
  %27 = fmul double 5.000000e-01, %26
  ret double %27
}

; Function Attrs: nounwind
declare double @exp(double noundef) #1

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

; Function Attrs: nounwind
declare double @sin(double noundef) #1

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


; 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
declare dso_local noundef double @_ZN13Interpolation6LinearEd(double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN13Interpolation8BouncingEd(double noundef %0) local_unnamed_addr #0 {
  %2 = tail call noundef double @_ZN13Interpolation6LinearEd(double noundef %0)
  %3 = tail call double @llvm.fmuladd.f64(double %2, double -4.000000e+00, double 8.000000e-01)
  %4 = fmul double %3, 1.000000e+01
  %5 = tail call double @exp(double noundef %4) #3
  %6 = fadd double %2, 0xBFD5555555555555
  %7 = fmul double %6, 5.000000e+01
  %8 = tail call double @sin(double noundef %7) #3
  %9 = fmul double %8, 2.500000e+00
  %10 = fmul double %2, -7.000000e+00
  %11 = tail call double @exp(double noundef %10) #3
  %12 = tail call double @llvm.fmuladd.f64(double %9, double %11, double 1.000000e+00)
  %13 = tail call double @llvm.fmuladd.f64(double %2, double -1.500000e+01, double 3.100000e+00)
  %14 = fmul double %13, 1.000000e+01
  %15 = tail call double @exp(double noundef %14) #3
  %16 = insertelement <2 x double> poison, double %5, i64 0
  %17 = insertelement <2 x double> %16, double %15, i64 1
  %18 = fadd <2 x double> %17, <double 1.000000e+00, double 1.000000e+00>
  %19 = insertelement <2 x double> <double 1.000000e+00, double poison>, double %12, i64 1
  %20 = fdiv <2 x double> %19, %18
  %shift = shufflevector <2 x double> %20, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %21 = fadd <2 x double> %20, %shift
  %22 = extractelement <2 x double> %21, i64 0
  %23 = fmul double %22, 5.000000e-01
  ret double %23
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @exp(double noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #1

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 = { 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 #2 = { mustprogress 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)"}


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass,VectorCombinePass