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

; 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::ResamplingAudioSource" = type { %"class.juce::AudioSource", %"class.juce::OptionalScopedPointer.85", double, double, %"class.juce::AudioBuffer", i32, i32, double, [6 x double], %"class.juce::SpinLock", i32, %"class.juce::HeapBlock.106", %"class.juce::HeapBlock.107", %"class.juce::HeapBlock.108" }
%"class.juce::AudioSource" = type { ptr }
%"class.juce::OptionalScopedPointer.85" = type <{ %"class.juce::ScopedPointer.86", i8, [7 x i8] }>
%"class.juce::ScopedPointer.86" = type { ptr }
%"class.juce::AudioBuffer" = type <{ i32, i32, i64, ptr, %"class.juce::HeapBlock.0", [32 x ptr], i8, [7 x i8] }>
%"class.juce::HeapBlock.0" = type { ptr }
%"class.juce::SpinLock" = type { %"class.juce::Atomic" }
%"class.juce::Atomic" = type { i32, [4 x i8] }
%"class.juce::HeapBlock.106" = type { ptr }
%"class.juce::HeapBlock.107" = type { ptr }
%"class.juce::HeapBlock.108" = type { ptr }

; 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 @_ZN4juce21ResamplingAudioSource21setFilterCoefficientsEdddddd(ptr noundef nonnull align 8 dereferenceable(440) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6) #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 %15, align 8, !tbaa !9
  %20 = load double, ptr %9, align 8, !tbaa !9
  %21 = fmul double %20, %19
  store double %21, ptr %9, align 8, !tbaa !9
  %22 = load double, ptr %15, align 8, !tbaa !9
  %23 = load double, ptr %10, align 8, !tbaa !9
  %24 = fmul double %23, %22
  store double %24, ptr %10, align 8, !tbaa !9
  %25 = load double, ptr %15, align 8, !tbaa !9
  %26 = load double, ptr %11, align 8, !tbaa !9
  %27 = fmul double %26, %25
  store double %27, ptr %11, align 8, !tbaa !9
  %28 = load double, ptr %15, align 8, !tbaa !9
  %29 = load double, ptr %13, align 8, !tbaa !9
  %30 = fmul double %29, %28
  store double %30, ptr %13, align 8, !tbaa !9
  %31 = load double, ptr %15, align 8, !tbaa !9
  %32 = load double, ptr %14, align 8, !tbaa !9
  %33 = fmul double %32, %31
  store double %33, ptr %14, align 8, !tbaa !9
  %34 = load double, ptr %9, align 8, !tbaa !9
  %35 = getelementptr inbounds %"class.juce::ResamplingAudioSource", ptr %16, i32 0, i32 8
  %36 = getelementptr inbounds [6 x double], ptr %35, i64 0, i64 0
  store double %34, ptr %36, align 8, !tbaa !9
  %37 = load double, ptr %10, align 8, !tbaa !9
  %38 = getelementptr inbounds %"class.juce::ResamplingAudioSource", ptr %16, i32 0, i32 8
  %39 = getelementptr inbounds [6 x double], ptr %38, i64 0, i64 1
  store double %37, ptr %39, align 8, !tbaa !9
  %40 = load double, ptr %11, align 8, !tbaa !9
  %41 = getelementptr inbounds %"class.juce::ResamplingAudioSource", ptr %16, i32 0, i32 8
  %42 = getelementptr inbounds [6 x double], ptr %41, i64 0, i64 2
  store double %40, ptr %42, align 8, !tbaa !9
  %43 = load double, ptr %12, align 8, !tbaa !9
  %44 = getelementptr inbounds %"class.juce::ResamplingAudioSource", ptr %16, i32 0, i32 8
  %45 = getelementptr inbounds [6 x double], ptr %44, i64 0, i64 3
  store double %43, ptr %45, align 8, !tbaa !9
  %46 = load double, ptr %13, align 8, !tbaa !9
  %47 = getelementptr inbounds %"class.juce::ResamplingAudioSource", ptr %16, i32 0, i32 8
  %48 = getelementptr inbounds [6 x double], ptr %47, i64 0, i64 4
  store double %46, ptr %48, align 8, !tbaa !9
  %49 = load double, ptr %14, align 8, !tbaa !9
  %50 = getelementptr inbounds %"class.juce::ResamplingAudioSource", ptr %16, i32 0, i32 8
  %51 = getelementptr inbounds [6 x double], ptr %50, i64 0, i64 5
  store double %49, ptr %51, align 8, !tbaa !9
  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}


; 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 @_ZN4juce21ResamplingAudioSource21setFilterCoefficientsEdddddd(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(440) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6) local_unnamed_addr #0 align 2 {
  %8 = fdiv double 1.000000e+00, %4
  %9 = fmul double %8, %3
  %10 = getelementptr inbounds i8, ptr %0, i64 352
  %11 = insertelement <2 x double> poison, double %8, i64 0
  %12 = shufflevector <2 x double> %11, <2 x double> poison, <2 x i32> zeroinitializer
  %13 = insertelement <2 x double> poison, double %1, i64 0
  %14 = insertelement <2 x double> %13, double %2, i64 1
  %15 = fmul <2 x double> %12, %14
  store <2 x double> %15, ptr %10, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 368
  store double %9, ptr %16, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 376
  store double %4, ptr %17, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %0, i64 384
  %19 = insertelement <2 x double> poison, double %5, i64 0
  %20 = insertelement <2 x double> %19, double %6, i64 1
  %21 = fmul <2 x double> %12, %20
  store <2 x double> %21, ptr %18, align 8, !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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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