#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
float __fast_log1p(float);
double __fast_sqrt(float);
float fabsf(float);
int /*<<< orphan*/ isfinite(float);
float asinhf(float x) {
  float z;
  if (!isfinite(x))
    return x;
  z = fabsf(x);
  z = __fast_log1p(z + z * z / (__fast_sqrt(z * z + 1.0) + 1.0));
  return (x > 0.0 ? z : -z);
}


x86 assembly (clang, -O0):
<asinhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <isfinite@plt>
cmp    $0x0,%eax
jne    115f <asinhf+0x2f>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    122d <asinhf+0xfd>
movss  -0x8(%rbp),%xmm0
movaps 0xea5(%rip),%xmm1
pand   %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe55(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <__fast_sqrt@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movsd  0xe33(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1050 <__fast_log1p@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    120c <asinhf+0xdc>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    1223 <asinhf+0xf3>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinhf>:
sub    $0x28,%rsp
movaps %xmm0,(%rsp)
call   1030 <isfinite@plt>
test   %eax,%eax
je     11c6 <asinhf+0x96>
movaps 0xeb4(%rip),%xmm0
movaps (%rsp),%xmm1
andps  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x20(%rsp)
movaps %xmm1,%xmm0
mulss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
addss  0xea7(%rip),%xmm0
call   1040 <__fast_sqrt@plt>
addsd  0xea2(%rip),%xmm0
movsd  0x18(%rsp),%xmm1
divsd  %xmm0,%xmm1
addsd  0x20(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
call   1050 <__fast_log1p@plt>
movaps 0xe67(%rip),%xmm1
xorps  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss (%rsp),%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm0,%xmm2
movaps %xmm2,%xmm0
add    $0x28,%rsp
ret
movaps (%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @asinhf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = call i32 @isfinite(float %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load float, float* %3
store float %9, float* %2
br label %41
10: ; preds = %1
%11 = load float, float* %3
%12 = call float @llvm.fabs.f32(float %11)
store float %12, float* %4
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = load float, float* %4
%16 = load float, float* %4
%17 = fmul float %15, %16
%18 = fpext float %17 to double
%19 = load float, float* %4
%20 = load float, float* %4
%21 = fmul float %19, %20
%22 = fpext float %21 to double
%23 = fadd double %22, 1.000000e+00
%24 = fptrunc double %23 to float
%25 = call double @__fast_sqrt(float %24)
%26 = fadd double %25, 1.000000e+00
%27 = fdiv double %18, %26
%28 = fadd double %14, %27
%29 = fptrunc double %28 to float
%30 = call float @__fast_log1p(float %29)
store float %30, float* %4
%31 = load float, float* %3
%32 = fpext float %31 to double
%33 = fcmp ogt double %32, 0.000000e+00
br i1 %33, label %34, label %36
34: ; preds = %10
%35 = load float, float* %4
br label %39
36: ; preds = %10
%37 = load float, float* %4
%38 = fneg float %37
br label %39
39: ; preds = %36, %34
%40 = phi float [ %35, %34 ], [ %38, %36 ]
store float %40, float* %2
br label %41
41: ; preds = %39, %8
%42 = load float, float* %2
ret float %42
}

LLVM IR (-O2):
define float @asinhf(float %0) {
%2 = tail call i32 @isfinite(float %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1
%5 = tail call float @llvm.fabs.f32(float %0)
%6 = fpext float %5 to double
%7 = fmul float %0, %0
%8 = fpext float %7 to double
%9 = fadd float %7, 1.000000e+00
%10 = tail call double @__fast_sqrt(float %9)
%11 = fadd double %10, 1.000000e+00
%12 = fdiv double %8, %11
%13 = fadd double %12, %6
%14 = fptrunc double %13 to float
%15 = tail call float @__fast_log1p(float %14)
%16 = fcmp ogt float %0, 0.000000e+00
%17 = fneg float %15
%18 = select i1 %16, float %15, float %17
br label %19
19: ; preds = %1, %4
%20 = phi float [ %18, %4 ], [ %0, %1 ]
ret float %20
}