; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/filter (soloud_bassboostfilter)

; 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.SoLoud::FilterInstance" = type { ptr, i32, i32, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6SoLoud23BassboostFilterInstance16fftFilterChannelEPfjfdjj(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef %1, i32 noundef %2, float noundef %3, double noundef %4, i32 noundef %5, i32 noundef %6) unnamed_addr #0 align 2 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i32 %2, ptr %10, align 4, !tbaa !9
  store float %3, ptr %11, align 4, !tbaa !11
  store double %4, ptr %12, align 8, !tbaa !13
  store i32 %5, ptr %13, align 4, !tbaa !9
  store i32 %6, ptr %14, align 4, !tbaa !9
  %16 = load ptr, ptr %8, align 8
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN6SoLoud17FFTFilterInstance13comp2MagPhaseEPfj(ptr noundef nonnull align 8 dereferenceable(176) %16, ptr noundef %17, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %33, %7
  %19 = load i32, ptr %15, align 4, !tbaa !9
  %20 = icmp ult i32 %19, 2
  br i1 %20, label %21, label %36

21:                                               ; preds = %18
  %22 = getelementptr inbounds %"class.SoLoud::FilterInstance", ptr %16, i32 0, i32 3
  %23 = load ptr, ptr %22, align 8, !tbaa !15
  %24 = getelementptr inbounds float, ptr %23, i64 1
  %25 = load float, ptr %24, align 4, !tbaa !11
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = load i32, ptr %15, align 4, !tbaa !9
  %28 = mul i32 %27, 2
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds float, ptr %26, i64 %29
  %31 = load float, ptr %30, align 4, !tbaa !11
  %32 = fmul float %31, %25
  store float %32, ptr %30, align 4, !tbaa !11
  br label %33

33:                                               ; preds = %21
  %34 = load i32, ptr %15, align 4, !tbaa !9
  %35 = add i32 %34, 1
  store i32 %35, ptr %15, align 4, !tbaa !9
  br label %18, !llvm.loop !17

36:                                               ; preds = %18
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN6SoLoud17FFTFilterInstance13magPhase2CompEPfj(ptr noundef nonnull align 8 dereferenceable(176) %16, ptr noundef %37, i32 noundef 2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  ret void
}

declare void @_ZN6SoLoud17FFTFilterInstance13comp2MagPhaseEPfj(ptr noundef nonnull align 8 dereferenceable(176), ptr noundef, i32 noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

declare void @_ZN6SoLoud17FFTFilterInstance13magPhase2CompEPfj(ptr noundef nonnull align 8 dereferenceable(176), ptr noundef, i32 noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

attributes #0 = { 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 #1 = { "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 willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !6, i64 16}
!16 = !{!"_ZTSN6SoLoud14FilterInstanceE", !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


; 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 uwtable
define dso_local void @_ZN6SoLoud23BassboostFilterInstance16fftFilterChannelEPfjfdjj(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef %1, i32 noundef %2, float noundef %3, double noundef %4, i32 noundef %5, i32 noundef %6) unnamed_addr #0 align 2 {
  tail call void @_ZN6SoLoud17FFTFilterInstance13comp2MagPhaseEPfj(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef %1, i32 noundef 2)
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 4
  %11 = load float, ptr %10, align 4, !tbaa !11
  %12 = load float, ptr %1, align 4, !tbaa !11
  %13 = fmul float %11, %12
  store float %13, ptr %1, align 4, !tbaa !11
  %14 = load float, ptr %10, align 4, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %1, i64 8
  %16 = load float, ptr %15, align 4, !tbaa !11
  %17 = fmul float %14, %16
  store float %17, ptr %15, align 4, !tbaa !11
  tail call void @_ZN6SoLoud17FFTFilterInstance13magPhase2CompEPfj(ptr noundef nonnull align 8 dereferenceable(176) %0, ptr noundef nonnull %1, i32 noundef 2)
  ret void
}

declare void @_ZN6SoLoud17FFTFilterInstance13comp2MagPhaseEPfj(ptr noundef nonnull align 8 dereferenceable(176), ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @_ZN6SoLoud17FFTFilterInstance13magPhase2CompEPfj(ptr noundef nonnull align 8 dereferenceable(176), ptr noundef, i32 noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { "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, !10, i64 16}
!6 = !{!"_ZTSN6SoLoud14FilterInstanceE", !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !8, i64 0}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass