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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZN4juce4jmaxIfEET_S1_S1_(float noundef, float noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN4juce4jmaxIdEET_S1_S1_(double noundef, double noundef) #3

; Function Attrs: nounwind
declare double @sqrt(double noundef) #4

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce15IIRCoefficients12makeLowShelfEdddf(ptr dead_on_unwind noalias writable sret(%"class.juce::IIRCoefficients") align 4 %0, double noundef %1, double noundef %2, double noundef %3, float noundef %4) #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca float, align 4
  %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
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  store ptr %0, ptr %6, align 8
  store double %1, ptr %7, align 8, !tbaa !5
  store double %2, ptr %8, align 8, !tbaa !5
  store double %3, ptr %9, align 8, !tbaa !5
  store float %4, ptr %10, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %5
  br label %19

19:                                               ; preds = %18
  br label %20

20:                                               ; preds = %19
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %27 = load float, ptr %10, align 4, !tbaa !9
  %28 = invoke noundef float @_ZSt4sqrtf(float noundef %27)
          to label %29 unwind label %92

29:                                               ; preds = %26
  %30 = invoke noundef float @_ZN4juce4jmaxIfEET_S1_S1_(float noundef 0.000000e+00, float noundef %28)
          to label %31 unwind label %92

31:                                               ; preds = %29
  %32 = fpext float %30 to double
  store double %32, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %33 = load double, ptr %11, align 8, !tbaa !5
  %34 = fsub double %33, 1.000000e+00
  store double %34, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %35 = load double, ptr %11, align 8, !tbaa !5
  %36 = fadd double %35, 1.000000e+00
  store double %36, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %37 = load double, ptr %8, align 8, !tbaa !5
  %38 = invoke noundef double @_ZN4juce4jmaxIdEET_S1_S1_(double noundef %37, double noundef 2.000000e+00)
          to label %39 unwind label %92

39:                                               ; preds = %31
  %40 = fmul double 0x401921FB54442D18, %38
  %41 = load double, ptr %7, align 8, !tbaa !5
  %42 = fdiv double %40, %41
  store double %42, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %43 = load double, ptr %14, align 8, !tbaa !5
  %44 = call double @cos(double noundef %43) #6
  store double %44, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %45 = load double, ptr %14, align 8, !tbaa !5
  %46 = call double @sin(double noundef %45) #6
  %47 = load double, ptr %11, align 8, !tbaa !5
  %48 = call double @sqrt(double noundef %47) #6
  %49 = fmul double %46, %48
  %50 = load double, ptr %9, align 8, !tbaa !5
  %51 = fdiv double %49, %50
  store double %51, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %52 = load double, ptr %12, align 8, !tbaa !5
  %53 = load double, ptr %15, align 8, !tbaa !5
  %54 = fmul double %52, %53
  store double %54, ptr %17, align 8, !tbaa !5
  %55 = load double, ptr %11, align 8, !tbaa !5
  %56 = load double, ptr %13, align 8, !tbaa !5
  %57 = load double, ptr %17, align 8, !tbaa !5
  %58 = fsub double %56, %57
  %59 = load double, ptr %16, align 8, !tbaa !5
  %60 = fadd double %58, %59
  %61 = fmul double %55, %60
  %62 = load double, ptr %11, align 8, !tbaa !5
  %63 = fmul double %62, 2.000000e+00
  %64 = load double, ptr %12, align 8, !tbaa !5
  %65 = load double, ptr %13, align 8, !tbaa !5
  %66 = load double, ptr %15, align 8, !tbaa !5
  %67 = fneg double %65
  %68 = call double @llvm.fmuladd.f64(double %67, double %66, double %64)
  %69 = fmul double %63, %68
  %70 = load double, ptr %11, align 8, !tbaa !5
  %71 = load double, ptr %13, align 8, !tbaa !5
  %72 = load double, ptr %17, align 8, !tbaa !5
  %73 = fsub double %71, %72
  %74 = load double, ptr %16, align 8, !tbaa !5
  %75 = fsub double %73, %74
  %76 = fmul double %70, %75
  %77 = load double, ptr %13, align 8, !tbaa !5
  %78 = load double, ptr %17, align 8, !tbaa !5
  %79 = fadd double %77, %78
  %80 = load double, ptr %16, align 8, !tbaa !5
  %81 = fadd double %79, %80
  %82 = load double, ptr %12, align 8, !tbaa !5
  %83 = load double, ptr %13, align 8, !tbaa !5
  %84 = load double, ptr %15, align 8, !tbaa !5
  %85 = call double @llvm.fmuladd.f64(double %83, double %84, double %82)
  %86 = fmul double -2.000000e+00, %85
  %87 = load double, ptr %13, align 8, !tbaa !5
  %88 = load double, ptr %17, align 8, !tbaa !5
  %89 = fadd double %87, %88
  %90 = load double, ptr %16, align 8, !tbaa !5
  %91 = fsub double %89, %90
  call void @_ZN4juce15IIRCoefficientsC1Edddddd(ptr noundef nonnull align 4 dereferenceable(20) %0, double noundef %61, double noundef %69, double noundef %76, double noundef %81, double noundef %86, double noundef %91) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  ret void

92:                                               ; preds = %31, %29, %26
  %93 = landingpad { ptr, i32 }
          catch ptr null
  %94 = extractvalue { ptr, i32 } %93, 0
  call void @__clang_call_terminate(ptr %94) #7
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float noundef) #5

; Function Attrs: nounwind
declare double @cos(double noundef) #4

; Function Attrs: nounwind
declare double @sin(double noundef) #4

declare void @_ZN4juce15IIRCoefficientsC1Edddddd(ptr, double, double, double, double, double, double)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { noinline noreturn nounwind uwtable "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 = { 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 #4 = { nounwind "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 #5 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { noreturn 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 = !{!"double", !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"

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZN4juce4jmaxIfEET_S1_S1_(float noundef, float noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN4juce4jmaxIdEET_S1_S1_(double noundef, double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce15IIRCoefficients12makeLowShelfEdddf(ptr dead_on_unwind noalias writable sret(%"class.juce::IIRCoefficients") align 4 %0, double noundef %1, double noundef %2, double noundef %3, float noundef %4) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %6 = tail call noundef float @_ZSt4sqrtf(float noundef %4)
  %7 = tail call noundef float @_ZN4juce4jmaxIfEET_S1_S1_(float noundef 0.000000e+00, float noundef %6)
  %8 = fpext float %7 to double
  %9 = fadd double %8, -1.000000e+00
  %10 = fadd double %8, 1.000000e+00
  %11 = tail call noundef double @_ZN4juce4jmaxIdEET_S1_S1_(double noundef %2, double noundef 2.000000e+00)
  %12 = fmul double %11, 0x401921FB54442D18
  %13 = fdiv double %12, %1
  %14 = tail call double @cos(double noundef %13) #4
  %15 = tail call double @sin(double noundef %13) #4
  %16 = tail call double @sqrt(double noundef %8) #4
  %17 = fmul double %15, %16
  %18 = fdiv double %17, %3
  %19 = fmul double %9, %14
  %20 = fsub double %10, %19
  %21 = fadd double %20, %18
  %22 = fmul double %21, %8
  %23 = fmul double %8, 2.000000e+00
  %24 = fneg double %10
  %25 = tail call double @llvm.fmuladd.f64(double %24, double %14, double %9)
  %26 = fmul double %23, %25
  %27 = fsub double %20, %18
  %28 = fmul double %27, %8
  %29 = fadd double %10, %19
  %30 = fadd double %29, %18
  %31 = tail call double @llvm.fmuladd.f64(double %10, double %14, double %9)
  %32 = fmul double %31, -2.000000e+00
  %33 = fsub double %29, %18
  tail call void @_ZN4juce15IIRCoefficientsC1Edddddd(ptr noundef nonnull align 4 dereferenceable(20) %0, double noundef %22, double noundef %26, double noundef %28, double noundef %30, double noundef %32, double noundef %33) #4
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #2

declare void @_ZN4juce15IIRCoefficientsC1Edddddd(ptr, double, double, double, double, double, double) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { mustprogress nofree nounwind willreturn memory(write) "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 = { inlinehint 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 #4 = { 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)"}


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