; LLVM IR from sp-nitech/SPTK :: src/analysis (adaptive_mel_generalized_cepstral_analysis)

; 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.sptk::AdaptiveMelGeneralizedCepstralAnalysis" = type <{ ptr, %"class.sptk::AdaptiveGeneralizedCepstralAnalysis", %"class.sptk::AdaptiveMelCepstralAnalysis", i8, [7 x i8] }>
%"class.sptk::AdaptiveGeneralizedCepstralAnalysis" = type <{ ptr, i32, [4 x i8], double, double, double, double, i8, [7 x i8], %"class.sptk::GeneralizedCepstrumInverseGainNormalization", i8, [7 x i8] }>
%"class.sptk::GeneralizedCepstrumInverseGainNormalization" = type <{ ptr, i32, [4 x i8], double, i8, [7 x i8] }>
%"class.sptk::AdaptiveMelCepstralAnalysis" = type <{ ptr, double, double, double, double, i8, [7 x i8], %"class.sptk::MlsaDigitalFilter", %"class.sptk::MlsaDigitalFilterCoefficientsToMelCepstrum", i8, [7 x i8] }>
%"class.sptk::MlsaDigitalFilter" = type { ptr, i32, i32, double, i8, i8, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.sptk::MlsaDigitalFilterCoefficientsToMelCepstrum" = type <{ ptr, i32, [4 x i8], double, i8, [7 x i8] }>
%"class.sptk::AdaptiveMelGeneralizedCepstralAnalysis::Buffer" = type { ptr, %"class.sptk::AdaptiveGeneralizedCepstralAnalysis::Buffer", %"class.sptk::AdaptiveMelCepstralAnalysis::Buffer" }
%"class.sptk::AdaptiveGeneralizedCepstralAnalysis::Buffer" = type { ptr, double, double, %"class.std::vector", %"class.std::vector", %"class.std::vector" }
%"class.sptk::AdaptiveMelCepstralAnalysis::Buffer" = type { ptr, double, double, %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.sptk::MlsaDigitalFilter::Buffer" }
%"class.sptk::MlsaDigitalFilter::Buffer" = type { ptr, %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector" }

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4sptk38AdaptiveMelGeneralizedCepstralAnalysis3RunEdPdPSt6vectorIdSaIdEEPNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(249) %0, double noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #0 align 2 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %12 = load ptr, ptr %7, align 8
  %13 = getelementptr inbounds %"class.sptk::AdaptiveMelGeneralizedCepstralAnalysis", ptr %12, i32 0, i32 3
  %14 = load i8, ptr %13, align 8, !tbaa !11, !range !24, !noundef !25
  %15 = trunc i8 %14 to i1
  br i1 %15, label %16, label %25

16:                                               ; preds = %5
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = icmp eq ptr null, %17
  br i1 %18, label %25, label %19

19:                                               ; preds = %16
  %20 = load ptr, ptr %10, align 8, !tbaa !5
  %21 = icmp eq ptr null, %20
  br i1 %21, label %25, label %22

22:                                               ; preds = %19
  %23 = load ptr, ptr %11, align 8, !tbaa !5
  %24 = icmp eq ptr null, %23
  br i1 %24, label %25, label %26

25:                                               ; preds = %22, %19, %16, %5
  store i1 false, ptr %6, align 1
  br label %46

26:                                               ; preds = %22
  %27 = getelementptr inbounds %"class.sptk::AdaptiveMelGeneralizedCepstralAnalysis", ptr %12, i32 0, i32 1
  %28 = call noundef i32 @_ZNK4sptk35AdaptiveGeneralizedCepstralAnalysis11GetNumStageEv(ptr noundef nonnull align 8 dereferenceable(89) %27)
  %29 = icmp eq i32 0, %28
  br i1 %29, label %30, label %38

30:                                               ; preds = %26
  %31 = getelementptr inbounds %"class.sptk::AdaptiveMelGeneralizedCepstralAnalysis", ptr %12, i32 0, i32 2
  %32 = load double, ptr %8, align 8, !tbaa !9
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = getelementptr inbounds %"class.sptk::AdaptiveMelGeneralizedCepstralAnalysis::Buffer", ptr %35, i32 0, i32 2
  %37 = call noundef zeroext i1 @_ZNK4sptk27AdaptiveMelCepstralAnalysis3RunEdPdPSt6vectorIdSaIdEEPNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(137) %31, double noundef %32, ptr noundef %33, ptr noundef %34, ptr noundef %36)
  store i1 %37, ptr %6, align 1
  br label %46

38:                                               ; preds = %26
  %39 = getelementptr inbounds %"class.sptk::AdaptiveMelGeneralizedCepstralAnalysis", ptr %12, i32 0, i32 1
  %40 = load double, ptr %8, align 8, !tbaa !9
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  %44 = getelementptr inbounds %"class.sptk::AdaptiveMelGeneralizedCepstralAnalysis::Buffer", ptr %43, i32 0, i32 1
  %45 = call noundef zeroext i1 @_ZNK4sptk35AdaptiveGeneralizedCepstralAnalysis3RunEdPdPSt6vectorIdSaIdEEPNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(89) %39, double noundef %40, ptr noundef %41, ptr noundef %42, ptr noundef %44)
  store i1 %45, ptr %6, align 1
  br label %46

46:                                               ; preds = %38, %30, %25
  %47 = load i1, ptr %6, align 1
  ret i1 %47
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4sptk35AdaptiveGeneralizedCepstralAnalysis11GetNumStageEv(ptr noundef nonnull align 8 dereferenceable(89)) #1 align 2

declare noundef zeroext i1 @_ZNK4sptk27AdaptiveMelCepstralAnalysis3RunEdPdPSt6vectorIdSaIdEEPNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(137), double noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare noundef zeroext i1 @_ZNK4sptk35AdaptiveGeneralizedCepstralAnalysis3RunEdPdPSt6vectorIdSaIdEEPNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(89), double noundef, ptr noundef, ptr noundef, ptr noundef) #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 = { 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 = { "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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !15, i64 248}
!12 = !{!"_ZTSN4sptk38AdaptiveMelGeneralizedCepstralAnalysisE", !13, i64 8, !17, i64 104, !15, i64 248}
!13 = !{!"_ZTSN4sptk35AdaptiveGeneralizedCepstralAnalysisE", !14, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !15, i64 48, !16, i64 56, !15, i64 88}
!14 = !{!"int", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSN4sptk43GeneralizedCepstrumInverseGainNormalizationE", !14, i64 8, !10, i64 16, !15, i64 24}
!17 = !{!"_ZTSN4sptk27AdaptiveMelCepstralAnalysisE", !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !15, i64 40, !18, i64 48, !23, i64 104, !15, i64 136}
!18 = !{!"_ZTSN4sptk17MlsaDigitalFilterE", !14, i64 8, !14, i64 12, !10, i64 16, !15, i64 24, !15, i64 25, !19, i64 32}
!19 = !{!"_ZTSSt6vectorIdSaIdEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTSN4sptk42MlsaDigitalFilterCoefficientsToMelCepstrumE", !14, i64 8, !10, i64 16, !15, i64 24}
!24 = !{i8 0, i8 2}
!25 = !{}


; 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 noundef zeroext i1 @_ZNK4sptk38AdaptiveMelGeneralizedCepstralAnalysis3RunEdPdPSt6vectorIdSaIdEEPNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(249) %0, double noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #0 align 2 {
  %6 = getelementptr inbounds i8, ptr %0, i64 248
  %7 = load i8, ptr %6, align 8, !tbaa !5, !range !22, !noundef !23
  %8 = trunc nuw i8 %7 to i1
  %.not = xor i1 %8, true
  %9 = icmp eq ptr %2, null
  %or.cond = or i1 %9, %.not
  %10 = icmp eq ptr %3, null
  %or.cond3 = or i1 %10, %or.cond
  %11 = icmp eq ptr %4, null
  %or.cond5 = or i1 %11, %or.cond3
  br i1 %or.cond5, label %23, label %12

12:                                               ; preds = %5
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = tail call noundef i32 @_ZNK4sptk35AdaptiveGeneralizedCepstralAnalysis11GetNumStageEv(ptr noundef nonnull align 8 dereferenceable(89) %13)
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %20

16:                                               ; preds = %12
  %17 = getelementptr inbounds i8, ptr %0, i64 104
  %18 = getelementptr inbounds i8, ptr %4, i64 104
  %19 = tail call noundef zeroext i1 @_ZNK4sptk27AdaptiveMelCepstralAnalysis3RunEdPdPSt6vectorIdSaIdEEPNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(137) %17, double noundef %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %18)
  br label %23

20:                                               ; preds = %12
  %21 = getelementptr inbounds i8, ptr %4, i64 8
  %22 = tail call noundef zeroext i1 @_ZNK4sptk35AdaptiveGeneralizedCepstralAnalysis3RunEdPdPSt6vectorIdSaIdEEPNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(89) %13, double noundef %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %21)
  br label %23

23:                                               ; preds = %5, %20, %16
  %.0 = phi i1 [ %19, %16 ], [ %22, %20 ], [ false, %5 ]
  ret i1 %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4sptk35AdaptiveGeneralizedCepstralAnalysis11GetNumStageEv(ptr noundef nonnull align 8 dereferenceable(89)) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNK4sptk27AdaptiveMelCepstralAnalysis3RunEdPdPSt6vectorIdSaIdEEPNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(137), double noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZNK4sptk35AdaptiveGeneralizedCepstralAnalysis3RunEdPdPSt6vectorIdSaIdEEPNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(89), double noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #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 = { 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 = { "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, !12, i64 248}
!6 = !{!"_ZTSN4sptk38AdaptiveMelGeneralizedCepstralAnalysisE", !7, i64 8, !14, i64 104, !12, i64 248}
!7 = !{!"_ZTSN4sptk35AdaptiveGeneralizedCepstralAnalysisE", !8, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !12, i64 48, !13, i64 56, !12, i64 88}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"double", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!"_ZTSN4sptk43GeneralizedCepstrumInverseGainNormalizationE", !8, i64 8, !11, i64 16, !12, i64 24}
!14 = !{!"_ZTSN4sptk27AdaptiveMelCepstralAnalysisE", !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !12, i64 40, !15, i64 48, !21, i64 104, !12, i64 136}
!15 = !{!"_ZTSN4sptk17MlsaDigitalFilterE", !8, i64 8, !8, i64 12, !11, i64 16, !12, i64 24, !12, i64 25, !16, i64 32}
!16 = !{!"_ZTSSt6vectorIdSaIdEE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !20, i64 0, !20, i64 8, !20, i64 16}
!20 = !{!"any pointer", !9, i64 0}
!21 = !{!"_ZTSN4sptk42MlsaDigitalFilterCoefficientsToMelCepstrumE", !8, i64 8, !11, i64 16, !12, i64 24}
!22 = !{i8 0, i8 2}
!23 = !{}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass