; LLVM IR from jgaeddert/liquid-dsp :: src/framing/src (framing_cccf)

; 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.bpresync_cccf_s = type { i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, float }

; 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 i32 @bpresync_cccf_execute(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca { float, float }, align 4
  %9 = alloca float, align 4
  %10 = alloca { float, float }, align 4
  %11 = alloca { float, float }, align 4
  %12 = alloca float, align 4
  %13 = alloca { float, float }, align 4
  %14 = alloca { float, float }, align 4
  %15 = alloca { float, float }, align 4
  %16 = alloca { float, float }, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %17 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %18 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  store float 0.000000e+00, ptr %17, align 4
  store float 0.000000e+00, ptr %18, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store float 0.000000e+00, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store float 0.000000e+00, ptr %12, align 4, !tbaa !9
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %19

19:                                               ; preds = %96, %3
  %20 = load i32, ptr %7, align 4, !tbaa !11
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.bpresync_cccf_s, ptr %21, i32 0, i32 1
  %23 = load i32, ptr %22, align 4, !tbaa !13
  %24 = icmp ult i32 %20, %23
  br i1 %24, label %25, label %99

25:                                               ; preds = %19
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = load i32, ptr %7, align 4, !tbaa !11
  %28 = call i32 @bpresync_cccf_correlatex(ptr noundef %26, i32 noundef %27, ptr noundef %10, ptr noundef %11)
  %29 = getelementptr inbounds { float, float }, ptr %10, i32 0, i32 0
  %30 = load float, ptr %29, align 4
  %31 = getelementptr inbounds { float, float }, ptr %10, i32 0, i32 1
  %32 = load float, ptr %31, align 4
  %33 = getelementptr inbounds { float, float }, ptr %13, i32 0, i32 0
  %34 = getelementptr inbounds { float, float }, ptr %13, i32 0, i32 1
  store float %30, ptr %33, align 4
  store float %32, ptr %34, align 4
  %35 = load <2 x float>, ptr %13, align 4
  %36 = call float @cabsf(<2 x float> noundef %35) #4
  %37 = load float, ptr %9, align 4, !tbaa !9
  %38 = fcmp ogt float %36, %37
  br i1 %38, label %39, label %61

39:                                               ; preds = %25
  %40 = getelementptr inbounds { float, float }, ptr %10, i32 0, i32 0
  %41 = load float, ptr %40, align 4
  %42 = getelementptr inbounds { float, float }, ptr %10, i32 0, i32 1
  %43 = load float, ptr %42, align 4
  %44 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %45 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  store float %41, ptr %44, align 4
  store float %43, ptr %45, align 4
  %46 = getelementptr inbounds { float, float }, ptr %10, i32 0, i32 0
  %47 = load float, ptr %46, align 4
  %48 = getelementptr inbounds { float, float }, ptr %10, i32 0, i32 1
  %49 = load float, ptr %48, align 4
  %50 = getelementptr inbounds { float, float }, ptr %14, i32 0, i32 0
  %51 = getelementptr inbounds { float, float }, ptr %14, i32 0, i32 1
  store float %47, ptr %50, align 4
  store float %49, ptr %51, align 4
  %52 = load <2 x float>, ptr %14, align 4
  %53 = call float @cabsf(<2 x float> noundef %52) #4
  store float %53, ptr %9, align 4, !tbaa !9
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.bpresync_cccf_s, ptr %54, i32 0, i32 4
  %56 = load ptr, ptr %55, align 8, !tbaa !15
  %57 = load i32, ptr %7, align 4, !tbaa !11
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds float, ptr %56, i64 %58
  %60 = load float, ptr %59, align 4, !tbaa !9
  store float %60, ptr %12, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %39, %25
  %62 = getelementptr inbounds { float, float }, ptr %11, i32 0, i32 0
  %63 = load float, ptr %62, align 4
  %64 = getelementptr inbounds { float, float }, ptr %11, i32 0, i32 1
  %65 = load float, ptr %64, align 4
  %66 = getelementptr inbounds { float, float }, ptr %15, i32 0, i32 0
  %67 = getelementptr inbounds { float, float }, ptr %15, i32 0, i32 1
  store float %63, ptr %66, align 4
  store float %65, ptr %67, align 4
  %68 = load <2 x float>, ptr %15, align 4
  %69 = call float @cabsf(<2 x float> noundef %68) #4
  %70 = load float, ptr %9, align 4, !tbaa !9
  %71 = fcmp ogt float %69, %70
  br i1 %71, label %72, label %95

72:                                               ; preds = %61
  %73 = getelementptr inbounds { float, float }, ptr %11, i32 0, i32 0
  %74 = load float, ptr %73, align 4
  %75 = getelementptr inbounds { float, float }, ptr %11, i32 0, i32 1
  %76 = load float, ptr %75, align 4
  %77 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %78 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  store float %74, ptr %77, align 4
  store float %76, ptr %78, align 4
  %79 = getelementptr inbounds { float, float }, ptr %11, i32 0, i32 0
  %80 = load float, ptr %79, align 4
  %81 = getelementptr inbounds { float, float }, ptr %11, i32 0, i32 1
  %82 = load float, ptr %81, align 4
  %83 = getelementptr inbounds { float, float }, ptr %16, i32 0, i32 0
  %84 = getelementptr inbounds { float, float }, ptr %16, i32 0, i32 1
  store float %80, ptr %83, align 4
  store float %82, ptr %84, align 4
  %85 = load <2 x float>, ptr %16, align 4
  %86 = call float @cabsf(<2 x float> noundef %85) #4
  store float %86, ptr %9, align 4, !tbaa !9
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.bpresync_cccf_s, ptr %87, i32 0, i32 4
  %89 = load ptr, ptr %88, align 8, !tbaa !15
  %90 = load i32, ptr %7, align 4, !tbaa !11
  %91 = zext i32 %90 to i64
  %92 = getelementptr inbounds float, ptr %89, i64 %91
  %93 = load float, ptr %92, align 4, !tbaa !9
  %94 = fneg float %93
  store float %94, ptr %12, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %72, %61
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %7, align 4, !tbaa !11
  %98 = add i32 %97, 1
  store i32 %98, ptr %7, align 4, !tbaa !11
  br label %19, !llvm.loop !16

99:                                               ; preds = %19
  %100 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %101 = load float, ptr %100, align 4
  %102 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  %103 = load float, ptr %102, align 4
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds { float, float }, ptr %104, i32 0, i32 0
  %106 = getelementptr inbounds { float, float }, ptr %104, i32 0, i32 1
  store float %101, ptr %105, align 4
  store float %103, ptr %106, align 4
  %107 = load float, ptr %12, align 4, !tbaa !9
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  store float %107, ptr %108, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret i32 0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @bpresync_cccf_correlatex(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare float @cabsf(<2 x float> noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="64" "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 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 #3 = { nounwind "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 = { 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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 4}
!14 = !{!"bpresync_cccf_s", !12, i64 0, !12, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56}
!15 = !{!14, !6, i64 24}
!16 = distinct !{!16, !17}
!17 = !{!"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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress 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 noundef i32 @bpresync_cccf_execute(ptr noundef %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef writeonly %2) local_unnamed_addr #1 {
  %4 = alloca { float, float }, align 8
  %5 = alloca { float, float }, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %6 = getelementptr inbounds i8, ptr %0, i64 4
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  br label %9

9:                                                ; preds = %.lr.ph, %34
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %34 ]
  %.029 = phi float [ 0.000000e+00, %.lr.ph ], [ %.2, %34 ]
  %.02128 = phi float [ 0.000000e+00, %.lr.ph ], [ %.223, %34 ]
  %10 = phi <2 x float> [ zeroinitializer, %.lr.ph ], [ %35, %34 ]
  %11 = trunc nuw i64 %indvars.iv to i32
  %12 = call i32 @bpresync_cccf_correlatex(ptr noundef nonnull %0, i32 noundef %11, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %13 = load <2 x float>, ptr %4, align 8
  %14 = call float @cabsf(<2 x float> noundef %13) #4
  %15 = fcmp ogt float %14, %.02128
  br i1 %15, label %16, label %22

16:                                               ; preds = %9
  %17 = load <2 x float>, ptr %4, align 8
  %18 = call float @cabsf(<2 x float> noundef %17) #4
  %19 = load ptr, ptr %8, align 8, !tbaa !12
  %20 = getelementptr inbounds float, ptr %19, i64 %indvars.iv
  %21 = load float, ptr %20, align 4, !tbaa !13
  br label %22

22:                                               ; preds = %16, %9
  %.122 = phi float [ %18, %16 ], [ %.02128, %9 ]
  %.1 = phi float [ %21, %16 ], [ %.029, %9 ]
  %23 = phi <2 x float> [ %17, %16 ], [ %10, %9 ]
  %24 = load <2 x float>, ptr %5, align 8
  %25 = call float @cabsf(<2 x float> noundef %24) #4
  %26 = fcmp ogt float %25, %.122
  br i1 %26, label %27, label %34

27:                                               ; preds = %22
  %28 = load <2 x float>, ptr %5, align 8
  %29 = call float @cabsf(<2 x float> noundef %28) #4
  %30 = load ptr, ptr %8, align 8, !tbaa !12
  %31 = getelementptr inbounds float, ptr %30, i64 %indvars.iv
  %32 = load float, ptr %31, align 4, !tbaa !13
  %33 = fneg float %32
  br label %34

34:                                               ; preds = %22, %27
  %.223 = phi float [ %29, %27 ], [ %.122, %22 ]
  %.2 = phi float [ %33, %27 ], [ %.1, %22 ]
  %35 = phi <2 x float> [ %28, %27 ], [ %23, %22 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = zext i32 %36 to i64
  %38 = icmp ult i64 %indvars.iv.next, %37
  br i1 %38, label %9, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %34, %3
  %.0.lcssa = phi float [ 0.000000e+00, %3 ], [ %.2, %34 ]
  %39 = phi <2 x float> [ zeroinitializer, %3 ], [ %35, %34 ]
  store <2 x float> %39, ptr %1, align 4
  store float %.0.lcssa, ptr %2, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  ret i32 0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @bpresync_cccf_correlatex(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare float @cabsf(<2 x float> noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="64" "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 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 #3 = { nounwind "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 = { 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 4}
!6 = !{!"bpresync_cccf_s", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !11, i64 56}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!6, !10, i64 24}
!13 = !{!11, !11, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass