; LLVM IR from HiFi-LoFi/FFTConvolver :: TwoStageFFTConvolver.ll (ZN12fftconvolver20TwoStageFFTConvolver5resetEv)

; 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.fftconvolver::TwoStageFFTConvolver" = type { ptr, i64, i64, %"class.fftconvolver::FFTConvolver", %"class.fftconvolver::FFTConvolver", %"class.fftconvolver::Buffer", %"class.fftconvolver::Buffer", %"class.fftconvolver::FFTConvolver", %"class.fftconvolver::Buffer", %"class.fftconvolver::Buffer", %"class.fftconvolver::Buffer", i64, i64, %"class.fftconvolver::Buffer" }
%"class.fftconvolver::FFTConvolver" = type { ptr, i64, i64, i64, i64, %"class.std::vector", %"class.std::vector", %"class.fftconvolver::Buffer", %"class.audiofft::AudioFFT", %"class.fftconvolver::SplitComplex", %"class.fftconvolver::SplitComplex", %"class.fftconvolver::Buffer", i64, %"class.fftconvolver::Buffer", i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<fftconvolver::SplitComplex *, std::allocator<fftconvolver::SplitComplex *>>::_Vector_impl" }
%"struct.std::_Vector_base<fftconvolver::SplitComplex *, std::allocator<fftconvolver::SplitComplex *>>::_Vector_impl" = type { %"struct.std::_Vector_base<fftconvolver::SplitComplex *, std::allocator<fftconvolver::SplitComplex *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<fftconvolver::SplitComplex *, std::allocator<fftconvolver::SplitComplex *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.audiofft::AudioFFT" = type { %"class.std::unique_ptr" }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.fftconvolver::SplitComplex" = type { i64, %"class.fftconvolver::Buffer", %"class.fftconvolver::Buffer" }
%"class.fftconvolver::Buffer" = type { ptr, ptr, i64 }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12fftconvolver20TwoStageFFTConvolver5resetEv(ptr noundef nonnull align 8 dereferenceable(1072) %0) #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %"class.fftconvolver::TwoStageFFTConvolver", ptr %3, i32 0, i32 1
  store i64 0, ptr %4, align 8, !tbaa !9
  %5 = getelementptr inbounds %"class.fftconvolver::TwoStageFFTConvolver", ptr %3, i32 0, i32 2
  store i64 0, ptr %5, align 8, !tbaa !26
  %6 = getelementptr inbounds %"class.fftconvolver::TwoStageFFTConvolver", ptr %3, i32 0, i32 3
  call void @_ZN12fftconvolver12FFTConvolver5resetEv(ptr noundef nonnull align 8 dereferenceable(296) %6)
  %7 = getelementptr inbounds %"class.fftconvolver::TwoStageFFTConvolver", ptr %3, i32 0, i32 4
  call void @_ZN12fftconvolver12FFTConvolver5resetEv(ptr noundef nonnull align 8 dereferenceable(296) %7)
  %8 = getelementptr inbounds %"class.fftconvolver::TwoStageFFTConvolver", ptr %3, i32 0, i32 5
  call void @_ZN12fftconvolver6BufferIfE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %9 = getelementptr inbounds %"class.fftconvolver::TwoStageFFTConvolver", ptr %3, i32 0, i32 6
  call void @_ZN12fftconvolver6BufferIfE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %10 = getelementptr inbounds %"class.fftconvolver::TwoStageFFTConvolver", ptr %3, i32 0, i32 7
  call void @_ZN12fftconvolver12FFTConvolver5resetEv(ptr noundef nonnull align 8 dereferenceable(296) %10)
  %11 = getelementptr inbounds %"class.fftconvolver::TwoStageFFTConvolver", ptr %3, i32 0, i32 8
  call void @_ZN12fftconvolver6BufferIfE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %12 = getelementptr inbounds %"class.fftconvolver::TwoStageFFTConvolver", ptr %3, i32 0, i32 9
  call void @_ZN12fftconvolver6BufferIfE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %13 = getelementptr inbounds %"class.fftconvolver::TwoStageFFTConvolver", ptr %3, i32 0, i32 10
  call void @_ZN12fftconvolver6BufferIfE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
  %14 = getelementptr inbounds %"class.fftconvolver::TwoStageFFTConvolver", ptr %3, i32 0, i32 11
  store i64 0, ptr %14, align 8, !tbaa !27
  %15 = getelementptr inbounds %"class.fftconvolver::TwoStageFFTConvolver", ptr %3, i32 0, i32 11
  store i64 0, ptr %15, align 8, !tbaa !27
  %16 = getelementptr inbounds %"class.fftconvolver::TwoStageFFTConvolver", ptr %3, i32 0, i32 12
  store i64 0, ptr %16, align 8, !tbaa !28
  %17 = getelementptr inbounds %"class.fftconvolver::TwoStageFFTConvolver", ptr %3, i32 0, i32 13
  call void @_ZN12fftconvolver6BufferIfE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %17)
  ret void
}

declare void @_ZN12fftconvolver12FFTConvolver5resetEv(ptr noundef nonnull align 8 dereferenceable(296)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12fftconvolver6BufferIfE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 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" }

!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, !11, i64 8}
!10 = !{!"_ZTSN12fftconvolver20TwoStageFFTConvolverE", !11, i64 8, !11, i64 16, !12, i64 24, !12, i64 320, !17, i64 616, !17, i64 640, !12, i64 664, !17, i64 960, !17, i64 984, !17, i64 1008, !11, i64 1032, !11, i64 1040, !17, i64 1048}
!11 = !{!"long", !7, i64 0}
!12 = !{!"_ZTSN12fftconvolver12FFTConvolverE", !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !13, i64 40, !13, i64 64, !17, i64 88, !18, i64 112, !25, i64 120, !25, i64 176, !17, i64 232, !11, i64 256, !17, i64 264, !11, i64 288}
!13 = !{!"_ZTSSt6vectorIPN12fftconvolver12SplitComplexESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIPN12fftconvolver12SplitComplexESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPN12fftconvolver12SplitComplexESaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIPN12fftconvolver12SplitComplexESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTSN12fftconvolver6BufferIfEE", !6, i64 8, !11, i64 16}
!18 = !{!"_ZTSN8audiofft8AudioFFTE", !19, i64 0}
!19 = !{!"_ZTSSt10unique_ptrIN8audiofft6detail12AudioFFTImplESt14default_deleteIS2_EE", !20, i64 0}
!20 = !{!"_ZTSSt15__uniq_ptr_dataIN8audiofft6detail12AudioFFTImplESt14default_deleteIS2_ELb1ELb1EE", !21, i64 0}
!21 = !{!"_ZTSSt15__uniq_ptr_implIN8audiofft6detail12AudioFFTImplESt14default_deleteIS2_EE", !22, i64 0}
!22 = !{!"_ZTSSt5tupleIJPN8audiofft6detail12AudioFFTImplESt14default_deleteIS2_EEE", !23, i64 0}
!23 = !{!"_ZTSSt11_Tuple_implILm0EJPN8audiofft6detail12AudioFFTImplESt14default_deleteIS2_EEE", !24, i64 0}
!24 = !{!"_ZTSSt10_Head_baseILm0EPN8audiofft6detail12AudioFFTImplELb0EE", !6, i64 0}
!25 = !{!"_ZTSN12fftconvolver12SplitComplexE", !11, i64 0, !17, i64 8, !17, i64 32}
!26 = !{!10, !11, i64 16}
!27 = !{!10, !11, i64 1032}
!28 = !{!10, !11, i64 1040}


; 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 @_ZN12fftconvolver20TwoStageFFTConvolver5resetEv(ptr noundef nonnull align 8 dereferenceable(1072) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %2, i8 0, i64 16, i1 false)
  tail call void @_ZN12fftconvolver12FFTConvolver5resetEv(ptr noundef nonnull align 8 dereferenceable(296) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 320
  tail call void @_ZN12fftconvolver12FFTConvolver5resetEv(ptr noundef nonnull align 8 dereferenceable(296) %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 616
  tail call void @_ZN12fftconvolver6BufferIfE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %6 = getelementptr inbounds i8, ptr %0, i64 640
  tail call void @_ZN12fftconvolver6BufferIfE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  %7 = getelementptr inbounds i8, ptr %0, i64 664
  tail call void @_ZN12fftconvolver12FFTConvolver5resetEv(ptr noundef nonnull align 8 dereferenceable(296) %7)
  %8 = getelementptr inbounds i8, ptr %0, i64 960
  tail call void @_ZN12fftconvolver6BufferIfE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %9 = getelementptr inbounds i8, ptr %0, i64 984
  tail call void @_ZN12fftconvolver6BufferIfE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %10 = getelementptr inbounds i8, ptr %0, i64 1008
  tail call void @_ZN12fftconvolver6BufferIfE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
  %11 = getelementptr inbounds i8, ptr %0, i64 1032
  %12 = getelementptr inbounds i8, ptr %0, i64 1048
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %11, i8 0, i64 16, i1 false)
  tail call void @_ZN12fftconvolver6BufferIfE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  ret void
}

declare void @_ZN12fftconvolver12FFTConvolver5resetEv(ptr noundef nonnull align 8 dereferenceable(296)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12fftconvolver6BufferIfE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 nounwind willreturn memory(argmem: write) }

!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,InstCombinePass,MemCpyOptPass,SROAPass,TailCallElimPass