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

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

9:                                                ; preds = %34, %0
  %10 = load i32, ptr %2, align 4, !tbaa !9
  %11 = icmp ult i32 %10, 20
  br i1 %11, label %12, label %37

12:                                               ; preds = %9
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %27, %12
  %14 = load i32, ptr %3, align 4, !tbaa !9
  %15 = icmp ult i32 %14, 3
  br i1 %15, label %16, label %30

16:                                               ; preds = %13
  %17 = call float (...) @randnf()
  %18 = call float (...) @randnf()
  %19 = fmul float 0.000000e+00, %18
  %20 = fmul float 1.000000e+00, %18
  %21 = fadd float %17, %19
  %22 = load i32, ptr %3, align 4, !tbaa !9
  %23 = zext i32 %22 to i64
  %24 = getelementptr inbounds [3 x { float, float }], ptr %4, i64 0, i64 %23
  %25 = getelementptr inbounds { float, float }, ptr %24, i32 0, i32 0
  %26 = getelementptr inbounds { float, float }, ptr %24, i32 0, i32 1
  store float %21, ptr %25, align 8
  store float %20, ptr %26, align 4
  br label %27

27:                                               ; preds = %16
  %28 = load i32, ptr %3, align 4, !tbaa !9
  %29 = add i32 %28, 1
  store i32 %29, ptr %3, align 4, !tbaa !9
  br label %13, !llvm.loop !11

30:                                               ; preds = %13
  %31 = load ptr, ptr %1, align 8, !tbaa !5
  %32 = getelementptr inbounds [3 x { float, float }], ptr %4, i64 0, i64 0
  %33 = call i32 @iirdecim_crcf_execute(ptr noundef %31, ptr noundef %32, ptr noundef %5)
  br label %34

34:                                               ; preds = %30
  %35 = load i32, ptr %2, align 4, !tbaa !9
  %36 = add i32 %35, 1
  store i32 %36, ptr %2, align 4, !tbaa !9
  br label %9, !llvm.loop !13

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

40:                                               ; preds = %88, %37
  %41 = load i32, ptr %2, align 4, !tbaa !9
  %42 = icmp ult i32 %41, 60
  br i1 %42, label %43, label %91

43:                                               ; preds = %40
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %58, %43
  %45 = load i32, ptr %3, align 4, !tbaa !9
  %46 = icmp ult i32 %45, 3
  br i1 %46, label %47, label %61

47:                                               ; preds = %44
  %48 = call float (...) @randnf()
  %49 = call float (...) @randnf()
  %50 = fmul float 0.000000e+00, %49
  %51 = fmul float 1.000000e+00, %49
  %52 = fadd float %48, %50
  %53 = load i32, ptr %3, align 4, !tbaa !9
  %54 = zext i32 %53 to i64
  %55 = getelementptr inbounds [3 x { float, float }], ptr %4, i64 0, i64 %54
  %56 = getelementptr inbounds { float, float }, ptr %55, i32 0, i32 0
  %57 = getelementptr inbounds { float, float }, ptr %55, i32 0, i32 1
  store float %52, ptr %56, align 8
  store float %51, ptr %57, align 4
  br label %58

58:                                               ; preds = %47
  %59 = load i32, ptr %3, align 4, !tbaa !9
  %60 = add i32 %59, 1
  store i32 %60, ptr %3, align 4, !tbaa !9
  br label %44, !llvm.loop !14

61:                                               ; preds = %44
  %62 = load ptr, ptr %1, align 8, !tbaa !5
  %63 = getelementptr inbounds [3 x { float, float }], ptr %4, i64 0, i64 0
  %64 = call i32 @iirdecim_crcf_execute(ptr noundef %62, ptr noundef %63, ptr noundef %5)
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds [3 x { float, float }], ptr %4, i64 0, i64 0
  %67 = call i32 @iirdecim_crcf_execute(ptr noundef %65, ptr noundef %66, ptr noundef %6)
  %68 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %69 = load float, ptr %68, align 4
  %70 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 1
  %71 = load float, ptr %70, align 4
  %72 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 0
  %73 = load float, ptr %72, align 4
  %74 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 1
  %75 = load float, ptr %74, align 4
  %76 = fcmp une float %69, %73
  %77 = fcmp une float %71, %75
  %78 = or i1 %76, %77
  br i1 %78, label %79, label %86

79:                                               ; preds = %61
  %80 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %81 = load float, ptr %80, align 4
  %82 = fpext float %81 to double
  %83 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 0
  %84 = load float, ptr %83, align 4
  %85 = fpext float %84 to double
  call void @liquid_autotest_failed_expr(ptr noundef @.str, i32 noundef 51, ptr noundef @.str.1, double noundef %82, ptr noundef @.str.2, ptr noundef @.str.3, double noundef %85)
  br label %87

86:                                               ; preds = %61
  call void (...) @liquid_autotest_passed()
  br label %87

87:                                               ; preds = %86, %79
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %2, align 4, !tbaa !9
  %90 = add i32 %89, 1
  store i32 %90, ptr %2, align 4, !tbaa !9
  br label %40, !llvm.loop !15

91:                                               ; preds = %40
  %92 = load ptr, ptr %1, align 8, !tbaa !5
  %93 = call i32 @iirdecim_crcf_destroy(ptr noundef %92)
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = call i32 @iirdecim_crcf_destroy(ptr noundef %94)
  call void @llvm.lifetime.end.p0(i64 8, 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 24, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
}

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

declare ptr @iirdecim_crcf_create_default(i32 noundef, i32 noundef) #2

declare float @randnf(...) #2

declare i32 @iirdecim_crcf_execute(ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @iirdecim_crcf_copy(ptr noundef) #2

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

declare void @liquid_autotest_passed(...) #2

declare i32 @iirdecim_crcf_destroy(ptr noundef) #2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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}
!14 = distinct !{!14, !12}
!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"

@.str = external hidden unnamed_addr constant [91 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @autotest_iirdecim_copy() local_unnamed_addr #0 {
  %1 = alloca [3 x { float, float }], align 16
  %2 = alloca { float, float }, align 4
  %3 = alloca { float, float }, align 4
  %4 = tail call ptr @iirdecim_crcf_create_default(i32 noundef 3, i32 noundef 7) #3
  call void @llvm.lifetime.start.p0(i64 24, 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
  %5 = getelementptr inbounds i8, ptr %1, i64 4
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  %7 = getelementptr inbounds i8, ptr %1, i64 12
  %8 = getelementptr inbounds i8, ptr %1, i64 16
  %9 = getelementptr inbounds i8, ptr %1, i64 20
  br label %.preheader17

.preheader17:                                     ; preds = %0, %.preheader17
  %.019 = phi i32 [ 0, %0 ], [ %23, %.preheader17 ]
  %10 = call float (...) @randnf() #3
  %11 = call float (...) @randnf() #3
  %12 = fmul float %11, 0.000000e+00
  %13 = fadd float %10, %12
  store float %13, ptr %1, align 16
  store float %11, ptr %5, align 4
  %14 = call float (...) @randnf() #3
  %15 = call float (...) @randnf() #3
  %16 = fmul float %15, 0.000000e+00
  %17 = fadd float %14, %16
  store float %17, ptr %6, align 8
  store float %15, ptr %7, align 4
  %18 = call float (...) @randnf() #3
  %19 = call float (...) @randnf() #3
  %20 = fmul float %19, 0.000000e+00
  %21 = fadd float %18, %20
  store float %21, ptr %8, align 16
  store float %19, ptr %9, align 4
  %22 = call i32 @iirdecim_crcf_execute(ptr noundef %4, ptr noundef nonnull %1, ptr noundef nonnull %2) #3
  %23 = add nuw nsw i32 %.019, 1
  %exitcond.not = icmp eq i32 %23, 20
  br i1 %exitcond.not, label %24, label %.preheader17, !llvm.loop !5

24:                                               ; preds = %.preheader17
  %25 = getelementptr inbounds i8, ptr %1, i64 4
  %26 = getelementptr inbounds i8, ptr %1, i64 8
  %27 = getelementptr inbounds i8, ptr %1, i64 12
  %28 = getelementptr inbounds i8, ptr %1, i64 16
  %29 = getelementptr inbounds i8, ptr %1, i64 20
  %30 = call ptr @iirdecim_crcf_copy(ptr noundef %4) #3
  %31 = getelementptr inbounds i8, ptr %2, i64 4
  %32 = getelementptr inbounds i8, ptr %3, i64 4
  br label %.preheader

.preheader:                                       ; preds = %24, %58
  %.121 = phi i32 [ 0, %24 ], [ %59, %58 ]
  %33 = call float (...) @randnf() #3
  %34 = call float (...) @randnf() #3
  %35 = fmul float %34, 0.000000e+00
  %36 = fadd float %33, %35
  store float %36, ptr %1, align 16
  store float %34, ptr %25, align 4
  %37 = call float (...) @randnf() #3
  %38 = call float (...) @randnf() #3
  %39 = fmul float %38, 0.000000e+00
  %40 = fadd float %37, %39
  store float %40, ptr %26, align 8
  store float %38, ptr %27, align 4
  %41 = call float (...) @randnf() #3
  %42 = call float (...) @randnf() #3
  %43 = fmul float %42, 0.000000e+00
  %44 = fadd float %41, %43
  store float %44, ptr %28, align 16
  store float %42, ptr %29, align 4
  %45 = call i32 @iirdecim_crcf_execute(ptr noundef %4, ptr noundef nonnull %1, ptr noundef nonnull %2) #3
  %46 = call i32 @iirdecim_crcf_execute(ptr noundef %30, ptr noundef nonnull %1, ptr noundef nonnull %3) #3
  %47 = load float, ptr %2, align 4
  %48 = load float, ptr %31, align 4
  %49 = load float, ptr %3, align 4
  %50 = load float, ptr %32, align 4
  %51 = fcmp une float %47, %49
  %52 = fcmp une float %48, %50
  %53 = or i1 %51, %52
  br i1 %53, label %54, label %57

54:                                               ; preds = %.preheader
  %55 = fpext float %47 to double
  %56 = fpext float %49 to double
  call void @liquid_autotest_failed_expr(ptr noundef nonnull @.str, i32 noundef 51, ptr noundef nonnull @.str.1, double noundef %55, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, double noundef %56) #3
  br label %58

57:                                               ; preds = %.preheader
  call void (...) @liquid_autotest_passed() #3
  br label %58

58:                                               ; preds = %54, %57
  %59 = add nuw nsw i32 %.121, 1
  %exitcond25.not = icmp eq i32 %59, 60
  br i1 %exitcond25.not, label %60, label %.preheader, !llvm.loop !7

60:                                               ; preds = %58
  %61 = call i32 @iirdecim_crcf_destroy(ptr noundef %4) #3
  %62 = call i32 @iirdecim_crcf_destroy(ptr noundef %30) #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 24, ptr nonnull %1) #3
  ret void
}

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

declare ptr @iirdecim_crcf_create_default(i32 noundef, i32 noundef) local_unnamed_addr #2

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

declare i32 @iirdecim_crcf_execute(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @iirdecim_crcf_copy(ptr noundef) 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 #2

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

declare i32 @iirdecim_crcf_destroy(ptr noundef) local_unnamed_addr #2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass,TailCallElimPass