#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 */
typedef int __m128;

/* Variables and functions */
int _mm_set1_ps(double);
__m128 very_fast_exp(__m128 x) {
  return _mm_set1_ps(1) -
         x * (_mm_set1_ps(0.9999999995) -
              x * (_mm_set1_ps(0.4999999206) -
                   x * (_mm_set1_ps(0.1666653019) -
                        x * (_mm_set1_ps(0.0416573475) -
                             x * (_mm_set1_ps(0.0083013598) -
                                  x * (_mm_set1_ps(0.0013298820) -
                                       x * (_mm_set1_ps(0.0001413161))))))));
}


x86 assembly (clang, -O0):
<very_fast_exp>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edi,-0x2c(%rbp)
movsd  0xf0c(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x34(%rbp)
movsd  0xeee(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    %eax,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
movsd  0xed0(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    %eax,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x44(%rbp)
movsd  0xeb2(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    %eax,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movsd  0xe94(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    %eax,-0x50(%rbp)
mov    -0x2c(%rbp),%ebx
movsd  0xe79(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    %eax,%r14d
mov    -0x2c(%rbp),%r15d
movsd  0xe5d(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    %eax,%r12d
mov    -0x2c(%rbp),%r13d
movsd  0xe41(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    -0x50(%rbp),%r11d
mov    -0x4c(%rbp),%r10d
mov    -0x48(%rbp),%r9d
mov    -0x44(%rbp),%r8d
mov    -0x40(%rbp),%edi
mov    -0x3c(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x34(%rbp),%ecx
imul   %eax,%r13d
mov    -0x30(%rbp),%eax
sub    %r13d,%r12d
imul   %r12d,%r15d
sub    %r15d,%r14d
imul   %r14d,%ebx
sub    %ebx,%r11d
imul   %r11d,%r10d
sub    %r10d,%r9d
imul   %r9d,%r8d
sub    %r8d,%edi
imul   %edi,%esi
sub    %esi,%edx
imul   %edx,%ecx
sub    %ecx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<very_fast_exp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,%ebx
movsd  0xedb(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    %eax,%ebp
movsd  0xed4(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    %eax,0x4(%rsp)
movsd  0xecb(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    %eax,(%rsp)
movsd  0xec3(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    %eax,%r12d
movsd  0xebb(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    %eax,%r13d
movsd  0xeb3(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    %eax,%r14d
movsd  0xeab(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
mov    %eax,%r15d
movsd  0xea3(%rip),%xmm0
call   1030 <_mm_set1_ps@plt>
imul   %ebx,%eax
sub    %r15d,%eax
imul   %ebx,%eax
add    %r14d,%eax
imul   %ebx,%eax
sub    %r13d,%eax
imul   %ebx,%eax
add    %r12d,%eax
imul   %ebx,%eax
sub    (%rsp),%eax
imul   %ebx,%eax
add    0x4(%rsp),%eax
imul   %ebx,%eax
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @very_fast_exp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_mm_set1_ps(double 1.000000e+00)
%4 = load i32, i32* %2
%5 = call i32 @_mm_set1_ps(double 0x3FEFFFFFFFBB47D0)
%6 = load i32, i32* %2
%7 = call i32 @_mm_set1_ps(double 0x3FDFFFFFAABEB1B6)
%8 = load i32, i32* %2
%9 = call i32 @_mm_set1_ps(double 0x3FC55549E284EC7A)
%10 = load i32, i32* %2
%11 = call i32 @_mm_set1_ps(double 0x3FA5541CA24D1C68)
%12 = load i32, i32* %2
%13 = call i32 @_mm_set1_ps(double 0x3F81004DA6D39E35)
%14 = load i32, i32* %2
%15 = call i32 @_mm_set1_ps(double 0x3F55C9EDECA47AEB)
%16 = load i32, i32* %2
%17 = call i32 @_mm_set1_ps(double 0x3F2285C80E48AE75)
%18 = mul nsw i32 %16, %17
%19 = sub nsw i32 %15, %18
%20 = mul nsw i32 %14, %19
%21 = sub nsw i32 %13, %20
%22 = mul nsw i32 %12, %21
%23 = sub nsw i32 %11, %22
%24 = mul nsw i32 %10, %23
%25 = sub nsw i32 %9, %24
%26 = mul nsw i32 %8, %25
%27 = sub nsw i32 %7, %26
%28 = mul nsw i32 %6, %27
%29 = sub nsw i32 %5, %28
%30 = mul nsw i32 %4, %29
%31 = sub nsw i32 %3, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @very_fast_exp(i32 %0) {
%2 = tail call i32 @_mm_set1_ps(double 1.000000e+00)
%3 = tail call i32 @_mm_set1_ps(double 0x3FEFFFFFFFBB47D0)
%4 = tail call i32 @_mm_set1_ps(double 0x3FDFFFFFAABEB1B6)
%5 = tail call i32 @_mm_set1_ps(double 0x3FC55549E284EC7A)
%6 = tail call i32 @_mm_set1_ps(double 0x3FA5541CA24D1C68)
%7 = tail call i32 @_mm_set1_ps(double 0x3F81004DA6D39E35)
%8 = tail call i32 @_mm_set1_ps(double 0x3F55C9EDECA47AEB)
%9 = tail call i32 @_mm_set1_ps(double 0x3F2285C80E48AE75)
%10 = mul nsw i32 %9, %0
%11 = sub i32 %10, %8
%12 = mul i32 %11, %0
%13 = add i32 %12, %7
%14 = mul nsw i32 %13, %0
%15 = sub i32 %14, %6
%16 = mul i32 %15, %0
%17 = add i32 %16, %5
%18 = mul nsw i32 %17, %0
%19 = sub i32 %18, %4
%20 = mul i32 %19, %0
%21 = add i32 %20, %3
%22 = mul nsw i32 %21, %0
%23 = sub nsw i32 %2, %22
ret i32 %23
}