#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 */
float __builtin_inff();
float ldexp2kf(float, int);
float mlaf(float, float, double);
scalar_t__ rintfk(float);
__attribute__((visibility("default"))) const float xexp2f_u35(float d) {
  int q = (int)rintfk(d);
  float s, u;
  s = d - q;
  u = +0.1535920892e-3;
  u = mlaf(u, s, +0.1339262701e-2);
  u = mlaf(u, s, +0.9618384764e-2);
  u = mlaf(u, s, +0.5550347269e-1);
  u = mlaf(u, s, +0.2402264476e+0);
  u = mlaf(u, s, +0.6931471825e+0);
  u = mlaf(u, s, +0.1000000000e+1);
  u = ldexp2kf(u, q);
  if (d >= 128)
    u = __builtin_inff();
  if (d < -150)
    u = 0;
  return u;
}


x86 assembly (clang, -O0):
<xexp2f_u35>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1050 <rintfk@plt>
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xe9f(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movsd  0xebc(%rip),%xmm2
call   1040 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movsd  0xe98(%rip),%xmm2
call   1040 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movsd  0xe74(%rip),%xmm2
call   1040 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movsd  0xe50(%rip),%xmm2
call   1040 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movsd  0xe2c(%rip),%xmm2
call   1040 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movsd  0xe08(%rip),%xmm2
call   1040 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1030 <ldexp2kf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xdcf(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1247 <xexp2f_u35+0x117>
movss  0xdc6(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xdbd(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1261 <xexp2f_u35+0x131>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xexp2f_u35>:
push   %rbx
sub    $0x20,%rsp
movaps %xmm0,0x10(%rsp)
call   1050 <rintfk@plt>
mov    %rax,%rbx
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
movaps 0x10(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
movss  0xea0(%rip),%xmm0
movsd  0xea8(%rip),%xmm2
call   1040 <mlaf@plt>
movsd  0xea3(%rip),%xmm2
movss  0xc(%rsp),%xmm1
call   1040 <mlaf@plt>
movsd  0xe98(%rip),%xmm2
movss  0xc(%rsp),%xmm1
call   1040 <mlaf@plt>
movsd  0xe8d(%rip),%xmm2
movss  0xc(%rsp),%xmm1
call   1040 <mlaf@plt>
movsd  0xe82(%rip),%xmm2
movss  0xc(%rsp),%xmm1
call   1040 <mlaf@plt>
movsd  0xe77(%rip),%xmm2
movss  0xc(%rsp),%xmm1
call   1040 <mlaf@plt>
mov    %ebx,%edi
call   1030 <ldexp2kf@plt>
movss  0xe29(%rip),%xmm1
movaps 0x10(%rsp),%xmm3
cmpnless %xmm3,%xmm1
andps  %xmm1,%xmm0
movss  0xe18(%rip),%xmm2
andnps %xmm2,%xmm1
orps   %xmm0,%xmm1
movaps %xmm3,%xmm0
cmpltss 0xe0a(%rip),%xmm0
andnps %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @xexp2f_u35(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %2
%6 = load float, float* %2
%7 = call i64 @rintfk(float %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
%9 = load float, float* %2
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to float
%12 = fsub float %9, %11
store float %12, float* %4
store float 0x3F2421B200000000, float* %5
%13 = load float, float* %5
%14 = load float, float* %4
%15 = call float @mlaf(float %13, float %14, double 0x3F55F14660195B37)
store float %15, float* %5
%16 = load float, float* %5
%17 = load float, float* %4
%18 = call float @mlaf(float %16, float %17, double 0x3F83B2CDC003883A)
store float %18, float* %5
%19 = load float, float* %5
%20 = load float, float* %4
%21 = call float @mlaf(float %19, float %20, double 0x3FAC6AF380093490)
store float %21, float* %5
%22 = load float, float* %5
%23 = load float, float* %4
%24 = call float @mlaf(float %22, float %23, double 0x3FCEBFBD8009C2D0)
store float %24, float* %5
%25 = load float, float* %5
%26 = load float, float* %4
%27 = call float @mlaf(float %25, float %26, double 0x3FE62E430004DD8A)
store float %27, float* %5
%28 = load float, float* %5
%29 = load float, float* %4
%30 = call float @mlaf(float %28, float %29, double 1.000000e+00)
store float %30, float* %5
%31 = load float, float* %5
%32 = load i32, i32* %3
%33 = call float @ldexp2kf(float %31, i32 %32)
store float %33, float* %5
%34 = load float, float* %2
%35 = fcmp oge float %34, 1.280000e+02
br i1 %35, label %36, label %37
36: ; preds = %1
store float 0x7FF0000000000000, float* %5
br label %37
37: ; preds = %36, %1
%38 = load float, float* %2
%39 = fcmp olt float %38, -1.500000e+02
br i1 %39, label %40, label %41
40: ; preds = %37
store float 0.000000e+00, float* %5
br label %41
41: ; preds = %40, %37
%42 = load float, float* %5
ret float %42
}

LLVM IR (-O2):
define float @xexp2f_u35(float %0) {
%2 = tail call i64 @rintfk(float %0)
%3 = trunc i64 %2 to i32
%4 = sitofp i32 %3 to float
%5 = fsub float %0, %4
%6 = tail call float @mlaf(float 0x3F2421B200000000, float %5, double 0x3F55F14660195B37)
%7 = tail call float @mlaf(float %6, float %5, double 0x3F83B2CDC003883A)
%8 = tail call float @mlaf(float %7, float %5, double 0x3FAC6AF380093490)
%9 = tail call float @mlaf(float %8, float %5, double 0x3FCEBFBD8009C2D0)
%10 = tail call float @mlaf(float %9, float %5, double 0x3FE62E430004DD8A)
%11 = tail call float @mlaf(float %10, float %5, double 1.000000e+00)
%12 = tail call float @ldexp2kf(float %11, i32 %3)
%13 = fcmp ult float %0, 1.280000e+02
%14 = select i1 %13, float %12, float 0x7FF0000000000000
%15 = fcmp olt float %0, -1.500000e+02
%16 = select i1 %15, float 0.000000e+00, float %14
ret float %16
}