; 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
define dso_local void @cftrec1(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 %9, align 4, !tbaa !5
  %17 = mul nsw i32 2, %16
  %18 = sub nsw i32 %15, %17
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds float, ptr %14, i64 %19
  call void @cftmdl1(i32 noundef %12, ptr noundef %13, ptr noundef %20)
  %21 = load i32, ptr %5, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 512
  br i1 %22, label %23, label %51

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @cftmdl1(i32 noundef, ptr 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
define dso_local void @cftrec1(i32 noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = ashr i32 %0, 2
  %6 = shl nsw i32 %5, 1
  %7 = sub nsw i32 %2, %6
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds float, ptr %3, i64 %8
  tail call void @cftmdl1(i32 noundef %0, ptr noundef %1, ptr noundef %9)
  %10 = icmp sgt i32 %0, 512
  br i1 %10, label %tailrecurse, label %tailrecurse._crit_edge

tailrecurse:                                      ; preds = %4, %tailrecurse
  %11 = phi i32 [ %21, %tailrecurse ], [ %6, %4 ]
  %12 = phi i32 [ %20, %tailrecurse ], [ %5, %4 ]
  %.tr2932 = phi ptr [ %19, %tailrecurse ], [ %1, %4 ]
  tail call void @cftrec1(i32 noundef %12, ptr noundef %.tr2932, i32 noundef %2, ptr noundef %3)
  %13 = zext nneg i32 %12 to i64
  %14 = getelementptr inbounds float, ptr %.tr2932, i64 %13
  tail call void @cftrec2(i32 noundef %12, ptr noundef %14, i32 noundef %2, ptr noundef %3)
  %15 = zext nneg i32 %11 to i64
  %16 = getelementptr inbounds float, ptr %.tr2932, i64 %15
  tail call void @cftrec1(i32 noundef %12, ptr noundef %16, i32 noundef %2, ptr noundef %3)
  %17 = mul nuw nsw i32 %12, 3
  %18 = zext nneg i32 %17 to i64
  %19 = getelementptr inbounds float, ptr %.tr2932, i64 %18
  %20 = lshr i32 %12, 2
  %21 = shl nuw nsw i32 %20, 1
  %22 = sub nsw i32 %2, %21
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds float, ptr %3, i64 %23
  tail call void @cftmdl1(i32 noundef %12, ptr noundef %19, ptr noundef %24)
  %25 = icmp sgt i32 %12, 512
  br i1 %25, label %tailrecurse, label %tailrecurse._crit_edge

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @cftmdl1(i32 noundef, ptr 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: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass