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

; Function Attrs: nounwind uwtable
define dso_local ptr @qdetector_cccf_execute(ptr noundef %0, <2 x float> noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca { float, float }, align 4
  %5 = alloca ptr, align 8
  %6 = alloca { float, float }, align 4
  %7 = alloca { float, float }, align 4
  store <2 x float> %1, ptr %4, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  %8 = load ptr, ptr %5, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.qdetector_cccf_s, ptr %8, i32 0, i32 24
  %10 = load i32, ptr %9, align 4, !tbaa !9
  switch i32 %10, label %31 [
    i32 0, label %11
    i32 1, label %21
  ]

11:                                               ; preds = %2
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %14 = load float, ptr %13, align 4
  %15 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 1
  %16 = load float, ptr %15, align 4
  %17 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 0
  %18 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 1
  store float %14, ptr %17, align 4
  store float %16, ptr %18, align 4
  %19 = load <2 x float>, ptr %6, align 4
  %20 = call i32 @qdetector_cccf_execute_seek(ptr noundef %12, <2 x float> noundef %19)
  br label %31

21:                                               ; preds = %2
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %24 = load float, ptr %23, align 4
  %25 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 1
  %26 = load float, ptr %25, align 4
  %27 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 0
  %28 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 1
  store float %24, ptr %27, align 4
  store float %26, ptr %28, align 4
  %29 = load <2 x float>, ptr %7, align 4
  %30 = call i32 @qdetector_cccf_execute_align(ptr noundef %22, <2 x float> noundef %29)
  br label %31

31:                                               ; preds = %21, %11, %2
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.qdetector_cccf_s, ptr %32, i32 0, i32 25
  %34 = load i32, ptr %33, align 8, !tbaa !13
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %42

36:                                               ; preds = %31
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.qdetector_cccf_s, ptr %37, i32 0, i32 25
  store i32 0, ptr %38, align 8, !tbaa !13
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.qdetector_cccf_s, ptr %39, i32 0, i32 7
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  store ptr %41, ptr %3, align 8
  br label %43

42:                                               ; preds = %31
  store ptr null, ptr %3, align 8
  br label %43

43:                                               ; preds = %42, %36
  %44 = load ptr, ptr %3, align 8
  ret ptr %44
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @qdetector_cccf_execute_seek(ptr noundef, <2 x float> noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @qdetector_cccf_execute_align(ptr noundef, <2 x float> noundef) #0

attributes #0 = { 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" }

!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, !11, i64 140}
!10 = !{!"qdetector_cccf_s", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !11, i64 64, !6, i64 72, !6, i64 80, !11, i64 88, !12, i64 92, !12, i64 96, !11, i64 100, !11, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !11, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !11, i64 140, !11, i64 144}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!10, !11, i64 144}
!14 = !{!10, !6, i64 56}


; 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 ptr @qdetector_cccf_execute(ptr noundef %0, <2 x float> noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 140
  %4 = load i32, ptr %3, align 4, !tbaa !5
  switch i32 %4, label %9 [
    i32 0, label %5
    i32 1, label %7
  ]

5:                                                ; preds = %2
  %6 = tail call i32 @qdetector_cccf_execute_seek(ptr noundef nonnull %0, <2 x float> noundef %1)
  br label %9

7:                                                ; preds = %2
  %8 = tail call i32 @qdetector_cccf_execute_align(ptr noundef nonnull %0, <2 x float> noundef %1)
  br label %9

9:                                                ; preds = %7, %5, %2
  %10 = getelementptr inbounds i8, ptr %0, i64 144
  %11 = load i32, ptr %10, align 8, !tbaa !12
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %15, label %12

12:                                               ; preds = %9
  store i32 0, ptr %10, align 8, !tbaa !12
  %13 = getelementptr inbounds i8, ptr %0, i64 56
  %14 = load ptr, ptr %13, align 8, !tbaa !13
  br label %15

15:                                               ; preds = %9, %12
  %.0 = phi ptr [ %14, %12 ], [ null, %9 ]
  ret ptr %.0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @qdetector_cccf_execute_seek(ptr noundef, <2 x float> noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @qdetector_cccf_execute_align(ptr noundef, <2 x float> noundef) local_unnamed_addr #0

attributes #0 = { 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" }

!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 140}
!6 = !{!"qdetector_cccf_s", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !10, i64 72, !10, i64 80, !7, i64 88, !11, i64 92, !11, i64 96, !7, i64 100, !7, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !7, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !7, i64 140, !7, i64 144}
!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, !7, i64 144}
!13 = !{!6, !10, i64 56}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass