#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 __builtin_inf();
double ldexp2k(double, int);
double mla(double, double, double);
scalar_t__ rintk(double);
__attribute__((visibility("default"))) const double xexp2_u35(double d) {
  int q = (int)rintk(d);
  double s, u;
  s = d - q;
  u = +0.4434359082926529454e-9;
  u = mla(u, s, +0.7073164598085707425e-8);
  u = mla(u, s, +0.1017819260921760451e-6);
  u = mla(u, s, +0.1321543872511327615e-5);
  u = mla(u, s, +0.1525273353517584730e-4);
  u = mla(u, s, +0.1540353045101147808e-3);
  u = mla(u, s, +0.1333355814670499073e-2);
  u = mla(u, s, +0.9618129107597600536e-2);
  u = mla(u, s, +0.5550410866482046596e-1);
  u = mla(u, s, +0.2402265069591012214e+0);
  u = mla(u, s, +0.6931471805599452862e+0);
  u = mla(u, s, +0.1000000000000000000e+1);
  u = ldexp2k(u, q);
  if (d >= 1024)
    u = __builtin_inf();
  if (d < -2000)
    u = 0;
  return u;
}


x86 assembly (clang, -O0):
<xexp2_u35>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <rintk@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xefb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xedc(%rip),%xmm2
call   1050 <mla@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xeb8(%rip),%xmm2
call   1050 <mla@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe94(%rip),%xmm2
call   1050 <mla@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe70(%rip),%xmm2
call   1050 <mla@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe4c(%rip),%xmm2
call   1050 <mla@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe28(%rip),%xmm2
call   1050 <mla@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe04(%rip),%xmm2
call   1050 <mla@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xde0(%rip),%xmm2
call   1050 <mla@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xdbc(%rip),%xmm2
call   1050 <mla@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xd98(%rip),%xmm2
call   1050 <mla@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xd74(%rip),%xmm2
call   1050 <mla@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1040 <ldexp2k@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xd43(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     12d4 <xexp2_u35+0x1a4>
movsd  0xd99(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xd94(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    12ef <xexp2_u35+0x1bf>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xexp2_u35>:
push   %rbx
sub    $0x20,%rsp
movaps %xmm0,0x10(%rsp)
call   1030 <rintk@plt>
mov    %rax,%rbx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movapd 0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xe9f(%rip),%xmm0
movsd  0xe9f(%rip),%xmm2
call   1050 <mla@plt>
movsd  0xe9a(%rip),%xmm2
movsd  0x8(%rsp),%xmm1
call   1050 <mla@plt>
movsd  0xe8f(%rip),%xmm2
movsd  0x8(%rsp),%xmm1
call   1050 <mla@plt>
movsd  0xe84(%rip),%xmm2
movsd  0x8(%rsp),%xmm1
call   1050 <mla@plt>
movsd  0xe79(%rip),%xmm2
movsd  0x8(%rsp),%xmm1
call   1050 <mla@plt>
movsd  0xe6e(%rip),%xmm2
movsd  0x8(%rsp),%xmm1
call   1050 <mla@plt>
movsd  0xe63(%rip),%xmm2
movsd  0x8(%rsp),%xmm1
call   1050 <mla@plt>
movsd  0xe58(%rip),%xmm2
movsd  0x8(%rsp),%xmm1
call   1050 <mla@plt>
movsd  0xe4d(%rip),%xmm2
movsd  0x8(%rsp),%xmm1
call   1050 <mla@plt>
movsd  0xe42(%rip),%xmm2
movsd  0x8(%rsp),%xmm1
call   1050 <mla@plt>
movsd  0xe37(%rip),%xmm2
movsd  0x8(%rsp),%xmm1
call   1050 <mla@plt>
mov    %ebx,%edi
call   1040 <ldexp2k@plt>
movsd  0xe25(%rip),%xmm1
movapd 0x10(%rsp),%xmm3
cmpnlesd %xmm3,%xmm1
andpd  %xmm1,%xmm0
movsd  0xe16(%rip),%xmm2
andnpd %xmm2,%xmm1
orpd   %xmm0,%xmm1
movapd %xmm3,%xmm0
cmpltsd 0xe09(%rip),%xmm0
andnpd %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @xexp2_u35(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = call i64 @rintk(double %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
%9 = load double, double* %2
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to double
%12 = fsub double %9, %11
store double %12, double* %4
store double 0x3DFE7901CA95E150, double* %5
%13 = load double, double* %5
%14 = load double, double* %4
%15 = call double @mla(double %13, double %14, double 0x3E3E6106D72C1C17)
store double %15, double* %5
%16 = load double, double* %5
%17 = load double, double* %4
%18 = call double @mla(double %16, double %17, double 0x3E7B5266946BF979)
store double %18, double* %5
%19 = load double, double* %5
%20 = load double, double* %4
%21 = call double @mla(double %19, double %20, double 0x3EB62BFCDABCBB81)
store double %21, double* %5
%22 = load double, double* %5
%23 = load double, double* %4
%24 = call double @mla(double %22, double %23, double 0x3EEFFCBFBC12CC80)
store double %24, double* %5
%25 = load double, double* %5
%26 = load double, double* %4
%27 = call double @mla(double %25, double %26, double 0x3F24309130CB34EC)
store double %27, double* %5
%28 = load double, double* %5
%29 = load double, double* %4
%30 = call double @mla(double %28, double %29, double 0x3F55D87FE78C5960)
store double %30, double* %5
%31 = load double, double* %5
%32 = load double, double* %4
%33 = call double @mla(double %31, double %32, double 0x3F83B2AB6FBA08F0)
store double %33, double* %5
%34 = load double, double* %5
%35 = load double, double* %4
%36 = call double @mla(double %34, double %35, double 0x3FAC6B08D704A01F)
store double %36, double* %5
%37 = load double, double* %5
%38 = load double, double* %4
%39 = call double @mla(double %37, double %38, double 0x3FCEBFBDFF82C5A1)
store double %39, double* %5
%40 = load double, double* %5
%41 = load double, double* %4
%42 = call double @mla(double %40, double %41, double 0x3FE62E42FEFA39EF)
store double %42, double* %5
%43 = load double, double* %5
%44 = load double, double* %4
%45 = call double @mla(double %43, double %44, double 1.000000e+00)
store double %45, double* %5
%46 = load double, double* %5
%47 = load i32, i32* %3
%48 = call double @ldexp2k(double %46, i32 %47)
store double %48, double* %5
%49 = load double, double* %2
%50 = fcmp oge double %49, 1.024000e+03
br i1 %50, label %51, label %52
51: ; preds = %1
store double 0x7FF0000000000000, double* %5
br label %52
52: ; preds = %51, %1
%53 = load double, double* %2
%54 = fcmp olt double %53, -2.000000e+03
br i1 %54, label %55, label %56
55: ; preds = %52
store double 0.000000e+00, double* %5
br label %56
56: ; preds = %55, %52
%57 = load double, double* %5
ret double %57
}

LLVM IR (-O2):
define double @xexp2_u35(double %0) {
%2 = tail call i64 @rintk(double %0)
%3 = trunc i64 %2 to i32
%4 = sitofp i32 %3 to double
%5 = fsub double %0, %4
%6 = tail call double @mla(double 0x3DFE7901CA95E150, double %5, double 0x3E3E6106D72C1C17)
%7 = tail call double @mla(double %6, double %5, double 0x3E7B5266946BF979)
%8 = tail call double @mla(double %7, double %5, double 0x3EB62BFCDABCBB81)
%9 = tail call double @mla(double %8, double %5, double 0x3EEFFCBFBC12CC80)
%10 = tail call double @mla(double %9, double %5, double 0x3F24309130CB34EC)
%11 = tail call double @mla(double %10, double %5, double 0x3F55D87FE78C5960)
%12 = tail call double @mla(double %11, double %5, double 0x3F83B2AB6FBA08F0)
%13 = tail call double @mla(double %12, double %5, double 0x3FAC6B08D704A01F)
%14 = tail call double @mla(double %13, double %5, double 0x3FCEBFBDFF82C5A1)
%15 = tail call double @mla(double %14, double %5, double 0x3FE62E42FEFA39EF)
%16 = tail call double @mla(double %15, double %5, double 1.000000e+00)
%17 = tail call double @ldexp2k(double %16, i32 %3)
%18 = fcmp ult double %0, 1.024000e+03
%19 = select i1 %18, double %17, double 0x7FF0000000000000
%20 = fcmp olt double %0, -2.000000e+03
%21 = select i1 %20, double 0.000000e+00, double %19
ret double %21
}