#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 */
long double __fast_log1pl(long double);
long double __fast_sqrtl(long double);
long double fabsl(long double);
int /*<<< orphan*/ isfinite(long double);
long double asinhl(long double x) {
  long double z;
  if (!isfinite(x))
    return x;
  z = fabsl(x);
  z = __fast_log1pl(z + z * z / (__fast_sqrtl(z * z + 1.0L) + 1.0L));
  return (x > 0.0 ? z : -z);
}


x86 assembly (clang, -O0):
<asinhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <isfinite@plt>
cmp    $0x0,%eax
jne    115f <asinhl+0x2f>
fldt   -0x20(%rbp)
fstpt  -0x10(%rbp)
jmp    11d6 <asinhl+0xa6>
fldt   -0x20(%rbp)
fabs
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fld    %st(0)
fstpt  -0x3c(%rbp)
fmul   %st,%st(0)
fld    %st(0)
fstpt  -0x48(%rbp)
fld1
fld    %st(0)
fstpt  -0x54(%rbp)
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <__fast_sqrtl@plt>
fldt   -0x54(%rbp)
fldt   -0x48(%rbp)
fldt   -0x3c(%rbp)
fxch   %st(3)
faddp  %st,%st(2)
fdivp  %st,%st(1)
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__fast_log1pl@plt>
fstpt  -0x30(%rbp)
fldt   -0x20(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    11c8 <asinhl+0x98>
jmp    11bd <asinhl+0x8d>
fldt   -0x30(%rbp)
fstpt  -0x60(%rbp)
jmp    11d0 <asinhl+0xa0>
fldt   -0x30(%rbp)
fchs
fstpt  -0x60(%rbp)
fldt   -0x60(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinhl>:
sub    $0x48,%rsp
fldt   0x50(%rsp)
fld    %st(0)
fstpt  0x18(%rsp)
fstpt  (%rsp)
call   1040 <isfinite@plt>
test   %eax,%eax
je     11a1 <asinhl+0x71>
fldt   0x18(%rsp)
fld    %st(0)
fabs
fstpt  0x3c(%rsp)
fmul   %st,%st(0)
fld    %st(0)
fstpt  0x30(%rsp)
fld1
fld    %st(0)
fstpt  0x24(%rsp)
faddp  %st,%st(1)
fstpt  (%rsp)
call   1050 <__fast_sqrtl@plt>
fldt   0x24(%rsp)
faddp  %st,%st(1)
fldt   0x30(%rsp)
fdivp  %st,%st(1)
fldt   0x3c(%rsp)
faddp  %st,%st(1)
fstpt  (%rsp)
call   1030 <__fast_log1pl@plt>
fldz
fldt   0x18(%rsp)
fucomip %st(1),%st
fstp   %st(0)
fld    %st(0)
fchs
fcmovnbe %st(1),%st
fstp   %st(1)
add    $0x48,%rsp
ret
fldt   0x18(%rsp)
add    $0x48,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @asinhl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
%5 = load x86_fp80, x86_fp80* %3
%6 = call i32 @isfinite(x86_fp80 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load x86_fp80, x86_fp80* %3
store x86_fp80 %9, x86_fp80* %2
br label %34
10: ; preds = %1
%11 = load x86_fp80, x86_fp80* %3
%12 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %11)
store x86_fp80 %12, x86_fp80* %4
%13 = load x86_fp80, x86_fp80* %4
%14 = load x86_fp80, x86_fp80* %4
%15 = load x86_fp80, x86_fp80* %4
%16 = fmul x86_fp80 %14, %15
%17 = load x86_fp80, x86_fp80* %4
%18 = load x86_fp80, x86_fp80* %4
%19 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %17, x86_fp80 %18, x86_fp80 0xK3FFF8000000000000000)
%20 = call x86_fp80 @__fast_sqrtl(x86_fp80 %19)
%21 = fadd x86_fp80 %20, 0xK3FFF8000000000000000
%22 = fdiv x86_fp80 %16, %21
%23 = fadd x86_fp80 %13, %22
%24 = call x86_fp80 @__fast_log1pl(x86_fp80 %23)
store x86_fp80 %24, x86_fp80* %4
%25 = load x86_fp80, x86_fp80* %3
%26 = fcmp ogt x86_fp80 %25, 0xK00000000000000000000
br i1 %26, label %27, label %29
27: ; preds = %10
%28 = load x86_fp80, x86_fp80* %4
br label %32
29: ; preds = %10
%30 = load x86_fp80, x86_fp80* %4
%31 = fneg x86_fp80 %30
br label %32
32: ; preds = %29, %27
%33 = phi x86_fp80 [ %28, %27 ], [ %31, %29 ]
store x86_fp80 %33, x86_fp80* %2
br label %34
34: ; preds = %32, %8
%35 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %35
}

LLVM IR (-O2):
define x86_fp80 @asinhl(x86_fp80 %0) {
%2 = tail call i32 @isfinite(x86_fp80 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1
%5 = tail call x86_fp80 @llvm.fabs.f80(x86_fp80 %0)
%6 = fmul x86_fp80 %0, %0
%7 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %0, x86_fp80 %0, x86_fp80 0xK3FFF8000000000000000)
%8 = tail call x86_fp80 @__fast_sqrtl(x86_fp80 %7)
%9 = fadd x86_fp80 %8, 0xK3FFF8000000000000000
%10 = fdiv x86_fp80 %6, %9
%11 = fadd x86_fp80 %5, %10
%12 = tail call x86_fp80 @__fast_log1pl(x86_fp80 %11)
%13 = fcmp ogt x86_fp80 %0, 0xK00000000000000000000
%14 = fneg x86_fp80 %12
%15 = select i1 %13, x86_fp80 %12, x86_fp80 %14
br label %16
16: ; preds = %1, %4
%17 = phi x86_fp80 [ %15, %4 ], [ %0, %1 ]
ret x86_fp80 %17
}