; LLVM IR from clangen/musikcube :: src/plugins/supereqdsp/supereq (Fftsg_fl)

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

; Function Attrs: nounwind uwtable
define dso_local void @cftrec2(i32 noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) #1 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  %10 = load i32, ptr %5, align 4, !tbaa !5
  %11 = ashr i32 %10, 2
  store i32 %11, ptr %9, align 4, !tbaa !5
  %12 = load i32, ptr %5, align 4, !tbaa !5
  %13 = load ptr, ptr %6, align 8, !tbaa !9
  %14 = load ptr, ptr %8, align 8, !tbaa !9
  %15 = load i32, ptr %7, align 4, !tbaa !5
  %16 = load i32, ptr %5, align 4, !tbaa !5
  %17 = sub nsw i32 %15, %16
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds float, ptr %14, i64 %18
  call void @cftmdl2(i32 noundef %12, ptr noundef %13, ptr noundef %19)
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 512
  br i1 %21, label %22, label %50

22:                                               ; preds = %4
  %23 = load i32, ptr %9, align 4, !tbaa !5
  %24 = load ptr, ptr %6, align 8, !tbaa !9
  %25 = load i32, ptr %7, align 4, !tbaa !5
  %26 = load ptr, ptr %8, align 8, !tbaa !9
  call void @cftrec1(i32 noundef %23, ptr noundef %24, i32 noundef %25, ptr noundef %26)
  %27 = load i32, ptr %9, align 4, !tbaa !5
  %28 = load ptr, ptr %6, align 8, !tbaa !9
  %29 = load i32, ptr %9, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds float, ptr %28, i64 %30
  %32 = load i32, ptr %7, align 4, !tbaa !5
  %33 = load ptr, ptr %8, align 8, !tbaa !9
  call void @cftrec2(i32 noundef %27, ptr noundef %31, i32 noundef %32, ptr noundef %33)
  %34 = load i32, ptr %9, align 4, !tbaa !5
  %35 = load ptr, ptr %6, align 8, !tbaa !9
  %36 = load i32, ptr %9, align 4, !tbaa !5
  %37 = mul nsw i32 2, %36
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds float, ptr %35, i64 %38
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = load ptr, ptr %8, align 8, !tbaa !9
  call void @cftrec1(i32 noundef %34, ptr noundef %39, i32 noundef %40, ptr noundef %41)
  %42 = load i32, ptr %9, align 4, !tbaa !5
  %43 = load ptr, ptr %6, align 8, !tbaa !9
  %44 = load i32, ptr %9, align 4, !tbaa !5
  %45 = mul nsw i32 3, %44
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds float, ptr %43, i64 %46
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = load ptr, ptr %8, align 8, !tbaa !9
  call void @cftrec2(i32 noundef %42, ptr noundef %47, i32 noundef %48, ptr noundef %49)
  br label %55

50:                                               ; preds = %4
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = load ptr, ptr %6, align 8, !tbaa !9
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = load ptr, ptr %8, align 8, !tbaa !9
  call void @cftexp2(i32 noundef %51, ptr noundef %52, i32 noundef %53, ptr noundef %54)
  br label %55

55:                                               ; preds = %50, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  ret void
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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/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: nounwind uwtable
declare dso_local void @cftrec1(i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @cftrec2(i32 noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = sub nsw i32 %2, %0
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds float, ptr %3, i64 %6
  tail call void @cftmdl2(i32 noundef %0, ptr noundef %1, ptr noundef %7)
  %8 = icmp sgt i32 %0, 512
  br i1 %8, label %tailrecurse, label %tailrecurse._crit_edge

tailrecurse:                                      ; preds = %4, %tailrecurse
  %.tr2933 = phi ptr [ %17, %tailrecurse ], [ %1, %4 ]
  %.tr32 = phi i32 [ %9, %tailrecurse ], [ %0, %4 ]
  %9 = lshr i32 %.tr32, 2
  tail call void @cftrec1(i32 noundef %9, ptr noundef %.tr2933, i32 noundef %2, ptr noundef %3)
  %10 = zext nneg i32 %9 to i64
  %11 = getelementptr inbounds float, ptr %.tr2933, i64 %10
  tail call void @cftrec2(i32 noundef %9, ptr noundef %11, i32 noundef %2, ptr noundef %3)
  %12 = shl nuw nsw i32 %9, 1
  %13 = zext nneg i32 %12 to i64
  %14 = getelementptr inbounds float, ptr %.tr2933, i64 %13
  tail call void @cftrec1(i32 noundef %9, ptr noundef %14, i32 noundef %2, ptr noundef %3)
  %15 = mul nuw nsw i32 %9, 3
  %16 = zext nneg i32 %15 to i64
  %17 = getelementptr inbounds float, ptr %.tr2933, i64 %16
  %18 = sub nsw i32 %2, %9
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds float, ptr %3, i64 %19
  tail call void @cftmdl2(i32 noundef %9, ptr noundef %17, ptr noundef %20)
  %21 = icmp ugt i32 %.tr32, 2051
  br i1 %21, label %tailrecurse, label %tailrecurse._crit_edge

tailrecurse._crit_edge:                           ; preds = %tailrecurse, %4
  %.tr.lcssa = phi i32 [ %0, %4 ], [ %9, %tailrecurse ]
  %.tr29.lcssa = phi ptr [ %1, %4 ], [ %17, %tailrecurse ]
  tail call void @cftexp2(i32 noundef %.tr.lcssa, ptr noundef %.tr29.lcssa, i32 noundef %2, ptr noundef %3)
  ret void
}

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

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

attributes #0 = { 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: GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass