; LLVM IR from rdguez-mariano/fast_imas_IPOL :: libSimuTilts/splines.ll (Z4keysPfff)

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z4keysPfff(ptr noundef %0, float noundef %1, float noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store float %1, ptr %5, align 4, !tbaa !9
  store float %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %9 = load float, ptr %5, align 4, !tbaa !9
  %10 = load float, ptr %5, align 4, !tbaa !9
  %11 = fmul float %9, %10
  store float %11, ptr %7, align 4, !tbaa !9
  %12 = load float, ptr %6, align 4, !tbaa !9
  %13 = load float, ptr %5, align 4, !tbaa !9
  %14 = fmul float %12, %13
  store float %14, ptr %8, align 4, !tbaa !9
  %15 = load float, ptr %6, align 4, !tbaa !9
  %16 = load float, ptr %7, align 4, !tbaa !9
  %17 = fmul float %15, %16
  %18 = fpext float %17 to double
  %19 = load float, ptr %5, align 4, !tbaa !9
  %20 = fpext float %19 to double
  %21 = fsub double 1.000000e+00, %20
  %22 = fmul double %18, %21
  %23 = fptrunc double %22 to float
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds float, ptr %24, i64 0
  store float %23, ptr %25, align 4, !tbaa !9
  %26 = load float, ptr %6, align 4, !tbaa !9
  %27 = fpext float %26 to double
  %28 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %27, double 3.000000e+00)
  %29 = load float, ptr %6, align 4, !tbaa !9
  %30 = fpext float %29 to double
  %31 = fadd double %30, 2.000000e+00
  %32 = load float, ptr %5, align 4, !tbaa !9
  %33 = fpext float %32 to double
  %34 = fneg double %31
  %35 = call double @llvm.fmuladd.f64(double %34, double %33, double %28)
  %36 = load float, ptr %7, align 4, !tbaa !9
  %37 = fpext float %36 to double
  %38 = load float, ptr %8, align 4, !tbaa !9
  %39 = fpext float %38 to double
  %40 = fneg double %39
  %41 = call double @llvm.fmuladd.f64(double %35, double %37, double %40)
  %42 = fptrunc double %41 to float
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds float, ptr %43, i64 1
  store float %42, ptr %44, align 4, !tbaa !9
  %45 = load float, ptr %6, align 4, !tbaa !9
  %46 = fpext float %45 to double
  %47 = fadd double %46, 2.000000e+00
  %48 = load float, ptr %5, align 4, !tbaa !9
  %49 = fpext float %48 to double
  %50 = load float, ptr %6, align 4, !tbaa !9
  %51 = fpext float %50 to double
  %52 = fneg double %51
  %53 = call double @llvm.fmuladd.f64(double %47, double %49, double %52)
  %54 = fsub double %53, 3.000000e+00
  %55 = load float, ptr %7, align 4, !tbaa !9
  %56 = fpext float %55 to double
  %57 = call double @llvm.fmuladd.f64(double %54, double %56, double 1.000000e+00)
  %58 = fptrunc double %57 to float
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds float, ptr %59, i64 2
  store float %58, ptr %60, align 4, !tbaa !9
  %61 = load float, ptr %6, align 4, !tbaa !9
  %62 = fpext float %61 to double
  %63 = load float, ptr %5, align 4, !tbaa !9
  %64 = fpext float %63 to double
  %65 = fsub double %64, 2.000000e+00
  %66 = fmul double %62, %65
  %67 = load float, ptr %7, align 4, !tbaa !9
  %68 = fpext float %67 to double
  %69 = load float, ptr %8, align 4, !tbaa !9
  %70 = fpext float %69 to double
  %71 = call double @llvm.fmuladd.f64(double %66, double %68, double %70)
  %72 = fptrunc double %71 to float
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds float, ptr %73, i64 3
  store float %72, ptr %74, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = !{!"float", !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 nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @_Z4keysPfff(ptr nocapture noundef writeonly %0, float noundef %1, float noundef %2) local_unnamed_addr #1 {
  %4 = fmul float %1, %1
  %5 = fmul float %1, %2
  %6 = fmul float %4, %2
  %7 = fpext float %6 to double
  %8 = fpext float %1 to double
  %9 = fsub double 1.000000e+00, %8
  %10 = fmul double %9, %7
  %11 = fpext float %2 to double
  %12 = tail call double @llvm.fmuladd.f64(double %11, double 2.000000e+00, double 3.000000e+00)
  %13 = fadd double %11, 2.000000e+00
  %14 = fneg double %13
  %15 = tail call double @llvm.fmuladd.f64(double %14, double %8, double %12)
  %16 = fpext float %4 to double
  %17 = fpext float %5 to double
  %18 = fneg double %17
  %19 = tail call double @llvm.fmuladd.f64(double %15, double %16, double %18)
  %20 = fneg double %11
  %21 = tail call double @llvm.fmuladd.f64(double %13, double %8, double %20)
  %22 = fadd double %21, -3.000000e+00
  %23 = fadd double %8, -2.000000e+00
  %24 = fmul double %23, %11
  %25 = insertelement <2 x double> poison, double %22, i64 0
  %26 = insertelement <2 x double> %25, double %24, i64 1
  %27 = insertelement <2 x double> poison, double %16, i64 0
  %28 = shufflevector <2 x double> %27, <2 x double> poison, <2 x i32> zeroinitializer
  %29 = insertelement <2 x double> <double 1.000000e+00, double poison>, double %17, i64 1
  %30 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %26, <2 x double> %28, <2 x double> %29)
  %31 = insertelement <4 x double> poison, double %10, i64 0
  %32 = insertelement <4 x double> %31, double %19, i64 1
  %33 = shufflevector <2 x double> %30, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
  %34 = shufflevector <4 x double> %32, <4 x double> %33, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
  %35 = fptrunc <4 x double> %34 to <4 x float>
  store <4 x float> %35, ptr %0, align 4, !tbaa !5
  ret void
}

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

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

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


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