; LLVM IR from jgaeddert/liquid-dsp :: src/filter/src (filter_crcf)

; 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.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.93 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.94 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.95 = external hidden unnamed_addr constant [61 x i8], align 1

declare ptr @liquid_error_config_fl(ptr noundef, i32 noundef, ptr noundef, ...) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @iirfilt_crcf_create_sos(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local ptr @iirfilt_crcf_create_pll(float noundef %0, float noundef %1, float noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca [3 x float], align 4
  %9 = alloca [3 x float], align 4
  %10 = alloca [3 x float], align 4
  %11 = alloca [3 x float], align 4
  store float %0, ptr %5, align 4, !tbaa !5
  store float %1, ptr %6, align 4, !tbaa !5
  store float %2, ptr %7, align 4, !tbaa !5
  %12 = load float, ptr %5, align 4, !tbaa !5
  %13 = fcmp ole float %12, 0.000000e+00
  br i1 %13, label %17, label %14

14:                                               ; preds = %3
  %15 = load float, ptr %5, align 4, !tbaa !5
  %16 = fcmp oge float %15, 1.000000e+00
  br i1 %16, label %17, label %19

17:                                               ; preds = %14, %3
  %18 = call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef @.str.87, i32 noundef 412, ptr noundef @.str.93, ptr noundef @.str.2)
  store ptr %18, ptr %4, align 8
  br label %59

19:                                               ; preds = %14
  %20 = load float, ptr %6, align 4, !tbaa !5
  %21 = fcmp ole float %20, 0.000000e+00
  br i1 %21, label %25, label %22

22:                                               ; preds = %19
  %23 = load float, ptr %6, align 4, !tbaa !5
  %24 = fcmp oge float %23, 1.000000e+00
  br i1 %24, label %25, label %27

25:                                               ; preds = %22, %19
  %26 = call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef @.str.87, i32 noundef 414, ptr noundef @.str.94, ptr noundef @.str.2)
  store ptr %26, ptr %4, align 8
  br label %59

27:                                               ; preds = %22
  %28 = load float, ptr %7, align 4, !tbaa !5
  %29 = fcmp ole float %28, 0.000000e+00
  br i1 %29, label %30, label %32

30:                                               ; preds = %27
  %31 = call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef @.str.87, i32 noundef 416, ptr noundef @.str.95, ptr noundef @.str.2)
  store ptr %31, ptr %4, align 8
  br label %59

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #3
  %33 = load float, ptr %5, align 4, !tbaa !5
  %34 = load float, ptr %6, align 4, !tbaa !5
  %35 = load float, ptr %7, align 4, !tbaa !5
  %36 = getelementptr inbounds [3 x float], ptr %8, i64 0, i64 0
  %37 = getelementptr inbounds [3 x float], ptr %9, i64 0, i64 0
  call void @iirdes_pll_active_lag(float noundef %33, float noundef %34, float noundef %35, ptr noundef %36, ptr noundef %37)
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #3
  %38 = getelementptr inbounds [3 x float], ptr %8, i64 0, i64 0
  %39 = load float, ptr %38, align 4, !tbaa !5
  %40 = getelementptr inbounds [3 x float], ptr %10, i64 0, i64 0
  store float %39, ptr %40, align 4, !tbaa !5
  %41 = getelementptr inbounds [3 x float], ptr %8, i64 0, i64 1
  %42 = load float, ptr %41, align 4, !tbaa !5
  %43 = getelementptr inbounds [3 x float], ptr %10, i64 0, i64 1
  store float %42, ptr %43, align 4, !tbaa !5
  %44 = getelementptr inbounds [3 x float], ptr %8, i64 0, i64 2
  %45 = load float, ptr %44, align 4, !tbaa !5
  %46 = getelementptr inbounds [3 x float], ptr %10, i64 0, i64 2
  store float %45, ptr %46, align 4, !tbaa !5
  %47 = getelementptr inbounds [3 x float], ptr %9, i64 0, i64 0
  %48 = load float, ptr %47, align 4, !tbaa !5
  %49 = getelementptr inbounds [3 x float], ptr %11, i64 0, i64 0
  store float %48, ptr %49, align 4, !tbaa !5
  %50 = getelementptr inbounds [3 x float], ptr %9, i64 0, i64 1
  %51 = load float, ptr %50, align 4, !tbaa !5
  %52 = getelementptr inbounds [3 x float], ptr %11, i64 0, i64 1
  store float %51, ptr %52, align 4, !tbaa !5
  %53 = getelementptr inbounds [3 x float], ptr %9, i64 0, i64 2
  %54 = load float, ptr %53, align 4, !tbaa !5
  %55 = getelementptr inbounds [3 x float], ptr %11, i64 0, i64 2
  store float %54, ptr %55, align 4, !tbaa !5
  %56 = getelementptr inbounds [3 x float], ptr %10, i64 0, i64 0
  %57 = getelementptr inbounds [3 x float], ptr %11, i64 0, i64 0
  %58 = call ptr @iirfilt_crcf_create_sos(ptr noundef %56, ptr noundef %57, i32 noundef 1)
  store ptr %58, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #3
  br label %59

59:                                               ; preds = %32, %30, %25, %17
  %60 = load ptr, ptr %4, align 8
  ret ptr %60
}

declare void @iirdes_pll_active_lag(float noundef, float noundef, float noundef, ptr noundef, ptr noundef) #0

attributes #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 = { 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"}


; 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.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.93 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.94 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.95 = external hidden unnamed_addr constant [61 x i8], align 1

declare ptr @liquid_error_config_fl(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @iirfilt_crcf_create_sos(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local ptr @iirfilt_crcf_create_pll(float noundef %0, float noundef %1, float noundef %2) local_unnamed_addr #2 {
  %4 = alloca [3 x float], align 8
  %5 = alloca [3 x float], align 8
  %6 = alloca [3 x float], align 8
  %7 = alloca [3 x float], align 8
  %8 = fcmp ole float %0, 0.000000e+00
  %9 = fcmp oge float %0, 1.000000e+00
  %or.cond = or i1 %8, %9
  br i1 %or.cond, label %10, label %12

10:                                               ; preds = %3
  %11 = tail call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef nonnull @.str.87, i32 noundef 412, ptr noundef nonnull @.str.93, ptr noundef nonnull @.str.2) #3
  br label %31

12:                                               ; preds = %3
  %13 = fcmp ole float %1, 0.000000e+00
  %14 = fcmp oge float %1, 1.000000e+00
  %or.cond3 = or i1 %13, %14
  br i1 %or.cond3, label %15, label %17

15:                                               ; preds = %12
  %16 = tail call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef nonnull @.str.87, i32 noundef 414, ptr noundef nonnull @.str.94, ptr noundef nonnull @.str.2) #3
  br label %31

17:                                               ; preds = %12
  %18 = fcmp ugt float %2, 0.000000e+00
  br i1 %18, label %21, label %19

19:                                               ; preds = %17
  %20 = tail call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef nonnull @.str.87, i32 noundef 416, ptr noundef nonnull @.str.95, ptr noundef nonnull @.str.2) #3
  br label %31

21:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #3
  call void @iirdes_pll_active_lag(float noundef %0, float noundef %1, float noundef %2, ptr noundef nonnull %4, ptr noundef nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #3
  %22 = load <2 x float>, ptr %4, align 8, !tbaa !5
  store <2 x float> %22, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %4, i64 8
  %24 = load float, ptr %23, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %6, i64 8
  store float %24, ptr %25, align 8, !tbaa !5
  %26 = load <2 x float>, ptr %5, align 8, !tbaa !5
  store <2 x float> %26, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %5, i64 8
  %28 = load float, ptr %27, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %7, i64 8
  store float %28, ptr %29, align 8, !tbaa !5
  %30 = call ptr @iirfilt_crcf_create_sos(ptr noundef nonnull %6, ptr noundef nonnull %7, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #3
  br label %31

31:                                               ; preds = %21, %19, %15, %10
  %.0 = phi ptr [ %11, %10 ], [ %16, %15 ], [ %20, %19 ], [ %30, %21 ]
  ret ptr %.0
}

declare void @iirdes_pll_active_lag(float noundef, float noundef, float noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

attributes #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 = { 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"}


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