; LLVM IR from suxiaojack/sapDecoder :: src/filter_impl.ll (ZNK10FilterImpl17InverseFFTScalingEPSt6vectorIfSaIfEE)

; 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.FilterImpl = type { ptr, i32, i32, %"class.std::vector", %"class.std::vector", i8, %"class.std::vector", %"class.std::vector.0", i32, %"class.std::vector.5", %"class.std::vector.10", %"class.std::vector.0", ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<std::vector<float>, std::allocator<std::vector<float>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<float>, std::allocator<std::vector<float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<float>, std::allocator<std::vector<float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<float>, std::allocator<std::vector<float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<std::vector<kiss_fft_cpx>, std::allocator<std::vector<kiss_fft_cpx>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<kiss_fft_cpx>, std::allocator<std::vector<kiss_fft_cpx>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<kiss_fft_cpx>, std::allocator<std::vector<kiss_fft_cpx>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<kiss_fft_cpx>, std::allocator<std::vector<kiss_fft_cpx>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<kiss_fft_cpx, std::allocator<kiss_fft_cpx>>::_Vector_impl" }
%"struct.std::_Vector_base<kiss_fft_cpx, std::allocator<kiss_fft_cpx>>::_Vector_impl" = type { %"struct.std::_Vector_base<kiss_fft_cpx, std::allocator<kiss_fft_cpx>>::_Vector_impl_data" }
%"struct.std::_Vector_base<kiss_fft_cpx, std::allocator<kiss_fft_cpx>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.2 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__._ZNK10FilterImpl17InverseFFTScalingEPSt6vectorIfSaIfEE = external hidden unnamed_addr constant [58 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [27 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZNK10FilterImpl17InverseFFTScalingEPSt6vectorIfSaIfEE(ptr noundef nonnull align 8 dereferenceable(216) %0, ptr noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = icmp ne ptr %7, null
  br i1 %8, label %9, label %10

9:                                                ; preds = %2
  br label %12

10:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.2, i32 noundef 95, ptr noundef @__PRETTY_FUNCTION__._ZNK10FilterImpl17InverseFFTScalingEPSt6vectorIfSaIfEE) #3
  unreachable

11:                                               ; No predecessors!
  br label %12

12:                                               ; preds = %11, %9
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  %15 = getelementptr inbounds %class.FilterImpl, ptr %6, i32 0, i32 2
  %16 = load i32, ptr %15, align 4, !tbaa !9
  %17 = sext i32 %16 to i64
  %18 = icmp eq i64 %14, %17
  br i1 %18, label %19, label %20

19:                                               ; preds = %12
  br label %22

20:                                               ; preds = %12
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.2, i32 noundef 96, ptr noundef @__PRETTY_FUNCTION__._ZNK10FilterImpl17InverseFFTScalingEPSt6vectorIfSaIfEE) #3
  unreachable

21:                                               ; No predecessors!
  br label %22

22:                                               ; preds = %21, %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !29
  br label %23

23:                                               ; preds = %39, %22
  %24 = load i32, ptr %5, align 4, !tbaa !29
  %25 = getelementptr inbounds %class.FilterImpl, ptr %6, i32 0, i32 2
  %26 = load i32, ptr %25, align 4, !tbaa !9
  %27 = icmp slt i32 %24, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %42

29:                                               ; preds = %23
  %30 = getelementptr inbounds %class.FilterImpl, ptr %6, i32 0, i32 2
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = sitofp i32 %31 to float
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = load i32, ptr %5, align 4, !tbaa !29
  %35 = sext i32 %34 to i64
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %35) #4
  %37 = load float, ptr %36, align 4, !tbaa !30
  %38 = fdiv float %37, %32
  store float %38, ptr %36, align 4, !tbaa !30
  br label %39

39:                                               ; preds = %29
  %40 = load i32, ptr %5, align 4, !tbaa !29
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %5, align 4, !tbaa !29
  br label %23, !llvm.loop !32

42:                                               ; preds = %28
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn 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 = { 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 = { noreturn nounwind }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 12}
!10 = !{!"_ZTS10FilterImpl", !11, i64 8, !11, i64 12, !12, i64 16, !12, i64 40, !16, i64 64, !12, i64 72, !17, i64 96, !11, i64 120, !21, i64 128, !25, i64 152, !17, i64 176, !6, i64 200, !6, i64 208}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIfSaIfEE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSSt6vectorI12kiss_fft_cpxSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseI12kiss_fft_cpxSaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseI12kiss_fft_cpxSaIS0_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseI12kiss_fft_cpxSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSSt6vectorIS_IfSaIfEESaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"_ZTSSt6vectorIS_I12kiss_fft_cpxSaIS0_EESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseISt6vectorI12kiss_fft_cpxSaIS1_EESaIS3_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseISt6vectorI12kiss_fft_cpxSaIS1_EESaIS3_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseISt6vectorI12kiss_fft_cpxSaIS1_EESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!11, !11, i64 0}
!30 = !{!31, !31, i64 0}
!31 = !{!"float", !7, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"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"

@.str.2 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__._ZNK10FilterImpl17InverseFFTScalingEPSt6vectorIfSaIfEE = external hidden unnamed_addr constant [58 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZNK10FilterImpl17InverseFFTScalingEPSt6vectorIfSaIfEE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(216) %0, ptr noundef %1) local_unnamed_addr #1 align 2 {
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %3, label %4

3:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.2, i32 noundef 95, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK10FilterImpl17InverseFFTScalingEPSt6vectorIfSaIfEE) #2
  unreachable

4:                                                ; preds = %2
  %5 = tail call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  %6 = getelementptr inbounds i8, ptr %0, i64 12
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = icmp eq i64 %5, %8
  br i1 %9, label %.preheader, label %11

.preheader:                                       ; preds = %4
  %10 = icmp sgt i32 %7, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

11:                                               ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.2, i32 noundef 96, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK10FilterImpl17InverseFFTScalingEPSt6vectorIfSaIfEE) #2
  unreachable

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  ret void

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  %12 = phi i32 [ %17, %.lr.ph ], [ %7, %.preheader ]
  %13 = sitofp i32 %12 to float
  %14 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #3
  %15 = load float, ptr %14, align 4, !tbaa !28
  %16 = fdiv float %15, %13
  store float %16, ptr %14, align 4, !tbaa !28
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = load i32, ptr %6, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %indvars.iv.next, %18
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !30
}

attributes #0 = { noreturn 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 #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 = { noreturn nounwind }
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, !7, i64 12}
!6 = !{!"_ZTS10FilterImpl", !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 40, !15, i64 64, !10, i64 72, !16, i64 96, !7, i64 120, !20, i64 128, !24, i64 152, !16, i64 176, !14, i64 200, !14, i64 208}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIfSaIfEE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"bool", !8, i64 0}
!16 = !{!"_ZTSSt6vectorI12kiss_fft_cpxSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseI12kiss_fft_cpxSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI12kiss_fft_cpxSaIS0_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseI12kiss_fft_cpxSaIS0_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!20 = !{!"_ZTSSt6vectorIS_IfSaIfEESaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseISt6vectorIfSaIfEESaIS2_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!24 = !{!"_ZTSSt6vectorIS_I12kiss_fft_cpxSaIS0_EESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseISt6vectorI12kiss_fft_cpxSaIS1_EESaIS3_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseISt6vectorI12kiss_fft_cpxSaIS1_EESaIS3_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseISt6vectorI12kiss_fft_cpxSaIS1_EESaIS3_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!28 = !{!29, !29, i64 0}
!29 = !{!"float", !8, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass