; LLVM IR from jgaeddert/liquid-dsp :: src/filter/tests (dds_cccf_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.4 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [3 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

declare ptr @dds_cccf_create(i32 noundef, float noundef, float noundef, float noundef) #1

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

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

declare i32 @dds_cccf_destroy(ptr noundef) #1

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

declare void @liquid_autotest_failed_expr(ptr noundef, i32 noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, double noundef) #1

declare void @liquid_autotest_passed(...) #1

; Function Attrs: nounwind uwtable
define dso_local void @autotest_dds_copy() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca { float, float }, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca { float, float }, align 4
  %9 = alloca { float, float }, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 3, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = shl i32 1, %12
  store i32 %13, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = call ptr @dds_cccf_create(i32 noundef %14, float noundef 0x3FBF972480000000, float noundef 0x3FDBA786C0000000, float noundef 6.000000e+01)
  store ptr %15, ptr %3, align 8, !tbaa !9
  %16 = load ptr, ptr %3, align 8, !tbaa !9
  %17 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %18 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 1
  store float 0x3FE7212D80000000, ptr %17, align 4
  store float 0.000000e+00, ptr %18, align 4
  %19 = load <2 x float>, ptr %4, align 4
  %20 = call i32 @dds_cccf_set_scale(ptr noundef %16, <2 x float> noundef %19)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %21 = call ptr @symstreamrcf_create()
  store ptr %21, ptr %5, align 8, !tbaa !9
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = zext i32 %22 to i64
  %24 = call ptr @llvm.stacksave.p0()
  store ptr %24, ptr %6, align 8
  %25 = alloca { float, float }, i64 %23, align 16
  store i64 %23, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %35, %0
  %27 = load i32, ptr %10, align 4, !tbaa !5
  %28 = icmp ult i32 %27, 10
  br i1 %28, label %29, label %38

29:                                               ; preds = %26
  %30 = load ptr, ptr %5, align 8, !tbaa !9
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = call i32 @symstreamrcf_write_samples(ptr noundef %30, ptr noundef %25, i32 noundef %31)
  %33 = load ptr, ptr %3, align 8, !tbaa !9
  %34 = call i32 @dds_cccf_decim_execute(ptr noundef %33, ptr noundef %25, ptr noundef %8)
  br label %35

35:                                               ; preds = %29
  %36 = load i32, ptr %10, align 4, !tbaa !5
  %37 = add i32 %36, 1
  store i32 %37, ptr %10, align 4, !tbaa !5
  br label %26, !llvm.loop !11

38:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %39 = load ptr, ptr %3, align 8, !tbaa !9
  %40 = call ptr @dds_cccf_copy(ptr noundef %39)
  store ptr %40, ptr %11, align 8, !tbaa !9
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %72, %38
  %42 = load i32, ptr %10, align 4, !tbaa !5
  %43 = icmp ult i32 %42, 60
  br i1 %43, label %44, label %75

44:                                               ; preds = %41
  %45 = load ptr, ptr %5, align 8, !tbaa !9
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = call i32 @symstreamrcf_write_samples(ptr noundef %45, ptr noundef %25, i32 noundef %46)
  %48 = load ptr, ptr %3, align 8, !tbaa !9
  %49 = call i32 @dds_cccf_decim_execute(ptr noundef %48, ptr noundef %25, ptr noundef %8)
  %50 = load ptr, ptr %11, align 8, !tbaa !9
  %51 = call i32 @dds_cccf_decim_execute(ptr noundef %50, ptr noundef %25, ptr noundef %9)
  %52 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %53 = load float, ptr %52, align 4
  %54 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  %55 = load float, ptr %54, align 4
  %56 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 0
  %57 = load float, ptr %56, align 4
  %58 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 1
  %59 = load float, ptr %58, align 4
  %60 = fcmp une float %53, %57
  %61 = fcmp une float %55, %59
  %62 = or i1 %60, %61
  br i1 %62, label %63, label %70

63:                                               ; preds = %44
  %64 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %65 = load float, ptr %64, align 4
  %66 = fpext float %65 to double
  %67 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 0
  %68 = load float, ptr %67, align 4
  %69 = fpext float %68 to double
  call void @liquid_autotest_failed_expr(ptr noundef @.str.4, i32 noundef 181, ptr noundef @.str.15, double noundef %66, ptr noundef @.str.6, ptr noundef @.str.16, double noundef %69)
  br label %71

70:                                               ; preds = %44
  call void (...) @liquid_autotest_passed()
  br label %71

71:                                               ; preds = %70, %63
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %10, align 4, !tbaa !5
  %74 = add i32 %73, 1
  store i32 %74, ptr %10, align 4, !tbaa !5
  br label %41, !llvm.loop !13

75:                                               ; preds = %41
  %76 = load ptr, ptr %3, align 8, !tbaa !9
  %77 = call i32 @dds_cccf_destroy(ptr noundef %76)
  %78 = load ptr, ptr %11, align 8, !tbaa !9
  %79 = call i32 @dds_cccf_destroy(ptr noundef %78)
  %80 = load ptr, ptr %5, align 8, !tbaa !9
  %81 = call i32 @symstreamrcf_destroy(ptr noundef %80)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %82 = load ptr, ptr %6, align 8
  call void @llvm.stackrestore.p0(ptr %82)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void
}

declare ptr @symstreamrcf_create() #1

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

declare ptr @dds_cccf_copy(ptr noundef) #1

declare i32 @symstreamrcf_destroy(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 = { nocallback nofree nosync nounwind willreturn }
attributes #3 = { 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 #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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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.4 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [3 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

declare ptr @dds_cccf_create(i32 noundef, float noundef, float noundef, float noundef) local_unnamed_addr #1

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

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

declare i32 @dds_cccf_destroy(ptr noundef) local_unnamed_addr #1

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

declare void @liquid_autotest_failed_expr(ptr noundef, i32 noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, double noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @autotest_dds_copy() local_unnamed_addr #2 {
  %1 = alloca { float, float }, align 4
  %2 = alloca { float, float }, align 4
  %3 = tail call ptr @dds_cccf_create(i32 noundef 3, float noundef 0x3FBF972480000000, float noundef 0x3FDBA786C0000000, float noundef 6.000000e+01) #3
  %4 = tail call i32 @dds_cccf_set_scale(ptr noundef %3, <2 x float> noundef <float 0x3FE7212D80000000, float 0.000000e+00>) #3
  %5 = tail call ptr @symstreamrcf_create() #3
  %6 = alloca [8 x { float, float }], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  %7 = call i32 @symstreamrcf_write_samples(ptr noundef %5, ptr noundef nonnull %6, i32 noundef 8) #3
  %8 = call i32 @dds_cccf_decim_execute(ptr noundef %3, ptr noundef nonnull %6, ptr noundef nonnull %1) #3
  %9 = call i32 @symstreamrcf_write_samples(ptr noundef %5, ptr noundef nonnull %6, i32 noundef 8) #3
  %10 = call i32 @dds_cccf_decim_execute(ptr noundef %3, ptr noundef nonnull %6, ptr noundef nonnull %1) #3
  %11 = call i32 @symstreamrcf_write_samples(ptr noundef %5, ptr noundef nonnull %6, i32 noundef 8) #3
  %12 = call i32 @dds_cccf_decim_execute(ptr noundef %3, ptr noundef nonnull %6, ptr noundef nonnull %1) #3
  %13 = call i32 @symstreamrcf_write_samples(ptr noundef %5, ptr noundef nonnull %6, i32 noundef 8) #3
  %14 = call i32 @dds_cccf_decim_execute(ptr noundef %3, ptr noundef nonnull %6, ptr noundef nonnull %1) #3
  %15 = call i32 @symstreamrcf_write_samples(ptr noundef %5, ptr noundef nonnull %6, i32 noundef 8) #3
  %16 = call i32 @dds_cccf_decim_execute(ptr noundef %3, ptr noundef nonnull %6, ptr noundef nonnull %1) #3
  %17 = call i32 @symstreamrcf_write_samples(ptr noundef %5, ptr noundef nonnull %6, i32 noundef 8) #3
  %18 = call i32 @dds_cccf_decim_execute(ptr noundef %3, ptr noundef nonnull %6, ptr noundef nonnull %1) #3
  %19 = call i32 @symstreamrcf_write_samples(ptr noundef %5, ptr noundef nonnull %6, i32 noundef 8) #3
  %20 = call i32 @dds_cccf_decim_execute(ptr noundef %3, ptr noundef nonnull %6, ptr noundef nonnull %1) #3
  %21 = call i32 @symstreamrcf_write_samples(ptr noundef %5, ptr noundef nonnull %6, i32 noundef 8) #3
  %22 = call i32 @dds_cccf_decim_execute(ptr noundef %3, ptr noundef nonnull %6, ptr noundef nonnull %1) #3
  %23 = call i32 @symstreamrcf_write_samples(ptr noundef %5, ptr noundef nonnull %6, i32 noundef 8) #3
  %24 = call i32 @dds_cccf_decim_execute(ptr noundef %3, ptr noundef nonnull %6, ptr noundef nonnull %1) #3
  %25 = call i32 @symstreamrcf_write_samples(ptr noundef %5, ptr noundef nonnull %6, i32 noundef 8) #3
  %26 = call i32 @dds_cccf_decim_execute(ptr noundef %3, ptr noundef nonnull %6, ptr noundef nonnull %1) #3
  %27 = call ptr @dds_cccf_copy(ptr noundef %3) #3
  %28 = getelementptr inbounds i8, ptr %1, i64 4
  %29 = getelementptr inbounds i8, ptr %2, i64 4
  br label %30

30:                                               ; preds = %0, %45
  %.121 = phi i32 [ 0, %0 ], [ %46, %45 ]
  %31 = call i32 @symstreamrcf_write_samples(ptr noundef %5, ptr noundef nonnull %6, i32 noundef 8) #3
  %32 = call i32 @dds_cccf_decim_execute(ptr noundef %3, ptr noundef nonnull %6, ptr noundef nonnull %1) #3
  %33 = call i32 @dds_cccf_decim_execute(ptr noundef %27, ptr noundef nonnull %6, ptr noundef nonnull %2) #3
  %34 = load float, ptr %1, align 4
  %35 = load float, ptr %28, align 4
  %36 = load float, ptr %2, align 4
  %37 = load float, ptr %29, align 4
  %38 = fcmp une float %34, %36
  %39 = fcmp une float %35, %37
  %40 = or i1 %38, %39
  br i1 %40, label %41, label %44

41:                                               ; preds = %30
  %42 = fpext float %34 to double
  %43 = fpext float %36 to double
  call void @liquid_autotest_failed_expr(ptr noundef nonnull @.str.4, i32 noundef 181, ptr noundef nonnull @.str.15, double noundef %42, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.16, double noundef %43) #3
  br label %45

44:                                               ; preds = %30
  call void (...) @liquid_autotest_passed() #3
  br label %45

45:                                               ; preds = %41, %44
  %46 = add nuw nsw i32 %.121, 1
  %exitcond.not = icmp eq i32 %46, 60
  br i1 %exitcond.not, label %47, label %30, !llvm.loop !5

47:                                               ; preds = %45
  %48 = call i32 @dds_cccf_destroy(ptr noundef %3) #3
  %49 = call i32 @dds_cccf_destroy(ptr noundef %27) #3
  %50 = call i32 @symstreamrcf_destroy(ptr noundef %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  ret void
}

declare ptr @symstreamrcf_create() local_unnamed_addr #1

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

declare ptr @dds_cccf_copy(ptr noundef) local_unnamed_addr #1

declare i32 @symstreamrcf_destroy(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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass