; LLVM IR from erwincoumans/tiny-differentiable-simulator :: third_party/cloud_seed/AudioLib/Biquad.ll (ZN8AudioLib6Biquad11GetResponseEf)

; 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 { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, i32, float, float, 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 uwtable
define dso_local noundef float @_ZN8AudioLib6Biquad11GetResponseEf(ptr noundef nonnull align 4 dereferenceable(76) %0, float noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %6 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %7 = load float, ptr %4, align 4, !tbaa !9
  %8 = fpext float %7 to double
  %9 = fmul double 0x401921FB54442D18, %8
  %10 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 0
  %11 = load float, ptr %10, align 4, !tbaa !11
  %12 = fpext float %11 to double
  %13 = fmul double 2.000000e+00, %12
  %14 = fdiv double %9, %13
  %15 = call double @sin(double noundef %14) #5
  %16 = 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 %15, i32 noundef 2)
  %17 = fptrunc double %16 to float
  store float %17, ptr %5, align 4, !tbaa !9
  %18 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 6
  %19 = load float, ptr %18, align 4, !tbaa !14
  %20 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 7
  %21 = load float, ptr %20, align 4, !tbaa !15
  %22 = fadd float %19, %21
  %23 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 8
  %24 = load float, ptr %23, align 4, !tbaa !16
  %25 = fadd float %22, %24
  %26 = call noundef double @_ZSt3powIfdEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(float noundef %25, double noundef 2.000000e+00)
  %27 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 6
  %28 = load float, ptr %27, align 4, !tbaa !14
  %29 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 7
  %30 = load float, ptr %29, align 4, !tbaa !15
  %31 = fmul float %28, %30
  %32 = fpext float %31 to double
  %33 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 6
  %34 = load float, ptr %33, align 4, !tbaa !14
  %35 = fpext float %34 to double
  %36 = fmul double 4.000000e+00, %35
  %37 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 8
  %38 = load float, ptr %37, align 4, !tbaa !16
  %39 = fpext float %38 to double
  %40 = call double @llvm.fmuladd.f64(double %36, double %39, double %32)
  %41 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 7
  %42 = load float, ptr %41, align 4, !tbaa !15
  %43 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 8
  %44 = load float, ptr %43, align 4, !tbaa !16
  %45 = fmul float %42, %44
  %46 = fpext float %45 to double
  %47 = fadd double %40, %46
  %48 = fmul double 4.000000e+00, %47
  %49 = load float, ptr %5, align 4, !tbaa !9
  %50 = fpext float %49 to double
  %51 = fneg double %48
  %52 = call double @llvm.fmuladd.f64(double %51, double %50, double %26)
  %53 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 6
  %54 = load float, ptr %53, align 4, !tbaa !14
  %55 = fpext float %54 to double
  %56 = fmul double 1.600000e+01, %55
  %57 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 8
  %58 = load float, ptr %57, align 4, !tbaa !16
  %59 = fpext float %58 to double
  %60 = fmul double %56, %59
  %61 = load float, ptr %5, align 4, !tbaa !9
  %62 = fpext float %61 to double
  %63 = fmul double %60, %62
  %64 = load float, ptr %5, align 4, !tbaa !9
  %65 = fpext float %64 to double
  %66 = call double @llvm.fmuladd.f64(double %63, double %65, double %52)
  %67 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 4
  %68 = load float, ptr %67, align 4, !tbaa !17
  %69 = fpext float %68 to double
  %70 = fadd double 1.000000e+00, %69
  %71 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 5
  %72 = load float, ptr %71, align 4, !tbaa !18
  %73 = fpext float %72 to double
  %74 = fadd double %70, %73
  %75 = call double @pow(double noundef %74, double noundef 2.000000e+00) #5
  %76 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 4
  %77 = load float, ptr %76, align 4, !tbaa !17
  %78 = fpext float %77 to double
  %79 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 5
  %80 = load float, ptr %79, align 4, !tbaa !18
  %81 = fpext float %80 to double
  %82 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %81, double %78)
  %83 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 4
  %84 = load float, ptr %83, align 4, !tbaa !17
  %85 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 5
  %86 = load float, ptr %85, align 4, !tbaa !18
  %87 = fmul float %84, %86
  %88 = fpext float %87 to double
  %89 = fadd double %82, %88
  %90 = fmul double 4.000000e+00, %89
  %91 = load float, ptr %5, align 4, !tbaa !9
  %92 = fpext float %91 to double
  %93 = fneg double %90
  %94 = call double @llvm.fmuladd.f64(double %93, double %92, double %75)
  %95 = getelementptr inbounds %"class.AudioLib::Biquad", ptr %6, i32 0, i32 5
  %96 = load float, ptr %95, align 4, !tbaa !18
  %97 = fpext float %96 to double
  %98 = fmul double 1.600000e+01, %97
  %99 = load float, ptr %5, align 4, !tbaa !9
  %100 = fpext float %99 to double
  %101 = fmul double %98, %100
  %102 = load float, ptr %5, align 4, !tbaa !9
  %103 = fpext float %102 to double
  %104 = call double @llvm.fmuladd.f64(double %101, double %103, double %94)
  %105 = fdiv double %66, %104
  %106 = fptrunc double %105 to float
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret float %106
}

; 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) #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIfdEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(float noundef, double noundef) #2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"float", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSN8AudioLib6BiquadE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !13, i64 60, !10, i64 64, !10, i64 68, !10, i64 72}
!13 = !{!"_ZTSN8AudioLib6Biquad10FilterTypeE", !7, i64 0}
!14 = !{!12, !10, i64 24}
!15 = !{!12, !10, i64 28}
!16 = !{!12, !10, i64 32}
!17 = !{!12, !10, i64 16}
!18 = !{!12, !10, i64 20}


; 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 nounwind uwtable
define dso_local noundef float @_ZN8AudioLib6Biquad11GetResponseEf(ptr nocapture noundef nonnull readonly align 4 dereferenceable(76) %0, float noundef %1) local_unnamed_addr #0 align 2 {
  %3 = load float, ptr %0, align 4, !tbaa !5
  %4 = insertelement <2 x float> poison, float %1, i64 0
  %5 = insertelement <2 x float> %4, float %3, i64 1
  %6 = fpext <2 x float> %5 to <2 x double>
  %7 = fmul <2 x double> %6, <double 0x401921FB54442D18, double 2.000000e+00>
  %8 = extractelement <2 x double> %7, i64 0
  %9 = extractelement <2 x double> %7, i64 1
  %10 = fdiv double %8, %9
  %11 = tail call double @sin(double noundef %10) #4
  %12 = 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 %11, i32 noundef 2)
  %13 = fptrunc double %12 to float
  %14 = getelementptr inbounds i8, ptr %0, i64 24
  %15 = load float, ptr %14, align 4, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %0, i64 28
  %17 = load float, ptr %16, align 4, !tbaa !12
  %18 = fadd float %15, %17
  %19 = getelementptr inbounds i8, ptr %0, i64 32
  %20 = load float, ptr %19, align 4, !tbaa !13
  %21 = fadd float %18, %20
  %22 = tail call noundef double @_ZSt3powIfdEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(float noundef %21, double noundef 2.000000e+00)
  %23 = load float, ptr %14, align 4, !tbaa !11
  %24 = load float, ptr %16, align 4, !tbaa !12
  %25 = fmul float %23, %24
  %26 = fpext float %23 to double
  %27 = fmul double %26, 4.000000e+00
  %28 = load <4 x float>, ptr %19, align 4
  %29 = shufflevector <4 x float> %28, <4 x float> poison, <2 x i32> <i32 0, i32 poison>
  %30 = fpext float %13 to double
  %31 = fmul double %26, 1.600000e+01
  %32 = getelementptr inbounds i8, ptr %0, i64 16
  %33 = load float, ptr %32, align 4, !tbaa !14
  %34 = getelementptr inbounds i8, ptr %0, i64 20
  %35 = load float, ptr %34, align 4, !tbaa !15
  %36 = insertelement <2 x float> poison, float %25, i64 0
  %37 = insertelement <2 x float> %36, float %33, i64 1
  %38 = fpext <2 x float> %37 to <2 x double>
  %39 = extractelement <2 x double> %38, i64 1
  %40 = fadd double %39, 1.000000e+00
  %41 = insertelement <2 x float> %29, float %35, i64 1
  %42 = fpext <2 x float> %41 to <2 x double>
  %43 = extractelement <2 x double> %42, i64 1
  %44 = fadd double %40, %43
  %square = fmul double %44, %44
  %45 = insertelement <2 x double> <double poison, double 4.000000e+00>, double %27, i64 0
  %46 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %45, <2 x double> %42, <2 x double> %38)
  %47 = insertelement <2 x float> %29, float %33, i64 1
  %48 = insertelement <2 x float> poison, float %24, i64 0
  %49 = insertelement <2 x float> %48, float %35, i64 1
  %50 = fmul <2 x float> %47, %49
  %51 = fpext <2 x float> %50 to <2 x double>
  %52 = fadd <2 x double> %46, %51
  %53 = fmul <2 x double> %52, <double -4.000000e+00, double -4.000000e+00>
  %54 = insertelement <2 x double> poison, double %30, i64 0
  %55 = shufflevector <2 x double> %54, <2 x double> poison, <2 x i32> zeroinitializer
  %56 = insertelement <2 x double> poison, double %22, i64 0
  %57 = insertelement <2 x double> %56, double %square, i64 1
  %58 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %53, <2 x double> %55, <2 x double> %57)
  %59 = insertelement <2 x double> <double poison, double 1.600000e+01>, double %31, i64 0
  %60 = fmul <2 x double> %59, %42
  %61 = fmul <2 x double> %60, %55
  %62 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %61, <2 x double> %55, <2 x double> %58)
  %63 = extractelement <2 x double> %62, i64 0
  %64 = extractelement <2 x double> %62, i64 1
  %65 = fdiv double %63, %64
  %66 = fptrunc double %65 to float
  ret float %66
}

; 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 #1

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

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

; 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 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 = { 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 #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 = { 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 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !10, i64 60, !7, i64 64, !7, i64 68, !7, i64 72}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN8AudioLib6Biquad10FilterTypeE", !8, i64 0}
!11 = !{!6, !7, i64 24}
!12 = !{!6, !7, i64 28}
!13 = !{!6, !7, i64 32}
!14 = !{!6, !7, i64 16}
!15 = !{!6, !7, i64 20}


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