#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;
double M_PI_4;
int exp(double);
double log1p(int);
double pow(int, double);
double sinh(double);
double ftrans(double y) {
  double x = M_PI * sinh(y);
  double t;
  if (x >= 0) {
    t = x + log1p(exp(-x));
  } else {
    t = log1p(exp(x));
  }
  return pow(M_PI_4 * t, M_PI_4) / pow(1 + exp(x), M_PI_4);
}


x86 assembly (clang, -O0):
<ftrans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2e94(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sinh@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11d2 <ftrans+0x92>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
call   1060 <log1p@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11e8 <ftrans+0xa8>
movsd  -0x10(%rbp),%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
call   1060 <log1p@plt>
movsd  %xmm0,-0x18(%rbp)
mov    0x2df1(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
mov    0x2ddd(%rip),%rax
movsd  (%rax),%xmm0
call   1050 <pow@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
add    $0x1,%edi
mov    0x2db9(%rip),%rax
movsd  (%rax),%xmm0
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftrans>:
push   %rbx
sub    $0x20,%rsp
mov    0x2e9c(%rip),%rax
movsd  (%rax),%xmm1
movsd  %xmm1,(%rsp)
call   1030 <sinh@plt>
mulsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
movapd %xmm0,(%rsp)
ucomisd %xmm1,%xmm0
jae    1181 <ftrans+0x41>
movapd (%rsp),%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
call   1060 <log1p@plt>
jmp    119f <ftrans+0x5f>
movapd 0xe77(%rip),%xmm0
xorpd  (%rsp),%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
call   1060 <log1p@plt>
addsd  (%rsp),%xmm0
mov    0x2e3a(%rip),%rbx
movsd  (%rbx),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movapd %xmm1,%xmm0
call   1050 <pow@plt>
movsd  %xmm0,0x18(%rsp)
movaps (%rsp),%xmm0
call   1040 <exp@plt>
lea    0x1(%rax),%edi
movsd  (%rbx),%xmm0
call   1050 <pow@plt>
movsd  0x18(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
@M_PI_4 = 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
%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 = fcmp oge double %9, 0.000000e+00
br i1 %10, label %11, label %18
11: ; preds = %1
%12 = load double, double* %3
%13 = load double, double* %3
%14 = fneg double %13
%15 = call i32 @exp(double %14)
%16 = call double @log1p(i32 %15)
%17 = fadd double %12, %16
store double %17, double* %4
br label %22
18: ; preds = %1
%19 = load double, double* %3
%20 = call i32 @exp(double %19)
%21 = call double @log1p(i32 %20)
store double %21, double* %4
br label %22
22: ; preds = %18, %11
%23 = load double, double* @M_PI_4
%24 = load double, double* %4
%25 = fmul double %23, %24
%26 = fptosi double %25 to i32
%27 = load double, double* @M_PI_4
%28 = call double @pow(i32 %26, double %27)
%29 = load double, double* %3
%30 = call i32 @exp(double %29)
%31 = add nsw i32 1, %30
%32 = load double, double* @M_PI_4
%33 = call double @pow(i32 %31, double %32)
%34 = fdiv double %28, %33
ret double %34
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
@M_PI_4 = global double 0.000000e+00
define double @ftrans(double %0) {
%2 = load double, double* @M_PI
%3 = tail call double @sinh(double %0)
%4 = fmul double %2, %3
%5 = fcmp ult double %4, 0.000000e+00
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = fneg double %4
%8 = tail call i32 @exp(double %7)
%9 = tail call double @log1p(i32 %8)
%10 = fadd double %4, %9
br label %14
11: ; preds = %1
%12 = tail call i32 @exp(double %4)
%13 = tail call double @log1p(i32 %12)
br label %14
14: ; preds = %11, %6
%15 = phi double [ %10, %6 ], [ %13, %11 ]
%16 = load double, double* @M_PI_4
%17 = fmul double %15, %16
%18 = fptosi double %17 to i32
%19 = tail call double @pow(i32 %18, double %16)
%20 = tail call i32 @exp(double %4)
%21 = add nsw i32 %20, 1
%22 = load double, double* @M_PI_4
%23 = tail call double @pow(i32 %21, double %22)
%24 = fdiv double %19, %23
ret double %24
}