; LLVM IR from sp-nitech/SPTK :: src/analysis (autocorrelation_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::AutocorrelationAnalysis" = type <{ ptr, i8, [7 x i8], ptr, ptr, i8, [7 x i8] }>
%"class.sptk::AutocorrelationAnalysis::Buffer" = type { ptr, %"class.sptk::SpectrumToAutocorrelation::Buffer" }
%"class.sptk::SpectrumToAutocorrelation::Buffer" = type { ptr, %"class.std::vector", %"class.std::vector", %"class.sptk::RealValuedInverseFastFourierTransform::Buffer" }
%"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::RealValuedInverseFastFourierTransform::Buffer" = type { ptr, %"class.sptk::RealValuedFastFourierTransform::Buffer" }
%"class.sptk::RealValuedFastFourierTransform::Buffer" = type { ptr, %"class.std::vector", %"class.std::vector" }

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

14:                                               ; preds = %4
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  %16 = icmp eq ptr null, %15
  br i1 %16, label %20, label %17

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

20:                                               ; preds = %17, %14, %4
  store i1 false, ptr %5, align 1
  br label %39

21:                                               ; preds = %17
  %22 = getelementptr inbounds %"class.sptk::AutocorrelationAnalysis", ptr %10, i32 0, i32 1
  %23 = load i8, ptr %22, align 8, !tbaa !14, !range !12, !noundef !13
  %24 = trunc i8 %23 to i1
  br i1 %24, label %25, label %31

25:                                               ; preds = %21
  %26 = getelementptr inbounds %"class.sptk::AutocorrelationAnalysis", ptr %10, i32 0, i32 3
  %27 = load ptr, ptr %26, align 8, !tbaa !15
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = call noundef zeroext i1 @_ZNK4sptk25WaveformToAutocorrelation3RunERKSt6vectorIdSaIdEEPS3_(ptr noundef nonnull align 8 dereferenceable(17) %27, ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef %29)
  store i1 %30, ptr %5, align 1
  br label %39

31:                                               ; preds = %21
  %32 = getelementptr inbounds %"class.sptk::AutocorrelationAnalysis", ptr %10, i32 0, i32 4
  %33 = load ptr, ptr %32, align 8, !tbaa !16
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds %"class.sptk::AutocorrelationAnalysis::Buffer", ptr %36, i32 0, i32 1
  %38 = call noundef zeroext i1 @_ZNK4sptk25SpectrumToAutocorrelation3RunERKSt6vectorIdSaIdEEPS3_PNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(129) %33, ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef %35, ptr noundef %37)
  store i1 %38, ptr %5, align 1
  br label %39

39:                                               ; preds = %31, %25, %20
  %40 = load i1, ptr %5, align 1
  ret i1 %40
}

declare noundef zeroext i1 @_ZNK4sptk25WaveformToAutocorrelation3RunERKSt6vectorIdSaIdEEPS3_(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) #1

declare noundef zeroext i1 @_ZNK4sptk25SpectrumToAutocorrelation3RunERKSt6vectorIdSaIdEEPS3_PNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(129), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef) #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 32}
!10 = !{!"_ZTSN4sptk23AutocorrelationAnalysisE", !11, i64 8, !6, i64 16, !6, i64 24, !11, i64 32}
!11 = !{!"bool", !7, i64 0}
!12 = !{i8 0, i8 2}
!13 = !{}
!14 = !{!10, !11, i64 8}
!15 = !{!10, !6, i64 16}
!16 = !{!10, !6, i64 24}


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

10:                                               ; preds = %4
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load i8, ptr %11, align 8, !tbaa !13, !range !11, !noundef !12
  %13 = trunc nuw i8 %12 to i1
  br i1 %13, label %14, label %18

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %17 = tail call noundef zeroext i1 @_ZNK4sptk25WaveformToAutocorrelation3RunERKSt6vectorIdSaIdEEPS3_(ptr noundef nonnull align 8 dereferenceable(17) %16, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull %2)
  br label %23

18:                                               ; preds = %10
  %19 = getelementptr inbounds i8, ptr %0, i64 24
  %20 = load ptr, ptr %19, align 8, !tbaa !15
  %21 = getelementptr inbounds i8, ptr %3, i64 8
  %22 = tail call noundef zeroext i1 @_ZNK4sptk25SpectrumToAutocorrelation3RunERKSt6vectorIdSaIdEEPS3_PNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(129) %20, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull %2, ptr noundef nonnull %21)
  br label %23

23:                                               ; preds = %4, %18, %14
  %.0 = phi i1 [ %17, %14 ], [ %22, %18 ], [ false, %4 ]
  ret i1 %.0
}

declare noundef zeroext i1 @_ZNK4sptk25WaveformToAutocorrelation3RunERKSt6vectorIdSaIdEEPS3_(ptr noundef nonnull align 8 dereferenceable(17), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) local_unnamed_addr #1

declare noundef zeroext i1 @_ZNK4sptk25SpectrumToAutocorrelation3RunERKSt6vectorIdSaIdEEPS3_PNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(129), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr 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, !7, i64 32}
!6 = !{!"_ZTSN4sptk23AutocorrelationAnalysisE", !7, i64 8, !10, i64 16, !10, i64 24, !7, i64 32}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!6, !7, i64 8}
!14 = !{!6, !10, i64 16}
!15 = !{!6, !10, i64 24}


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