#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 log(double);
double pow(double, double);
double twtailx(double tw) {
  double bot, lbot, ltop, y1, y2;
  if (tw <= 0.0)
    return 1.0;
  bot = ((1.0 / 0.5641895835477562869480795)) * 4.0;
  lbot = log(bot);
  y1 = -0.75 * log(tw);
  y2 = -2.0 * pow(tw, 1.5) / 3.0;
  ltop = y1 + y2;
  return exp(ltop - lbot);
}


x86 assembly (clang, -O0):
<twtailx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     115d <twtailx+0x2d>
movsd  0xed5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ec <twtailx+0xbc>
movsd  0xebb(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  0xe8a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe6c(%rip),%xmm1
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe54(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe40(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twtailx>:
sub    $0x18,%rsp
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    118d <twtailx+0x5d>
movsd  %xmm0,0x8(%rsp)
call   1040 <log@plt>
mulsd  0xeb7(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xeb1(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1050 <pow@plt>
addsd  %xmm0,%xmm0
divsd  0xea2(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
addsd  0xe9c(%rip),%xmm0
add    $0x18,%rsp
jmp    1030 <exp@plt>
movsd  0xe6b(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @twtailx(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %3
%9 = load double, double* %3
%10 = fcmp ole double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %1
store double 1.000000e+00, double* %2
br label %29
12: ; preds = %1
store double 0x401C5BF891B4EF6B, double* %4
%13 = load double, double* %4
%14 = call double @log(double %13)
store double %14, double* %5
%15 = load double, double* %3
%16 = call double @log(double %15)
%17 = fmul double -7.500000e-01, %16
store double %17, double* %7
%18 = load double, double* %3
%19 = call double @pow(double %18, double 1.500000e+00)
%20 = fmul double -2.000000e+00, %19
%21 = fdiv double %20, 3.000000e+00
store double %21, double* %8
%22 = load double, double* %7
%23 = load double, double* %8
%24 = fadd double %22, %23
store double %24, double* %6
%25 = load double, double* %6
%26 = load double, double* %5
%27 = fsub double %25, %26
%28 = call double @exp(double %27)
store double %28, double* %2
br label %29
29: ; preds = %12, %11
%30 = load double, double* %2
ret double %30
}

LLVM IR (-O2):
define double @twtailx(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %3, label %12
3: ; preds = %1
%4 = tail call double @log(double %0)
%5 = fmul double %4, -7.500000e-01
%6 = tail call double @pow(double %0, double 1.500000e+00)
%7 = fmul double %6, 2.000000e+00
%8 = fdiv double %7, 3.000000e+00
%9 = fsub double %5, %8
%10 = fadd double %9, 0xBFFF56AB236E0ACE
%11 = tail call double @exp(double %10)
br label %12
12: ; preds = %1, %3
%13 = phi double [ %11, %3 ], [ 1.000000e+00, %1 ]
ret double %13
}