; 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.23 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.25 = 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 @firhilbf_create(i32 noundef, float noundef) #1

declare i32 @firhilbf_decim_execute(ptr noundef, ptr noundef, ptr 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 float @randnf(...) #1

declare ptr @firhilbf_copy(ptr noundef) #1

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

8:                                                ; preds = %19, %0
  %9 = load i32, ptr %2, align 4, !tbaa !9
  %10 = icmp ult i32 %9, 80
  br i1 %10, label %11, label %22

11:                                               ; preds = %8
  %12 = call float (...) @randnf()
  %13 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 0
  store float %12, ptr %13, align 4, !tbaa !11
  %14 = call float (...) @randnf()
  %15 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 1
  store float %14, ptr %15, align 4, !tbaa !11
  %16 = load ptr, ptr %1, align 8, !tbaa !5
  %17 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 0
  %18 = call i32 @firhilbf_decim_execute(ptr noundef %16, ptr noundef %17, ptr noundef %4)
  br label %19

19:                                               ; preds = %11
  %20 = load i32, ptr %2, align 4, !tbaa !9
  %21 = add i32 %20, 1
  store i32 %21, ptr %2, align 4, !tbaa !9
  br label %8, !llvm.loop !13

22:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %23 = load ptr, ptr %1, align 8, !tbaa !5
  %24 = call ptr @firhilbf_copy(ptr noundef %23)
  store ptr %24, ptr %6, align 8, !tbaa !5
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %91, %22
  %26 = load i32, ptr %2, align 4, !tbaa !9
  %27 = icmp ult i32 %26, 80
  br i1 %27, label %28, label %94

28:                                               ; preds = %25
  %29 = call float (...) @randnf()
  %30 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 0
  store float %29, ptr %30, align 4, !tbaa !11
  %31 = call float (...) @randnf()
  %32 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 1
  store float %31, ptr %32, align 4, !tbaa !11
  %33 = load ptr, ptr %1, align 8, !tbaa !5
  %34 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 0
  %35 = call i32 @firhilbf_decim_execute(ptr noundef %33, ptr noundef %34, ptr noundef %4)
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 0
  %38 = call i32 @firhilbf_decim_execute(ptr noundef %36, ptr noundef %37, ptr noundef %5)
  %39 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !9
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %70

41:                                               ; preds = %28
  %42 = load i32, ptr %2, align 4, !tbaa !9
  %43 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 0
  %44 = load float, ptr %43, align 4, !tbaa !11
  %45 = fpext float %44 to double
  %46 = getelementptr inbounds [2 x float], ptr %3, i64 0, i64 1
  %47 = load float, ptr %46, align 4, !tbaa !11
  %48 = fpext float %47 to double
  %49 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %50 = load float, ptr %49, align 4
  %51 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 1
  %52 = load float, ptr %51, align 4
  %53 = fpext float %50 to double
  %54 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %55 = load float, ptr %54, align 4
  %56 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 1
  %57 = load float, ptr %56, align 4
  %58 = fpext float %57 to double
  %59 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %60 = load float, ptr %59, align 4
  %61 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 1
  %62 = load float, ptr %61, align 4
  %63 = fpext float %60 to double
  %64 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %65 = load float, ptr %64, align 4
  %66 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 1
  %67 = load float, ptr %66, align 4
  %68 = fpext float %67 to double
  %69 = call i32 (ptr, ...) @printf(ptr noundef @.str.23, i32 noundef %42, double noundef %45, double noundef %48, double noundef %53, double noundef %58, double noundef %63, double noundef %68)
  br label %70

70:                                               ; preds = %41, %28
  %71 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %72 = load float, ptr %71, align 4
  %73 = getelementptr inbounds { float, float }, ptr %4, 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 = %70
  %83 = getelementptr inbounds { float, float }, ptr %4, 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.2, i32 noundef 259, ptr noundef @.str.24, double noundef %85, ptr noundef @.str.15, ptr noundef @.str.25, double noundef %88)
  br label %90

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

90:                                               ; preds = %89, %82
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %2, align 4, !tbaa !9
  %93 = add i32 %92, 1
  store i32 %93, ptr %2, align 4, !tbaa !9
  br label %25, !llvm.loop !15

94:                                               ; preds = %25
  %95 = load ptr, ptr %1, align 8, !tbaa !5
  %96 = call i32 @firhilbf_destroy(ptr noundef %95)
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = call i32 @firhilbf_destroy(ptr noundef %97)
  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 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  ret void
}

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"="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 #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 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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.23 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.25 = 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 @firhilbf_create(i32 noundef, float noundef) local_unnamed_addr #1

declare i32 @firhilbf_decim_execute(ptr noundef, ptr noundef, ptr 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 float @randnf(...) local_unnamed_addr #1

declare ptr @firhilbf_copy(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @autotest_firhilbf_copy_decim() local_unnamed_addr #3 {
  %1 = alloca [2 x float], align 4
  %2 = alloca { float, float }, align 4
  %3 = alloca { float, float }, align 4
  %4 = 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
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %5 = getelementptr inbounds i8, ptr %1, i64 4
  br label %6

6:                                                ; preds = %0, %6
  %.010 = phi i32 [ 0, %0 ], [ %10, %6 ]
  %7 = call float (...) @randnf() #4
  store float %7, ptr %1, align 4, !tbaa !5
  %8 = call float (...) @randnf() #4
  store float %8, ptr %5, align 4, !tbaa !5
  %9 = call i32 @firhilbf_decim_execute(ptr noundef %4, ptr noundef nonnull %1, ptr noundef nonnull %2) #4
  %10 = add nuw nsw i32 %.010, 1
  %exitcond.not = icmp eq i32 %10, 80
  br i1 %exitcond.not, label %11, label %6, !llvm.loop !9

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

15:                                               ; preds = %11, %47
  %.111 = phi i32 [ 0, %11 ], [ %48, %47 ]
  %16 = call float (...) @randnf() #4
  store float %16, ptr %1, align 4, !tbaa !5
  %17 = call float (...) @randnf() #4
  store float %17, ptr %5, align 4, !tbaa !5
  %18 = call i32 @firhilbf_decim_execute(ptr noundef %4, ptr noundef nonnull %1, ptr noundef nonnull %2) #4
  %19 = call i32 @firhilbf_decim_execute(ptr noundef %12, ptr noundef nonnull %1, ptr noundef nonnull %3) #4
  %20 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !11
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %35, label %21

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

35:                                               ; preds = %21, %15
  %36 = load float, ptr %2, align 4
  %37 = load float, ptr %13, align 4
  %38 = load float, ptr %3, align 4
  %39 = load float, ptr %14, align 4
  %40 = fcmp une float %36, %38
  %41 = fcmp une float %37, %39
  %42 = or i1 %40, %41
  br i1 %42, label %43, label %46

43:                                               ; preds = %35
  %44 = fpext float %36 to double
  %45 = fpext float %38 to double
  call void @liquid_autotest_failed_expr(ptr noundef nonnull @.str.2, i32 noundef 259, ptr noundef nonnull @.str.24, double noundef %44, ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.25, double noundef %45) #4
  br label %47

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

47:                                               ; preds = %43, %46
  %48 = add nuw nsw i32 %.111, 1
  %exitcond12.not = icmp eq i32 %48, 80
  br i1 %exitcond12.not, label %49, label %15, !llvm.loop !13

49:                                               ; preds = %47
  %50 = call i32 @firhilbf_destroy(ptr noundef %4) #4
  %51 = call i32 @firhilbf_destroy(ptr noundef %12) #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 8, ptr nonnull %1) #4
  ret void
}

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


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