; LLVM IR from tyoma/agge :: src/agge/curves.ll (ZN4agge7cbezier9calculateEPfS1_fffffffff)

; 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 float @llvm.fmuladd.f32(float, float, float) #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 @_ZN4agge7cbezier9calculateEPfS1_fffffffff(ptr noundef %0, ptr noundef %1, float noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6, float noundef %7, float noundef %8, float noundef %9, float noundef %10) #2 align 2 {
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca [4 x float], align 16
  store ptr %0, ptr %12, align 8, !tbaa !5
  store ptr %1, ptr %13, align 8, !tbaa !5
  store float %2, ptr %14, align 4, !tbaa !9
  store float %3, ptr %15, align 4, !tbaa !9
  store float %4, ptr %16, align 4, !tbaa !9
  store float %5, ptr %17, align 4, !tbaa !9
  store float %6, ptr %18, align 4, !tbaa !9
  store float %7, ptr %19, align 4, !tbaa !9
  store float %8, ptr %20, align 4, !tbaa !9
  store float %9, ptr %21, align 4, !tbaa !9
  store float %10, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  %26 = load float, ptr %22, align 4, !tbaa !9
  %27 = fsub float 1.000000e+00, %26
  store float %27, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  %28 = load float, ptr %22, align 4, !tbaa !9
  %29 = fmul float 3.000000e+00, %28
  %30 = load float, ptr %23, align 4, !tbaa !9
  %31 = fmul float %29, %30
  store float %31, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #3
  %32 = load float, ptr %23, align 4, !tbaa !9
  %33 = load float, ptr %23, align 4, !tbaa !9
  %34 = fmul float %32, %33
  %35 = load float, ptr %23, align 4, !tbaa !9
  %36 = fmul float %34, %35
  store float %36, ptr %25, align 4, !tbaa !9
  %37 = getelementptr inbounds float, ptr %25, i64 1
  %38 = load float, ptr %24, align 4, !tbaa !9
  %39 = load float, ptr %23, align 4, !tbaa !9
  %40 = fmul float %38, %39
  store float %40, ptr %37, align 4, !tbaa !9
  %41 = getelementptr inbounds float, ptr %25, i64 2
  %42 = load float, ptr %24, align 4, !tbaa !9
  %43 = load float, ptr %22, align 4, !tbaa !9
  %44 = fmul float %42, %43
  store float %44, ptr %41, align 4, !tbaa !9
  %45 = getelementptr inbounds float, ptr %25, i64 3
  %46 = load float, ptr %22, align 4, !tbaa !9
  %47 = load float, ptr %22, align 4, !tbaa !9
  %48 = fmul float %46, %47
  %49 = load float, ptr %22, align 4, !tbaa !9
  %50 = fmul float %48, %49
  store float %50, ptr %45, align 4, !tbaa !9
  %51 = load float, ptr %14, align 4, !tbaa !9
  %52 = getelementptr inbounds [4 x float], ptr %25, i64 0, i64 0
  %53 = load float, ptr %52, align 16, !tbaa !9
  %54 = load float, ptr %16, align 4, !tbaa !9
  %55 = getelementptr inbounds [4 x float], ptr %25, i64 0, i64 1
  %56 = load float, ptr %55, align 4, !tbaa !9
  %57 = fmul float %54, %56
  %58 = call float @llvm.fmuladd.f32(float %51, float %53, float %57)
  %59 = load float, ptr %18, align 4, !tbaa !9
  %60 = getelementptr inbounds [4 x float], ptr %25, i64 0, i64 2
  %61 = load float, ptr %60, align 8, !tbaa !9
  %62 = call float @llvm.fmuladd.f32(float %59, float %61, float %58)
  %63 = load float, ptr %20, align 4, !tbaa !9
  %64 = getelementptr inbounds [4 x float], ptr %25, i64 0, i64 3
  %65 = load float, ptr %64, align 4, !tbaa !9
  %66 = call float @llvm.fmuladd.f32(float %63, float %65, float %62)
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  store float %66, ptr %67, align 4, !tbaa !9
  %68 = load float, ptr %15, align 4, !tbaa !9
  %69 = getelementptr inbounds [4 x float], ptr %25, i64 0, i64 0
  %70 = load float, ptr %69, align 16, !tbaa !9
  %71 = load float, ptr %17, align 4, !tbaa !9
  %72 = getelementptr inbounds [4 x float], ptr %25, i64 0, i64 1
  %73 = load float, ptr %72, align 4, !tbaa !9
  %74 = fmul float %71, %73
  %75 = call float @llvm.fmuladd.f32(float %68, float %70, float %74)
  %76 = load float, ptr %19, align 4, !tbaa !9
  %77 = getelementptr inbounds [4 x float], ptr %25, i64 0, i64 2
  %78 = load float, ptr %77, align 8, !tbaa !9
  %79 = call float @llvm.fmuladd.f32(float %76, float %78, float %75)
  %80 = load float, ptr %21, align 4, !tbaa !9
  %81 = getelementptr inbounds [4 x float], ptr %25, i64 0, i64 3
  %82 = load float, ptr %81, align 4, !tbaa !9
  %83 = call float @llvm.fmuladd.f32(float %80, float %82, float %79)
  %84 = load ptr, ptr %13, align 8, !tbaa !5
  store float %83, ptr %84, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #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 float @llvm.fmuladd.f32(float, float, float) #0

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @_ZN4agge7cbezier9calculateEPfS1_fffffffff(ptr nocapture noundef writeonly %0, ptr nocapture noundef writeonly %1, float noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6, float noundef %7, float noundef %8, float noundef %9, float noundef %10) local_unnamed_addr #1 align 2 {
  %12 = fsub float 1.000000e+00, %10
  %13 = fmul float %10, 3.000000e+00
  %14 = fmul float %13, %12
  %15 = fmul float %12, %12
  %16 = fmul float %12, %15
  %17 = fmul float %12, %14
  %18 = fmul float %14, %10
  %19 = fmul float %10, %10
  %20 = fmul float %19, %10
  %21 = fmul float %17, %4
  %22 = tail call float @llvm.fmuladd.f32(float %2, float %16, float %21)
  %23 = tail call float @llvm.fmuladd.f32(float %6, float %18, float %22)
  %24 = tail call float @llvm.fmuladd.f32(float %8, float %20, float %23)
  store float %24, ptr %0, align 4, !tbaa !5
  %25 = fmul float %17, %5
  %26 = tail call float @llvm.fmuladd.f32(float %3, float %16, float %25)
  %27 = tail call float @llvm.fmuladd.f32(float %7, float %18, float %26)
  %28 = tail call float @llvm.fmuladd.f32(float %9, float %20, float %27)
  store float %28, ptr %1, align 4, !tbaa !5
  ret void
}

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

!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: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,TailCallElimPass