; LLVM IR from jgaeddert/liquid-dsp :: src/filter/tests (iirfiltsos_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 [93 x i8], align 1
@__const.autotest_iirfiltsos_copy.a = external hidden unnamed_addr constant [3 x float], align 4
@__const.autotest_iirfiltsos_copy.b = external hidden unnamed_addr constant [3 x float], align 4
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = 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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @autotest_iirfiltsos_copy() #3 {
  %1 = alloca [3 x float], align 4
  %2 = alloca [3 x float], align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca { float, float }, align 4
  %7 = alloca { float, float }, align 4
  %8 = alloca { float, float }, 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
  %13 = alloca { float, float }, align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr %1) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %1, ptr align 4 @__const.autotest_iirfiltsos_copy.a, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %2) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %2, ptr align 4 @__const.autotest_iirfiltsos_copy.b, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %14 = getelementptr inbounds [3 x float], ptr %2, i64 0, i64 0
  %15 = getelementptr inbounds [3 x float], ptr %1, i64 0, i64 0
  %16 = call ptr @iirfiltsos_crcf_create(ptr noundef %14, ptr noundef %15)
  store ptr %16, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 80, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %17

17:                                               ; preds = %38, %0
  %18 = load i32, ptr %4, align 4, !tbaa !9
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = icmp ult i32 %18, %19
  br i1 %20, label %21, label %41

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

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

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

44:                                               ; preds = %94, %41
  %45 = load i32, ptr %4, align 4, !tbaa !9
  %46 = load i32, ptr %5, align 4, !tbaa !9
  %47 = icmp ult i32 %45, %46
  br i1 %47, label %48, label %97

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

85:                                               ; preds = %48
  %86 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 0
  %87 = load float, ptr %86, align 4
  %88 = fpext float %87 to double
  %89 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 0
  %90 = load float, ptr %89, align 4
  %91 = fpext float %90 to double
  call void @liquid_autotest_failed_expr(ptr noundef @.str, i32 noundef 164, ptr noundef @.str.4, double noundef %88, ptr noundef @.str.5, ptr noundef @.str.6, double noundef %91)
  br label %93

92:                                               ; preds = %48
  call void (...) @liquid_autotest_passed()
  br label %93

93:                                               ; preds = %92, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %4, align 4, !tbaa !9
  %96 = add i32 %95, 1
  store i32 %96, ptr %4, align 4, !tbaa !9
  br label %44, !llvm.loop !13

97:                                               ; preds = %44
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = call i32 @iirfiltsos_crcf_destroy(ptr noundef %98)
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = call i32 @iirfiltsos_crcf_destroy(ptr noundef %100)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %1) #4
  ret void
}

declare ptr @iirfiltsos_crcf_create(ptr noundef, ptr noundef) #2

declare float @randnf(...) #2

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

declare ptr @iirfiltsos_crcf_copy(ptr noundef) #2

declare i32 @iirfiltsos_crcf_destroy(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree 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 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 = !{!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 [93 x i8], align 1
@__const.autotest_iirfiltsos_copy.a = external hidden unnamed_addr constant [3 x float], align 4
@__const.autotest_iirfiltsos_copy.b = external hidden unnamed_addr constant [3 x float], align 4
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = 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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @autotest_iirfiltsos_copy() local_unnamed_addr #3 {
  %1 = alloca [3 x float], align 4
  %2 = alloca [3 x float], align 4
  %3 = alloca { float, float }, align 4
  %4 = alloca { float, float }, align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %1) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) @__const.autotest_iirfiltsos_copy.a, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) @__const.autotest_iirfiltsos_copy.b, i64 12, i1 false)
  %5 = call ptr @iirfiltsos_crcf_create(ptr noundef nonnull %2, ptr noundef nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  br label %6

6:                                                ; preds = %0, %6
  %.020 = phi i32 [ 0, %0 ], [ %12, %6 ]
  %7 = call float (...) @randnf() #4
  %8 = call float (...) @randnf() #4
  %9 = fmul float %8, 0.000000e+00
  %10 = fadd float %7, %9
  %.sroa.08.0.vec.insert = insertelement <2 x float> poison, float %10, i64 0
  %.sroa.08.4.vec.insert = insertelement <2 x float> %.sroa.08.0.vec.insert, float %8, i64 1
  %11 = call i32 @iirfiltsos_crcf_execute(ptr noundef %5, <2 x float> noundef %.sroa.08.4.vec.insert, ptr noundef nonnull %3) #4
  %12 = add nuw nsw i32 %.020, 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 @iirfiltsos_crcf_copy(ptr noundef %5) #4
  %15 = getelementptr inbounds i8, ptr %3, i64 4
  %16 = getelementptr inbounds i8, ptr %4, i64 4
  br label %17

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

31:                                               ; preds = %17
  %32 = fpext float %24 to double
  %33 = fpext float %26 to double
  call void @liquid_autotest_failed_expr(ptr noundef nonnull @.str, i32 noundef 164, ptr noundef nonnull @.str.4, double noundef %32, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, double noundef %33) #4
  br label %35

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

35:                                               ; preds = %34, %31
  %36 = add nuw nsw i32 %.121, 1
  %exitcond22.not = icmp eq i32 %36, 80
  br i1 %exitcond22.not, label %37, label %17, !llvm.loop !7

37:                                               ; preds = %35
  %38 = call i32 @iirfiltsos_crcf_destroy(ptr noundef %5) #4
  %39 = call i32 @iirfiltsos_crcf_destroy(ptr noundef %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %1) #4
  ret void
}

declare ptr @iirfiltsos_crcf_create(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

declare ptr @iirfiltsos_crcf_copy(ptr noundef) local_unnamed_addr #2

declare i32 @iirfiltsos_crcf_destroy(ptr noundef) local_unnamed_addr #2

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


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