; LLVM IR from jgaeddert/liquid-dsp :: src/filter/src (filter_rrrf)

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

%struct.iirfiltsos_rrrf_s = type { [3 x float], [3 x float], [3 x float], [3 x float], [3 x float] }

; Function Attrs: nounwind uwtable
define dso_local i32 @iirfiltsos_rrrf_execute_df2(ptr noundef %0, float noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store float %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %7, i32 0, i32 4
  %9 = getelementptr inbounds [3 x float], ptr %8, i64 0, i64 1
  %10 = load float, ptr %9, align 4, !tbaa !9
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %11, i32 0, i32 4
  %13 = getelementptr inbounds [3 x float], ptr %12, i64 0, i64 2
  store float %10, ptr %13, align 4, !tbaa !9
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %14, i32 0, i32 4
  %16 = getelementptr inbounds [3 x float], ptr %15, i64 0, i64 0
  %17 = load float, ptr %16, align 4, !tbaa !9
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %18, i32 0, i32 4
  %20 = getelementptr inbounds [3 x float], ptr %19, i64 0, i64 1
  store float %17, ptr %20, align 4, !tbaa !9
  %21 = load float, ptr %5, align 4, !tbaa !9
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %22, i32 0, i32 1
  %24 = getelementptr inbounds [3 x float], ptr %23, i64 0, i64 1
  %25 = load float, ptr %24, align 4, !tbaa !9
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %26, i32 0, i32 4
  %28 = getelementptr inbounds [3 x float], ptr %27, i64 0, i64 1
  %29 = load float, ptr %28, align 4, !tbaa !9
  %30 = fneg float %25
  %31 = call float @llvm.fmuladd.f32(float %30, float %29, float %21)
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %32, i32 0, i32 1
  %34 = getelementptr inbounds [3 x float], ptr %33, i64 0, i64 2
  %35 = load float, ptr %34, align 4, !tbaa !9
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %36, i32 0, i32 4
  %38 = getelementptr inbounds [3 x float], ptr %37, i64 0, i64 2
  %39 = load float, ptr %38, align 4, !tbaa !9
  %40 = fneg float %35
  %41 = call float @llvm.fmuladd.f32(float %40, float %39, float %31)
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %42, i32 0, i32 4
  %44 = getelementptr inbounds [3 x float], ptr %43, i64 0, i64 0
  store float %41, ptr %44, align 4, !tbaa !9
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %45, i32 0, i32 0
  %47 = getelementptr inbounds [3 x float], ptr %46, i64 0, i64 0
  %48 = load float, ptr %47, align 4, !tbaa !9
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %49, i32 0, i32 4
  %51 = getelementptr inbounds [3 x float], ptr %50, i64 0, i64 0
  %52 = load float, ptr %51, align 4, !tbaa !9
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds [3 x float], ptr %54, i64 0, i64 1
  %56 = load float, ptr %55, align 4, !tbaa !9
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %57, i32 0, i32 4
  %59 = getelementptr inbounds [3 x float], ptr %58, i64 0, i64 1
  %60 = load float, ptr %59, align 4, !tbaa !9
  %61 = fmul float %56, %60
  %62 = call float @llvm.fmuladd.f32(float %48, float %52, float %61)
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %63, i32 0, i32 0
  %65 = getelementptr inbounds [3 x float], ptr %64, i64 0, i64 2
  %66 = load float, ptr %65, align 4, !tbaa !9
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.iirfiltsos_rrrf_s, ptr %67, i32 0, i32 4
  %69 = getelementptr inbounds [3 x float], ptr %68, i64 0, i64 2
  %70 = load float, ptr %69, align 4, !tbaa !9
  %71 = call float @llvm.fmuladd.f32(float %66, float %70, float %62)
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  store float %71, ptr %72, align 4, !tbaa !9
  ret i32 0
}

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

attributes #0 = { 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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/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 nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local noundef i32 @iirfiltsos_rrrf_execute_df2(ptr nocapture noundef %0, float noundef %1, ptr nocapture noundef writeonly %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  %5 = getelementptr inbounds i8, ptr %0, i64 52
  %6 = load <2 x float>, ptr %4, align 4, !tbaa !5
  store <2 x float> %6, ptr %5, align 4, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load float, ptr %7, align 4, !tbaa !5
  %9 = fneg float %8
  %10 = extractelement <2 x float> %6, i64 0
  %11 = tail call float @llvm.fmuladd.f32(float %9, float %10, float %1)
  %12 = getelementptr inbounds i8, ptr %0, i64 20
  %13 = load float, ptr %12, align 4, !tbaa !5
  %14 = fneg float %13
  %15 = extractelement <2 x float> %6, i64 1
  %16 = tail call float @llvm.fmuladd.f32(float %14, float %15, float %11)
  store float %16, ptr %4, align 4, !tbaa !5
  %17 = load float, ptr %0, align 4, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %0, i64 4
  %19 = load float, ptr %18, align 4, !tbaa !5
  %20 = fmul float %10, %19
  %21 = tail call float @llvm.fmuladd.f32(float %17, float %16, float %20)
  %22 = getelementptr inbounds i8, ptr %0, i64 8
  %23 = load float, ptr %22, align 4, !tbaa !5
  %24 = tail call float @llvm.fmuladd.f32(float %23, float %15, float %21)
  store float %24, ptr %2, align 4, !tbaa !5
  ret i32 0
}

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

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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