#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 ldexpkf(float, int);
float mlaf(float, float, float);
scalar_t__ xisminff(float);
scalar_t__ xrintf(float);
float xexpf(float d) {
  int q = (int)xrintf(
      d *
      1.442695040888963407359924681001892137426645954152985934135449406931f);
  float s, u;
  s = mlaf(q, -0.693145751953125f, d);
  s = mlaf(q, -1.428606765330187045e-06f, s);
  u = 0.00136324646882712841033936f;
  u = mlaf(u, s, 0.00836596917361021041870117f);
  u = mlaf(u, s, 0.0416710823774337768554688f);
  u = mlaf(u, s, 0.166665524244308471679688f);
  u = mlaf(u, s, 0.499999850988388061523438f);
  u = s * s * u + s + 1.0f;
  u = ldexpkf(u, q);
  if (xisminff(d))
    u = 0;
  return u;
}


x86 assembly (clang, -O0):
<xexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xecb(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1050 <xrintf@plt>
mov    %eax,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xea8(%rip),%xmm1
call   1040 <mlaf@plt>
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  0xe88(%rip),%xmm1
call   1040 <mlaf@plt>
movss  %xmm0,-0xc(%rbp)
movss  0xe72(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xe57(%rip),%xmm2
call   1040 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xe37(%rip),%xmm2
call   1040 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xe17(%rip),%xmm2
call   1040 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xdf7(%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  0xdc5(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1060 <ldexpkf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <xisminff@plt>
cmp    $0x0,%rax
je     1272 <xexpf+0x132>
xorps  %xmm0,%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  0xeaa(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1050 <xrintf@plt>
mov    %rax,%rbx
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xe8d(%rip),%xmm1
movss  0xc(%rsp),%xmm2
call   1040 <mlaf@plt>
movaps %xmm0,%xmm2
movss  0xe7b(%rip),%xmm1
movss  0x8(%rsp),%xmm0
call   1040 <mlaf@plt>
movaps %xmm0,%xmm1
movss  %xmm0,0x8(%rsp)
movss  0xe63(%rip),%xmm0
movss  0xe5f(%rip),%xmm2
call   1040 <mlaf@plt>
movss  0xe56(%rip),%xmm2
movss  0x8(%rsp),%xmm1
call   1040 <mlaf@plt>
movss  0xe47(%rip),%xmm2
movss  0x8(%rsp),%xmm1
call   1040 <mlaf@plt>
movss  0xe38(%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  0xe14(%rip),%xmm0
mov    %ebx,%edi
call   1060 <ldexpkf@plt>
movss  %xmm0,0x8(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <xisminff@plt>
movss  0x8(%rsp),%xmm0
test   %rax,%rax
je     1232 <xexpf+0xf2>
xorps  %xmm0,%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 @xrintf(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 = call float @mlaf(float %11, float 0xBFE62E4000000000, float %12)
store float %13, float* %4
%14 = load i32, i32* %3
%15 = sitofp i32 %14 to float
%16 = load float, float* %4
%17 = call float @mlaf(float %15, float 0xBEB7F7D1C0000000, float %16)
store float %17, float* %4
store float 0x3F5655DEC0000000, float* %5
%18 = load float, float* %5
%19 = load float, float* %4
%20 = call float @mlaf(float %18, float %19, float 0x3F81222D60000000)
store float %20, float* %5
%21 = load float, float* %5
%22 = load float, float* %4
%23 = call float @mlaf(float %21, float %22, float 0x3FA555E980000000)
store float %23, float* %5
%24 = load float, float* %5
%25 = load float, float* %4
%26 = call float @mlaf(float %24, float %25, float 0x3FC5554BC0000000)
store float %26, float* %5
%27 = load float, float* %5
%28 = load float, float* %4
%29 = call float @mlaf(float %27, float %28, float 0x3FDFFFFF60000000)
store float %29, float* %5
%30 = load float, float* %4
%31 = load float, float* %4
%32 = fmul float %30, %31
%33 = load float, float* %5
%34 = load float, float* %4
%35 = call float @llvm.fmuladd.f32(float %32, float %33, float %34)
%36 = fadd float %35, 1.000000e+00
store float %36, float* %5
%37 = load float, float* %5
%38 = load i32, i32* %3
%39 = call float @ldexpkf(float %37, i32 %38)
store float %39, float* %5
%40 = load float, float* %2
%41 = call i64 @xisminff(float %40)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %1
store float 0.000000e+00, float* %5
br label %44
44: ; preds = %43, %1
%45 = load float, float* %5
ret float %45
}

LLVM IR (-O2):
define float @xexpf(float %0) {
%2 = fmul float %0, 0x3FF7154760000000
%3 = tail call i64 @xrintf(float %2)
%4 = trunc i64 %3 to i32
%5 = sitofp i32 %4 to float
%6 = tail call float @mlaf(float %5, float 0xBFE62E4000000000, float %0)
%7 = tail call float @mlaf(float %5, float 0xBEB7F7D1C0000000, float %6)
%8 = tail call float @mlaf(float 0x3F5655DEC0000000, float %7, float 0x3F81222D60000000)
%9 = tail call float @mlaf(float %8, float %7, float 0x3FA555E980000000)
%10 = tail call float @mlaf(float %9, float %7, float 0x3FC5554BC0000000)
%11 = tail call float @mlaf(float %10, float %7, float 0x3FDFFFFF60000000)
%12 = fmul float %7, %7
%13 = tail call float @llvm.fmuladd.f32(float %12, float %11, float %7)
%14 = fadd float %13, 1.000000e+00
%15 = tail call float @ldexpkf(float %14, i32 %4)
%16 = tail call i64 @xisminff(float %0)
%17 = icmp eq i64 %16, 0
%18 = select i1 %17, float %15, float 0.000000e+00
ret float %18
}