; LLVM IR from sp-nitech/SPTK :: third_party/WORLD (common)

; 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"

%"struct.sptk::world::fft_plan" = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"struct.sptk::world::MinimumPhaseAnalysis" = type { i32, ptr, ptr, ptr, %"struct.sptk::world::fft_plan", %"struct.sptk::world::fft_plan" }

; 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 speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #2

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

declare void @_ZN4sptk5world19fft_plan_dft_r2c_1dEiPdPA2_dj(ptr dead_on_unwind writable sret(%"struct.sptk::world::fft_plan") align 8, i32 noundef, ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare void @_ZN4sptk5world15fft_plan_dft_1dEiPA2_dS2_ij(ptr dead_on_unwind writable sret(%"struct.sptk::world::fft_plan") align 8, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk5world30InitializeMinimumPhaseAnalysisEiPNS0_20MinimumPhaseAnalysisE(i32 noundef %0, ptr noundef %1) #5 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.sptk::world::fft_plan", align 8
  %6 = alloca %"struct.sptk::world::fft_plan", align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  %7 = load i32, ptr %3, align 4, !tbaa !5
  %8 = load ptr, ptr %4, align 8, !tbaa !9
  %9 = getelementptr inbounds %"struct.sptk::world::MinimumPhaseAnalysis", ptr %8, i32 0, i32 0
  store i32 %7, ptr %9, align 8, !tbaa !11
  %10 = load i32, ptr %3, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %11, i64 8)
  %13 = extractvalue { i64, i1 } %12, 1
  %14 = extractvalue { i64, i1 } %12, 0
  %15 = select i1 %13, i64 -1, i64 %14
  %16 = call noalias noundef nonnull ptr @_Znam(i64 noundef %15) #6
  %17 = load ptr, ptr %4, align 8, !tbaa !9
  %18 = getelementptr inbounds %"struct.sptk::world::MinimumPhaseAnalysis", ptr %17, i32 0, i32 1
  store ptr %16, ptr %18, align 8, !tbaa !14
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %20, i64 16)
  %22 = extractvalue { i64, i1 } %21, 1
  %23 = extractvalue { i64, i1 } %21, 0
  %24 = mul i64 %20, 2
  %25 = select i1 %22, i64 -1, i64 %23
  %26 = call noalias noundef nonnull ptr @_Znam(i64 noundef %25) #6
  %27 = load ptr, ptr %4, align 8, !tbaa !9
  %28 = getelementptr inbounds %"struct.sptk::world::MinimumPhaseAnalysis", ptr %27, i32 0, i32 2
  store ptr %26, ptr %28, align 8, !tbaa !15
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %30, i64 16)
  %32 = extractvalue { i64, i1 } %31, 1
  %33 = extractvalue { i64, i1 } %31, 0
  %34 = mul i64 %30, 2
  %35 = select i1 %32, i64 -1, i64 %33
  %36 = call noalias noundef nonnull ptr @_Znam(i64 noundef %35) #6
  %37 = load ptr, ptr %4, align 8, !tbaa !9
  %38 = getelementptr inbounds %"struct.sptk::world::MinimumPhaseAnalysis", ptr %37, i32 0, i32 3
  store ptr %36, ptr %38, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 72, ptr %5) #7
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = load ptr, ptr %4, align 8, !tbaa !9
  %41 = getelementptr inbounds %"struct.sptk::world::MinimumPhaseAnalysis", ptr %40, i32 0, i32 1
  %42 = load ptr, ptr %41, align 8, !tbaa !14
  %43 = load ptr, ptr %4, align 8, !tbaa !9
  %44 = getelementptr inbounds %"struct.sptk::world::MinimumPhaseAnalysis", ptr %43, i32 0, i32 3
  %45 = load ptr, ptr %44, align 8, !tbaa !16
  call void @_ZN4sptk5world19fft_plan_dft_r2c_1dEiPdPA2_dj(ptr dead_on_unwind writable sret(%"struct.sptk::world::fft_plan") align 8 %5, i32 noundef %39, ptr noundef %42, ptr noundef %45, i32 noundef 3)
  %46 = load ptr, ptr %4, align 8, !tbaa !9
  %47 = getelementptr inbounds %"struct.sptk::world::MinimumPhaseAnalysis", ptr %46, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %47, ptr align 8 %5, i64 72, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 72, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 72, ptr %6) #7
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = load ptr, ptr %4, align 8, !tbaa !9
  %50 = getelementptr inbounds %"struct.sptk::world::MinimumPhaseAnalysis", ptr %49, i32 0, i32 3
  %51 = load ptr, ptr %50, align 8, !tbaa !16
  %52 = load ptr, ptr %4, align 8, !tbaa !9
  %53 = getelementptr inbounds %"struct.sptk::world::MinimumPhaseAnalysis", ptr %52, i32 0, i32 2
  %54 = load ptr, ptr %53, align 8, !tbaa !15
  call void @_ZN4sptk5world15fft_plan_dft_1dEiPA2_dS2_ij(ptr dead_on_unwind writable sret(%"struct.sptk::world::fft_plan") align 8 %6, i32 noundef %48, ptr noundef %51, ptr noundef %54, i32 noundef 1, i32 noundef 3)
  %55 = load ptr, ptr %4, align 8, !tbaa !9
  %56 = getelementptr inbounds %"struct.sptk::world::MinimumPhaseAnalysis", ptr %55, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %56, ptr align 8 %6, i64 72, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 72, ptr %6) #7
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nobuiltin allocsize(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 = { "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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { builtin allocsize(0) }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSN4sptk5world20MinimumPhaseAnalysisE", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !13, i64 32, !13, i64 104}
!13 = !{!"_ZTSN4sptk5world8fft_planE", !6, i64 0, !6, i64 4, !6, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !10, i64 16}
!16 = !{!12, !10, i64 24}
!17 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 16, i64 8, !9, i64 24, i64 8, !9, i64 32, i64 8, !9, i64 40, i64 8, !9, i64 48, i64 8, !9, i64 56, i64 8, !9, i64 64, i64 8, !9}


; 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"

%"struct.sptk::world::fft_plan" = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #1

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

declare void @_ZN4sptk5world19fft_plan_dft_r2c_1dEiPdPA2_dj(ptr dead_on_unwind writable sret(%"struct.sptk::world::fft_plan") align 8, i32 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare void @_ZN4sptk5world15fft_plan_dft_1dEiPA2_dS2_ij(ptr dead_on_unwind writable sret(%"struct.sptk::world::fft_plan") align 8, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk5world30InitializeMinimumPhaseAnalysisEiPNS0_20MinimumPhaseAnalysisE(i32 noundef %0, ptr nocapture noundef %1) local_unnamed_addr #4 {
  %3 = alloca %"struct.sptk::world::fft_plan", align 8
  %4 = alloca %"struct.sptk::world::fft_plan", align 8
  store i32 %0, ptr %1, align 8, !tbaa !5
  %5 = sext i32 %0 to i64
  %6 = icmp slt i32 %0, 0
  %7 = shl nsw i64 %5, 3
  %8 = select i1 %6, i64 -1, i64 %7
  %9 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %8) #5
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr %9, ptr %10, align 8, !tbaa !12
  %11 = shl nsw i64 %5, 4
  %12 = select i1 %6, i64 -1, i64 %11
  %13 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %12) #5
  %14 = getelementptr inbounds i8, ptr %1, i64 16
  store ptr %13, ptr %14, align 8, !tbaa !13
  %15 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %12) #5
  %16 = getelementptr inbounds i8, ptr %1, i64 24
  store ptr %15, ptr %16, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %3) #6
  call void @_ZN4sptk5world19fft_plan_dft_r2c_1dEiPdPA2_dj(ptr dead_on_unwind nonnull writable sret(%"struct.sptk::world::fft_plan") align 8 %3, i32 noundef %0, ptr noundef nonnull %9, ptr noundef nonnull %15, i32 noundef 3)
  %17 = getelementptr inbounds i8, ptr %1, i64 32
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %17, ptr noundef nonnull align 8 dereferenceable(72) %3, i64 72, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %4) #6
  %18 = load ptr, ptr %16, align 8, !tbaa !14
  %19 = load ptr, ptr %14, align 8, !tbaa !13
  call void @_ZN4sptk5world15fft_plan_dft_1dEiPA2_dS2_ij(ptr dead_on_unwind nonnull writable sret(%"struct.sptk::world::fft_plan") align 8 %4, i32 noundef %0, ptr noundef %18, ptr noundef %19, i32 noundef 1, i32 noundef 3)
  %20 = getelementptr inbounds i8, ptr %1, i64 104
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %20, ptr noundef nonnull align 8 dereferenceable(72) %4, i64 72, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %4) #6
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(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" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { builtin allocsize(0) }
attributes #6 = { 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 0}
!6 = !{!"_ZTSN4sptk5world20MinimumPhaseAnalysisE", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !11, i64 32, !11, i64 104}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTSN4sptk5world8fft_planE", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64}
!12 = !{!6, !10, i64 8}
!13 = !{!6, !10, i64 16}
!14 = !{!6, !10, i64 24}
!15 = !{i64 0, i64 4, !16, i64 4, i64 4, !16, i64 8, i64 4, !16, i64 16, i64 8, !17, i64 24, i64 8, !17, i64 32, i64 8, !17, i64 40, i64 8, !17, i64 48, i64 8, !17, i64 56, i64 8, !17, i64 64, i64 8, !17}
!16 = !{!7, !7, i64 0}
!17 = !{!10, !10, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass