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

@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [71 x i8], align 1

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

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

declare ptr @liquid_error_config_fl(ptr noundef, i32 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
define dso_local ptr @firinterp_cccf_create(i32 noundef %0, ptr noundef %1, i32 noundef %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !5
  %10 = load i32, ptr %5, align 4, !tbaa !5
  %11 = icmp ult i32 %10, 2
  br i1 %11, label %12, label %14

12:                                               ; preds = %3
  %13 = call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef @.str.42, i32 noundef 47, ptr noundef @.str.43, ptr noundef @.str.3)
  store ptr %13, ptr %4, align 8
  br label %111

14:                                               ; preds = %3
  %15 = load i32, ptr %7, align 4, !tbaa !5
  %16 = load i32, ptr %5, align 4, !tbaa !5
  %17 = icmp ult i32 %15, %16
  br i1 %17, label %18, label %20

18:                                               ; preds = %14
  %19 = call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef @.str.42, i32 noundef 49, ptr noundef @.str.44, ptr noundef @.str.3)
  store ptr %19, ptr %4, align 8
  br label %111

20:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %21 = call noalias ptr @malloc(i64 noundef 32) #5
  store ptr %21, ptr %8, align 8, !tbaa !9
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = load ptr, ptr %8, align 8, !tbaa !9
  %24 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %23, i32 0, i32 3
  store i32 %22, ptr %24, align 8, !tbaa !11
  %25 = load i32, ptr %7, align 4, !tbaa !5
  %26 = load ptr, ptr %8, align 8, !tbaa !9
  %27 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %26, i32 0, i32 1
  store i32 %25, ptr %27, align 8, !tbaa !13
  %28 = load ptr, ptr %8, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %28, i32 0, i32 2
  store i32 0, ptr %29, align 4, !tbaa !14
  br label %30

30:                                               ; preds = %40, %20
  %31 = load ptr, ptr %8, align 8, !tbaa !9
  %32 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %31, i32 0, i32 3
  %33 = load i32, ptr %32, align 8, !tbaa !11
  %34 = load ptr, ptr %8, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %34, i32 0, i32 2
  %36 = load i32, ptr %35, align 4, !tbaa !14
  %37 = mul i32 %33, %36
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = icmp ult i32 %37, %38
  br i1 %39, label %40, label %45

40:                                               ; preds = %30
  %41 = load ptr, ptr %8, align 8, !tbaa !9
  %42 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %41, i32 0, i32 2
  %43 = load i32, ptr %42, align 4, !tbaa !14
  %44 = add i32 %43, 1
  store i32 %44, ptr %42, align 4, !tbaa !14
  br label %30, !llvm.loop !15

45:                                               ; preds = %30
  %46 = load ptr, ptr %8, align 8, !tbaa !9
  %47 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %46, i32 0, i32 3
  %48 = load i32, ptr %47, align 8, !tbaa !11
  %49 = load ptr, ptr %8, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %49, i32 0, i32 2
  %51 = load i32, ptr %50, align 4, !tbaa !14
  %52 = mul i32 %48, %51
  %53 = load ptr, ptr %8, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %53, i32 0, i32 1
  store i32 %52, ptr %54, align 8, !tbaa !13
  %55 = load ptr, ptr %8, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 8, !tbaa !13
  %58 = zext i32 %57 to i64
  %59 = mul i64 %58, 8
  %60 = call noalias ptr @malloc(i64 noundef %59) #5
  %61 = load ptr, ptr %8, align 8, !tbaa !9
  %62 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %61, i32 0, i32 0
  store ptr %60, ptr %62, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %94, %45
  %64 = load i32, ptr %9, align 4, !tbaa !5
  %65 = load ptr, ptr %8, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %65, i32 0, i32 1
  %67 = load i32, ptr %66, align 8, !tbaa !13
  %68 = icmp ult i32 %64, %67
  br i1 %68, label %69, label %97

69:                                               ; preds = %63
  %70 = load i32, ptr %9, align 4, !tbaa !5
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = icmp ult i32 %70, %71
  br i1 %72, label %73, label %82

73:                                               ; preds = %69
  %74 = load ptr, ptr %6, align 8, !tbaa !9
  %75 = load i32, ptr %9, align 4, !tbaa !5
  %76 = zext i32 %75 to i64
  %77 = getelementptr inbounds { float, float }, ptr %74, i64 %76
  %78 = getelementptr inbounds { float, float }, ptr %77, i32 0, i32 0
  %79 = load float, ptr %78, align 4
  %80 = getelementptr inbounds { float, float }, ptr %77, i32 0, i32 1
  %81 = load float, ptr %80, align 4
  br label %83

82:                                               ; preds = %69
  br label %83

83:                                               ; preds = %82, %73
  %84 = phi float [ %79, %73 ], [ 0.000000e+00, %82 ]
  %85 = phi float [ %81, %73 ], [ 0.000000e+00, %82 ]
  %86 = load ptr, ptr %8, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8, !tbaa !17
  %89 = load i32, ptr %9, align 4, !tbaa !5
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds { float, float }, ptr %88, i64 %90
  %92 = getelementptr inbounds { float, float }, ptr %91, i32 0, i32 0
  %93 = getelementptr inbounds { float, float }, ptr %91, i32 0, i32 1
  store float %84, ptr %92, align 4
  store float %85, ptr %93, align 4
  br label %94

94:                                               ; preds = %83
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = add i32 %95, 1
  store i32 %96, ptr %9, align 4, !tbaa !5
  br label %63, !llvm.loop !18

97:                                               ; preds = %63
  %98 = load ptr, ptr %8, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %98, i32 0, i32 3
  %100 = load i32, ptr %99, align 8, !tbaa !11
  %101 = load ptr, ptr %8, align 8, !tbaa !9
  %102 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %101, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !17
  %104 = load ptr, ptr %8, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %104, i32 0, i32 1
  %106 = load i32, ptr %105, align 8, !tbaa !13
  %107 = call ptr @firpfb_cccf_create(i32 noundef %100, ptr noundef %103, i32 noundef %106)
  %108 = load ptr, ptr %8, align 8, !tbaa !9
  %109 = getelementptr inbounds %struct.firinterp_cccf_s, ptr %108, i32 0, i32 4
  store ptr %107, ptr %109, align 8, !tbaa !19
  %110 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %110, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %111

111:                                              ; preds = %97, %18, %12
  %112 = load ptr, ptr %4, align 8
  ret ptr %112
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(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 = { "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 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 #4 = { nounwind }
attributes #5 = { nounwind allocsize(0) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"firinterp_cccf_s", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !10, i64 24}
!13 = !{!12, !6, i64 8}
!14 = !{!12, !6, i64 12}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!12, !10, i64 0}
!18 = distinct !{!18, !16}
!19 = !{!12, !10, i64 24}


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

@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [71 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

declare ptr @liquid_error_config_fl(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local ptr @firinterp_cccf_create(i32 noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #2 {
  %4 = icmp ult i32 %0, 2
  br i1 %4, label %5, label %7

5:                                                ; preds = %3
  %6 = tail call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef nonnull @.str.42, i32 noundef 47, ptr noundef nonnull @.str.43, ptr noundef nonnull @.str.3) #3
  br label %46

7:                                                ; preds = %3
  %8 = icmp ult i32 %2, %0
  br i1 %8, label %9, label %11

9:                                                ; preds = %7
  %10 = tail call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef nonnull @.str.42, i32 noundef 49, ptr noundef nonnull @.str.44, ptr noundef nonnull @.str.3) #3
  br label %46

11:                                               ; preds = %7
  %12 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #4
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  store i32 %0, ptr %13, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %12, i64 8
  br label %15

15:                                               ; preds = %15, %11
  %indvars.iv38 = phi i32 [ %indvars.iv.next39, %15 ], [ 0, %11 ]
  %storemerge = phi i32 [ %18, %15 ], [ 0, %11 ]
  %16 = mul i32 %storemerge, %0
  %17 = icmp ult i32 %16, %2
  %18 = add i32 %storemerge, 1
  %indvars.iv.next39 = add i32 %indvars.iv38, %0
  br i1 %17, label %15, label %.lr.ph.preheader, !llvm.loop !11

.lr.ph.preheader:                                 ; preds = %15
  %19 = getelementptr inbounds i8, ptr %12, i64 12
  store i32 %storemerge, ptr %19, align 4, !tbaa !13
  store i32 %16, ptr %14, align 8, !tbaa !14
  %20 = zext i32 %16 to i64
  %21 = shl nuw nsw i64 %20, 3
  %22 = tail call noalias ptr @malloc(i64 noundef %21) #4
  store ptr %22, ptr %12, align 8, !tbaa !15
  %23 = zext i32 %2 to i64
  %wide.trip.count = zext i32 %indvars.iv38 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %24 = icmp eq i32 %indvars.iv38, 1
  br i1 %24, label %._crit_edge.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 4294967294
  br label %.lr.ph

.lr.ph:                                           ; preds = %35, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %35 ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %35 ]
  %25 = icmp ult i64 %indvars.iv, %23
  br i1 %25, label %26, label %.lr.ph.1

26:                                               ; preds = %.lr.ph
  %27 = getelementptr inbounds { float, float }, ptr %1, i64 %indvars.iv
  %28 = load <2 x float>, ptr %27, align 4
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph, %26
  %29 = phi <2 x float> [ %28, %26 ], [ zeroinitializer, %.lr.ph ]
  %30 = getelementptr inbounds { float, float }, ptr %22, i64 %indvars.iv
  store <2 x float> %29, ptr %30, align 4
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %31 = icmp ult i64 %indvars.iv.next, %23
  br i1 %31, label %32, label %35

32:                                               ; preds = %.lr.ph.1
  %33 = getelementptr inbounds { float, float }, ptr %1, i64 %indvars.iv.next
  %34 = load <2 x float>, ptr %33, align 4
  br label %35

35:                                               ; preds = %32, %.lr.ph.1
  %36 = phi <2 x float> [ %34, %32 ], [ zeroinitializer, %.lr.ph.1 ]
  %37 = getelementptr inbounds { float, float }, ptr %22, i64 %indvars.iv.next
  store <2 x float> %36, ptr %37, align 4
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.unr-lcssa, label %.lr.ph, !llvm.loop !16

._crit_edge.unr-lcssa:                            ; preds = %35, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %35 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.unr-lcssa
  %38 = icmp ult i64 %indvars.iv.unr, %23
  br i1 %38, label %39, label %._crit_edge.epilog-lcssa

39:                                               ; preds = %.lr.ph.epil
  %40 = getelementptr inbounds { float, float }, ptr %1, i64 %indvars.iv.unr
  %41 = load <2 x float>, ptr %40, align 4
  br label %._crit_edge.epilog-lcssa

._crit_edge.epilog-lcssa:                         ; preds = %39, %.lr.ph.epil
  %42 = phi <2 x float> [ %41, %39 ], [ zeroinitializer, %.lr.ph.epil ]
  %43 = getelementptr inbounds { float, float }, ptr %22, i64 %indvars.iv.unr
  store <2 x float> %42, ptr %43, align 4
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.unr-lcssa, %._crit_edge.epilog-lcssa
  %44 = tail call ptr @firpfb_cccf_create(i32 noundef %0, ptr noundef nonnull %22, i32 noundef %16)
  %45 = getelementptr inbounds i8, ptr %12, i64 24
  store ptr %44, ptr %45, align 8, !tbaa !17
  br label %46

46:                                               ; preds = %._crit_edge, %9, %5
  %.031 = phi ptr [ %6, %5 ], [ %10, %9 ], [ %12, %._crit_edge ]
  ret ptr %.031
}

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { "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 }
attributes #4 = { nounwind allocsize(0) }

!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, !10, i64 16}
!6 = !{!"firinterp_cccf_s", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !7, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!6, !10, i64 12}
!14 = !{!6, !10, i64 8}
!15 = !{!6, !7, i64 0}
!16 = distinct !{!16, !12}
!17 = !{!6, !7, i64 24}


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