; LLVM IR from jgaeddert/liquid-dsp :: src/filter/tests (firdespm_autotest)

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

@.str = external hidden unnamed_addr constant [91 x i8], align 1
@liquid_autotest_verbose = external global i32, align 4
@__const.autotest_firdespm_copy.bands = external hidden unnamed_addr constant [4 x float], align 16
@__const.autotest_firdespm_copy.des = external hidden unnamed_addr constant [2 x float], align 4
@__const.autotest_firdespm_copy.w = external hidden unnamed_addr constant [2 x float], align 4
@.str.7 = external hidden unnamed_addr constant [40 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: 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) #1

declare void @liquid_autotest_passed(...) #2

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

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

declare i32 @firdespm_destroy(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @autotest_firdespm_copy() #3 {
  %1 = alloca [4 x float], align 16
  %2 = alloca [2 x float], align 4
  %3 = alloca [2 x float], align 4
  %4 = alloca [2 x i32], align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [51 x float], align 16
  %8 = alloca [51 x float], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr %1) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %1, ptr align 16 @__const.autotest_firdespm_copy.bands, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %2, ptr align 4 @__const.autotest_firdespm_copy.des, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 4 @__const.autotest_firdespm_copy.w, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.memset.p0.i64(ptr align 4 %4, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %9 = getelementptr inbounds [4 x float], ptr %1, i64 0, i64 0
  %10 = getelementptr inbounds [2 x float], ptr %2, i64 0, i64 0
  %11 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 0
  %12 = getelementptr inbounds [2 x i32], ptr %4, i64 0, i64 0
  %13 = call ptr @firdespm_create(i32 noundef 51, i32 noundef 2, ptr noundef %9, ptr noundef %10, ptr noundef %11, ptr noundef %12, i32 noundef 0)
  store ptr %13, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = call ptr @firdespm_copy(ptr noundef %14)
  store ptr %15, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 204, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 204, ptr %8) #5
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds [51 x float], ptr %7, i64 0, i64 0
  %18 = call i32 @firdespm_execute(ptr noundef %16, ptr noundef %17)
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds [51 x float], ptr %8, i64 0, i64 0
  %21 = call i32 @firdespm_execute(ptr noundef %19, ptr noundef %20)
  %22 = getelementptr inbounds [51 x float], ptr %7, i64 0, i64 0
  %23 = getelementptr inbounds [51 x float], ptr %8, i64 0, i64 0
  %24 = call i32 @liquid_autotest_same_data(ptr noundef %22, ptr noundef %23, i32 noundef 204)
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %33, label %26

26:                                               ; preds = %0
  call void @liquid_autotest_failed_msg(ptr noundef @.str, i32 noundef 260, ptr noundef @.str.7)
  %27 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !9
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %32

29:                                               ; preds = %26
  %30 = getelementptr inbounds [51 x float], ptr %7, i64 0, i64 0
  call void @liquid_autotest_print_array(ptr noundef %30, i32 noundef 204)
  %31 = getelementptr inbounds [51 x float], ptr %8, i64 0, i64 0
  call void @liquid_autotest_print_array(ptr noundef %31, i32 noundef 204)
  br label %32

32:                                               ; preds = %29, %26
  br label %34

33:                                               ; preds = %0
  call void (...) @liquid_autotest_passed()
  br label %34

34:                                               ; preds = %33, %32
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = call i32 @firdespm_destroy(ptr noundef %35)
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = call i32 @firdespm_destroy(ptr noundef %37)
  call void @llvm.lifetime.end.p0(i64 204, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 204, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %1) #5
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

declare ptr @firdespm_copy(ptr noundef) #2

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

declare void @liquid_autotest_failed_msg(ptr noundef, i32 noundef, ptr noundef) #2

declare void @liquid_autotest_print_array(ptr noundef, i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}


; 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 = external hidden unnamed_addr constant [91 x i8], align 1
@liquid_autotest_verbose = external local_unnamed_addr global i32, align 4
@__const.autotest_firdespm_copy.bands = external hidden unnamed_addr constant [4 x float], align 16
@__const.autotest_firdespm_copy.des = external hidden unnamed_addr constant [2 x float], align 4
@__const.autotest_firdespm_copy.w = external hidden unnamed_addr constant [2 x float], align 4
@.str.7 = external hidden unnamed_addr constant [40 x i8], align 1

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

declare void @liquid_autotest_passed(...) local_unnamed_addr #2

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

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

declare i32 @firdespm_destroy(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @autotest_firdespm_copy() local_unnamed_addr #3 {
  %1 = alloca [4 x float], align 16
  %2 = alloca [2 x float], align 8
  %3 = alloca [2 x float], align 8
  %4 = alloca [2 x i32], align 8
  %5 = alloca [51 x float], align 16
  %6 = alloca [51 x float], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %1, ptr noundef nonnull align 16 dereferenceable(16) @__const.autotest_firdespm_copy.bands, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %7 = load i64, ptr @__const.autotest_firdespm_copy.des, align 4
  store i64 %7, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %8 = load i64, ptr @__const.autotest_firdespm_copy.w, align 4
  store i64 %8, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  store i64 0, ptr %4, align 8
  %9 = call ptr @firdespm_create(i32 noundef 51, i32 noundef 2, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4, i32 noundef 0) #4
  %10 = call ptr @firdespm_copy(ptr noundef %9) #4
  call void @llvm.lifetime.start.p0(i64 204, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 204, ptr nonnull %6) #4
  %11 = call i32 @firdespm_execute(ptr noundef %9, ptr noundef nonnull %5) #4
  %12 = call i32 @firdespm_execute(ptr noundef %10, ptr noundef nonnull %6) #4
  %13 = call i32 @liquid_autotest_same_data(ptr noundef nonnull %5, ptr noundef nonnull %6, i32 noundef 204) #4
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %17

14:                                               ; preds = %0
  call void @liquid_autotest_failed_msg(ptr noundef nonnull @.str, i32 noundef 260, ptr noundef nonnull @.str.7) #4
  %15 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %.not5 = icmp eq i32 %15, 0
  br i1 %.not5, label %18, label %16

16:                                               ; preds = %14
  call void @liquid_autotest_print_array(ptr noundef nonnull %5, i32 noundef 204) #4
  call void @liquid_autotest_print_array(ptr noundef nonnull %6, i32 noundef 204) #4
  br label %18

17:                                               ; preds = %0
  call void (...) @liquid_autotest_passed() #4
  br label %18

18:                                               ; preds = %14, %16, %17
  %19 = call i32 @firdespm_destroy(ptr noundef %9) #4
  %20 = call i32 @firdespm_destroy(ptr noundef %10) #4
  call void @llvm.lifetime.end.p0(i64 204, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 204, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #4
  ret void
}

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

declare ptr @firdespm_copy(ptr noundef) local_unnamed_addr #2

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

declare void @liquid_autotest_failed_msg(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @liquid_autotest_print_array(ptr noundef, i32 noundef) local_unnamed_addr #2

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass