#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 M_PI_2;
double cosh(double);
double exp(double);
double sinh(double);
double sqrt(int);
double tanh(double);
double ftrans(double y) {
  double x = M_PI_2 * sinh(y);
  double val = tanh(x);
  return sqrt(1 + val * val) * 0.5 / (exp(0.5 * x) * cosh(x));
}


x86 assembly (clang, -O0):
<ftrans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2e84(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sinh@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <tanh@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5b(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1070 <sqrt@plt>
movsd  0xe3e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe2d(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <cosh@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftrans>:
sub    $0x18,%rsp
mov    0x2e8d(%rip),%rax
movsd  (%rax),%xmm1
movsd  %xmm1,(%rsp)
call   1030 <sinh@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
call   1040 <tanh@plt>
mulsd  %xmm0,%xmm0
addsd  0xe7c(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1070 <sqrt@plt>
movapd %xmm0,%xmm1
movsd  0xe6f(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mulsd  (%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1050 <cosh@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI_2 = global double 0.000000e+00
define double @ftrans(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* @M_PI_2
%6 = load double, double* %2
%7 = call double @sinh(double %6)
%8 = fmul double %5, %7
store double %8, double* %3
%9 = load double, double* %3
%10 = call double @tanh(double %9)
store double %10, double* %4
%11 = load double, double* %4
%12 = load double, double* %4
%13 = call double @llvm.fmuladd.f64(double %11, double %12, double 1.000000e+00)
%14 = fptosi double %13 to i32
%15 = call double @sqrt(i32 %14)
%16 = fmul double %15, 5.000000e-01
%17 = load double, double* %3
%18 = fmul double 5.000000e-01, %17
%19 = call double @exp(double %18)
%20 = load double, double* %3
%21 = call double @cosh(double %20)
%22 = fmul double %19, %21
%23 = fdiv double %16, %22
ret double %23
}

LLVM IR (-O2):
@M_PI_2 = global double 0.000000e+00
define double @ftrans(double %0) {
%2 = load double, double* @M_PI_2
%3 = tail call double @sinh(double %0)
%4 = fmul double %2, %3
%5 = tail call double @tanh(double %4)
%6 = tail call double @llvm.fmuladd.f64(double %5, double %5, double 1.000000e+00)
%7 = fptosi double %6 to i32
%8 = tail call double @sqrt(i32 %7)
%9 = fmul double %8, 5.000000e-01
%10 = fmul double %4, 5.000000e-01
%11 = tail call double @exp(double %10)
%12 = tail call double @cosh(double %4)
%13 = fmul double %11, %12
%14 = fdiv double %9, %13
ret double %14
}