#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 */
int exp(double);
double sinh(double arg) {
  double temp, argsq;
  register int sign;
  sign = 1;
  if (arg < 0) {
    arg = -arg;
    sign = -1;
  }
  if (arg > 21.) {
    temp = exp(arg) / 2;
    if (sign > 0)
      return (temp);
    else
      return (-temp);
  }
  if (arg > 0.5) {
    return (sign * (exp(arg) - exp(-arg)) / 2);
  }
  argsq = arg * arg;
  temp = (((-0.263056321339750e+2 * argsq + -0.289421135598956e+4) * argsq +
           -0.899127202203951e+5) *
              argsq +
          -0.630767364049772e+6) *
         arg;
  temp /= (((argsq + -0.173678953558234e+3) * argsq + 0.152151737879002e+5) *
               argsq +
           -0.630767364049772e+6);
  return (sign * temp);
}


x86 assembly (clang, -O0):
<sinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movl   $0x1,-0x24(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115a <sinh+0x4a>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0xffffffff,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe99(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11cb <sinh+0xbb>
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    11a5 <sinh+0x95>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12ed <sinh+0x1dd>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12ed <sinh+0x1dd>
movsd  -0x10(%rbp),%xmm0
movsd  0xe30(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1239 <sinh+0x129>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
mov    %eax,-0x2c(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    -0x2c(%rbp),%ecx
mov    %eax,%edx
mov    -0x28(%rbp),%eax
sub    %edx,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12ed <sinh+0x1dd>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xddb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdd7(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdb2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd85(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xd7f(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xd61(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xd44(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x24(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinh>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movapd %xmm0,%xmm2
xorpd  %xmm3,%xmm3
xor    %eax,%eax
ucomisd %xmm0,%xmm3
setbe  %cl
movapd 0xed1(%rip),%xmm1
xorpd  %xmm0,%xmm1
cmpltsd %xmm3,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
ucomisd 0xec4(%rip),%xmm0
jbe    1184 <sinh+0x74>
movapd %xmm2,(%rsp)
call   1030 <exp@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorpd  %xmm0,%xmm0
ucomisd (%rsp),%xmm0
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
jbe    1234 <sinh+0x124>
xorpd  0xe81(%rip),%xmm0
jmp    1234 <sinh+0x124>
mov    %cl,%al
lea    (%rax,%rax,1),%ebp
add    $0xffffffff,%ebp
ucomisd 0xe84(%rip),%xmm0
jbe    11c9 <sinh+0xb9>
movapd %xmm0,(%rsp)
call   1030 <exp@plt>
mov    %eax,%ebx
movaps 0xe57(%rip),%xmm0
xorps  (%rsp),%xmm0
call   1030 <exp@plt>
sub    %eax,%ebx
imul   %ebp,%ebx
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
sar    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
jmp    1234 <sinh+0x124>
movapd %xmm0,%xmm4
mulsd  %xmm0,%xmm4
movsd  0xe47(%rip),%xmm1
mulsd  %xmm4,%xmm1
addsd  0xe43(%rip),%xmm1
mulsd  %xmm4,%xmm1
addsd  0xe3f(%rip),%xmm1
mulsd  %xmm4,%xmm1
movsd  0xe3b(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe33(%rip),%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm4,%xmm3
addsd  0xe2b(%rip),%xmm3
mulsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
divsd  %xmm3,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  %xmm1,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @sinh(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %3
store i32 1, i32* %6
%7 = load double, double* %3
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load double, double* %3
%11 = fneg double %10
store double %11, double* %3
store i32 -1, i32* %6
br label %12
12: ; preds = %9, %1
%13 = load double, double* %3
%14 = fcmp ogt double %13, 2.100000e+01
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = load double, double* %3
%17 = call i32 @exp(double %16)
%18 = sdiv i32 %17, 2
%19 = sitofp i32 %18 to double
store double %19, double* %4
%20 = load i32, i32* %6
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %15
%23 = load double, double* %4
store double %23, double* %2
br label %65
24: ; preds = %15
%25 = load double, double* %4
%26 = fneg double %25
store double %26, double* %2
br label %65
27: ; preds = %12
%28 = load double, double* %3
%29 = fcmp ogt double %28, 5.000000e-01
br i1 %29, label %30, label %41
30: ; preds = %27
%31 = load i32, i32* %6
%32 = load double, double* %3
%33 = call i32 @exp(double %32)
%34 = load double, double* %3
%35 = fneg double %34
%36 = call i32 @exp(double %35)
%37 = sub nsw i32 %33, %36
%38 = mul nsw i32 %31, %37
%39 = sdiv i32 %38, 2
%40 = sitofp i32 %39 to double
store double %40, double* %2
br label %65
41: ; preds = %27
%42 = load double, double* %3
%43 = load double, double* %3
%44 = fmul double %42, %43
store double %44, double* %5
%45 = load double, double* %5
%46 = call double @llvm.fmuladd.f64(double 0xC03A4E3DE8540781, double %45, double 0xC0A69C6C36DA2DF3)
%47 = load double, double* %5
%48 = call double @llvm.fmuladd.f64(double %46, double %47, double 0xC0F5F38B8605D22E)
%49 = load double, double* %5
%50 = call double @llvm.fmuladd.f64(double %48, double %49, double 0xC1233FDEBA64BB52)
%51 = load double, double* %3
%52 = fmul double %50, %51
store double %52, double* %4
%53 = load double, double* %5
%54 = fadd double %53, 0xC065B5B9FCD003C6
%55 = load double, double* %5
%56 = call double @llvm.fmuladd.f64(double %54, double %55, double 0x40CDB7963EAE91E6)
%57 = load double, double* %5
%58 = call double @llvm.fmuladd.f64(double %56, double %57, double 0xC1233FDEBA64BB52)
%59 = load double, double* %4
%60 = fdiv double %59, %58
store double %60, double* %4
%61 = load i32, i32* %6
%62 = sitofp i32 %61 to double
%63 = load double, double* %4
%64 = fmul double %62, %63
store double %64, double* %2
br label %65
65: ; preds = %41, %30, %24, %22
%66 = load double, double* %2
ret double %66
}

LLVM IR (-O2):
define double @sinh(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = select i1 %2, i32 -1, i32 1
%6 = fcmp ogt double %4, 2.100000e+01
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = tail call i32 @exp(double %4)
%9 = sdiv i32 %8, 2
%10 = sitofp i32 %9 to double
br i1 %2, label %11, label %35
11: ; preds = %7
%12 = fneg double %10
br label %35
13: ; preds = %1
%14 = fcmp ogt double %4, 5.000000e-01
br i1 %14, label %15, label %23
15: ; preds = %13
%16 = tail call i32 @exp(double %4)
%17 = fneg double %4
%18 = tail call i32 @exp(double %17)
%19 = sub nsw i32 %16, %18
%20 = mul nsw i32 %19, %5
%21 = sdiv i32 %20, 2
%22 = sitofp i32 %21 to double
br label %35
23: ; preds = %13
%24 = fmul double %4, %4
%25 = tail call double @llvm.fmuladd.f64(double %24, double 0xC03A4E3DE8540781, double 0xC0A69C6C36DA2DF3)
%26 = tail call double @llvm.fmuladd.f64(double %25, double %24, double 0xC0F5F38B8605D22E)
%27 = tail call double @llvm.fmuladd.f64(double %26, double %24, double 0xC1233FDEBA64BB52)
%28 = fmul double %4, %27
%29 = fadd double %24, 0xC065B5B9FCD003C6
%30 = tail call double @llvm.fmuladd.f64(double %29, double %24, double 0x40CDB7963EAE91E6)
%31 = tail call double @llvm.fmuladd.f64(double %30, double %24, double 0xC1233FDEBA64BB52)
%32 = fdiv double %28, %31
%33 = sitofp i32 %5 to double
%34 = fmul double %32, %33
br label %35
35: ; preds = %7, %23, %15, %11
%36 = phi double [ %12, %11 ], [ %22, %15 ], [ %34, %23 ], [ %10, %7 ]
ret double %36
}