#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__ rintfk(float);
__attribute__((always_)) const float expk3f(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 = mlaf(s * s, u, s + 1.0f);
  u = ldexpkf(u, q);
  if (d < -104)
    u = 0;
  return u;
}


x86 assembly (clang, -O0):
<expk3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1040 <rintfk@plt>
mov    %eax,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xec0(%rip),%xmm1
call   1030 <mlaf@plt>
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  0xea0(%rip),%xmm1
call   1030 <mlaf@plt>
movss  %xmm0,-0xc(%rbp)
movss  0xe8a(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xe6f(%rip),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xe4f(%rip),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xe2f(%rip),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xe0f(%rip),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xdef(%rip),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  0xdca(%rip),%xmm2
addss  -0xc(%rbp),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1050 <ldexpkf@plt>
movss  %xmm0,-0x10(%rbp)
movss  0xd9d(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1275 <expk3f+0x145>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expk3f>:
push   %rbx
sub    $0x20,%rsp
movaps %xmm0,%xmm1
movaps %xmm0,0x10(%rsp)
movss  0xebb(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1040 <rintfk@plt>
mov    %rax,%rbx
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
movss  %xmm0,0xc(%rsp)
movss  0xe9e(%rip),%xmm1
movaps 0x10(%rsp),%xmm2
call   1030 <mlaf@plt>
movaps %xmm0,%xmm2
movss  0xe8d(%rip),%xmm1
movss  0xc(%rsp),%xmm0
call   1030 <mlaf@plt>
movaps %xmm0,%xmm1
movss  %xmm0,0xc(%rsp)
movss  0xe75(%rip),%xmm0
movss  0xe71(%rip),%xmm2
call   1030 <mlaf@plt>
movss  0xe68(%rip),%xmm2
movss  0xc(%rsp),%xmm1
call   1030 <mlaf@plt>
movss  0xe59(%rip),%xmm2
movss  0xc(%rsp),%xmm1
call   1030 <mlaf@plt>
movss  0xe4a(%rip),%xmm2
movss  0xc(%rsp),%xmm1
call   1030 <mlaf@plt>
movss  0xe3b(%rip),%xmm2
movss  0xc(%rsp),%xmm1
call   1030 <mlaf@plt>
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm2
movaps %xmm2,%xmm0
mulss  %xmm2,%xmm0
addss  0xe1c(%rip),%xmm2
call   1030 <mlaf@plt>
mov    %ebx,%edi
call   1050 <ldexpkf@plt>
movaps 0x10(%rsp),%xmm1
cmpltss 0xe06(%rip),%xmm1
andnps %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @expk3f(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 = 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 0x3F2A057B40000000, float* %5
%18 = load float, float* %5
%19 = load float, float* %4
%20 = call float @mlaf(float %18, float %19, float 0x3F56D2D920000000)
store float %20, float* %5
%21 = load float, float* %5
%22 = load float, float* %4
%23 = call float @mlaf(float %21, float %22, float 0x3F811114C0000000)
store float %23, float* %5
%24 = load float, float* %5
%25 = load float, float* %4
%26 = call float @mlaf(float %24, float %25, float 0x3FA5554F40000000)
store float %26, float* %5
%27 = load float, float* %5
%28 = load float, float* %4
%29 = call float @mlaf(float %27, float %28, float 0x3FC5555560000000)
store float %29, float* %5
%30 = load float, float* %5
%31 = load float, float* %4
%32 = call float @mlaf(float %30, float %31, float 5.000000e-01)
store float %32, float* %5
%33 = load float, float* %4
%34 = load float, float* %4
%35 = fmul float %33, %34
%36 = load float, float* %5
%37 = load float, float* %4
%38 = fadd float %37, 1.000000e+00
%39 = call float @mlaf(float %35, float %36, float %38)
store float %39, float* %5
%40 = load float, float* %5
%41 = load i32, i32* %3
%42 = call float @ldexpkf(float %40, i32 %41)
store float %42, float* %5
%43 = load float, float* %2
%44 = fcmp olt float %43, -1.040000e+02
br i1 %44, label %45, label %46
45: ; preds = %1
store float 0.000000e+00, float* %5
br label %46
46: ; preds = %45, %1
%47 = load float, float* %5
ret float %47
}

LLVM IR (-O2):
define float @expk3f(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 = 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 0x3F2A057B40000000, float %7, float 0x3F56D2D920000000)
%9 = tail call float @mlaf(float %8, float %7, float 0x3F811114C0000000)
%10 = tail call float @mlaf(float %9, float %7, float 0x3FA5554F40000000)
%11 = tail call float @mlaf(float %10, float %7, float 0x3FC5555560000000)
%12 = tail call float @mlaf(float %11, float %7, float 5.000000e-01)
%13 = fmul float %7, %7
%14 = fadd float %7, 1.000000e+00
%15 = tail call float @mlaf(float %13, float %12, float %14)
%16 = tail call float @ldexpkf(float %15, i32 %4)
%17 = fcmp olt float %0, -1.040000e+02
%18 = select i1 %17, float 0.000000e+00, float %16
ret float %18
}