; 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.9 = external hidden unnamed_addr constant [38 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

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

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

declare i32 @iirfilt_rrrf_destroy(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @autotest_iirdes_ellip_highpass() #2 {
  %1 = alloca i32, align 4
  %2 = alloca float, align 4
  %3 = alloca float, align 4
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca [3 x %struct.autotest_psd_s], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  store i32 9, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store float 0x3FC99999A0000000, ptr %2, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store float 0x3FB99999A0000000, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store float 6.000000e+01, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store float 0x3F50624DE0000000, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 800, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = load float, ptr %2, align 4, !tbaa !9
  %11 = load float, ptr %3, align 4, !tbaa !9
  %12 = load float, ptr %4, align 4, !tbaa !9
  %13 = call ptr @iirfilt_rrrf_create_prototype(i32 noundef 3, i32 noundef 1, i32 noundef 0, i32 noundef %9, float noundef %10, float noundef 0.000000e+00, float noundef %11, float noundef %12)
  store ptr %13, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 72, ptr %8) #3
  %14 = getelementptr inbounds %struct.autotest_psd_s, ptr %8, i32 0, i32 0
  store float -5.000000e-01, ptr %14, align 8, !tbaa !13
  %15 = getelementptr inbounds %struct.autotest_psd_s, ptr %8, i32 0, i32 1
  %16 = load float, ptr %2, align 4, !tbaa !9
  %17 = fneg float %16
  store float %17, ptr %15, align 4, !tbaa !15
  %18 = getelementptr inbounds %struct.autotest_psd_s, ptr %8, i32 0, i32 2
  %19 = load float, ptr %3, align 4, !tbaa !9
  %20 = fneg float %19
  %21 = load float, ptr %5, align 4, !tbaa !9
  %22 = fsub float %20, %21
  store float %22, ptr %18, align 8, !tbaa !16
  %23 = getelementptr inbounds %struct.autotest_psd_s, ptr %8, i32 0, i32 3
  %24 = load float, ptr %5, align 4, !tbaa !9
  store float %24, ptr %23, align 4, !tbaa !17
  %25 = getelementptr inbounds %struct.autotest_psd_s, ptr %8, i32 0, i32 4
  store i32 1, ptr %25, align 8, !tbaa !18
  %26 = getelementptr inbounds %struct.autotest_psd_s, ptr %8, i32 0, i32 5
  store i32 1, ptr %26, align 4, !tbaa !19
  %27 = getelementptr inbounds %struct.autotest_psd_s, ptr %8, i64 1
  %28 = getelementptr inbounds %struct.autotest_psd_s, ptr %27, i32 0, i32 0
  store float 0xBFC78D4FE0000000, ptr %28, align 8, !tbaa !13
  %29 = getelementptr inbounds %struct.autotest_psd_s, ptr %27, i32 0, i32 1
  store float 0x3FC78D4FE0000000, ptr %29, align 4, !tbaa !15
  %30 = getelementptr inbounds %struct.autotest_psd_s, ptr %27, i32 0, i32 2
  store float 0.000000e+00, ptr %30, align 8, !tbaa !16
  %31 = getelementptr inbounds %struct.autotest_psd_s, ptr %27, i32 0, i32 3
  %32 = load float, ptr %4, align 4, !tbaa !9
  %33 = fneg float %32
  %34 = load float, ptr %5, align 4, !tbaa !9
  %35 = fadd float %33, %34
  store float %35, ptr %31, align 4, !tbaa !17
  %36 = getelementptr inbounds %struct.autotest_psd_s, ptr %27, i32 0, i32 4
  store i32 0, ptr %36, align 8, !tbaa !18
  %37 = getelementptr inbounds %struct.autotest_psd_s, ptr %27, i32 0, i32 5
  store i32 1, ptr %37, align 4, !tbaa !19
  %38 = getelementptr inbounds %struct.autotest_psd_s, ptr %8, i64 2
  %39 = getelementptr inbounds %struct.autotest_psd_s, ptr %38, i32 0, i32 0
  %40 = load float, ptr %2, align 4, !tbaa !9
  store float %40, ptr %39, align 8, !tbaa !13
  %41 = getelementptr inbounds %struct.autotest_psd_s, ptr %38, i32 0, i32 1
  store float 5.000000e-01, ptr %41, align 4, !tbaa !15
  %42 = getelementptr inbounds %struct.autotest_psd_s, ptr %38, i32 0, i32 2
  %43 = load float, ptr %3, align 4, !tbaa !9
  %44 = fneg float %43
  %45 = load float, ptr %5, align 4, !tbaa !9
  %46 = fsub float %44, %45
  store float %46, ptr %42, align 8, !tbaa !16
  %47 = getelementptr inbounds %struct.autotest_psd_s, ptr %38, i32 0, i32 3
  %48 = load float, ptr %5, align 4, !tbaa !9
  store float %48, ptr %47, align 4, !tbaa !17
  %49 = getelementptr inbounds %struct.autotest_psd_s, ptr %38, i32 0, i32 4
  store i32 1, ptr %49, align 8, !tbaa !18
  %50 = getelementptr inbounds %struct.autotest_psd_s, ptr %38, i32 0, i32 5
  store i32 1, ptr %50, align 4, !tbaa !19
  %51 = load ptr, ptr %7, align 8, !tbaa !11
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = getelementptr inbounds [3 x %struct.autotest_psd_s], ptr %8, 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.9, ptr null
  %58 = call i32 @liquid_autotest_validate_psd_iirfilt_rrrf(ptr noundef %51, i32 noundef %52, ptr noundef %53, i32 noundef 3, ptr noundef %57)
  %59 = load ptr, ptr %7, align 8, !tbaa !11
  %60 = call i32 @iirfilt_rrrf_destroy(ptr noundef %59)
  call void @llvm.lifetime.end.p0(i64 72, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, 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 4, 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 = !{!"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.9 = external hidden unnamed_addr constant [38 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 ptr @iirfilt_rrrf_create_prototype(i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #1

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

declare i32 @iirfilt_rrrf_destroy(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @autotest_iirdes_ellip_highpass() local_unnamed_addr #2 {
  %1 = alloca [3 x %struct.autotest_psd_s], align 16
  %2 = tail call ptr @iirfilt_rrrf_create_prototype(i32 noundef 3, i32 noundef 1, i32 noundef 0, i32 noundef 9, float noundef 0x3FC99999A0000000, float noundef 0.000000e+00, float noundef 0x3FB99999A0000000, float noundef 6.000000e+01) #3
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %1) #3
  store <4 x float> <float -5.000000e-01, float 0xBFC99999A0000000, float 0xBFB9DB22E0000000, float 0x3F50624DE0000000>, ptr %1, align 16, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %1, i64 16
  store i32 1, ptr %3, align 16, !tbaa !9
  %4 = getelementptr inbounds i8, ptr %1, i64 20
  store i32 1, ptr %4, align 4, !tbaa !12
  %5 = getelementptr inbounds i8, ptr %1, i64 24
  store <4 x float> <float 0xBFC78D4FE0000000, float 0x3FC78D4FE0000000, float 0.000000e+00, float 0xC04DFFDF40000000>, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 40
  store i32 0, ptr %6, align 8, !tbaa !9
  %7 = getelementptr inbounds i8, ptr %1, i64 44
  store i32 1, ptr %7, align 4, !tbaa !12
  %8 = getelementptr inbounds i8, ptr %1, i64 48
  store <4 x float> <float 0x3FC99999A0000000, float 5.000000e-01, float 0xBFB9DB22E0000000, float 0x3F50624DE0000000>, ptr %8, align 16, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %1, i64 64
  store i32 1, ptr %9, align 16, !tbaa !9
  %10 = getelementptr inbounds i8, ptr %1, i64 68
  store i32 1, ptr %10, align 4, !tbaa !12
  %11 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !13
  %.not = icmp eq i32 %11, 0
  %12 = select i1 %.not, ptr null, ptr @.str.9
  %13 = call i32 @liquid_autotest_validate_psd_iirfilt_rrrf(ptr noundef %2, i32 noundef 800, ptr noundef nonnull %1, i32 noundef 3, ptr noundef %12) #3
  %14 = call i32 @iirfilt_rrrf_destroy(ptr noundef %2) #3
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %1) #3
  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 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 16}
!10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !11, i64 16, !11, i64 20}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 20}
!13 = !{!11, !11, i64 0}


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