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

%struct.autotest_psd_s = type { float, float, float, float, i32, i32 }

@liquid_autotest_verbose = external global i32, align 4
@.str.5 = external hidden unnamed_addr constant [37 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 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 @testbench_iirdes_ellip_lowpass(i32 noundef %0, float noundef %1, float noundef %2, float noundef %3, float noundef %4) #1 {
  %6 = alloca i32, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca [2 x %struct.autotest_psd_s], align 16
  store i32 %0, ptr %6, align 4, !tbaa !5
  store float %1, ptr %7, align 4, !tbaa !9
  store float %2, ptr %8, align 4, !tbaa !9
  store float %3, ptr %9, align 4, !tbaa !9
  store float %4, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store float 0x3F50624DE0000000, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 800, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %18 = load i32, ptr %6, align 4, !tbaa !5
  %19 = load float, ptr %7, align 4, !tbaa !9
  %20 = load float, ptr %9, align 4, !tbaa !9
  %21 = load float, ptr %10, align 4, !tbaa !9
  %22 = call ptr @iirfilt_rrrf_create_prototype(i32 noundef 3, i32 noundef 0, i32 noundef 0, i32 noundef %18, float noundef %19, float noundef 0.000000e+00, float noundef %20, float noundef %21)
  store ptr %22, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  store float 0.000000e+00, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %23 = load float, ptr %9, align 4, !tbaa !9
  %24 = fneg float %23
  store float %24, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %25 = load float, ptr %10, align 4, !tbaa !9
  %26 = fneg float %25
  store float %26, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 48, ptr %17) #3
  %27 = getelementptr inbounds %struct.autotest_psd_s, ptr %17, i32 0, i32 0
  store float 0.000000e+00, ptr %27, align 8, !tbaa !13
  %28 = getelementptr inbounds %struct.autotest_psd_s, ptr %17, i32 0, i32 1
  %29 = load float, ptr %7, align 4, !tbaa !9
  store float %29, ptr %28, align 4, !tbaa !15
  %30 = getelementptr inbounds %struct.autotest_psd_s, ptr %17, i32 0, i32 2
  %31 = load float, ptr %15, align 4, !tbaa !9
  %32 = load float, ptr %11, align 4, !tbaa !9
  %33 = fsub float %31, %32
  store float %33, ptr %30, align 8, !tbaa !16
  %34 = getelementptr inbounds %struct.autotest_psd_s, ptr %17, i32 0, i32 3
  %35 = load float, ptr %14, align 4, !tbaa !9
  %36 = load float, ptr %11, align 4, !tbaa !9
  %37 = fadd float %35, %36
  store float %37, ptr %34, align 4, !tbaa !17
  %38 = getelementptr inbounds %struct.autotest_psd_s, ptr %17, i32 0, i32 4
  store i32 1, ptr %38, align 8, !tbaa !18
  %39 = getelementptr inbounds %struct.autotest_psd_s, ptr %17, i32 0, i32 5
  store i32 1, ptr %39, align 4, !tbaa !19
  %40 = getelementptr inbounds %struct.autotest_psd_s, ptr %17, i64 1
  %41 = getelementptr inbounds %struct.autotest_psd_s, ptr %40, i32 0, i32 0
  %42 = load float, ptr %8, align 4, !tbaa !9
  store float %42, ptr %41, align 8, !tbaa !13
  %43 = getelementptr inbounds %struct.autotest_psd_s, ptr %40, i32 0, i32 1
  store float 5.000000e-01, ptr %43, align 4, !tbaa !15
  %44 = getelementptr inbounds %struct.autotest_psd_s, ptr %40, i32 0, i32 2
  store float 0.000000e+00, ptr %44, align 8, !tbaa !16
  %45 = getelementptr inbounds %struct.autotest_psd_s, ptr %40, i32 0, i32 3
  %46 = load float, ptr %16, align 4, !tbaa !9
  %47 = load float, ptr %11, align 4, !tbaa !9
  %48 = fadd float %46, %47
  store float %48, ptr %45, align 4, !tbaa !17
  %49 = getelementptr inbounds %struct.autotest_psd_s, ptr %40, i32 0, i32 4
  store i32 0, ptr %49, align 8, !tbaa !18
  %50 = getelementptr inbounds %struct.autotest_psd_s, ptr %40, i32 0, i32 5
  store i32 1, ptr %50, align 4, !tbaa !19
  %51 = load ptr, ptr %13, align 8, !tbaa !11
  %52 = load i32, ptr %12, align 4, !tbaa !5
  %53 = getelementptr inbounds [2 x %struct.autotest_psd_s], ptr %17, i64 0, i64 0
  %54 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %55 = icmp ne i32 %54, 0
  %56 = zext i1 %55 to i64
  %57 = select i1 %55, ptr @.str.5, ptr null
  %58 = call i32 @liquid_autotest_validate_psd_iirfilt_rrrf(ptr noundef %51, i32 noundef %52, ptr noundef %53, i32 noundef 2, ptr noundef %57)
  %59 = load ptr, ptr %13, align 8, !tbaa !11
  %60 = call i32 @iirfilt_rrrf_destroy(ptr noundef %59)
  call void @llvm.lifetime.end.p0(i64 48, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  ret void
}

declare ptr @iirfilt_rrrf_create_prototype(i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, float noundef, float noundef, float noundef) #2

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

declare i32 @iirfilt_rrrf_destroy(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 20}
!15 = !{!14, !10, i64 4}
!16 = !{!14, !10, i64 8}
!17 = !{!14, !10, i64 12}
!18 = !{!14, !6, i64 16}
!19 = !{!14, !6, i64 20}


; 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"

%struct.autotest_psd_s = type { float, float, float, float, i32, i32 }

@liquid_autotest_verbose = external local_unnamed_addr global i32, align 4
@.str.5 = external hidden unnamed_addr constant [37 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 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 @testbench_iirdes_ellip_lowpass(i32 noundef %0, float noundef %1, float noundef %2, float noundef %3, float noundef %4) local_unnamed_addr #1 {
  %6 = alloca [2 x %struct.autotest_psd_s], align 16
  %7 = tail call ptr @iirfilt_rrrf_create_prototype(i32 noundef 3, i32 noundef 0, i32 noundef 0, i32 noundef %0, float noundef %1, float noundef 0.000000e+00, float noundef %3, float noundef %4) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #3
  store float 0.000000e+00, ptr %6, align 16, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %6, i64 4
  store float %1, ptr %8, align 4, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %6, i64 8
  %10 = fsub float 0xBF50624DE0000000, %3
  store float %10, ptr %9, align 8, !tbaa !12
  %11 = getelementptr inbounds i8, ptr %6, i64 12
  store float 0x3F50624DE0000000, ptr %11, align 4, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %6, i64 16
  store i32 1, ptr %12, align 16, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %6, i64 20
  store i32 1, ptr %13, align 4, !tbaa !15
  %14 = getelementptr inbounds i8, ptr %6, i64 24
  store float %2, ptr %14, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %6, i64 28
  store <2 x float> <float 5.000000e-01, float 0.000000e+00>, ptr %15, align 4, !tbaa !16
  %16 = getelementptr inbounds i8, ptr %6, i64 36
  %17 = fsub float 0x3F50624DE0000000, %4
  store float %17, ptr %16, align 4, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %6, i64 40
  store i32 0, ptr %18, align 8, !tbaa !14
  %19 = getelementptr inbounds i8, ptr %6, i64 44
  store i32 1, ptr %19, align 4, !tbaa !15
  %20 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !17
  %.not = icmp eq i32 %20, 0
  %21 = select i1 %.not, ptr null, ptr @.str.5
  %22 = call i32 @liquid_autotest_validate_psd_iirfilt_rrrf(ptr noundef %7, i32 noundef 800, ptr noundef nonnull %6, i32 noundef 2, ptr noundef %21) #3
  %23 = call i32 @iirfilt_rrrf_destroy(ptr noundef %7) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #3
  ret void
}

declare ptr @iirfilt_rrrf_create_prototype(i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #2

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

declare i32 @iirfilt_rrrf_destroy(ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 20}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !7, i64 8}
!13 = !{!6, !7, i64 12}
!14 = !{!6, !10, i64 16}
!15 = !{!6, !10, i64 20}
!16 = !{!7, !7, i64 0}
!17 = !{!10, !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass