; LLVM IR from sp-nitech/SPTK :: third_party/WORLD/fft_world.ll (ZN4sptk5world7cftbsubEiPdPiiS1_)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk5world7cftbsubEiPdPiiS1_(i32 noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) #0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  store i32 %0, ptr %6, align 4, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !9
  %11 = load i32, ptr %6, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 8
  br i1 %12, label %13, label %68

13:                                               ; preds = %5
  %14 = load i32, ptr %6, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 32
  br i1 %15, label %16, label %51

16:                                               ; preds = %13
  %17 = load i32, ptr %6, align 4, !tbaa !5
  %18 = load ptr, ptr %7, align 8, !tbaa !9
  %19 = load ptr, ptr %10, align 8, !tbaa !9
  %20 = load i32, ptr %9, align 4, !tbaa !5
  %21 = load i32, ptr %6, align 4, !tbaa !5
  %22 = ashr i32 %21, 2
  %23 = sub nsw i32 %20, %22
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds double, ptr %19, i64 %24
  call void @_ZN4sptk5world7cftb1stEiPdS1_(i32 noundef %17, ptr noundef %18, ptr noundef %25)
  %26 = load i32, ptr %6, align 4, !tbaa !5
  %27 = icmp sgt i32 %26, 512
  br i1 %27, label %28, label %33

28:                                               ; preds = %16
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = load ptr, ptr %7, align 8, !tbaa !9
  %31 = load i32, ptr %9, align 4, !tbaa !5
  %32 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN4sptk5world7cftrec4EiPdiS1_(i32 noundef %29, ptr noundef %30, i32 noundef %31, ptr noundef %32)
  br label %47

33:                                               ; preds = %16
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 128
  br i1 %35, label %36, label %41

36:                                               ; preds = %33
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = load ptr, ptr %7, align 8, !tbaa !9
  %39 = load i32, ptr %9, align 4, !tbaa !5
  %40 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN4sptk5world7cftleafEiiPdiS1_(i32 noundef %37, i32 noundef 1, ptr noundef %38, i32 noundef %39, ptr noundef %40)
  br label %46

41:                                               ; preds = %33
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = load ptr, ptr %7, align 8, !tbaa !9
  %44 = load i32, ptr %9, align 4, !tbaa !5
  %45 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN4sptk5world7cftfx41EiPdiS1_(i32 noundef %42, ptr noundef %43, i32 noundef %44, ptr noundef %45)
  br label %46

46:                                               ; preds = %41, %36
  br label %47

47:                                               ; preds = %46, %28
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = load ptr, ptr %8, align 8, !tbaa !9
  %50 = load ptr, ptr %7, align 8, !tbaa !9
  call void @_ZN4sptk5world10bitrv2conjEiPiPd(i32 noundef %48, ptr noundef %49, ptr noundef %50)
  br label %67

51:                                               ; preds = %13
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = icmp eq i32 %52, 32
  br i1 %53, label %54, label %62

54:                                               ; preds = %51
  %55 = load ptr, ptr %7, align 8, !tbaa !9
  %56 = load ptr, ptr %10, align 8, !tbaa !9
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = sub nsw i32 %57, 8
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds double, ptr %56, i64 %59
  call void @_ZN4sptk5world7cftf161EPdS1_(ptr noundef %55, ptr noundef %60)
  %61 = load ptr, ptr %7, align 8, !tbaa !9
  call void @_ZN4sptk5world11bitrv216negEPd(ptr noundef %61)
  br label %66

62:                                               ; preds = %51
  %63 = load ptr, ptr %7, align 8, !tbaa !9
  %64 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN4sptk5world7cftf081EPdS1_(ptr noundef %63, ptr noundef %64)
  %65 = load ptr, ptr %7, align 8, !tbaa !9
  call void @_ZN4sptk5world11bitrv208negEPd(ptr noundef %65)
  br label %66

66:                                               ; preds = %62, %54
  br label %67

67:                                               ; preds = %66, %47
  br label %80

68:                                               ; preds = %5
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = icmp eq i32 %69, 8
  br i1 %70, label %71, label %73

71:                                               ; preds = %68
  %72 = load ptr, ptr %7, align 8, !tbaa !9
  call void @_ZN4sptk5world7cftb040EPd(ptr noundef %72)
  br label %79

73:                                               ; preds = %68
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = icmp eq i32 %74, 4
  br i1 %75, label %76, label %78

76:                                               ; preds = %73
  %77 = load ptr, ptr %7, align 8, !tbaa !9
  call void @_ZN4sptk5world7cftx020EPd(ptr noundef %77)
  br label %78

78:                                               ; preds = %76, %73
  br label %79

79:                                               ; preds = %78, %71
  br label %80

80:                                               ; preds = %79, %67
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4sptk5world7cftrec4EiPdiS1_(i32 noundef, ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4sptk5world7cftleafEiiPdiS1_(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4sptk5world7cftfx41EiPdiS1_(i32 noundef, ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world7cftf161EPdS1_(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world7cftf081EPdS1_(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world7cftx020EPd(ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world7cftb1stEiPdS1_(i32 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world10bitrv2conjEiPiPd(i32 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world11bitrv216negEPd(ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world11bitrv208negEPd(ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world7cftb040EPd(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 = { 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" }

!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}


; 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 @_ZN4sptk5world7cftbsubEiPdPiiS1_(i32 noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = icmp sgt i32 %0, 8
  br i1 %6, label %7, label %28

7:                                                ; preds = %5
  %8 = icmp ugt i32 %0, 32
  br i1 %8, label %9, label %21

9:                                                ; preds = %7
  %10 = lshr i32 %0, 2
  %11 = sub nsw i32 %3, %10
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds double, ptr %4, i64 %12
  tail call void @_ZN4sptk5world7cftb1stEiPdS1_(i32 noundef %0, ptr noundef %1, ptr noundef %13)
  %14 = icmp ugt i32 %0, 512
  br i1 %14, label %15, label %16

15:                                               ; preds = %9
  tail call void @_ZN4sptk5world7cftrec4EiPdiS1_(i32 noundef %0, ptr noundef %1, i32 noundef %3, ptr noundef %4)
  br label %20

16:                                               ; preds = %9
  %17 = icmp ugt i32 %0, 128
  br i1 %17, label %18, label %19

18:                                               ; preds = %16
  tail call void @_ZN4sptk5world7cftleafEiiPdiS1_(i32 noundef %0, i32 noundef 1, ptr noundef %1, i32 noundef %3, ptr noundef %4)
  br label %20

19:                                               ; preds = %16
  tail call void @_ZN4sptk5world7cftfx41EiPdiS1_(i32 noundef %0, ptr noundef %1, i32 noundef %3, ptr noundef %4)
  br label %20

20:                                               ; preds = %18, %19, %15
  tail call void @_ZN4sptk5world10bitrv2conjEiPiPd(i32 noundef %0, ptr noundef %2, ptr noundef %1)
  br label %31

21:                                               ; preds = %7
  %22 = icmp eq i32 %0, 32
  br i1 %22, label %23, label %27

23:                                               ; preds = %21
  %24 = sext i32 %3 to i64
  %25 = getelementptr double, ptr %4, i64 %24
  %26 = getelementptr i8, ptr %25, i64 -64
  tail call void @_ZN4sptk5world7cftf161EPdS1_(ptr noundef %1, ptr noundef %26)
  tail call void @_ZN4sptk5world11bitrv216negEPd(ptr noundef %1)
  br label %31

27:                                               ; preds = %21
  tail call void @_ZN4sptk5world7cftf081EPdS1_(ptr noundef %1, ptr noundef %4)
  tail call void @_ZN4sptk5world11bitrv208negEPd(ptr noundef %1)
  br label %31

28:                                               ; preds = %5
  switch i32 %0, label %31 [
    i32 8, label %29
    i32 4, label %30
  ]

29:                                               ; preds = %28
  tail call void @_ZN4sptk5world7cftb040EPd(ptr noundef %1)
  br label %31

30:                                               ; preds = %28
  tail call void @_ZN4sptk5world7cftx020EPd(ptr noundef %1)
  br label %31

31:                                               ; preds = %28, %29, %30, %20, %27, %23
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4sptk5world7cftrec4EiPdiS1_(i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4sptk5world7cftleafEiiPdiS1_(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4sptk5world7cftfx41EiPdiS1_(i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world7cftf161EPdS1_(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world7cftf081EPdS1_(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world7cftx020EPd(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world7cftb1stEiPdS1_(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world10bitrv2conjEiPiPd(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world11bitrv216negEPd(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world11bitrv208negEPd(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk5world7cftb040EPd(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 = { 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" }

!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: CorrelatedValuePropagationPass,GlobalOptPass,IPSCCPPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass