; LLVM IR from jgaeddert/liquid-dsp :: src/filter/src/iirdes.pll (iirdes_pll_active_PI)

; 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 [82 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [52 x i8], align 1

declare i32 @liquid_error_fl(i32 noundef, 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
define dso_local void @iirdes_pll_active_PI(float noundef %0, float noundef %1, float noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  store float %0, ptr %6, align 4, !tbaa !5
  store float %1, ptr %7, align 4, !tbaa !5
  store float %2, ptr %8, align 4, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !9
  %14 = load float, ptr %6, align 4, !tbaa !5
  %15 = fcmp ole float %14, 0.000000e+00
  br i1 %15, label %16, label %18

16:                                               ; preds = %5
  %17 = call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef @.str, i32 noundef 96, ptr noundef @.str.4)
  br label %82

18:                                               ; preds = %5
  %19 = load float, ptr %7, align 4, !tbaa !5
  %20 = fcmp ole float %19, 0.000000e+00
  br i1 %20, label %21, label %23

21:                                               ; preds = %18
  %22 = call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef @.str, i32 noundef 99, ptr noundef @.str.5)
  br label %82

23:                                               ; preds = %18
  %24 = load float, ptr %8, align 4, !tbaa !5
  %25 = fcmp ole float %24, 0.000000e+00
  br i1 %25, label %26, label %28

26:                                               ; preds = %23
  %27 = call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef @.str, i32 noundef 102, ptr noundef @.str.6)
  br label %82

28:                                               ; preds = %23
  br label %29

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %31 = load float, ptr %6, align 4, !tbaa !5
  store float %31, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %32 = load float, ptr %8, align 4, !tbaa !5
  %33 = load float, ptr %11, align 4, !tbaa !5
  %34 = load float, ptr %11, align 4, !tbaa !5
  %35 = fmul float %33, %34
  %36 = fdiv float %32, %35
  store float %36, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %37 = load float, ptr %7, align 4, !tbaa !5
  %38 = fmul float 2.000000e+00, %37
  %39 = load float, ptr %11, align 4, !tbaa !5
  %40 = fdiv float %38, %39
  store float %40, ptr %13, align 4, !tbaa !5
  %41 = load float, ptr %8, align 4, !tbaa !5
  %42 = fmul float 2.000000e+00, %41
  %43 = fpext float %42 to double
  %44 = load float, ptr %13, align 4, !tbaa !5
  %45 = fdiv float %44, 2.000000e+00
  %46 = fpext float %45 to double
  %47 = fadd double 1.000000e+00, %46
  %48 = fmul double %43, %47
  %49 = fptrunc double %48 to float
  %50 = load ptr, ptr %9, align 8, !tbaa !9
  %51 = getelementptr inbounds float, ptr %50, i64 0
  store float %49, ptr %51, align 4, !tbaa !5
  %52 = load float, ptr %8, align 4, !tbaa !5
  %53 = fmul float 2.000000e+00, %52
  %54 = fpext float %53 to double
  %55 = fmul double %54, 2.000000e+00
  %56 = fptrunc double %55 to float
  %57 = load ptr, ptr %9, align 8, !tbaa !9
  %58 = getelementptr inbounds float, ptr %57, i64 1
  store float %56, ptr %58, align 4, !tbaa !5
  %59 = load float, ptr %8, align 4, !tbaa !5
  %60 = fmul float 2.000000e+00, %59
  %61 = fpext float %60 to double
  %62 = load float, ptr %13, align 4, !tbaa !5
  %63 = fdiv float %62, 2.000000e+00
  %64 = fpext float %63 to double
  %65 = fsub double 1.000000e+00, %64
  %66 = fmul double %61, %65
  %67 = fptrunc double %66 to float
  %68 = load ptr, ptr %9, align 8, !tbaa !9
  %69 = getelementptr inbounds float, ptr %68, i64 2
  store float %67, ptr %69, align 4, !tbaa !5
  %70 = load float, ptr %12, align 4, !tbaa !5
  %71 = fdiv float %70, 2.000000e+00
  %72 = load ptr, ptr %10, align 8, !tbaa !9
  %73 = getelementptr inbounds float, ptr %72, i64 0
  store float %71, ptr %73, align 4, !tbaa !5
  %74 = load float, ptr %12, align 4, !tbaa !5
  %75 = fneg float %74
  %76 = load ptr, ptr %10, align 8, !tbaa !9
  %77 = getelementptr inbounds float, ptr %76, i64 1
  store float %75, ptr %77, align 4, !tbaa !5
  %78 = load float, ptr %12, align 4, !tbaa !5
  %79 = fdiv float %78, 2.000000e+00
  %80 = load ptr, ptr %10, align 8, !tbaa !9
  %81 = getelementptr inbounds float, ptr %80, i64 2
  store float %79, ptr %81, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, 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
  br label %82

82:                                               ; preds = %30, %26, %21, %16
  ret void
}

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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}


; 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 [82 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [52 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local void @iirdes_pll_active_PI(float noundef %0, float noundef %1, float noundef %2, ptr nocapture noundef writeonly %3, ptr nocapture noundef writeonly %4) local_unnamed_addr #1 {
  %6 = fcmp ugt float %0, 0.000000e+00
  br i1 %6, label %9, label %7

7:                                                ; preds = %5
  %8 = tail call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef nonnull @.str, i32 noundef 96, ptr noundef nonnull @.str.4) #2
  br label %39

9:                                                ; preds = %5
  %10 = fcmp ugt float %1, 0.000000e+00
  br i1 %10, label %13, label %11

11:                                               ; preds = %9
  %12 = tail call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef nonnull @.str, i32 noundef 99, ptr noundef nonnull @.str.5) #2
  br label %39

13:                                               ; preds = %9
  %14 = fcmp ugt float %2, 0.000000e+00
  br i1 %14, label %17, label %15

15:                                               ; preds = %13
  %16 = tail call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef nonnull @.str, i32 noundef 102, ptr noundef nonnull @.str.6) #2
  br label %39

17:                                               ; preds = %13
  %18 = fmul float %0, %0
  %19 = fdiv float %2, %18
  %20 = fmul float %1, 2.000000e+00
  %21 = fdiv float %20, %0
  %22 = fmul float %2, 2.000000e+00
  %23 = fpext float %22 to double
  %24 = fmul float %21, 5.000000e-01
  %25 = fpext float %24 to double
  %26 = fadd double %25, 1.000000e+00
  %27 = fmul double %26, %23
  %28 = fptrunc double %27 to float
  store float %28, ptr %3, align 4, !tbaa !5
  %29 = fmul float %22, 2.000000e+00
  %30 = getelementptr inbounds i8, ptr %3, i64 4
  store float %29, ptr %30, align 4, !tbaa !5
  %31 = fsub double 1.000000e+00, %25
  %32 = fmul double %31, %23
  %33 = fptrunc double %32 to float
  %34 = getelementptr inbounds i8, ptr %3, i64 8
  store float %33, ptr %34, align 4, !tbaa !5
  %35 = fmul float %19, 5.000000e-01
  store float %35, ptr %4, align 4, !tbaa !5
  %36 = fneg float %19
  %37 = getelementptr inbounds i8, ptr %4, i64 4
  store float %36, ptr %37, align 4, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %4, i64 8
  store float %35, ptr %38, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %17, %15, %11, %7
  ret void
}

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 = { 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 = { 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,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass