; LLVM IR from jgaeddert/liquid-dsp :: src/filter/tests (rresamp_crcf_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"

@liquid_autotest_verbose = external global i32, align 4
@.str.5 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [54 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 @rresamp_crcf_create_kaiser(i32 noundef, i32 noundef, i32 noundef, float noundef, float 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 ptr @llvm.stacksave.p0() #2

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

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

declare i32 @rresamp_crcf_destroy(ptr noundef) #1

declare i32 @symstreamrcf_destroy(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @autotest_rresamp_copy() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 17, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 23, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 12, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = load i32, ptr %4, align 4, !tbaa !5
  %15 = call ptr @rresamp_crcf_create_kaiser(i32 noundef %12, i32 noundef %13, i32 noundef %14, float noundef 0x3FD99999A0000000, float noundef 6.000000e+01)
  store ptr %15, ptr %5, align 8, !tbaa !9
  %16 = load ptr, ptr %5, align 8, !tbaa !9
  %17 = call i32 @rresamp_crcf_set_scale(ptr noundef %16, float noundef 0x3FBF9A6B60000000)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %18 = call ptr @symstreamrcf_create()
  store ptr %18, ptr %6, align 8, !tbaa !9
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = zext i32 %19 to i64
  %21 = call ptr @llvm.stacksave.p0()
  store ptr %21, ptr %7, align 8
  %22 = alloca { float, float }, i64 %20, align 16
  store i64 %20, ptr %8, align 8
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = zext i32 %23 to i64
  %25 = alloca { float, float }, i64 %24, align 16
  store i64 %24, ptr %9, align 8
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = zext i32 %26 to i64
  %28 = alloca { float, float }, i64 %27, align 16
  store i64 %27, ptr %10, align 8
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %38, %0
  %30 = load i32, ptr %1, align 4, !tbaa !5
  %31 = icmp ult i32 %30, 10
  br i1 %31, label %32, label %41

32:                                               ; preds = %29
  %33 = load ptr, ptr %6, align 8, !tbaa !9
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = call i32 @symstreamrcf_write_samples(ptr noundef %33, ptr noundef %22, i32 noundef %34)
  %36 = load ptr, ptr %5, align 8, !tbaa !9
  %37 = call i32 @rresamp_crcf_execute(ptr noundef %36, ptr noundef %22, ptr noundef %25)
  br label %38

38:                                               ; preds = %32
  %39 = load i32, ptr %1, align 4, !tbaa !5
  %40 = add i32 %39, 1
  store i32 %40, ptr %1, align 4, !tbaa !5
  br label %29, !llvm.loop !11

41:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %42 = load ptr, ptr %5, align 8, !tbaa !9
  %43 = call ptr @rresamp_crcf_copy(ptr noundef %42)
  store ptr %43, ptr %11, align 8, !tbaa !9
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %76, %41
  %45 = load i32, ptr %1, align 4, !tbaa !5
  %46 = icmp ult i32 %45, 60
  br i1 %46, label %47, label %79

47:                                               ; preds = %44
  %48 = load ptr, ptr %6, align 8, !tbaa !9
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = call i32 @symstreamrcf_write_samples(ptr noundef %48, ptr noundef %22, i32 noundef %49)
  %51 = load ptr, ptr %5, align 8, !tbaa !9
  %52 = call i32 @rresamp_crcf_execute(ptr noundef %51, ptr noundef %22, ptr noundef %25)
  %53 = load ptr, ptr %11, align 8, !tbaa !9
  %54 = call i32 @rresamp_crcf_execute(ptr noundef %53, ptr noundef %22, ptr noundef %28)
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = zext i32 %55 to i64
  %57 = mul i64 %56, 8
  %58 = trunc i64 %57 to i32
  %59 = call i32 @liquid_autotest_same_data(ptr noundef %25, ptr noundef %28, i32 noundef %58)
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %74, label %61

61:                                               ; preds = %47
  call void @liquid_autotest_failed_msg(ptr noundef @.str.5, i32 noundef 156, ptr noundef @.str.6)
  %62 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %73

64:                                               ; preds = %61
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = zext i32 %65 to i64
  %67 = mul i64 %66, 8
  %68 = trunc i64 %67 to i32
  call void @liquid_autotest_print_array(ptr noundef %25, i32 noundef %68)
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = zext i32 %69 to i64
  %71 = mul i64 %70, 8
  %72 = trunc i64 %71 to i32
  call void @liquid_autotest_print_array(ptr noundef %28, i32 noundef %72)
  br label %73

73:                                               ; preds = %64, %61
  br label %75

74:                                               ; preds = %47
  call void (...) @liquid_autotest_passed()
  br label %75

75:                                               ; preds = %74, %73
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %1, align 4, !tbaa !5
  %78 = add i32 %77, 1
  store i32 %78, ptr %1, align 4, !tbaa !5
  br label %44, !llvm.loop !13

79:                                               ; preds = %44
  %80 = load ptr, ptr %5, align 8, !tbaa !9
  %81 = call i32 @rresamp_crcf_destroy(ptr noundef %80)
  %82 = load ptr, ptr %11, align 8, !tbaa !9
  %83 = call i32 @rresamp_crcf_destroy(ptr noundef %82)
  %84 = load ptr, ptr %6, align 8, !tbaa !9
  %85 = call i32 @symstreamrcf_destroy(ptr noundef %84)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  %86 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %86)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, 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 i32 @rresamp_crcf_set_scale(ptr noundef, float noundef) #1

declare ptr @symstreamrcf_create() #1

declare ptr @rresamp_crcf_copy(ptr noundef) #1

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

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

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

declare void @liquid_autotest_passed(...) #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"="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"}
!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"

@liquid_autotest_verbose = external local_unnamed_addr global i32, align 4
@.str.5 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [54 x i8], align 1

declare ptr @rresamp_crcf_create_kaiser(i32 noundef, i32 noundef, i32 noundef, float noundef, float noundef) local_unnamed_addr #0

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

declare i32 @rresamp_crcf_execute(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @rresamp_crcf_destroy(ptr noundef) local_unnamed_addr #0

declare i32 @symstreamrcf_destroy(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @autotest_rresamp_copy() local_unnamed_addr #1 {
  %1 = tail call ptr @rresamp_crcf_create_kaiser(i32 noundef 17, i32 noundef 23, i32 noundef 12, float noundef 0x3FD99999A0000000, float noundef 6.000000e+01) #2
  %2 = tail call i32 @rresamp_crcf_set_scale(ptr noundef %1, float noundef 0x3FBF9A6B60000000) #2
  %3 = tail call ptr @symstreamrcf_create() #2
  %4 = alloca [23 x { float, float }], align 16
  %5 = alloca [17 x { float, float }], align 16
  %6 = alloca [17 x { float, float }], align 16
  %7 = call i32 @symstreamrcf_write_samples(ptr noundef %3, ptr noundef nonnull %4, i32 noundef 23) #2
  %8 = call i32 @rresamp_crcf_execute(ptr noundef %1, ptr noundef nonnull %4, ptr noundef nonnull %5) #2
  %9 = call i32 @symstreamrcf_write_samples(ptr noundef %3, ptr noundef nonnull %4, i32 noundef 23) #2
  %10 = call i32 @rresamp_crcf_execute(ptr noundef %1, ptr noundef nonnull %4, ptr noundef nonnull %5) #2
  %11 = call i32 @symstreamrcf_write_samples(ptr noundef %3, ptr noundef nonnull %4, i32 noundef 23) #2
  %12 = call i32 @rresamp_crcf_execute(ptr noundef %1, ptr noundef nonnull %4, ptr noundef nonnull %5) #2
  %13 = call i32 @symstreamrcf_write_samples(ptr noundef %3, ptr noundef nonnull %4, i32 noundef 23) #2
  %14 = call i32 @rresamp_crcf_execute(ptr noundef %1, ptr noundef nonnull %4, ptr noundef nonnull %5) #2
  %15 = call i32 @symstreamrcf_write_samples(ptr noundef %3, ptr noundef nonnull %4, i32 noundef 23) #2
  %16 = call i32 @rresamp_crcf_execute(ptr noundef %1, ptr noundef nonnull %4, ptr noundef nonnull %5) #2
  %17 = call i32 @symstreamrcf_write_samples(ptr noundef %3, ptr noundef nonnull %4, i32 noundef 23) #2
  %18 = call i32 @rresamp_crcf_execute(ptr noundef %1, ptr noundef nonnull %4, ptr noundef nonnull %5) #2
  %19 = call i32 @symstreamrcf_write_samples(ptr noundef %3, ptr noundef nonnull %4, i32 noundef 23) #2
  %20 = call i32 @rresamp_crcf_execute(ptr noundef %1, ptr noundef nonnull %4, ptr noundef nonnull %5) #2
  %21 = call i32 @symstreamrcf_write_samples(ptr noundef %3, ptr noundef nonnull %4, i32 noundef 23) #2
  %22 = call i32 @rresamp_crcf_execute(ptr noundef %1, ptr noundef nonnull %4, ptr noundef nonnull %5) #2
  %23 = call i32 @symstreamrcf_write_samples(ptr noundef %3, ptr noundef nonnull %4, i32 noundef 23) #2
  %24 = call i32 @rresamp_crcf_execute(ptr noundef %1, ptr noundef nonnull %4, ptr noundef nonnull %5) #2
  %25 = call i32 @symstreamrcf_write_samples(ptr noundef %3, ptr noundef nonnull %4, i32 noundef 23) #2
  %26 = call i32 @rresamp_crcf_execute(ptr noundef %1, ptr noundef nonnull %4, ptr noundef nonnull %5) #2
  %27 = call ptr @rresamp_crcf_copy(ptr noundef %1) #2
  br label %28

28:                                               ; preds = %0, %37
  %.127 = phi i32 [ 0, %0 ], [ %38, %37 ]
  %29 = call i32 @symstreamrcf_write_samples(ptr noundef %3, ptr noundef nonnull %4, i32 noundef 23) #2
  %30 = call i32 @rresamp_crcf_execute(ptr noundef %1, ptr noundef nonnull %4, ptr noundef nonnull %5) #2
  %31 = call i32 @rresamp_crcf_execute(ptr noundef %27, ptr noundef nonnull %4, ptr noundef nonnull %6) #2
  %32 = call i32 @liquid_autotest_same_data(ptr noundef nonnull %5, ptr noundef nonnull %6, i32 noundef 136) #2
  %.not = icmp eq i32 %32, 0
  br i1 %.not, label %33, label %36

33:                                               ; preds = %28
  call void @liquid_autotest_failed_msg(ptr noundef nonnull @.str.5, i32 noundef 156, ptr noundef nonnull @.str.6) #2
  %34 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %.not25 = icmp eq i32 %34, 0
  br i1 %.not25, label %37, label %35

35:                                               ; preds = %33
  call void @liquid_autotest_print_array(ptr noundef nonnull %5, i32 noundef 136) #2
  call void @liquid_autotest_print_array(ptr noundef nonnull %6, i32 noundef 136) #2
  br label %37

36:                                               ; preds = %28
  call void (...) @liquid_autotest_passed() #2
  br label %37

37:                                               ; preds = %36, %35, %33
  %38 = add nuw nsw i32 %.127, 1
  %exitcond.not = icmp eq i32 %38, 60
  br i1 %exitcond.not, label %39, label %28, !llvm.loop !9

39:                                               ; preds = %37
  %40 = call i32 @rresamp_crcf_destroy(ptr noundef %1) #2
  %41 = call i32 @rresamp_crcf_destroy(ptr noundef %27) #2
  %42 = call i32 @symstreamrcf_destroy(ptr noundef %3) #2
  ret void
}

declare i32 @rresamp_crcf_set_scale(ptr noundef, float noundef) local_unnamed_addr #0

declare ptr @symstreamrcf_create() local_unnamed_addr #0

declare ptr @rresamp_crcf_copy(ptr noundef) local_unnamed_addr #0

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

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

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

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

attributes #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 = { 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 #2 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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