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

; Function Attrs: nounwind uwtable
define dso_local ptr @channel_cccf_create() #0 {
  %1 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  %2 = call noalias ptr @malloc(i64 noundef 88) #5
  store ptr %2, ptr %1, align 8, !tbaa !5
  %3 = load ptr, ptr %1, align 8, !tbaa !5
  %4 = getelementptr inbounds %struct.channel_cccf_s, ptr %3, i32 0, i32 0
  store i32 0, ptr %4, align 8, !tbaa !9
  %5 = load ptr, ptr %1, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.channel_cccf_s, ptr %5, i32 0, i32 5
  store i32 0, ptr %6, align 4, !tbaa !13
  %7 = load ptr, ptr %1, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.channel_cccf_s, ptr %7, i32 0, i32 9
  store i32 0, ptr %8, align 8, !tbaa !14
  %9 = load ptr, ptr %1, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.channel_cccf_s, ptr %9, i32 0, i32 13
  store i32 0, ptr %10, align 4, !tbaa !15
  %11 = call ptr @nco_crcf_create(i32 noundef 1)
  %12 = load ptr, ptr %1, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.channel_cccf_s, ptr %12, i32 0, i32 8
  store ptr %11, ptr %13, align 8, !tbaa !16
  %14 = load ptr, ptr %1, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.channel_cccf_s, ptr %14, i32 0, i32 12
  store i32 1, ptr %15, align 8, !tbaa !17
  %16 = load ptr, ptr %1, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.channel_cccf_s, ptr %16, i32 0, i32 12
  %18 = load i32, ptr %17, align 8, !tbaa !17
  %19 = zext i32 %18 to i64
  %20 = mul i64 %19, 8
  %21 = call noalias ptr @malloc(i64 noundef %20) #5
  %22 = load ptr, ptr %1, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.channel_cccf_s, ptr %22, i32 0, i32 11
  store ptr %21, ptr %23, align 8, !tbaa !18
  %24 = load ptr, ptr %1, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.channel_cccf_s, ptr %24, i32 0, i32 11
  %26 = load ptr, ptr %25, align 8, !tbaa !18
  %27 = getelementptr inbounds { float, float }, ptr %26, i64 0
  %28 = getelementptr inbounds { float, float }, ptr %27, i32 0, i32 0
  %29 = getelementptr inbounds { float, float }, ptr %27, i32 0, i32 1
  store float 1.000000e+00, ptr %28, align 4
  store float 0.000000e+00, ptr %29, align 4
  %30 = load ptr, ptr %1, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.channel_cccf_s, ptr %30, i32 0, i32 11
  %32 = load ptr, ptr %31, align 8, !tbaa !18
  %33 = load ptr, ptr %1, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.channel_cccf_s, ptr %33, i32 0, i32 12
  %35 = load i32, ptr %34, align 8, !tbaa !17
  %36 = call ptr @firfilt_cccf_create(ptr noundef %32, i32 noundef %35)
  %37 = load ptr, ptr %1, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.channel_cccf_s, ptr %37, i32 0, i32 10
  store ptr %36, ptr %38, align 8, !tbaa !19
  %39 = load ptr, ptr %1, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.channel_cccf_s, ptr %39, i32 0, i32 14
  store ptr null, ptr %40, align 8, !tbaa !20
  %41 = load ptr, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret ptr %41
}

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

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

declare ptr @nco_crcf_create(i32 noundef) #3

declare ptr @firfilt_cccf_create(ptr noundef, i32 noundef) #3

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"channel_cccf_s", !11, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !11, i64 20, !12, i64 24, !12, i64 28, !6, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !11, i64 64, !11, i64 68, !6, i64 72, !12, i64 80, !12, i64 84}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!10, !11, i64 20}
!14 = !{!10, !11, i64 40}
!15 = !{!10, !11, i64 68}
!16 = !{!10, !6, i64 32}
!17 = !{!10, !11, i64 64}
!18 = !{!10, !6, i64 56}
!19 = !{!10, !6, i64 48}
!20 = !{!10, !6, i64 72}


; 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 noalias noundef ptr @channel_cccf_create() local_unnamed_addr #0 {
  %1 = tail call noalias dereferenceable_or_null(88) ptr @malloc(i64 noundef 88) #3
  store i32 0, ptr %1, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %1, i64 20
  store i32 0, ptr %2, align 4, !tbaa !12
  %3 = getelementptr inbounds i8, ptr %1, i64 40
  store i32 0, ptr %3, align 8, !tbaa !13
  %4 = getelementptr inbounds i8, ptr %1, i64 68
  store i32 0, ptr %4, align 4, !tbaa !14
  %5 = tail call ptr @nco_crcf_create(i32 noundef 1) #4
  %6 = getelementptr inbounds i8, ptr %1, i64 32
  store ptr %5, ptr %6, align 8, !tbaa !15
  %7 = getelementptr inbounds i8, ptr %1, i64 64
  store i32 1, ptr %7, align 8, !tbaa !16
  %8 = tail call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #3
  %9 = getelementptr inbounds i8, ptr %1, i64 56
  store ptr %8, ptr %9, align 8, !tbaa !17
  store <2 x float> <float 1.000000e+00, float 0.000000e+00>, ptr %8, align 4
  %10 = tail call ptr @firfilt_cccf_create(ptr noundef nonnull %8, i32 noundef 1) #4
  %11 = getelementptr inbounds i8, ptr %1, i64 48
  store ptr %10, ptr %11, align 8, !tbaa !18
  %12 = getelementptr inbounds i8, ptr %1, i64 72
  store ptr null, ptr %12, align 8, !tbaa !19
  ret ptr %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 #1

declare ptr @nco_crcf_create(i32 noundef) local_unnamed_addr #2

declare ptr @firfilt_cccf_create(ptr noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { 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 #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 allocsize(0) }
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 0}
!6 = !{!"channel_cccf_s", !7, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !7, i64 20, !10, i64 24, !10, i64 28, !11, i64 32, !7, i64 40, !11, i64 48, !11, i64 56, !7, i64 64, !7, i64 68, !11, i64 72, !10, i64 80, !10, i64 84}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !7, i64 20}
!13 = !{!6, !7, i64 40}
!14 = !{!6, !7, i64 68}
!15 = !{!6, !11, i64 32}
!16 = !{!6, !7, i64 64}
!17 = !{!6, !11, i64 56}
!18 = !{!6, !11, i64 48}
!19 = !{!6, !11, i64 72}


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