#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 */
long double __builtin_huge_vall();
long double expl(long double);
long double fabsl(long double);
long double floorl(long double);
long double expx2l(long double x) {
  long double u, u1, m, f;
  x = fabsl(x);
  m = 3.0517578125e-5L * floorl(32768.0L * x + 0.5L);
  f = x - m;
  u = m * m;
  u1 = 2 * m * f + f * f;
  if ((u + u1) > 1.1356523406294143949492E4L)
    return (__builtin_huge_vall());
  u = expl(u) * expl(u1);
  return (u);
}


x86 assembly (clang, -O0):
<expx2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fabs
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
flds   0xebe(%rip)
fmulp  %st,%st(1)
flds   0xeba(%rip)
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <floorl@plt>
flds   0xeac(%rip)
fmulp  %st,%st(1)
fstpt  -0x50(%rbp)
fldt   -0x20(%rbp)
fldt   -0x50(%rbp)
fsubrp %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x50(%rbp)
fmul   %st,%st(0)
fstpt  -0x30(%rbp)
fldt   -0x50(%rbp)
fadd   %st,%st(0)
fldt   -0x60(%rbp)
fld    %st(0)
fmul   %st(1),%st
fxch   %st(2)
fmulp  %st,%st(1)
faddp  %st,%st(1)
fstpt  -0x40(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
faddp  %st,%st(1)
fldt   0xe79(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    11b6 <expx2l+0x96>
jmp    11a8 <expx2l+0x88>
flds   0xe5e(%rip)
fstpt  -0x10(%rbp)
jmp    11e1 <expx2l+0xc1>
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expl@plt>
fstpt  -0x6c(%rbp)
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expl@plt>
fldt   -0x6c(%rbp)
fmulp  %st,%st(1)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expx2l>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fabs
fld    %st(0)
fstpt  0x10(%rsp)
fmuls  0xeca(%rip)
fadds  0xec8(%rip)
fstpt  (%rsp)
call   1040 <floorl@plt>
fmuls  0xebe(%rip)
fldt   0x10(%rsp)
fsub   %st(1),%st
fld    %st(1)
fmul   %st(2),%st
fxch   %st(2)
fadd   %st,%st(0)
fld    %st(1)
fmul   %st(2),%st
fxch   %st(1)
fmulp  %st,%st(2)
faddp  %st,%st(1)
fld    %st(1)
fadd   %st(1),%st
flds   0xea0(%rip)
fldt   0xe9e(%rip)
fxch   %st(2)
fucomip %st(2),%st
fstp   %st(1)
ja     11a8 <expx2l+0x88>
fstp   %st(0)
fxch   %st(1)
fstpt  (%rsp)
fstpt  0x1c(%rsp)
call   1030 <expl@plt>
fstpt  0x10(%rsp)
fldt   0x1c(%rsp)
fstpt  (%rsp)
call   1030 <expl@plt>
fldt   0x10(%rsp)
fmulp  %st,%st(1)
fldz
fldz
fxch   %st(1)
fxch   %st(2)
fstp   %st(2)
fstp   %st(0)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @expx2l(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
%8 = load x86_fp80, x86_fp80* %3
%9 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %8)
store x86_fp80 %9, x86_fp80* %3
%10 = load x86_fp80, x86_fp80* %3
%11 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 0xK400E8000000000000000, x86_fp80 %10, x86_fp80 0xK3FFE8000000000000000)
%12 = call x86_fp80 @llvm.floor.f80(x86_fp80 %11)
%13 = fmul x86_fp80 0xK3FF08000000000000000, %12
store x86_fp80 %13, x86_fp80* %6
%14 = load x86_fp80, x86_fp80* %3
%15 = load x86_fp80, x86_fp80* %6
%16 = fsub x86_fp80 %14, %15
store x86_fp80 %16, x86_fp80* %7
%17 = load x86_fp80, x86_fp80* %6
%18 = load x86_fp80, x86_fp80* %6
%19 = fmul x86_fp80 %17, %18
store x86_fp80 %19, x86_fp80* %4
%20 = load x86_fp80, x86_fp80* %6
%21 = fmul x86_fp80 0xK40008000000000000000, %20
%22 = load x86_fp80, x86_fp80* %7
%23 = load x86_fp80, x86_fp80* %7
%24 = load x86_fp80, x86_fp80* %7
%25 = fmul x86_fp80 %23, %24
%26 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %21, x86_fp80 %22, x86_fp80 %25)
store x86_fp80 %26, x86_fp80* %5
%27 = load x86_fp80, x86_fp80* %4
%28 = load x86_fp80, x86_fp80* %5
%29 = fadd x86_fp80 %27, %28
%30 = fcmp ogt x86_fp80 %29, 0xK400CB17217F7D1CF79AC
br i1 %30, label %31, label %32
31: ; preds = %1
store x86_fp80 0xK7FFF8000000000000000, x86_fp80* %2
br label %39
32: ; preds = %1
%33 = load x86_fp80, x86_fp80* %4
%34 = call x86_fp80 @expl(x86_fp80 %33)
%35 = load x86_fp80, x86_fp80* %5
%36 = call x86_fp80 @expl(x86_fp80 %35)
%37 = fmul x86_fp80 %34, %36
store x86_fp80 %37, x86_fp80* %4
%38 = load x86_fp80, x86_fp80* %4
store x86_fp80 %38, x86_fp80* %2
br label %39
39: ; preds = %32, %31
%40 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %40
}

LLVM IR (-O2):
define x86_fp80 @expx2l(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.fabs.f80(x86_fp80 %0)
%3 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %2, x86_fp80 0xK400E8000000000000000, x86_fp80 0xK3FFE8000000000000000)
%4 = tail call x86_fp80 @llvm.floor.f80(x86_fp80 %3)
%5 = fmul x86_fp80 %4, 0xK3FF08000000000000000
%6 = fsub x86_fp80 %2, %5
%7 = fmul x86_fp80 %5, %5
%8 = fmul x86_fp80 %5, 0xK40008000000000000000
%9 = fmul x86_fp80 %6, %6
%10 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %8, x86_fp80 %6, x86_fp80 %9)
%11 = fadd x86_fp80 %7, %10
%12 = fcmp ogt x86_fp80 %11, 0xK400CB17217F7D1CF79AC
br i1 %12, label %17, label %13
13: ; preds = %1
%14 = tail call x86_fp80 @expl(x86_fp80 %7)
%15 = tail call x86_fp80 @expl(x86_fp80 %10)
%16 = fmul x86_fp80 %14, %15
br label %17
17: ; preds = %1, %13
%18 = phi x86_fp80 [ %16, %13 ], [ 0xK7FFF8000000000000000, %1 ]
ret x86_fp80 %18
}