; LLVM IR from FedericaPaoli1/stm32-speech-recognition-and-traduction :: Drivers/CMSIS/DSP/Source/TransformFunctions (arm_rfft_f32)

; 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: nounwind uwtable
define dso_local void @arm_split_rifft_f32(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5) #1 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store i32 %5, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds float, ptr %22, i64 0
  store ptr %23, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = load i32, ptr %8, align 4, !tbaa !9
  %26 = mul i32 2, %25
  %27 = add i32 %26, 1
  %28 = zext i32 %27 to i64
  %29 = getelementptr inbounds float, ptr %24, i64 %28
  store ptr %29, ptr %21, align 8, !tbaa !5
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds float, ptr %30, i64 0
  store ptr %31, ptr %15, align 8, !tbaa !5
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = getelementptr inbounds float, ptr %32, i64 0
  store ptr %33, ptr %16, align 8, !tbaa !5
  br label %34

34:                                               ; preds = %37, %6
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = icmp ugt i32 %35, 0
  br i1 %36, label %37, label %106

37:                                               ; preds = %34
  %38 = load ptr, ptr %15, align 8, !tbaa !5
  %39 = getelementptr inbounds float, ptr %38, i32 1
  store ptr %39, ptr %15, align 8, !tbaa !5
  %40 = load float, ptr %38, align 4, !tbaa !11
  store float %40, ptr %17, align 4, !tbaa !11
  %41 = load ptr, ptr %15, align 8, !tbaa !5
  %42 = load float, ptr %41, align 4, !tbaa !11
  store float %42, ptr %18, align 4, !tbaa !11
  %43 = load ptr, ptr %20, align 8, !tbaa !5
  %44 = load float, ptr %43, align 4, !tbaa !11
  %45 = load float, ptr %17, align 4, !tbaa !11
  %46 = fmul float %44, %45
  store float %46, ptr %13, align 4, !tbaa !11
  %47 = load ptr, ptr %20, align 8, !tbaa !5
  %48 = getelementptr inbounds float, ptr %47, i32 1
  store ptr %48, ptr %20, align 8, !tbaa !5
  %49 = load float, ptr %47, align 4, !tbaa !11
  %50 = fneg float %49
  %51 = load float, ptr %18, align 4, !tbaa !11
  %52 = fmul float %50, %51
  store float %52, ptr %14, align 4, !tbaa !11
  %53 = load ptr, ptr %20, align 8, !tbaa !5
  %54 = load float, ptr %53, align 4, !tbaa !11
  %55 = load ptr, ptr %21, align 8, !tbaa !5
  %56 = load float, ptr %55, align 4, !tbaa !11
  %57 = fadd float %54, %56
  %58 = load float, ptr %18, align 4, !tbaa !11
  %59 = load float, ptr %13, align 4, !tbaa !11
  %60 = call float @llvm.fmuladd.f32(float %57, float %58, float %59)
  store float %60, ptr %13, align 4, !tbaa !11
  %61 = load ptr, ptr %20, align 8, !tbaa !5
  %62 = getelementptr inbounds float, ptr %61, i32 1
  store ptr %62, ptr %20, align 8, !tbaa !5
  %63 = load float, ptr %61, align 4, !tbaa !11
  %64 = load float, ptr %17, align 4, !tbaa !11
  %65 = load float, ptr %14, align 4, !tbaa !11
  %66 = call float @llvm.fmuladd.f32(float %63, float %64, float %65)
  store float %66, ptr %14, align 4, !tbaa !11
  %67 = load ptr, ptr %16, align 8, !tbaa !5
  %68 = load float, ptr %67, align 4, !tbaa !11
  store float %68, ptr %19, align 4, !tbaa !11
  %69 = load ptr, ptr %21, align 8, !tbaa !5
  %70 = getelementptr inbounds float, ptr %69, i32 -1
  store ptr %70, ptr %21, align 8, !tbaa !5
  %71 = load float, ptr %69, align 4, !tbaa !11
  %72 = load float, ptr %19, align 4, !tbaa !11
  %73 = load float, ptr %14, align 4, !tbaa !11
  %74 = fneg float %71
  %75 = call float @llvm.fmuladd.f32(float %74, float %72, float %73)
  store float %75, ptr %14, align 4, !tbaa !11
  %76 = load ptr, ptr %21, align 8, !tbaa !5
  %77 = load float, ptr %76, align 4, !tbaa !11
  %78 = load float, ptr %19, align 4, !tbaa !11
  %79 = load float, ptr %13, align 4, !tbaa !11
  %80 = call float @llvm.fmuladd.f32(float %77, float %78, float %79)
  store float %80, ptr %13, align 4, !tbaa !11
  %81 = load ptr, ptr %21, align 8, !tbaa !5
  %82 = getelementptr inbounds float, ptr %81, i32 -1
  store ptr %82, ptr %21, align 8, !tbaa !5
  %83 = load float, ptr %81, align 4, !tbaa !11
  %84 = load float, ptr %18, align 4, !tbaa !11
  %85 = load float, ptr %14, align 4, !tbaa !11
  %86 = call float @llvm.fmuladd.f32(float %83, float %84, float %85)
  store float %86, ptr %14, align 4, !tbaa !11
  %87 = load float, ptr %13, align 4, !tbaa !11
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = getelementptr inbounds float, ptr %88, i32 1
  store ptr %89, ptr %11, align 8, !tbaa !5
  store float %87, ptr %88, align 4, !tbaa !11
  %90 = load float, ptr %14, align 4, !tbaa !11
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = getelementptr inbounds float, ptr %91, i32 1
  store ptr %92, ptr %11, align 8, !tbaa !5
  store float %90, ptr %91, align 4, !tbaa !11
  %93 = load ptr, ptr %16, align 8, !tbaa !5
  %94 = load i32, ptr %12, align 4, !tbaa !9
  %95 = mul i32 %94, 2
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds float, ptr %93, i64 %96
  store ptr %97, ptr %16, align 8, !tbaa !5
  %98 = load ptr, ptr %15, align 8, !tbaa !5
  %99 = load i32, ptr %12, align 4, !tbaa !9
  %100 = mul i32 %99, 2
  %101 = sub i32 %100, 1
  %102 = zext i32 %101 to i64
  %103 = getelementptr inbounds float, ptr %98, i64 %102
  store ptr %103, ptr %15, align 8, !tbaa !5
  %104 = load i32, ptr %8, align 4, !tbaa !9
  %105 = add i32 %104, -1
  store i32 %105, ptr %8, align 4, !tbaa !9
  br label %34, !llvm.loop !13

106:                                              ; preds = %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #2

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @arm_split_rifft_f32(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr nocapture noundef writeonly %4, i32 noundef %5) local_unnamed_addr #0 {
  %.not42 = icmp eq i32 %1, 0
  br i1 %.not42, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %6
  %7 = shl i32 %1, 1
  %8 = or disjoint i32 %7, 1
  %9 = zext i32 %8 to i64
  %10 = getelementptr inbounds float, ptr %0, i64 %9
  %11 = shl i32 %5, 1
  %12 = zext i32 %11 to i64
  %13 = add i32 %11, -1
  %14 = zext i32 %13 to i64
  br label %15

15:                                               ; preds = %.lr.ph, %15
  %.048 = phi ptr [ %10, %.lr.ph ], [ %33, %15 ]
  %.03747 = phi ptr [ %0, %.lr.ph ], [ %27, %15 ]
  %.03846 = phi i32 [ %1, %.lr.ph ], [ %49, %15 ]
  %.03945 = phi ptr [ %4, %.lr.ph ], [ %34, %15 ]
  %.04044 = phi ptr [ %2, %.lr.ph ], [ %48, %15 ]
  %.04143 = phi ptr [ %3, %.lr.ph ], [ %47, %15 ]
  %16 = getelementptr inbounds i8, ptr %.04044, i64 4
  %17 = load float, ptr %.04044, align 4, !tbaa !5
  %18 = load float, ptr %16, align 4, !tbaa !5
  %19 = load float, ptr %.03747, align 4, !tbaa !5
  %20 = fmul float %17, %19
  %21 = getelementptr inbounds i8, ptr %.03747, i64 4
  %22 = fneg float %19
  %23 = fmul float %18, %22
  %24 = load float, ptr %21, align 4, !tbaa !5
  %25 = load float, ptr %.048, align 4, !tbaa !5
  %26 = fadd float %24, %25
  %27 = getelementptr inbounds i8, ptr %.03747, i64 8
  %28 = tail call float @llvm.fmuladd.f32(float %24, float %17, float %23)
  %29 = load float, ptr %.04143, align 4, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %.048, i64 -4
  %31 = fneg float %25
  %32 = load float, ptr %30, align 4, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %.048, i64 -8
  %34 = getelementptr inbounds i8, ptr %.03945, i64 8
  %35 = insertelement <2 x float> poison, float %26, i64 0
  %36 = insertelement <2 x float> %35, float %31, i64 1
  %37 = insertelement <2 x float> poison, float %18, i64 0
  %38 = insertelement <2 x float> %37, float %29, i64 1
  %39 = insertelement <2 x float> poison, float %20, i64 0
  %40 = insertelement <2 x float> %39, float %28, i64 1
  %41 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %36, <2 x float> %38, <2 x float> %40)
  %42 = insertelement <2 x float> poison, float %32, i64 0
  %43 = shufflevector <2 x float> %42, <2 x float> poison, <2 x i32> zeroinitializer
  %44 = insertelement <2 x float> poison, float %29, i64 0
  %45 = insertelement <2 x float> %44, float %18, i64 1
  %46 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %43, <2 x float> %45, <2 x float> %41)
  store <2 x float> %46, ptr %.03945, align 4, !tbaa !5
  %47 = getelementptr inbounds float, ptr %.04143, i64 %12
  %48 = getelementptr inbounds float, ptr %16, i64 %14
  %49 = add i32 %.03846, -1
  %.not = icmp eq i32 %49, 0
  br i1 %.not, label %._crit_edge, label %15, !llvm.loop !9

._crit_edge:                                      ; preds = %15, %6
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x float> @llvm.fmuladd.v2f32(<2 x float>, <2 x float>, <2 x float>) #2

attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass