; LLVM IR from jgaeddert/liquid-dsp :: src/equalization/src (equalizer_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"

; 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 @eqlms_cccf_step_blind(ptr noundef %0, <2 x float> noundef %1) #1 {
  %3 = alloca { float, float }, align 4
  %4 = alloca ptr, align 8
  %5 = alloca { float, float }, align 4
  %6 = alloca { float, float }, align 4
  %7 = alloca { float, float }, align 4
  %8 = alloca { float, float }, align 4
  store <2 x float> %1, ptr %3, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %9 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %10 = load float, ptr %9, align 4
  %11 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 1
  %12 = load float, ptr %11, align 4
  %13 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %14 = load float, ptr %13, align 4
  %15 = getelementptr inbounds { float, float }, ptr %3, 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 float @cabsf(<2 x float> noundef %19) #3
  %21 = fdiv float %10, %20
  %22 = fdiv float %12, %20
  %23 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %24 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 1
  store float %21, ptr %23, align 4
  store float %22, ptr %24, align 4
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %27 = load float, ptr %26, align 4
  %28 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 1
  %29 = load float, ptr %28, align 4
  %30 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %31 = load float, ptr %30, align 4
  %32 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 1
  %33 = load float, ptr %32, align 4
  %34 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 0
  %35 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 1
  store float %27, ptr %34, align 4
  store float %29, ptr %35, align 4
  %36 = load <2 x float>, ptr %7, align 4
  %37 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %38 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  store float %31, ptr %37, align 4
  store float %33, ptr %38, align 4
  %39 = load <2 x float>, ptr %8, align 4
  %40 = call i32 @eqlms_cccf_step(ptr noundef %25, <2 x float> noundef %36, <2 x float> noundef %39)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret i32 %40
}

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

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

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 "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 }

!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"}


; 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 i32 @eqlms_cccf_step_blind(ptr noundef %0, <2 x float> noundef %1) local_unnamed_addr #0 {
  %3 = tail call float @cabsf(<2 x float> noundef %1) #2
  %4 = insertelement <2 x float> poison, float %3, i64 0
  %5 = shufflevector <2 x float> %4, <2 x float> poison, <2 x i32> zeroinitializer
  %6 = fdiv <2 x float> %1, %5
  %7 = tail call i32 @eqlms_cccf_step(ptr noundef %0, <2 x float> noundef %6, <2 x float> noundef %1)
  ret i32 %7
}

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

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass