; LLVM IR from lichen-community-systems/signaletic :: libsignaletic/src (libsignaletic)

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

; 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: inlinehint nounwind uwtable
define dso_local float @sig_fastTanhf(float noundef %0) #1 {
  %2 = alloca float, align 4
  %3 = alloca float, align 4
  %4 = alloca float, align 4
  store float %0, ptr %3, align 4, !tbaa !5
  %5 = load float, ptr %3, align 4, !tbaa !5
  %6 = fcmp ogt float %5, 3.000000e+00
  br i1 %6, label %7, label %8

7:                                                ; preds = %1
  store float 1.000000e+00, ptr %2, align 4
  br label %23

8:                                                ; preds = %1
  %9 = load float, ptr %3, align 4, !tbaa !5
  %10 = fcmp olt float %9, -3.000000e+00
  br i1 %10, label %11, label %12

11:                                               ; preds = %8
  store float -1.000000e+00, ptr %2, align 4
  br label %23

12:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %13 = load float, ptr %3, align 4, !tbaa !5
  %14 = load float, ptr %3, align 4, !tbaa !5
  %15 = fmul float %13, %14
  store float %15, ptr %4, align 4, !tbaa !5
  %16 = load float, ptr %3, align 4, !tbaa !5
  %17 = load float, ptr %4, align 4, !tbaa !5
  %18 = fadd float 2.700000e+01, %17
  %19 = fmul float %16, %18
  %20 = load float, ptr %4, align 4, !tbaa !5
  %21 = call float @llvm.fmuladd.f32(float 9.000000e+00, float %20, float 2.700000e+01)
  %22 = fdiv float %19, %21
  store float %22, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %23

23:                                               ; preds = %12, %11, %7
  %24 = load float, ptr %2, align 4
  ret float %24
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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"

; Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local noundef float @sig_fastTanhf(float noundef %0) local_unnamed_addr #0 {
  %2 = fcmp ogt float %0, 3.000000e+00
  br i1 %2, label %11, label %3

3:                                                ; preds = %1
  %4 = fcmp olt float %0, -3.000000e+00
  br i1 %4, label %11, label %5

5:                                                ; preds = %3
  %6 = fmul float %0, %0
  %7 = fadd float %6, 2.700000e+01
  %8 = fmul float %7, %0
  %9 = tail call float @llvm.fmuladd.f32(float %6, float 9.000000e+00, float 2.700000e+01)
  %10 = fdiv float %8, %9
  br label %11

11:                                               ; preds = %3, %1, %5
  %.0 = phi float [ %10, %5 ], [ 1.000000e+00, %1 ], [ -1.000000e+00, %3 ]
  ret float %.0
}

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

attributes #0 = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(none) 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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)"}


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass