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

%struct.eqrls_cccf_s = type { i32, float, float, ptr, ptr, ptr, ptr, ptr, ptr, ptr, { float, float }, ptr, ptr, i32, ptr }

@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [89 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #3

declare ptr @windowcf_copy(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local ptr @eqrls_cccf_copy(ptr noundef %0) #4 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = icmp eq ptr %6, null
  br i1 %7, label %8, label %10

8:                                                ; preds = %1
  %9 = call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef @.str.14, i32 noundef 132, ptr noundef @.str.8, ptr noundef @.str.2)
  store ptr %9, ptr %2, align 8
  br label %95

10:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %11 = call noalias ptr @malloc(i64 noundef 112) #6
  store ptr %11, ptr %4, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %12, ptr align 8 %13, i64 112, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %14, i32 0, i32 0
  %16 = load i32, ptr %15, align 8, !tbaa !9
  store i32 %16, ptr %5, align 4, !tbaa !13
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %17, i32 0, i32 3
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  %20 = load i32, ptr %5, align 4, !tbaa !13
  %21 = call ptr @liquid_malloc_copy(ptr noundef %19, i32 noundef %20, i32 noundef 8)
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %22, i32 0, i32 3
  store ptr %21, ptr %23, align 8, !tbaa !14
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %24, i32 0, i32 4
  %26 = load ptr, ptr %25, align 8, !tbaa !15
  %27 = load i32, ptr %5, align 4, !tbaa !13
  %28 = call ptr @liquid_malloc_copy(ptr noundef %26, i32 noundef %27, i32 noundef 8)
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %29, i32 0, i32 4
  store ptr %28, ptr %30, align 8, !tbaa !15
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %31, i32 0, i32 5
  %33 = load ptr, ptr %32, align 8, !tbaa !16
  %34 = load i32, ptr %5, align 4, !tbaa !13
  %35 = call ptr @liquid_malloc_copy(ptr noundef %33, i32 noundef %34, i32 noundef 8)
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %36, i32 0, i32 5
  store ptr %35, ptr %37, align 8, !tbaa !16
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %38, i32 0, i32 6
  %40 = load ptr, ptr %39, align 8, !tbaa !17
  %41 = load i32, ptr %5, align 4, !tbaa !13
  %42 = load i32, ptr %5, align 4, !tbaa !13
  %43 = mul i32 %41, %42
  %44 = call ptr @liquid_malloc_copy(ptr noundef %40, i32 noundef %43, i32 noundef 8)
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %45, i32 0, i32 6
  store ptr %44, ptr %46, align 8, !tbaa !17
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %47, i32 0, i32 7
  %49 = load ptr, ptr %48, align 8, !tbaa !18
  %50 = load i32, ptr %5, align 4, !tbaa !13
  %51 = load i32, ptr %5, align 4, !tbaa !13
  %52 = mul i32 %50, %51
  %53 = call ptr @liquid_malloc_copy(ptr noundef %49, i32 noundef %52, i32 noundef 8)
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %54, i32 0, i32 7
  store ptr %53, ptr %55, align 8, !tbaa !18
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %56, i32 0, i32 8
  %58 = load ptr, ptr %57, align 8, !tbaa !19
  %59 = load i32, ptr %5, align 4, !tbaa !13
  %60 = call ptr @liquid_malloc_copy(ptr noundef %58, i32 noundef %59, i32 noundef 8)
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %61, i32 0, i32 8
  store ptr %60, ptr %62, align 8, !tbaa !19
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %63, i32 0, i32 9
  %65 = load ptr, ptr %64, align 8, !tbaa !20
  %66 = load i32, ptr %5, align 4, !tbaa !13
  %67 = call ptr @liquid_malloc_copy(ptr noundef %65, i32 noundef %66, i32 noundef 8)
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %68, i32 0, i32 9
  store ptr %67, ptr %69, align 8, !tbaa !20
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %70, i32 0, i32 11
  %72 = load ptr, ptr %71, align 8, !tbaa !21
  %73 = load i32, ptr %5, align 4, !tbaa !13
  %74 = load i32, ptr %5, align 4, !tbaa !13
  %75 = mul i32 %73, %74
  %76 = call ptr @liquid_malloc_copy(ptr noundef %72, i32 noundef %75, i32 noundef 8)
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %77, i32 0, i32 11
  store ptr %76, ptr %78, align 8, !tbaa !21
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %79, i32 0, i32 12
  %81 = load ptr, ptr %80, align 8, !tbaa !22
  %82 = load i32, ptr %5, align 4, !tbaa !13
  %83 = load i32, ptr %5, align 4, !tbaa !13
  %84 = mul i32 %82, %83
  %85 = call ptr @liquid_malloc_copy(ptr noundef %81, i32 noundef %84, i32 noundef 8)
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %86, i32 0, i32 12
  store ptr %85, ptr %87, align 8, !tbaa !22
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %88, i32 0, i32 14
  %90 = load ptr, ptr %89, align 8, !tbaa !23
  %91 = call ptr @windowcf_copy(ptr noundef %90)
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.eqrls_cccf_s, ptr %92, i32 0, i32 14
  store ptr %91, ptr %93, align 8, !tbaa !23
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %94, ptr %2, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %95

95:                                               ; preds = %10, %8
  %96 = load ptr, ptr %2, align 8
  ret ptr %96
}

declare ptr @liquid_malloc_copy(ptr noundef, i32 noundef, i32 noundef) #2

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { 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 = !{!"eqrls_cccf_s", !11, i64 0, !12, i64 4, !12, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !7, i64 72, !6, i64 80, !6, i64 88, !11, i64 96, !6, i64 104}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!10, !6, i64 24}
!16 = !{!10, !6, i64 32}
!17 = !{!10, !6, i64 40}
!18 = !{!10, !6, i64 48}
!19 = !{!10, !6, i64 56}
!20 = !{!10, !6, i64 64}
!21 = !{!10, !6, i64 80}
!22 = !{!10, !6, i64 88}
!23 = !{!10, !6, i64 104}


; 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.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [89 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

declare ptr @windowcf_copy(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local ptr @eqrls_cccf_copy(ptr noundef readonly %0) local_unnamed_addr #2 {
  %2 = icmp eq ptr %0, null
  br i1 %2, label %3, label %5

3:                                                ; preds = %1
  %4 = tail call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef nonnull @.str.14, i32 noundef 132, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.2) #4
  br label %49

5:                                                ; preds = %1
  %6 = tail call noalias dereferenceable_or_null(112) ptr @malloc(i64 noundef 112) #5
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(112) %6, ptr noundef nonnull align 8 dereferenceable(112) %0, i64 112, i1 false)
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = load ptr, ptr %8, align 8, !tbaa !12
  %10 = tail call ptr @liquid_malloc_copy(ptr noundef %9, i32 noundef %7, i32 noundef 8) #4
  %11 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %10, ptr %11, align 8, !tbaa !12
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  %13 = load ptr, ptr %12, align 8, !tbaa !13
  %14 = tail call ptr @liquid_malloc_copy(ptr noundef %13, i32 noundef %7, i32 noundef 8) #4
  %15 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr %14, ptr %15, align 8, !tbaa !13
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  %17 = load ptr, ptr %16, align 8, !tbaa !14
  %18 = tail call ptr @liquid_malloc_copy(ptr noundef %17, i32 noundef %7, i32 noundef 8) #4
  %19 = getelementptr inbounds i8, ptr %6, i64 32
  store ptr %18, ptr %19, align 8, !tbaa !14
  %20 = getelementptr inbounds i8, ptr %0, i64 40
  %21 = load ptr, ptr %20, align 8, !tbaa !15
  %22 = mul i32 %7, %7
  %23 = tail call ptr @liquid_malloc_copy(ptr noundef %21, i32 noundef %22, i32 noundef 8) #4
  %24 = getelementptr inbounds i8, ptr %6, i64 40
  store ptr %23, ptr %24, align 8, !tbaa !15
  %25 = getelementptr inbounds i8, ptr %0, i64 48
  %26 = load ptr, ptr %25, align 8, !tbaa !16
  %27 = tail call ptr @liquid_malloc_copy(ptr noundef %26, i32 noundef %22, i32 noundef 8) #4
  %28 = getelementptr inbounds i8, ptr %6, i64 48
  store ptr %27, ptr %28, align 8, !tbaa !16
  %29 = getelementptr inbounds i8, ptr %0, i64 56
  %30 = load ptr, ptr %29, align 8, !tbaa !17
  %31 = tail call ptr @liquid_malloc_copy(ptr noundef %30, i32 noundef %7, i32 noundef 8) #4
  %32 = getelementptr inbounds i8, ptr %6, i64 56
  store ptr %31, ptr %32, align 8, !tbaa !17
  %33 = getelementptr inbounds i8, ptr %0, i64 64
  %34 = load ptr, ptr %33, align 8, !tbaa !18
  %35 = tail call ptr @liquid_malloc_copy(ptr noundef %34, i32 noundef %7, i32 noundef 8) #4
  %36 = getelementptr inbounds i8, ptr %6, i64 64
  store ptr %35, ptr %36, align 8, !tbaa !18
  %37 = getelementptr inbounds i8, ptr %0, i64 80
  %38 = load ptr, ptr %37, align 8, !tbaa !19
  %39 = tail call ptr @liquid_malloc_copy(ptr noundef %38, i32 noundef %22, i32 noundef 8) #4
  %40 = getelementptr inbounds i8, ptr %6, i64 80
  store ptr %39, ptr %40, align 8, !tbaa !19
  %41 = getelementptr inbounds i8, ptr %0, i64 88
  %42 = load ptr, ptr %41, align 8, !tbaa !20
  %43 = tail call ptr @liquid_malloc_copy(ptr noundef %42, i32 noundef %22, i32 noundef 8) #4
  %44 = getelementptr inbounds i8, ptr %6, i64 88
  store ptr %43, ptr %44, align 8, !tbaa !20
  %45 = getelementptr inbounds i8, ptr %0, i64 104
  %46 = load ptr, ptr %45, align 8, !tbaa !21
  %47 = tail call ptr @windowcf_copy(ptr noundef %46) #4
  %48 = getelementptr inbounds i8, ptr %6, i64 104
  store ptr %47, ptr %48, align 8, !tbaa !21
  br label %49

49:                                               ; preds = %5, %3
  %.0 = phi ptr [ %4, %3 ], [ %6, %5 ]
  ret ptr %.0
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !7, i64 0}
!6 = !{!"eqrls_cccf_s", !7, i64 0, !10, i64 4, !10, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !8, i64 72, !11, i64 80, !11, i64 88, !7, i64 96, !11, i64 104}
!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, !11, i64 16}
!13 = !{!6, !11, i64 24}
!14 = !{!6, !11, i64 32}
!15 = !{!6, !11, i64 40}
!16 = !{!6, !11, i64 48}
!17 = !{!6, !11, i64 56}
!18 = !{!6, !11, i64 64}
!19 = !{!6, !11, i64 80}
!20 = !{!6, !11, i64 88}
!21 = !{!6, !11, i64 104}


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