; LLVM IR from xunil-cloud/CloudReverb :: audio_engine/AudioLib/Biquad.ll (ZN8AudioLib6Biquad11GetResponseEd)

; 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.AudioLib::Biquad" = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, i32, double, double, double }

; 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: nounwind
declare double @sin(double noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN8AudioLib6Biquad11GetResponseEd(ptr noundef nonnull align 8 dereferenceable(144) %0, double noundef %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  %6 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %7 = load double, ptr %4, align 8, !tbaa !9
  %8 = fmul double 0x401921FB54442D18, %7
  %9 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 0
  %10 = load double, ptr %9, align 8, !tbaa !11
  %11 = fmul double 2.000000e+00, %10
  %12 = fdiv double %8, %11
  %13 = call double @sin(double noundef %12) #5
  %14 = call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef %13, i32 noundef 2)
  store double %14, ptr %5, align 8, !tbaa !9
  %15 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 5
  %16 = load double, ptr %15, align 8, !tbaa !14
  %17 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 6
  %18 = load double, ptr %17, align 8, !tbaa !15
  %19 = fadd double %16, %18
  %20 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 7
  %21 = load double, ptr %20, align 8, !tbaa !16
  %22 = fadd double %19, %21
  %23 = call double @pow(double noundef %22, double noundef 2.000000e+00) #5
  %24 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 5
  %25 = load double, ptr %24, align 8, !tbaa !14
  %26 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 6
  %27 = load double, ptr %26, align 8, !tbaa !15
  %28 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 5
  %29 = load double, ptr %28, align 8, !tbaa !14
  %30 = fmul double 4.000000e+00, %29
  %31 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 7
  %32 = load double, ptr %31, align 8, !tbaa !16
  %33 = fmul double %30, %32
  %34 = call double @llvm.fmuladd.f64(double %25, double %27, double %33)
  %35 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 6
  %36 = load double, ptr %35, align 8, !tbaa !15
  %37 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 7
  %38 = load double, ptr %37, align 8, !tbaa !16
  %39 = call double @llvm.fmuladd.f64(double %36, double %38, double %34)
  %40 = fmul double 4.000000e+00, %39
  %41 = load double, ptr %5, align 8, !tbaa !9
  %42 = fneg double %40
  %43 = call double @llvm.fmuladd.f64(double %42, double %41, double %23)
  %44 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 5
  %45 = load double, ptr %44, align 8, !tbaa !14
  %46 = fmul double 1.600000e+01, %45
  %47 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 7
  %48 = load double, ptr %47, align 8, !tbaa !16
  %49 = fmul double %46, %48
  %50 = load double, ptr %5, align 8, !tbaa !9
  %51 = fmul double %49, %50
  %52 = load double, ptr %5, align 8, !tbaa !9
  %53 = call double @llvm.fmuladd.f64(double %51, double %52, double %43)
  %54 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 3
  %55 = load double, ptr %54, align 8, !tbaa !17
  %56 = fadd double 1.000000e+00, %55
  %57 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 4
  %58 = load double, ptr %57, align 8, !tbaa !18
  %59 = fadd double %56, %58
  %60 = call double @pow(double noundef %59, double noundef 2.000000e+00) #5
  %61 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 3
  %62 = load double, ptr %61, align 8, !tbaa !17
  %63 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 4
  %64 = load double, ptr %63, align 8, !tbaa !18
  %65 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %64, double %62)
  %66 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 3
  %67 = load double, ptr %66, align 8, !tbaa !17
  %68 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 4
  %69 = load double, ptr %68, align 8, !tbaa !18
  %70 = call double @llvm.fmuladd.f64(double %67, double %69, double %65)
  %71 = fmul double 4.000000e+00, %70
  %72 = load double, ptr %5, align 8, !tbaa !9
  %73 = fneg double %71
  %74 = call double @llvm.fmuladd.f64(double %73, double %72, double %60)
  %75 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 4
  %76 = load double, ptr %75, align 8, !tbaa !18
  %77 = fmul double 1.600000e+01, %76
  %78 = load double, ptr %5, align 8, !tbaa !9
  %79 = fmul double %77, %78
  %80 = load double, ptr %5, align 8, !tbaa !9
  %81 = call double @llvm.fmuladd.f64(double %79, double %80, double %74)
  %82 = fdiv double %53, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret double %82
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef, i32 noundef) #4

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress 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 = { 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 #5 = { 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, !10, i64 0}
!12 = !{!"_ZTSN8AudioLib6BiquadE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !13, i64 112, !10, i64 120, !10, i64 128, !10, i64 136}
!13 = !{!"_ZTSN8AudioLib6Biquad10FilterTypeE", !7, i64 0}
!14 = !{!12, !10, i64 40}
!15 = !{!12, !10, i64 48}
!16 = !{!12, !10, i64 56}
!17 = !{!12, !10, i64 24}
!18 = !{!12, !10, i64 32}


; 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 nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN8AudioLib6Biquad11GetResponseEd(ptr nocapture noundef nonnull readonly align 8 dereferenceable(144) %0, double noundef %1) local_unnamed_addr #1 align 2 {
  %3 = fmul double %1, 0x401921FB54442D18
  %4 = load double, ptr %0, align 8, !tbaa !5
  %5 = fmul double %4, 2.000000e+00
  %6 = fdiv double %3, %5
  %7 = tail call double @sin(double noundef %6) #4
  %8 = tail call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef %7, i32 noundef 2)
  %9 = getelementptr inbounds i8, ptr %0, i64 48
  %10 = load <2 x double>, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr %0, i64 56
  %12 = load double, ptr %11, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = load double, ptr %13, align 8, !tbaa !12
  %15 = getelementptr inbounds i8, ptr %0, i64 32
  %16 = load <2 x double>, ptr %15, align 8, !tbaa !13
  %17 = extractelement <2 x double> %16, i64 1
  %18 = fmul double %17, 4.000000e+00
  %19 = fmul double %18, %12
  %20 = fmul double %17, 1.600000e+01
  %21 = insertelement <2 x double> %10, double %14, i64 1
  %22 = shufflevector <2 x double> %16, <2 x double> <double poison, double 1.000000e+00>, <2 x i32> <i32 1, i32 3>
  %23 = fadd <2 x double> %21, %22
  %24 = insertelement <2 x double> poison, double %12, i64 0
  %25 = shufflevector <2 x double> %24, <2 x double> %16, <2 x i32> <i32 0, i32 2>
  %26 = fadd <2 x double> %23, %25
  %27 = fmul <2 x double> %26, %26
  %28 = shufflevector <2 x double> %10, <2 x double> <double 4.000000e+00, double poison>, <2 x i32> <i32 2, i32 0>
  %29 = insertelement <2 x double> poison, double %14, i64 0
  %30 = insertelement <2 x double> %29, double %19, i64 1
  %31 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %16, <2 x double> %28, <2 x double> %30)
  %32 = shufflevector <2 x double> %31, <2 x double> poison, <2 x i32> <i32 1, i32 0>
  %33 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %21, <2 x double> %25, <2 x double> %32)
  %34 = fmul <2 x double> %33, <double -4.000000e+00, double -4.000000e+00>
  %35 = insertelement <2 x double> poison, double %8, i64 0
  %36 = shufflevector <2 x double> %35, <2 x double> poison, <2 x i32> zeroinitializer
  %37 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %34, <2 x double> %36, <2 x double> %27)
  %38 = insertelement <2 x double> <double poison, double 1.600000e+01>, double %20, i64 0
  %39 = fmul <2 x double> %38, %25
  %40 = fmul <2 x double> %36, %39
  %41 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %40, <2 x double> %36, <2 x double> %37)
  %42 = extractelement <2 x double> %41, i64 0
  %43 = extractelement <2 x double> %41, i64 1
  %44 = fdiv double %42, %43
  ret double %44
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #3

attributes #0 = { 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 #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 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN8AudioLib6BiquadE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !10, i64 112, !7, i64 120, !7, i64 128, !7, i64 136}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN8AudioLib6Biquad10FilterTypeE", !8, i64 0}
!11 = !{!6, !7, i64 56}
!12 = !{!6, !7, i64 24}
!13 = !{!7, !7, i64 0}


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