; LLVM IR from jgaeddert/liquid-dsp :: src/filter/tests (firhilb_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.2 = external hidden unnamed_addr constant [90 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [6 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 @firhilbf_create(i32 noundef, float noundef) #1

declare i32 @printf(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

declare i32 @firhilbf_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

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

; Function Attrs: nounwind uwtable
define dso_local void @autotest_firhilbf_copy_interp() #2 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %3 = alloca [2 x float], align 4
  %4 = alloca [2 x float], align 4
  %5 = alloca { float, float }, align 4
  %6 = alloca { float, float }, align 4
  %7 = alloca ptr, align 8
  %8 = alloca { float, float }, align 4
  %9 = alloca { float, float }, align 4
  %10 = alloca { float, float }, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #3
  %11 = call ptr @firhilbf_create(i32 noundef 12, float noundef 1.200000e+02)
  store ptr %11, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, 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
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %12

12:                                               ; preds = %33, %0
  %13 = load i32, ptr %2, align 4, !tbaa !9
  %14 = icmp ult i32 %13, 80
  br i1 %14, label %15, label %36

15:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %16 = call float (...) @randnf()
  %17 = call float (...) @randnf()
  %18 = fmul float 0.000000e+00, %17
  %19 = fmul float 1.000000e+00, %17
  %20 = fadd float %16, %18
  %21 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %22 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 1
  store float %20, ptr %21, align 4
  store float %19, ptr %22, align 4
  %23 = load ptr, ptr %1, align 8, !tbaa !5
  %24 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %25 = load float, ptr %24, align 4
  %26 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 1
  %27 = load float, ptr %26, align 4
  %28 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 0
  %29 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 0
  %30 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 1
  store float %25, ptr %29, align 4
  store float %27, ptr %30, align 4
  %31 = load <2 x float>, ptr %6, align 4
  %32 = call i32 @firhilbf_interp_execute(ptr noundef %23, <2 x float> noundef %31, ptr noundef %28)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  br label %33

33:                                               ; preds = %15
  %34 = load i32, ptr %2, align 4, !tbaa !9
  %35 = add i32 %34, 1
  store i32 %35, ptr %2, align 4, !tbaa !9
  br label %12, !llvm.loop !11

36:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %37 = load ptr, ptr %1, align 8, !tbaa !5
  %38 = call ptr @firhilbf_copy(ptr noundef %37)
  store ptr %38, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %126, %36
  %40 = load i32, ptr %2, align 4, !tbaa !9
  %41 = icmp ult i32 %40, 80
  br i1 %41, label %42, label %129

42:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %43 = call float (...) @randnf()
  %44 = call float (...) @randnf()
  %45 = fmul float 0.000000e+00, %44
  %46 = fmul float 1.000000e+00, %44
  %47 = fadd float %43, %45
  %48 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %49 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  store float %47, ptr %48, align 4
  store float %46, ptr %49, align 4
  %50 = load ptr, ptr %1, align 8, !tbaa !5
  %51 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %52 = load float, ptr %51, align 4
  %53 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  %54 = load float, ptr %53, align 4
  %55 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 0
  %56 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 0
  %57 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 1
  store float %52, ptr %56, align 4
  store float %54, ptr %57, align 4
  %58 = load <2 x float>, ptr %9, align 4
  %59 = call i32 @firhilbf_interp_execute(ptr noundef %50, <2 x float> noundef %58, ptr noundef %55)
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %62 = load float, ptr %61, align 4
  %63 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  %64 = load float, ptr %63, align 4
  %65 = getelementptr inbounds [2 x float], ptr %4, i64 0, i64 0
  %66 = getelementptr inbounds { float, float }, ptr %10, i32 0, i32 0
  %67 = getelementptr inbounds { float, float }, ptr %10, i32 0, i32 1
  store float %62, ptr %66, align 4
  store float %64, ptr %67, align 4
  %68 = load <2 x float>, ptr %10, align 4
  %69 = call i32 @firhilbf_interp_execute(ptr noundef %60, <2 x float> noundef %68, ptr noundef %65)
  %70 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !9
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %97

72:                                               ; preds = %42
  %73 = load i32, ptr %2, align 4, !tbaa !9
  %74 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %75 = load float, ptr %74, align 4
  %76 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  %77 = load float, ptr %76, align 4
  %78 = fpext float %75 to double
  %79 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %80 = load float, ptr %79, align 4
  %81 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  %82 = load float, ptr %81, align 4
  %83 = fpext float %82 to double
  %84 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 0
  %85 = load float, ptr %84, align 4, !tbaa !13
  %86 = fpext float %85 to double
  %87 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 1
  %88 = load float, ptr %87, align 4, !tbaa !13
  %89 = fpext float %88 to double
  %90 = getelementptr inbounds [2 x float], ptr %4, i64 0, i64 0
  %91 = load float, ptr %90, align 4, !tbaa !13
  %92 = fpext float %91 to double
  %93 = getelementptr inbounds [2 x float], ptr %4, i64 0, i64 1
  %94 = load float, ptr %93, align 4, !tbaa !13
  %95 = fpext float %94 to double
  %96 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, i32 noundef %73, double noundef %78, double noundef %83, double noundef %86, double noundef %89, double noundef %92, double noundef %95)
  br label %97

97:                                               ; preds = %72, %42
  %98 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 0
  %99 = load float, ptr %98, align 4, !tbaa !13
  %100 = getelementptr inbounds [2 x float], ptr %4, i64 0, i64 0
  %101 = load float, ptr %100, align 4, !tbaa !13
  %102 = fcmp une float %99, %101
  br i1 %102, label %103, label %110

103:                                              ; preds = %97
  %104 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 0
  %105 = load float, ptr %104, align 4, !tbaa !13
  %106 = fpext float %105 to double
  %107 = getelementptr inbounds [2 x float], ptr %4, i64 0, i64 0
  %108 = load float, ptr %107, align 4, !tbaa !13
  %109 = fpext float %108 to double
  call void @liquid_autotest_failed_expr(ptr noundef @.str.2, i32 noundef 224, ptr noundef @.str.19, double noundef %106, ptr noundef @.str.15, ptr noundef @.str.20, double noundef %109)
  br label %111

110:                                              ; preds = %97
  call void (...) @liquid_autotest_passed()
  br label %111

111:                                              ; preds = %110, %103
  %112 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 1
  %113 = load float, ptr %112, align 4, !tbaa !13
  %114 = getelementptr inbounds [2 x float], ptr %4, i64 0, i64 1
  %115 = load float, ptr %114, align 4, !tbaa !13
  %116 = fcmp une float %113, %115
  br i1 %116, label %117, label %124

117:                                              ; preds = %111
  %118 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 1
  %119 = load float, ptr %118, align 4, !tbaa !13
  %120 = fpext float %119 to double
  %121 = getelementptr inbounds [2 x float], ptr %4, i64 0, i64 1
  %122 = load float, ptr %121, align 4, !tbaa !13
  %123 = fpext float %122 to double
  call void @liquid_autotest_failed_expr(ptr noundef @.str.2, i32 noundef 225, ptr noundef @.str.21, double noundef %120, ptr noundef @.str.15, ptr noundef @.str.22, double noundef %123)
  br label %125

124:                                              ; preds = %111
  call void (...) @liquid_autotest_passed()
  br label %125

125:                                              ; preds = %124, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %2, align 4, !tbaa !9
  %128 = add i32 %127, 1
  store i32 %128, ptr %2, align 4, !tbaa !9
  br label %39, !llvm.loop !15

129:                                              ; preds = %39
  %130 = load ptr, ptr %1, align 8, !tbaa !5
  %131 = call i32 @firhilbf_destroy(ptr noundef %130)
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = call i32 @firhilbf_destroy(ptr noundef %132)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #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 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  ret void
}

declare float @randnf(...) #1

declare ptr @firhilbf_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 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = distinct !{!15, !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.2 = external hidden unnamed_addr constant [90 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [6 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 @firhilbf_create(i32 noundef, float noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

declare i32 @firhilbf_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 i32 @firhilbf_interp_execute(ptr noundef, <2 x float> noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @autotest_firhilbf_copy_interp() local_unnamed_addr #3 {
  %1 = alloca [2 x float], align 4
  %2 = alloca [2 x float], align 4
  %3 = tail call ptr @firhilbf_create(i32 noundef 12, float noundef 1.200000e+02) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  br label %4

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

11:                                               ; preds = %4
  %12 = call ptr @firhilbf_copy(ptr noundef %3) #4
  %13 = getelementptr inbounds i8, ptr %1, i64 4
  %14 = getelementptr inbounds i8, ptr %2, i64 4
  br label %15

15:                                               ; preds = %11, %51
  %.128 = phi i32 [ 0, %11 ], [ %52, %51 ]
  %16 = call float (...) @randnf() #4
  %17 = call float (...) @randnf() #4
  %18 = fmul float %17, 0.000000e+00
  %19 = fadd float %16, %18
  %.sroa.02.0.vec.insert = insertelement <2 x float> poison, float %19, i64 0
  %.sroa.02.4.vec.insert = insertelement <2 x float> %.sroa.02.0.vec.insert, float %17, i64 1
  %20 = call i32 @firhilbf_interp_execute(ptr noundef %3, <2 x float> noundef %.sroa.02.4.vec.insert, ptr noundef nonnull %1) #4
  %21 = call i32 @firhilbf_interp_execute(ptr noundef %12, <2 x float> noundef %.sroa.02.4.vec.insert, ptr noundef nonnull %2) #4
  %22 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !7
  %.not = icmp eq i32 %22, 0
  br i1 %.not, label %35, label %23

23:                                               ; preds = %15
  %24 = fpext float %19 to double
  %25 = fpext float %17 to double
  %26 = load float, ptr %1, align 4, !tbaa !11
  %27 = fpext float %26 to double
  %28 = load float, ptr %13, align 4, !tbaa !11
  %29 = fpext float %28 to double
  %30 = load float, ptr %2, align 4, !tbaa !11
  %31 = fpext float %30 to double
  %32 = load float, ptr %14, align 4, !tbaa !11
  %33 = fpext float %32 to double
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, i32 noundef %.128, double noundef %24, double noundef %25, double noundef %27, double noundef %29, double noundef %31, double noundef %33)
  br label %35

35:                                               ; preds = %23, %15
  %36 = load float, ptr %1, align 4, !tbaa !11
  %37 = load float, ptr %2, align 4, !tbaa !11
  %38 = fcmp une float %36, %37
  br i1 %38, label %39, label %42

39:                                               ; preds = %35
  %40 = fpext float %36 to double
  %41 = fpext float %37 to double
  call void @liquid_autotest_failed_expr(ptr noundef nonnull @.str.2, i32 noundef 224, ptr noundef nonnull @.str.19, double noundef %40, ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.20, double noundef %41) #4
  br label %43

42:                                               ; preds = %35
  call void (...) @liquid_autotest_passed() #4
  br label %43

43:                                               ; preds = %42, %39
  %44 = load float, ptr %13, align 4, !tbaa !11
  %45 = load float, ptr %14, align 4, !tbaa !11
  %46 = fcmp une float %44, %45
  br i1 %46, label %47, label %50

47:                                               ; preds = %43
  %48 = fpext float %44 to double
  %49 = fpext float %45 to double
  call void @liquid_autotest_failed_expr(ptr noundef nonnull @.str.2, i32 noundef 225, ptr noundef nonnull @.str.21, double noundef %48, ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.22, double noundef %49) #4
  br label %51

50:                                               ; preds = %43
  call void (...) @liquid_autotest_passed() #4
  br label %51

51:                                               ; preds = %50, %47
  %52 = add nuw nsw i32 %.128, 1
  %exitcond29.not = icmp eq i32 %52, 80
  br i1 %exitcond29.not, label %53, label %15, !llvm.loop !13

53:                                               ; preds = %51
  %54 = call i32 @firhilbf_destroy(ptr noundef %3) #4
  %55 = call i32 @firhilbf_destroy(ptr noundef %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  ret void
}

declare float @randnf(...) local_unnamed_addr #1

declare ptr @firhilbf_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 = { nofree nounwind "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"="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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !9, i64 0}
!13 = distinct !{!13, !6}


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