#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 xexpf(float d) {
  int q = (int)rintfk(
      d *
      1.442695040888963407359924681001892137426645954152985934135449406931f);
  float s, u;
  s = mlaf(q, -0.693145751953125f, d);
  s = mlaf(q, -1.428606765330187045e-06f, s);
  u = 0.000198527617612853646278381;
  u = mlaf(u, s, 0.00139304355252534151077271);
  u = mlaf(u, s, 0.00833336077630519866943359);
  u = mlaf(u, s, 0.0416664853692054748535156);
  u = mlaf(u, s, 0.166666671633720397949219);
  u = mlaf(u, s, 0.5);
  u = s * s * u + s + 1.0f;
  u = ldexp2kf(u, q);
  if (d < -104)
    u = 0;
  if (d > 104)
    u = __builtin_inff();
  return u;
}


x86 assembly (clang, -O0):
<xexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xecf(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1050 <rintfk@plt>
mov    %eax,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movss  0xea8(%rip),%xmm1
call   1040 <mlaf@plt>
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movss  0xe84(%rip),%xmm1
call   1040 <mlaf@plt>
movss  %xmm0,-0xc(%rbp)
movss  0xe6e(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movsd  0xe8f(%rip),%xmm2
call   1040 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movsd  0xe6b(%rip),%xmm2
call   1040 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movsd  0xe47(%rip),%xmm2
call   1040 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movsd  0xe23(%rip),%xmm2
call   1040 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movsd  0xdff(%rip),%xmm2
call   1040 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xdb5(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1030 <ldexp2kf@plt>
movss  %xmm0,-0x10(%rbp)
movss  0xd8e(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1284 <xexpf+0x154>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xd87(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    12a7 <xexpf+0x177>
movss  0xd7a(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xexpf>:
push   %rbx
sub    $0x10,%rsp
movaps %xmm0,%xmm1
movss  %xmm0,0xc(%rsp)
movss  0xeba(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1050 <rintfk@plt>
mov    %rax,%rbx
cvtsi2ss %ebx,%xmm3
movss  %xmm3,0x8(%rsp)
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm2
movss  0xe96(%rip),%xmm1
movaps %xmm3,%xmm0
call   1040 <mlaf@plt>
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
movss  0xe83(%rip),%xmm1
movss  0x8(%rsp),%xmm0
call   1040 <mlaf@plt>
movaps %xmm0,%xmm1
movss  %xmm0,0x8(%rsp)
movss  0xe6b(%rip),%xmm0
movsd  0xe77(%rip),%xmm2
call   1040 <mlaf@plt>
movsd  0xe72(%rip),%xmm2
movss  0x8(%rsp),%xmm1
call   1040 <mlaf@plt>
movsd  0xe67(%rip),%xmm2
movss  0x8(%rsp),%xmm1
call   1040 <mlaf@plt>
movsd  0xe5c(%rip),%xmm2
movss  0x8(%rsp),%xmm1
call   1040 <mlaf@plt>
movsd  0xe51(%rip),%xmm2
movss  0x8(%rsp),%xmm1
call   1040 <mlaf@plt>
movss  0x8(%rsp),%xmm2
movaps %xmm2,%xmm1
mulss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
addss  0xdf9(%rip),%xmm0
mov    %ebx,%edi
call   1030 <ldexp2kf@plt>
movss  0xc(%rsp),%xmm3
movaps %xmm3,%xmm1
cmpltss 0xde4(%rip),%xmm1
andnps %xmm0,%xmm1
movss  0xddd(%rip),%xmm2
cmpltss %xmm3,%xmm2
movss  0xdd4(%rip),%xmm0
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @xexpf(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 = fmul float %6, 0x3FF7154760000000
%8 = call i64 @rintfk(float %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to float
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = call float @mlaf(float %11, float 0xBFE62E4000000000, double %13)
store float %14, float* %4
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to float
%17 = load float, float* %4
%18 = fpext float %17 to double
%19 = call float @mlaf(float %16, float 0xBEB7F7D1C0000000, double %18)
store float %19, float* %4
store float 0x3F2A057B40000000, float* %5
%20 = load float, float* %5
%21 = load float, float* %4
%22 = call float @mlaf(float %20, float %21, double 0x3F56D2D920000000)
store float %22, float* %5
%23 = load float, float* %5
%24 = load float, float* %4
%25 = call float @mlaf(float %23, float %24, double 0x3F811114C0000000)
store float %25, float* %5
%26 = load float, float* %5
%27 = load float, float* %4
%28 = call float @mlaf(float %26, float %27, double 0x3FA5554F40000000)
store float %28, float* %5
%29 = load float, float* %5
%30 = load float, float* %4
%31 = call float @mlaf(float %29, float %30, double 0x3FC5555560000000)
store float %31, float* %5
%32 = load float, float* %5
%33 = load float, float* %4
%34 = call float @mlaf(float %32, float %33, double 5.000000e-01)
store float %34, float* %5
%35 = load float, float* %4
%36 = load float, float* %4
%37 = fmul float %35, %36
%38 = load float, float* %5
%39 = load float, float* %4
%40 = call float @llvm.fmuladd.f32(float %37, float %38, float %39)
%41 = fadd float %40, 1.000000e+00
store float %41, float* %5
%42 = load float, float* %5
%43 = load i32, i32* %3
%44 = call float @ldexp2kf(float %42, i32 %43)
store float %44, float* %5
%45 = load float, float* %2
%46 = fcmp olt float %45, -1.040000e+02
br i1 %46, label %47, label %48
47: ; preds = %1
store float 0.000000e+00, float* %5
br label %48
48: ; preds = %47, %1
%49 = load float, float* %2
%50 = fcmp ogt float %49, 1.040000e+02
br i1 %50, label %51, label %52
51: ; preds = %48
store float 0x7FF0000000000000, float* %5
br label %52
52: ; preds = %51, %48
%53 = load float, float* %5
ret float %53
}

LLVM IR (-O2):
define float @xexpf(float %0) {
%2 = fmul float %0, 0x3FF7154760000000
%3 = tail call i64 @rintfk(float %2)
%4 = trunc i64 %3 to i32
%5 = sitofp i32 %4 to float
%6 = fpext float %0 to double
%7 = tail call float @mlaf(float %5, float 0xBFE62E4000000000, double %6)
%8 = fpext float %7 to double
%9 = tail call float @mlaf(float %5, float 0xBEB7F7D1C0000000, double %8)
%10 = tail call float @mlaf(float 0x3F2A057B40000000, float %9, double 0x3F56D2D920000000)
%11 = tail call float @mlaf(float %10, float %9, double 0x3F811114C0000000)
%12 = tail call float @mlaf(float %11, float %9, double 0x3FA5554F40000000)
%13 = tail call float @mlaf(float %12, float %9, double 0x3FC5555560000000)
%14 = tail call float @mlaf(float %13, float %9, double 5.000000e-01)
%15 = fmul float %9, %9
%16 = tail call float @llvm.fmuladd.f32(float %15, float %14, float %9)
%17 = fadd float %16, 1.000000e+00
%18 = tail call float @ldexp2kf(float %17, i32 %4)
%19 = fcmp olt float %0, -1.040000e+02
%20 = select i1 %19, float 0.000000e+00, float %18
%21 = fcmp ogt float %0, 1.040000e+02
%22 = select i1 %21, float 0x7FF0000000000000, float %20
ret float %22
}