; LLVM IR from jgaeddert/liquid-dsp :: src/filter/tests (firdespm_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.6 = external hidden unnamed_addr constant [45 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
declare ptr @llvm.stacksave.p0() #1

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @testbench_firdespm_halfband_ft(i32 noundef %0, float noundef %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca float, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca [3 x %struct.autotest_psd_s], align 16
  %12 = alloca [256 x i8], align 16
  store i32 %0, ptr %3, align 4, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = mul i32 4, %13
  %15 = add i32 %14, 1
  store i32 %15, ptr %5, align 4, !tbaa !5
  %16 = load i32, ptr %5, align 4, !tbaa !5
  %17 = zext i32 %16 to i64
  %18 = call ptr @llvm.stacksave.p0()
  store ptr %18, ptr %6, align 8
  %19 = alloca float, i64 %17, align 16
  store i64 %17, ptr %7, align 8
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = load float, ptr %4, align 4, !tbaa !9
  %22 = call i32 @liquid_firdespm_halfband_ft(i32 noundef %20, float noundef %21, ptr noundef %19)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %23 = load float, ptr %4, align 4, !tbaa !9
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = call float @estimate_req_filter_As(float noundef %23, i32 noundef %24)
  store float %25, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %26 = load float, ptr %4, align 4, !tbaa !9
  %27 = call float @llvm.fmuladd.f32(float -5.000000e-01, float %26, float 2.500000e-01)
  store float %27, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %28 = load float, ptr %4, align 4, !tbaa !9
  %29 = call float @llvm.fmuladd.f32(float 5.000000e-01, float %28, float 2.500000e-01)
  store float %29, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 72, ptr %11) #6
  %30 = getelementptr inbounds %struct.autotest_psd_s, ptr %11, i32 0, i32 0
  store float -5.000000e-01, ptr %30, align 8, !tbaa !11
  %31 = getelementptr inbounds %struct.autotest_psd_s, ptr %11, i32 0, i32 1
  %32 = load float, ptr %10, align 4, !tbaa !9
  %33 = fneg float %32
  store float %33, ptr %31, align 4, !tbaa !13
  %34 = getelementptr inbounds %struct.autotest_psd_s, ptr %11, i32 0, i32 2
  store float 0.000000e+00, ptr %34, align 8, !tbaa !14
  %35 = getelementptr inbounds %struct.autotest_psd_s, ptr %11, i32 0, i32 3
  %36 = load float, ptr %8, align 4, !tbaa !9
  %37 = fneg float %36
  store float %37, ptr %35, align 4, !tbaa !15
  %38 = getelementptr inbounds %struct.autotest_psd_s, ptr %11, i32 0, i32 4
  store i32 0, ptr %38, align 8, !tbaa !16
  %39 = getelementptr inbounds %struct.autotest_psd_s, ptr %11, i32 0, i32 5
  store i32 1, ptr %39, align 4, !tbaa !17
  %40 = getelementptr inbounds %struct.autotest_psd_s, ptr %11, i64 1
  %41 = getelementptr inbounds %struct.autotest_psd_s, ptr %40, i32 0, i32 0
  %42 = load float, ptr %9, align 4, !tbaa !9
  %43 = fneg float %42
  store float %43, ptr %41, align 8, !tbaa !11
  %44 = getelementptr inbounds %struct.autotest_psd_s, ptr %40, i32 0, i32 1
  %45 = load float, ptr %9, align 4, !tbaa !9
  store float %45, ptr %44, align 4, !tbaa !13
  %46 = getelementptr inbounds %struct.autotest_psd_s, ptr %40, i32 0, i32 2
  store float 0xBFB99999A0000000, ptr %46, align 8, !tbaa !14
  %47 = getelementptr inbounds %struct.autotest_psd_s, ptr %40, i32 0, i32 3
  store float 0x3FB99999A0000000, ptr %47, align 4, !tbaa !15
  %48 = getelementptr inbounds %struct.autotest_psd_s, ptr %40, i32 0, i32 4
  store i32 1, ptr %48, align 8, !tbaa !16
  %49 = getelementptr inbounds %struct.autotest_psd_s, ptr %40, i32 0, i32 5
  store i32 1, ptr %49, align 4, !tbaa !17
  %50 = getelementptr inbounds %struct.autotest_psd_s, ptr %11, i64 2
  %51 = getelementptr inbounds %struct.autotest_psd_s, ptr %50, i32 0, i32 0
  %52 = load float, ptr %10, align 4, !tbaa !9
  store float %52, ptr %51, align 8, !tbaa !11
  %53 = getelementptr inbounds %struct.autotest_psd_s, ptr %50, i32 0, i32 1
  store float 5.000000e-01, ptr %53, align 4, !tbaa !13
  %54 = getelementptr inbounds %struct.autotest_psd_s, ptr %50, i32 0, i32 2
  store float 0.000000e+00, ptr %54, align 8, !tbaa !14
  %55 = getelementptr inbounds %struct.autotest_psd_s, ptr %50, i32 0, i32 3
  %56 = load float, ptr %8, align 4, !tbaa !9
  %57 = fneg float %56
  store float %57, ptr %55, align 4, !tbaa !15
  %58 = getelementptr inbounds %struct.autotest_psd_s, ptr %50, i32 0, i32 4
  store i32 0, ptr %58, align 8, !tbaa !16
  %59 = getelementptr inbounds %struct.autotest_psd_s, ptr %50, i32 0, i32 5
  store i32 1, ptr %59, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 256, ptr %12) #6
  %60 = getelementptr inbounds [256 x i8], ptr %12, i64 0, i64 0
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = load float, ptr %4, align 4, !tbaa !9
  %63 = fmul float %62, 1.000000e+03
  %64 = fptosi float %63 to i32
  %65 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %60, ptr noundef @.str.6, i32 noundef %61, i32 noundef %64) #6
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = getelementptr inbounds [3 x %struct.autotest_psd_s], ptr %11, i64 0, i64 0
  %68 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %72

70:                                               ; preds = %2
  %71 = getelementptr inbounds [256 x i8], ptr %12, i64 0, i64 0
  br label %73

72:                                               ; preds = %2
  br label %73

73:                                               ; preds = %72, %70
  %74 = phi ptr [ %71, %70 ], [ null, %72 ]
  %75 = call i32 @liquid_autotest_validate_psd_signalf(ptr noundef %19, i32 noundef %66, ptr noundef %67, i32 noundef 3, ptr noundef %74)
  call void @llvm.lifetime.end.p0(i64 256, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %76 = load ptr, ptr %6, align 8
  call void @llvm.stackrestore.p0(ptr %76)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret void
}

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

declare float @estimate_req_filter_As(float noundef, i32 noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn }
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"="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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { 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, !10, i64 0}
!12 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 20}
!13 = !{!12, !10, i64 4}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !10, i64 12}
!16 = !{!12, !6, i64 16}
!17 = !{!12, !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.6 = external hidden unnamed_addr constant [45 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

declare i32 @liquid_autotest_validate_psd_signalf(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @testbench_firdespm_halfband_ft(i32 noundef %0, float noundef %1) local_unnamed_addr #2 {
  %3 = alloca [3 x %struct.autotest_psd_s], align 16
  %4 = alloca [256 x i8], align 16
  %5 = shl i32 %0, 2
  %6 = or disjoint i32 %5, 1
  %7 = zext i32 %6 to i64
  %8 = alloca float, i64 %7, align 16
  %9 = call i32 @liquid_firdespm_halfband_ft(i32 noundef %0, float noundef %1, ptr noundef nonnull %8) #5
  %10 = call float @estimate_req_filter_As(float noundef %1, i32 noundef %6) #5
  %11 = call float @llvm.fmuladd.f32(float %1, float -5.000000e-01, float 2.500000e-01)
  %12 = call float @llvm.fmuladd.f32(float %1, float 5.000000e-01, float 2.500000e-01)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %3) #5
  store float -5.000000e-01, ptr %3, align 16, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %3, i64 4
  %14 = fneg float %12
  store float %14, ptr %13, align 4, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %3, i64 8
  store float 0.000000e+00, ptr %15, align 8, !tbaa !12
  %16 = getelementptr inbounds i8, ptr %3, i64 12
  %17 = fneg float %10
  store float %17, ptr %16, align 4, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %3, i64 16
  store i32 0, ptr %18, align 16, !tbaa !14
  %19 = getelementptr inbounds i8, ptr %3, i64 20
  store i32 1, ptr %19, align 4, !tbaa !15
  %20 = getelementptr inbounds i8, ptr %3, i64 24
  %21 = fneg float %11
  store float %21, ptr %20, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %3, i64 28
  store float %11, ptr %22, align 4, !tbaa !11
  %23 = getelementptr inbounds i8, ptr %3, i64 32
  store <2 x float> <float 0xBFB99999A0000000, float 0x3FB99999A0000000>, ptr %23, align 16, !tbaa !16
  %24 = getelementptr inbounds i8, ptr %3, i64 40
  store i32 1, ptr %24, align 8, !tbaa !14
  %25 = getelementptr inbounds i8, ptr %3, i64 44
  store i32 1, ptr %25, align 4, !tbaa !15
  %26 = getelementptr inbounds i8, ptr %3, i64 48
  store float %12, ptr %26, align 16, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %3, i64 52
  store <2 x float> <float 5.000000e-01, float 0.000000e+00>, ptr %27, align 4, !tbaa !16
  %28 = getelementptr inbounds i8, ptr %3, i64 60
  store float %17, ptr %28, align 4, !tbaa !13
  %29 = getelementptr inbounds i8, ptr %3, i64 64
  store i32 0, ptr %29, align 16, !tbaa !14
  %30 = getelementptr inbounds i8, ptr %3, i64 68
  store i32 1, ptr %30, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #5
  %31 = fmul float %1, 1.000000e+03
  %32 = fptosi float %31 to i32
  %33 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %0, i32 noundef %32) #5
  %34 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !17
  %.not = icmp eq i32 %34, 0
  %35 = select i1 %.not, ptr null, ptr %4
  %36 = call i32 @liquid_autotest_validate_psd_signalf(ptr noundef nonnull %8, i32 noundef %6, ptr noundef nonnull %3, i32 noundef 3, ptr noundef %35) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %3) #5
  ret void
}

declare i32 @liquid_firdespm_halfband_ft(i32 noundef, float noundef, ptr noundef) local_unnamed_addr #1

declare float @estimate_req_filter_As(float noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { 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,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass