; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode/juce_audio_basics.ll (ZN4juce15IIRCoefficientsC2Edddddd)

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

%"class.juce::IIRCoefficients" = type { [5 x float] }

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce15IIRCoefficientsC2Edddddd(ptr noundef nonnull align 4 dereferenceable(20) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6) unnamed_addr #1 align 2 {
  %8 = alloca ptr, 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
  store ptr %0, ptr %8, align 8, !tbaa !5
  store double %1, ptr %9, align 8, !tbaa !9
  store double %2, ptr %10, align 8, !tbaa !9
  store double %3, ptr %11, align 8, !tbaa !9
  store double %4, ptr %12, align 8, !tbaa !9
  store double %5, ptr %13, align 8, !tbaa !9
  store double %6, ptr %14, align 8, !tbaa !9
  %16 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #2
  %17 = load double, ptr %12, align 8, !tbaa !9
  %18 = fdiv double 1.000000e+00, %17
  store double %18, ptr %15, align 8, !tbaa !9
  %19 = load double, ptr %9, align 8, !tbaa !9
  %20 = load double, ptr %15, align 8, !tbaa !9
  %21 = fmul double %19, %20
  %22 = fptrunc double %21 to float
  %23 = getelementptr inbounds %"class.juce::IIRCoefficients", ptr %16, i32 0, i32 0
  %24 = getelementptr inbounds [5 x float], ptr %23, i64 0, i64 0
  store float %22, ptr %24, align 4, !tbaa !11
  %25 = load double, ptr %10, align 8, !tbaa !9
  %26 = load double, ptr %15, align 8, !tbaa !9
  %27 = fmul double %25, %26
  %28 = fptrunc double %27 to float
  %29 = getelementptr inbounds %"class.juce::IIRCoefficients", ptr %16, i32 0, i32 0
  %30 = getelementptr inbounds [5 x float], ptr %29, i64 0, i64 1
  store float %28, ptr %30, align 4, !tbaa !11
  %31 = load double, ptr %11, align 8, !tbaa !9
  %32 = load double, ptr %15, align 8, !tbaa !9
  %33 = fmul double %31, %32
  %34 = fptrunc double %33 to float
  %35 = getelementptr inbounds %"class.juce::IIRCoefficients", ptr %16, i32 0, i32 0
  %36 = getelementptr inbounds [5 x float], ptr %35, i64 0, i64 2
  store float %34, ptr %36, align 4, !tbaa !11
  %37 = load double, ptr %13, align 8, !tbaa !9
  %38 = load double, ptr %15, align 8, !tbaa !9
  %39 = fmul double %37, %38
  %40 = fptrunc double %39 to float
  %41 = getelementptr inbounds %"class.juce::IIRCoefficients", ptr %16, i32 0, i32 0
  %42 = getelementptr inbounds [5 x float], ptr %41, i64 0, i64 3
  store float %40, ptr %42, align 4, !tbaa !11
  %43 = load double, ptr %14, align 8, !tbaa !9
  %44 = load double, ptr %15, align 8, !tbaa !9
  %45 = fmul double %43, %44
  %46 = fptrunc double %45 to float
  %47 = getelementptr inbounds %"class.juce::IIRCoefficients", ptr %16, i32 0, i32 0
  %48 = getelementptr inbounds [5 x float], ptr %47, i64 0, i64 4
  store float %46, ptr %48, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #2
  ret void
}

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 = { 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}
!11 = !{!12, !12, i64 0}
!12 = !{!"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: write) uwtable
define dso_local void @_ZN4juce15IIRCoefficientsC2Edddddd(ptr nocapture noundef nonnull writeonly align 4 dereferenceable(20) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6) unnamed_addr #0 align 2 {
  %8 = fdiv double 1.000000e+00, %4
  %9 = insertelement <4 x double> poison, double %8, i64 0
  %10 = shufflevector <4 x double> %9, <4 x double> poison, <4 x i32> zeroinitializer
  %11 = insertelement <4 x double> poison, double %1, i64 0
  %12 = insertelement <4 x double> %11, double %2, i64 1
  %13 = insertelement <4 x double> %12, double %3, i64 2
  %14 = insertelement <4 x double> %13, double %5, i64 3
  %15 = fmul <4 x double> %10, %14
  %16 = fptrunc <4 x double> %15 to <4 x float>
  store <4 x float> %16, ptr %0, align 4, !tbaa !5
  %17 = fmul double %8, %6
  %18 = fptrunc double %17 to float
  %19 = getelementptr inbounds i8, ptr %0, i64 16
  store float %18, ptr %19, align 4, !tbaa !5
  ret void
}

attributes #0 = { 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: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass