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

@.str = external hidden unnamed_addr constant [95 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [4 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 @resamp2_crcf_create(i32 noundef, float noundef, float noundef) #1

declare i32 @resamp2_crcf_destroy(ptr noundef) #1

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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: nounwind uwtable
define dso_local void @autotest_resamp2_copy() #2 {
  %1 = alloca ptr, align 8
  %2 = alloca { float, float }, align 4
  %3 = alloca { float, float }, align 4
  %4 = alloca { float, float }, align 4
  %5 = alloca { float, float }, align 4
  %6 = alloca { float, float }, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca { float, float }, align 4
  %10 = alloca ptr, align 8
  %11 = alloca { float, float }, align 4
  %12 = alloca { float, float }, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #3
  %13 = call ptr @resamp2_crcf_create(i32 noundef 12, float noundef 0.000000e+00, float noundef 6.000000e+01)
  store ptr %13, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 80, ptr %8, align 4, !tbaa !9
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %14

14:                                               ; preds = %35, %0
  %15 = load i32, ptr %7, align 4, !tbaa !9
  %16 = load i32, ptr %8, align 4, !tbaa !9
  %17 = icmp ult i32 %15, %16
  br i1 %17, label %18, label %38

18:                                               ; preds = %14
  %19 = call float (...) @randnf()
  %20 = call float (...) @randnf()
  %21 = fmul float 0.000000e+00, %20
  %22 = fmul float 1.000000e+00, %20
  %23 = fadd float %19, %21
  %24 = getelementptr inbounds { float, float }, ptr %2, i32 0, i32 0
  %25 = getelementptr inbounds { float, float }, ptr %2, i32 0, i32 1
  store float %23, ptr %24, align 4
  store float %22, ptr %25, align 4
  %26 = load ptr, ptr %1, align 8, !tbaa !5
  %27 = getelementptr inbounds { float, float }, ptr %2, i32 0, i32 0
  %28 = load float, ptr %27, align 4
  %29 = getelementptr inbounds { float, float }, ptr %2, i32 0, i32 1
  %30 = load float, ptr %29, align 4
  %31 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 0
  %32 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 1
  store float %28, ptr %31, align 4
  store float %30, ptr %32, align 4
  %33 = load <2 x float>, ptr %9, align 4
  %34 = call i32 @resamp2_crcf_filter_execute(ptr noundef %26, <2 x float> noundef %33, ptr noundef %3, ptr noundef %4)
  br label %35

35:                                               ; preds = %18
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = add i32 %36, 1
  store i32 %37, ptr %7, align 4, !tbaa !9
  br label %14, !llvm.loop !11

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

41:                                               ; preds = %111, %38
  %42 = load i32, ptr %7, align 4, !tbaa !9
  %43 = load i32, ptr %8, align 4, !tbaa !9
  %44 = icmp ult i32 %42, %43
  br i1 %44, label %45, label %114

45:                                               ; preds = %41
  %46 = call float (...) @randnf()
  %47 = call float (...) @randnf()
  %48 = fmul float 0.000000e+00, %47
  %49 = fmul float 1.000000e+00, %47
  %50 = fadd float %46, %48
  %51 = getelementptr inbounds { float, float }, ptr %2, i32 0, i32 0
  %52 = getelementptr inbounds { float, float }, ptr %2, i32 0, i32 1
  store float %50, ptr %51, align 4
  store float %49, ptr %52, align 4
  %53 = load ptr, ptr %1, align 8, !tbaa !5
  %54 = getelementptr inbounds { float, float }, ptr %2, i32 0, i32 0
  %55 = load float, ptr %54, align 4
  %56 = getelementptr inbounds { float, float }, ptr %2, i32 0, i32 1
  %57 = load float, ptr %56, align 4
  %58 = getelementptr inbounds { float, float }, ptr %11, i32 0, i32 0
  %59 = getelementptr inbounds { float, float }, ptr %11, i32 0, i32 1
  store float %55, ptr %58, align 4
  store float %57, ptr %59, align 4
  %60 = load <2 x float>, ptr %11, align 4
  %61 = call i32 @resamp2_crcf_filter_execute(ptr noundef %53, <2 x float> noundef %60, ptr noundef %3, ptr noundef %4)
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  %63 = getelementptr inbounds { float, float }, ptr %2, i32 0, i32 0
  %64 = load float, ptr %63, align 4
  %65 = getelementptr inbounds { float, float }, ptr %2, i32 0, i32 1
  %66 = load float, ptr %65, align 4
  %67 = getelementptr inbounds { float, float }, ptr %12, i32 0, i32 0
  %68 = getelementptr inbounds { float, float }, ptr %12, i32 0, i32 1
  store float %64, ptr %67, align 4
  store float %66, ptr %68, align 4
  %69 = load <2 x float>, ptr %12, align 4
  %70 = call i32 @resamp2_crcf_filter_execute(ptr noundef %62, <2 x float> noundef %69, ptr noundef %5, ptr noundef %6)
  %71 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %72 = load float, ptr %71, align 4
  %73 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 1
  %74 = load float, ptr %73, align 4
  %75 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %76 = load float, ptr %75, align 4
  %77 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 1
  %78 = load float, ptr %77, align 4
  %79 = fcmp une float %72, %76
  %80 = fcmp une float %74, %78
  %81 = or i1 %79, %80
  br i1 %81, label %82, label %89

82:                                               ; preds = %45
  %83 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %84 = load float, ptr %83, align 4
  %85 = fpext float %84 to double
  %86 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %87 = load float, ptr %86, align 4
  %88 = fpext float %87 to double
  call void @liquid_autotest_failed_expr(ptr noundef @.str, i32 noundef 284, ptr noundef @.str.24, double noundef %85, ptr noundef @.str.13, ptr noundef @.str.25, double noundef %88)
  br label %90

89:                                               ; preds = %45
  call void (...) @liquid_autotest_passed()
  br label %90

90:                                               ; preds = %89, %82
  %91 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %92 = load float, ptr %91, align 4
  %93 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 1
  %94 = load float, ptr %93, align 4
  %95 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 0
  %96 = load float, ptr %95, align 4
  %97 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 1
  %98 = load float, ptr %97, align 4
  %99 = fcmp une float %92, %96
  %100 = fcmp une float %94, %98
  %101 = or i1 %99, %100
  br i1 %101, label %102, label %109

102:                                              ; preds = %90
  %103 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %104 = load float, ptr %103, align 4
  %105 = fpext float %104 to double
  %106 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 0
  %107 = load float, ptr %106, align 4
  %108 = fpext float %107 to double
  call void @liquid_autotest_failed_expr(ptr noundef @.str, i32 noundef 285, ptr noundef @.str.26, double noundef %105, ptr noundef @.str.13, ptr noundef @.str.27, double noundef %108)
  br label %110

109:                                              ; preds = %90
  call void (...) @liquid_autotest_passed()
  br label %110

110:                                              ; preds = %109, %102
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %7, align 4, !tbaa !9
  %113 = add i32 %112, 1
  store i32 %113, ptr %7, align 4, !tbaa !9
  br label %41, !llvm.loop !13

114:                                              ; preds = %41
  %115 = load ptr, ptr %1, align 8, !tbaa !5
  %116 = call i32 @resamp2_crcf_destroy(ptr noundef %115)
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = call i32 @resamp2_crcf_destroy(ptr noundef %117)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  ret void
}

declare float @randnf(...) #1

declare ptr @resamp2_crcf_copy(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 = { 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 = !{!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}
!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 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [4 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 @resamp2_crcf_create(i32 noundef, float noundef, float noundef) local_unnamed_addr #1

declare i32 @resamp2_crcf_destroy(ptr noundef) local_unnamed_addr #1

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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: nounwind uwtable
define dso_local void @autotest_resamp2_copy() local_unnamed_addr #2 {
  %1 = alloca { float, float }, align 4
  %2 = alloca { float, float }, align 4
  %3 = alloca { float, float }, align 4
  %4 = alloca { float, float }, align 4
  %5 = tail call ptr @resamp2_crcf_create(i32 noundef 12, float noundef 0.000000e+00, float noundef 6.000000e+01) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  br label %6

6:                                                ; preds = %0, %6
  %.021 = phi i32 [ 0, %0 ], [ %12, %6 ]
  %7 = call float (...) @randnf() #3
  %8 = call float (...) @randnf() #3
  %9 = fmul float %8, 0.000000e+00
  %10 = fadd float %7, %9
  %.sroa.05.0.vec.insert = insertelement <2 x float> poison, float %10, i64 0
  %.sroa.05.4.vec.insert = insertelement <2 x float> %.sroa.05.0.vec.insert, float %8, i64 1
  %11 = call i32 @resamp2_crcf_filter_execute(ptr noundef %5, <2 x float> noundef %.sroa.05.4.vec.insert, ptr noundef nonnull %1, ptr noundef nonnull %2) #3
  %12 = add nuw nsw i32 %.021, 1
  %exitcond.not = icmp eq i32 %12, 80
  br i1 %exitcond.not, label %13, label %6, !llvm.loop !5

13:                                               ; preds = %6
  %14 = call ptr @resamp2_crcf_copy(ptr noundef %5) #3
  %15 = getelementptr inbounds i8, ptr %1, i64 4
  %16 = getelementptr inbounds i8, ptr %3, i64 4
  %17 = getelementptr inbounds i8, ptr %2, i64 4
  %18 = getelementptr inbounds i8, ptr %4, i64 4
  br label %19

19:                                               ; preds = %13, %49
  %.122 = phi i32 [ 0, %13 ], [ %50, %49 ]
  %20 = call float (...) @randnf() #3
  %21 = call float (...) @randnf() #3
  %22 = fmul float %21, 0.000000e+00
  %23 = fadd float %20, %22
  %.sroa.02.0.vec.insert = insertelement <2 x float> poison, float %23, i64 0
  %.sroa.02.4.vec.insert = insertelement <2 x float> %.sroa.02.0.vec.insert, float %21, i64 1
  %24 = call i32 @resamp2_crcf_filter_execute(ptr noundef %5, <2 x float> noundef %.sroa.02.4.vec.insert, ptr noundef nonnull %1, ptr noundef nonnull %2) #3
  %25 = call i32 @resamp2_crcf_filter_execute(ptr noundef %14, <2 x float> noundef %.sroa.02.4.vec.insert, ptr noundef nonnull %3, ptr noundef nonnull %4) #3
  %26 = load float, ptr %1, align 4
  %27 = load float, ptr %15, align 4
  %28 = load float, ptr %3, align 4
  %29 = load float, ptr %16, align 4
  %30 = fcmp une float %26, %28
  %31 = fcmp une float %27, %29
  %32 = or i1 %30, %31
  br i1 %32, label %33, label %36

33:                                               ; preds = %19
  %34 = fpext float %26 to double
  %35 = fpext float %28 to double
  call void @liquid_autotest_failed_expr(ptr noundef nonnull @.str, i32 noundef 284, ptr noundef nonnull @.str.24, double noundef %34, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.25, double noundef %35) #3
  br label %37

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

37:                                               ; preds = %36, %33
  %38 = load float, ptr %2, align 4
  %39 = load float, ptr %17, align 4
  %40 = load float, ptr %4, align 4
  %41 = load float, ptr %18, align 4
  %42 = fcmp une float %38, %40
  %43 = fcmp une float %39, %41
  %44 = or i1 %42, %43
  br i1 %44, label %45, label %48

45:                                               ; preds = %37
  %46 = fpext float %38 to double
  %47 = fpext float %40 to double
  call void @liquid_autotest_failed_expr(ptr noundef nonnull @.str, i32 noundef 285, ptr noundef nonnull @.str.26, double noundef %46, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.27, double noundef %47) #3
  br label %49

48:                                               ; preds = %37
  call void (...) @liquid_autotest_passed() #3
  br label %49

49:                                               ; preds = %45, %48
  %50 = add nuw nsw i32 %.122, 1
  %exitcond23.not = icmp eq i32 %50, 80
  br i1 %exitcond23.not, label %51, label %19, !llvm.loop !7

51:                                               ; preds = %49
  %52 = call i32 @resamp2_crcf_destroy(ptr noundef %5) #3
  %53 = call i32 @resamp2_crcf_destroy(ptr noundef %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #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 float @randnf(...) local_unnamed_addr #1

declare ptr @resamp2_crcf_copy(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"}
!7 = distinct !{!7, !6}


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