; LLVM IR from jgaeddert/liquid-dsp :: src/filter/src (filter_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.resamp2_cccf_s = type { ptr, i32, i32, float, float, ptr, ptr, i32, ptr, ptr, { float, float }, i32 }

; 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

declare i32 @windowcf_push(ptr noundef, <2 x float> noundef) #1

declare i32 @windowcf_read(ptr noundef, ptr noundef) #1

declare <2 x float> @__mulsc3(float, float, float, float)

; Function Attrs: nounwind uwtable
define dso_local i32 @resamp2_cccf_interp_execute(ptr noundef %0, <2 x float> noundef %1, ptr noundef %2) #2 {
  %4 = alloca { float, float }, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca { float, float }, align 4
  %9 = alloca { float, float }, align 4
  %10 = alloca { float, float }, align 4
  %11 = alloca { float, float }, align 4
  store <2 x float> %1, ptr %4, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.resamp2_cccf_s, ptr %12, i32 0, i32 8
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %16 = load float, ptr %15, align 4
  %17 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 1
  %18 = load float, ptr %17, align 4
  %19 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %20 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  store float %16, ptr %19, align 4
  store float %18, ptr %20, align 4
  %21 = load <2 x float>, ptr %8, align 4
  %22 = call i32 @windowcf_push(ptr noundef %14, <2 x float> noundef %21)
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.resamp2_cccf_s, ptr %23, i32 0, i32 8
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.resamp2_cccf_s, ptr %26, i32 0, i32 1
  %28 = load i32, ptr %27, align 8, !tbaa !13
  %29 = sub i32 %28, 1
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds { float, float }, ptr %30, i64 0
  %32 = call i32 @windowcf_index(ptr noundef %25, i32 noundef %29, ptr noundef %31)
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.resamp2_cccf_s, ptr %33, i32 0, i32 9
  %35 = load ptr, ptr %34, align 8, !tbaa !14
  %36 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %37 = load float, ptr %36, align 4
  %38 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 1
  %39 = load float, ptr %38, align 4
  %40 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 0
  %41 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 1
  store float %37, ptr %40, align 4
  store float %39, ptr %41, align 4
  %42 = load <2 x float>, ptr %9, align 4
  %43 = call i32 @windowcf_push(ptr noundef %35, <2 x float> noundef %42)
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.resamp2_cccf_s, ptr %44, i32 0, i32 9
  %46 = load ptr, ptr %45, align 8, !tbaa !14
  %47 = call i32 @windowcf_read(ptr noundef %46, ptr noundef %7)
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.resamp2_cccf_s, ptr %48, i32 0, i32 6
  %50 = load ptr, ptr %49, align 8, !tbaa !15
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds { float, float }, ptr %52, i64 1
  %54 = call i32 @dotprod_cccf_execute(ptr noundef %50, ptr noundef %51, ptr noundef %53)
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.resamp2_cccf_s, ptr %55, i32 0, i32 10
  %57 = getelementptr inbounds { float, float }, ptr %56, i32 0, i32 0
  %58 = load float, ptr %57, align 8
  %59 = getelementptr inbounds { float, float }, ptr %56, i32 0, i32 1
  %60 = load float, ptr %59, align 4
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds { float, float }, ptr %61, i64 0
  %63 = getelementptr inbounds { float, float }, ptr %62, i32 0, i32 0
  %64 = load float, ptr %63, align 4
  %65 = getelementptr inbounds { float, float }, ptr %62, i32 0, i32 1
  %66 = load float, ptr %65, align 4
  %67 = fmul float %64, %58
  %68 = fmul float %66, %60
  %69 = fmul float %64, %60
  %70 = fmul float %66, %58
  %71 = fsub float %67, %68
  %72 = fadd float %69, %70
  %73 = fcmp uno float %71, %71
  br i1 %73, label %74, label %82, !prof !16

74:                                               ; preds = %3
  %75 = fcmp uno float %72, %72
  br i1 %75, label %76, label %82, !prof !16

76:                                               ; preds = %74
  %77 = call <2 x float> @__mulsc3(float noundef %64, float noundef %66, float noundef %58, float noundef %60) #3
  store <2 x float> %77, ptr %10, align 4
  %78 = getelementptr inbounds { float, float }, ptr %10, i32 0, i32 0
  %79 = load float, ptr %78, align 4
  %80 = getelementptr inbounds { float, float }, ptr %10, i32 0, i32 1
  %81 = load float, ptr %80, align 4
  br label %82

82:                                               ; preds = %76, %74, %3
  %83 = phi float [ %71, %3 ], [ %71, %74 ], [ %79, %76 ]
  %84 = phi float [ %72, %3 ], [ %72, %74 ], [ %81, %76 ]
  %85 = getelementptr inbounds { float, float }, ptr %62, i32 0, i32 0
  %86 = getelementptr inbounds { float, float }, ptr %62, i32 0, i32 1
  store float %83, ptr %85, align 4
  store float %84, ptr %86, align 4
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.resamp2_cccf_s, ptr %87, i32 0, i32 10
  %89 = getelementptr inbounds { float, float }, ptr %88, i32 0, i32 0
  %90 = load float, ptr %89, align 8
  %91 = getelementptr inbounds { float, float }, ptr %88, i32 0, i32 1
  %92 = load float, ptr %91, align 4
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds { float, float }, ptr %93, i64 1
  %95 = getelementptr inbounds { float, float }, ptr %94, i32 0, i32 0
  %96 = load float, ptr %95, align 4
  %97 = getelementptr inbounds { float, float }, ptr %94, i32 0, i32 1
  %98 = load float, ptr %97, align 4
  %99 = fmul float %96, %90
  %100 = fmul float %98, %92
  %101 = fmul float %96, %92
  %102 = fmul float %98, %90
  %103 = fsub float %99, %100
  %104 = fadd float %101, %102
  %105 = fcmp uno float %103, %103
  br i1 %105, label %106, label %114, !prof !16

106:                                              ; preds = %82
  %107 = fcmp uno float %104, %104
  br i1 %107, label %108, label %114, !prof !16

108:                                              ; preds = %106
  %109 = call <2 x float> @__mulsc3(float noundef %96, float noundef %98, float noundef %90, float noundef %92) #3
  store <2 x float> %109, ptr %11, align 4
  %110 = getelementptr inbounds { float, float }, ptr %11, i32 0, i32 0
  %111 = load float, ptr %110, align 4
  %112 = getelementptr inbounds { float, float }, ptr %11, i32 0, i32 1
  %113 = load float, ptr %112, align 4
  br label %114

114:                                              ; preds = %108, %106, %82
  %115 = phi float [ %103, %82 ], [ %103, %106 ], [ %111, %108 ]
  %116 = phi float [ %104, %82 ], [ %104, %106 ], [ %113, %108 ]
  %117 = getelementptr inbounds { float, float }, ptr %94, i32 0, i32 0
  %118 = getelementptr inbounds { float, float }, ptr %94, i32 0, i32 1
  store float %115, ptr %117, align 4
  store float %116, ptr %118, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret i32 0
}

declare i32 @dotprod_cccf_execute(ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @windowcf_index(ptr noundef, i32 noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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"="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 #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, !6, i64 48}
!10 = !{!"resamp2_cccf_s", !6, i64 0, !11, i64 8, !11, i64 12, !12, i64 16, !12, i64 20, !6, i64 24, !6, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !7, i64 64, !11, i64 72}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!10, !11, i64 8}
!14 = !{!10, !6, i64 56}
!15 = !{!10, !6, i64 32}
!16 = !{!"branch_weights", i32 1, i32 1048575}


; 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

declare i32 @windowcf_push(ptr noundef, <2 x float> noundef) local_unnamed_addr #1

declare i32 @windowcf_read(ptr noundef, ptr noundef) local_unnamed_addr #1

declare <2 x float> @__mulsc3(float, float, float, float) local_unnamed_addr

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @resamp2_cccf_interp_execute(ptr nocapture noundef readonly %0, <2 x float> noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 48
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call i32 @windowcf_push(ptr noundef %6, <2 x float> noundef %1) #3
  %8 = load ptr, ptr %5, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = load i32, ptr %9, align 8, !tbaa !12
  %11 = add i32 %10, -1
  %12 = tail call i32 @windowcf_index(ptr noundef %8, i32 noundef %11, ptr noundef %2) #3
  %13 = getelementptr inbounds i8, ptr %0, i64 56
  %14 = load ptr, ptr %13, align 8, !tbaa !13
  %15 = tail call i32 @windowcf_push(ptr noundef %14, <2 x float> noundef %1) #3
  %16 = load ptr, ptr %13, align 8, !tbaa !13
  %17 = call i32 @windowcf_read(ptr noundef %16, ptr noundef nonnull %4) #3
  %18 = getelementptr inbounds i8, ptr %0, i64 32
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  %20 = load ptr, ptr %4, align 8, !tbaa !15
  %21 = getelementptr inbounds i8, ptr %2, i64 8
  %22 = call i32 @dotprod_cccf_execute(ptr noundef %19, ptr noundef %20, ptr noundef nonnull %21) #3
  %23 = getelementptr inbounds i8, ptr %0, i64 64
  %24 = getelementptr inbounds i8, ptr %2, i64 4
  %25 = load <2 x float>, ptr %23, align 8
  %26 = load <2 x float>, ptr %2, align 4
  %27 = fmul <2 x float> %25, %26
  %28 = shufflevector <2 x float> %25, <2 x float> poison, <2 x i32> <i32 1, i32 0>
  %29 = fmul <2 x float> %28, %26
  %shift = shufflevector <2 x float> %27, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %30 = fsub <2 x float> %27, %shift
  %31 = extractelement <2 x float> %30, i64 0
  %shift22 = shufflevector <2 x float> %29, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %32 = fadd <2 x float> %29, %shift22
  %33 = extractelement <2 x float> %32, i64 0
  %34 = fcmp uno float %31, 0.000000e+00
  br i1 %34, label %35, label %43, !prof !16

35:                                               ; preds = %3
  %36 = fcmp uno float %33, 0.000000e+00
  br i1 %36, label %37, label %43, !prof !16

37:                                               ; preds = %35
  %38 = extractelement <2 x float> %25, i64 0
  %39 = extractelement <2 x float> %25, i64 1
  %40 = extractelement <2 x float> %26, i64 0
  %41 = extractelement <2 x float> %26, i64 1
  %42 = call <2 x float> @__mulsc3(float noundef %40, float noundef %41, float noundef %38, float noundef %39) #3
  %.sroa.01.0.vec.extract = extractelement <2 x float> %42, i64 0
  %.sroa.01.4.vec.extract = extractelement <2 x float> %42, i64 1
  br label %43

43:                                               ; preds = %37, %35, %3
  %44 = phi float [ %31, %3 ], [ %31, %35 ], [ %.sroa.01.0.vec.extract, %37 ]
  %45 = phi float [ %33, %3 ], [ %33, %35 ], [ %.sroa.01.4.vec.extract, %37 ]
  store float %44, ptr %2, align 4
  store float %45, ptr %24, align 4
  %46 = load <2 x float>, ptr %23, align 8
  %47 = load <2 x float>, ptr %21, align 4
  %48 = fmul <2 x float> %46, %47
  %49 = shufflevector <2 x float> %46, <2 x float> poison, <2 x i32> <i32 1, i32 0>
  %50 = fmul <2 x float> %49, %47
  %shift23 = shufflevector <2 x float> %48, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %51 = fsub <2 x float> %48, %shift23
  %52 = extractelement <2 x float> %51, i64 0
  %shift24 = shufflevector <2 x float> %50, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %53 = fadd <2 x float> %50, %shift24
  %54 = extractelement <2 x float> %53, i64 0
  %55 = fcmp uno float %52, 0.000000e+00
  br i1 %55, label %56, label %64, !prof !16

56:                                               ; preds = %43
  %57 = fcmp uno float %54, 0.000000e+00
  br i1 %57, label %58, label %64, !prof !16

58:                                               ; preds = %56
  %59 = extractelement <2 x float> %46, i64 0
  %60 = extractelement <2 x float> %46, i64 1
  %61 = extractelement <2 x float> %47, i64 0
  %62 = extractelement <2 x float> %47, i64 1
  %63 = call <2 x float> @__mulsc3(float noundef %61, float noundef %62, float noundef %59, float noundef %60) #3
  %.sroa.0.0.vec.extract = extractelement <2 x float> %63, i64 0
  %.sroa.0.4.vec.extract = extractelement <2 x float> %63, i64 1
  br label %64

64:                                               ; preds = %58, %56, %43
  %65 = phi float [ %52, %43 ], [ %52, %56 ], [ %.sroa.0.0.vec.extract, %58 ]
  %66 = phi float [ %54, %43 ], [ %54, %56 ], [ %.sroa.0.4.vec.extract, %58 ]
  %67 = getelementptr inbounds i8, ptr %2, i64 12
  store float %65, ptr %21, align 4
  store float %66, ptr %67, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret i32 0
}

declare i32 @dotprod_cccf_execute(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @windowcf_index(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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"="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 #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, !7, i64 48}
!6 = !{!"resamp2_cccf_s", !7, i64 0, !10, i64 8, !10, i64 12, !11, i64 16, !11, i64 20, !7, i64 24, !7, i64 32, !10, i64 40, !7, i64 48, !7, i64 56, !8, i64 64, !10, i64 72}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!6, !10, i64 8}
!13 = !{!6, !7, i64 56}
!14 = !{!6, !7, i64 32}
!15 = !{!7, !7, i64 0}
!16 = !{!"branch_weights", i32 1, i32 1048575}


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