#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 */
double exp(double);
double expm1(double);
double fabs(double);
double sinh(double x) {
  double t, w, h;
  int ix, jx;
  unsigned lx;
  jx = *(1 + (const int *)&x);
  ix = jx & 0x7fffffff;
  if (ix >= 0x7ff00000) {
    return x + x;
  }
  h = 0.5;
  if (jx < 0) {
    h = -h;
  }
  if (ix < 0x40360000) {
    if (ix < 0x3e300000) {
      if (1.0e307 + x > 1.0) {
        return x;
      }
    }
    t = expm1(fabs(x));
    if (ix < 0x3ff00000) {
      return h * (2.0 * t - t * t / (t + 1.0));
    }
    return h * (t + t / (t + 1.0));
  }
  if (ix < 0x40862E42) {
    return h * exp(fabs(x));
  }
  lx = ((1 >> 29) + (unsigned int)x);
  if (ix < 0x408633CE || ((ix == 0x408633ce) && (lx <= (unsigned)0x8fb9f87d))) {
    w = exp(0.5 * fabs(x));
    t = h * w;
    return t * w;
  }
  return x * 1.0e307;
}


x86 assembly (clang, -O0):
<sinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x7ff00000,-0x2c(%rbp)
jl     115f <sinh+0x3f>
movsd  -0x10(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    135f <sinh+0x23f>
movsd  0xe99(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
cmpl   $0x0,-0x30(%rbp)
jge    1197 <sinh+0x77>
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
cmpl   $0x40360000,-0x2c(%rbp)
jge    128f <sinh+0x16f>
cmpl   $0x3e300000,-0x2c(%rbp)
jge    11e4 <sinh+0xc4>
movsd  0xe4f(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xe4a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11df <sinh+0xbf>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    135f <sinh+0x23f>
jmp    11e4 <sinh+0xc4>
movsd  -0x10(%rbp),%xmm0
movaps 0xe30(%rip),%xmm1
pand   %xmm1,%xmm0
call   1040 <expm1@plt>
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x3ff00000,-0x2c(%rbp)
jge    125d <sinh+0x13d>
movsd  -0x28(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mulsd  -0x18(%rbp),%xmm2
movsd  0xde9(%rip),%xmm3
addsd  -0x18(%rbp),%xmm3
divsd  %xmm3,%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
addsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    135f <sinh+0x23f>
movsd  -0x28(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  0xd9c(%rip),%xmm3
addsd  -0x18(%rbp),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    135f <sinh+0x23f>
cmpl   $0x40862e42,-0x2c(%rbp)
jge    12d1 <sinh+0x1b1>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xd6e(%rip),%xmm1
pand   %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    135f <sinh+0x23f>
cvttsd2si -0x10(%rbp),%rax
add    $0x0,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x408633ce,-0x2c(%rbp)
jl     1304 <sinh+0x1e4>
cmpl   $0x408633ce,-0x2c(%rbp)
jne    134d <sinh+0x22d>
cmpl   $0x8fb9f87d,-0x34(%rbp)
ja     134d <sinh+0x22d>
movsd  -0x10(%rbp),%xmm1
movaps 0xd10(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xce4(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    135f <sinh+0x23f>
movsd  0xcb3(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinh>:
push   %rbx
sub    $0x10,%rsp
movq   %xmm0,%rbx
shr    $0x20,%rbx
and    $0x7fffffff,%ebx
cmp    $0x7ff00000,%ebx
jb     1145 <sinh+0x25>
addsd  %xmm0,%xmm0
jmp    1221 <sinh+0x101>
movdqa 0xeb3(%rip),%xmm2
pand   %xmm0,%xmm2
por    0xeb7(%rip),%xmm2
cmp    $0x4035ffff,%ebx
ja     11bf <sinh+0x9f>
movsd  0xec7(%rip),%xmm1
addsd  %xmm0,%xmm1
ucomisd 0xecb(%rip),%xmm1
jbe    1183 <sinh+0x63>
cmp    $0x3e300000,%ebx
jb     1221 <sinh+0x101>
movdqa %xmm2,(%rsp)
andpd  0xe90(%rip),%xmm0
call   1040 <expm1@plt>
movsd  0xea3(%rip),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
cmp    $0x3fefffff,%ebx
ja     1227 <sinh+0x107>
mulsd  %xmm0,%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm0,%xmm0
subsd  %xmm2,%xmm0
jmp    11d9 <sinh+0xb9>
cmp    $0x40862e41,%ebx
ja     11e0 <sinh+0xc0>
andpd  0xe51(%rip),%xmm0
movdqa %xmm2,(%rsp)
call   1030 <exp@plt>
movapd (%rsp),%xmm1
jmp    1219 <sinh+0xf9>
cmp    $0x408633ce,%ebx
jb     11f6 <sinh+0xd6>
jne    123a <sinh+0x11a>
cvttsd2si %xmm0,%rax
cmp    $0x8fb9f87d,%eax
ja     123a <sinh+0x11a>
andpd  0xe22(%rip),%xmm0
mulsd  0xe32(%rip),%xmm0
movdqa %xmm2,(%rsp)
call   1030 <exp@plt>
movapd (%rsp),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret
divsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movapd (%rsp),%xmm0
mulsd  %xmm2,%xmm0
jmp    1221 <sinh+0x101>
mulsd  0xdee(%rip),%xmm0
jmp    1221 <sinh+0x101>

LLVM IR (-O0):
define double @sinh(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store double %0, double* %3
%10 = bitcast double* %3 to i32*
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = and i32 %13, 2147483647
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = icmp sge i32 %15, 2146435072
br i1 %16, label %17, label %21
17: ; preds = %1
%18 = load double, double* %3
%19 = load double, double* %3
%20 = fadd double %18, %19
store double %20, double* %2
br label %102
21: ; preds = %1
store double 5.000000e-01, double* %6
%22 = load i32, i32* %8
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load double, double* %6
%26 = fneg double %25
store double %26, double* %6
br label %27
27: ; preds = %24, %21
%28 = load i32, i32* %7
%29 = icmp slt i32 %28, 1077280768
br i1 %29, label %30, label %67
30: ; preds = %27
%31 = load i32, i32* %7
%32 = icmp slt i32 %31, 1043333120
br i1 %32, label %33, label %40
33: ; preds = %30
%34 = load double, double* %3
%35 = fadd double 0x7FAC7B1F3CAC7433, %34
%36 = fcmp ogt double %35, 1.000000e+00
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = load double, double* %3
store double %38, double* %2
br label %102
39: ; preds = %33
br label %40
40: ; preds = %39, %30
%41 = load double, double* %3
%42 = call double @llvm.fabs.f64(double %41)
%43 = call double @expm1(double %42)
store double %43, double* %4
%44 = load i32, i32* %7
%45 = icmp slt i32 %44, 1072693248
br i1 %45, label %46, label %58
46: ; preds = %40
%47 = load double, double* %6
%48 = load double, double* %4
%49 = load double, double* %4
%50 = load double, double* %4
%51 = fmul double %49, %50
%52 = load double, double* %4
%53 = fadd double %52, 1.000000e+00
%54 = fdiv double %51, %53
%55 = fneg double %54
%56 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %48, double %55)
%57 = fmul double %47, %56
store double %57, double* %2
br label %102
58: ; preds = %40
%59 = load double, double* %6
%60 = load double, double* %4
%61 = load double, double* %4
%62 = load double, double* %4
%63 = fadd double %62, 1.000000e+00
%64 = fdiv double %61, %63
%65 = fadd double %60, %64
%66 = fmul double %59, %65
store double %66, double* %2
br label %102
67: ; preds = %27
%68 = load i32, i32* %7
%69 = icmp slt i32 %68, 1082535490
br i1 %69, label %70, label %76
70: ; preds = %67
%71 = load double, double* %6
%72 = load double, double* %3
%73 = call double @llvm.fabs.f64(double %72)
%74 = call double @exp(double %73)
%75 = fmul double %71, %74
store double %75, double* %2
br label %102
76: ; preds = %67
%77 = load double, double* %3
%78 = fptoui double %77 to i32
%79 = add i32 0, %78
store i32 %79, i32* %9
%80 = load i32, i32* %7
%81 = icmp slt i32 %80, 1082536910
br i1 %81, label %88, label %82
82: ; preds = %76
%83 = load i32, i32* %7
%84 = icmp eq i32 %83, 1082536910
br i1 %84, label %85, label %99
85: ; preds = %82
%86 = load i32, i32* %9
%87 = icmp ule i32 %86, -1883637635
br i1 %87, label %88, label %99
88: ; preds = %85, %76
%89 = load double, double* %3
%90 = call double @llvm.fabs.f64(double %89)
%91 = fmul double 5.000000e-01, %90
%92 = call double @exp(double %91)
store double %92, double* %5
%93 = load double, double* %6
%94 = load double, double* %5
%95 = fmul double %93, %94
store double %95, double* %4
%96 = load double, double* %4
%97 = load double, double* %5
%98 = fmul double %96, %97
store double %98, double* %2
br label %102
99: ; preds = %85, %82
%100 = load double, double* %3
%101 = fmul double %100, 0x7FAC7B1F3CAC7433
store double %101, double* %2
br label %102
102: ; preds = %99, %88, %70, %58, %46, %37, %17
%103 = load double, double* %2
ret double %103
}

LLVM IR (-O2):
define double @sinh(double %0) {
%2 = bitcast double %0 to i64
%3 = lshr i64 %2, 32
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 2147483647
%6 = icmp ugt i32 %5, 2146435071
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = fadd double %0, %0
br label %53
9: ; preds = %1
%10 = tail call double @llvm.copysign.f64(double 5.000000e-01, double %0)
%11 = icmp ult i32 %5, 1077280768
br i1 %11, label %12, label %32
12: ; preds = %9
%13 = icmp ult i32 %5, 1043333120
%14 = fadd double %0, 0x7FAC7B1F3CAC7433
%15 = fcmp ogt double %14, 1.000000e+00
%16 = and i1 %15, %13
br i1 %16, label %53, label %17
17: ; preds = %12
%18 = tail call double @llvm.fabs.f64(double %0)
%19 = tail call double @expm1(double %18)
%20 = icmp ult i32 %5, 1072693248
%21 = fadd double %19, 1.000000e+00
br i1 %20, label %22, label %28
22: ; preds = %17
%23 = fneg double %19
%24 = fmul double %19, %23
%25 = fdiv double %24, %21
%26 = tail call double @llvm.fmuladd.f64(double %19, double 2.000000e+00, double %25)
%27 = fmul double %10, %26
br label %53
28: ; preds = %17
%29 = fdiv double %19, %21
%30 = fadd double %19, %29
%31 = fmul double %10, %30
br label %53
32: ; preds = %9
%33 = icmp ult i32 %5, 1082535490
br i1 %33, label %34, label %38
34: ; preds = %32
%35 = tail call double @llvm.fabs.f64(double %0)
%36 = tail call double @exp(double %35)
%37 = fmul double %10, %36
br label %53
38: ; preds = %32
%39 = icmp ult i32 %5, 1082536910
br i1 %39, label %45, label %40
40: ; preds = %38
%41 = fptoui double %0 to i32
%42 = icmp eq i32 %5, 1082536910
%43 = icmp ult i32 %41, -1883637634
%44 = select i1 %42, i1 %43, i1 false
br i1 %44, label %45, label %51
45: ; preds = %40, %38
%46 = tail call double @llvm.fabs.f64(double %0)
%47 = fmul double %46, 5.000000e-01
%48 = tail call double @exp(double %47)
%49 = fmul double %10, %48
%50 = fmul double %48, %49
br label %53
51: ; preds = %40
%52 = fmul double %0, 0x7FAC7B1F3CAC7433
br label %53
53: ; preds = %12, %51, %45, %34, %28, %22, %7
%54 = phi double [ %8, %7 ], [ %27, %22 ], [ %31, %28 ], [ %37, %34 ], [ %50, %45 ], [ %52, %51 ], [ %0, %12 ]
ret double %54
}