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

/* Variables and functions */
int /*<<< orphan*/ _mm_add_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_add_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_castsi128_ps(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_cvtepi32_ps(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_cvtps_epi32(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_max_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_min_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_mul_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set1_epi32(int);
int /*<<< orphan*/ _mm_set1_ps(float);
int /*<<< orphan*/ _mm_slli_epi32(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_sub_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 _mm_exp2_ps(__m128 x) {
  __m128i ipart;
  __m128 fpart, expipart, expfpart;
  x = _mm_min_ps(x, _mm_set1_ps(129.00000f));
  x = _mm_max_ps(x, _mm_set1_ps(-126.99999f));
  ipart = _mm_cvtps_epi32(_mm_sub_ps(x, _mm_set1_ps(0.5f)));
  fpart = _mm_sub_ps(x, _mm_cvtepi32_ps(ipart));
  expipart = _mm_castsi128_ps(
      _mm_slli_epi32(_mm_add_epi32(ipart, _mm_set1_epi32(127)), 23));
  expfpart = _mm_add_ps(
      _mm_mul_ps(
          _mm_add_ps(
              _mm_mul_ps(
                  _mm_add_ps(
                      _mm_mul_ps(
                          _mm_add_ps(
                              _mm_mul_ps(_mm_set1_ps(1.3534167e-2f), fpart),
                              _mm_set1_ps(5.2011464e-2f)),
                          fpart),
                      _mm_set1_ps(2.4144275e-1f)),
                  fpart),
              _mm_set1_ps(6.9300383e-1f)),
          fpart),
      _mm_set1_ps(1.0000026f));
  return _mm_mul_ps(expipart, expfpart);
}


x86 assembly (clang, -O0):
<_mm_exp2_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x38(%rbp)
movss  0xe43(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    -0x38(%rbp),%edi
mov    %eax,%esi
call   1060 <_mm_min_ps@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x34(%rbp)
movss  0xe1f(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    -0x34(%rbp),%edi
mov    %eax,%esi
call   1070 <_mm_max_ps@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x30(%rbp)
movss  0xdfb(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    -0x30(%rbp),%edi
mov    %eax,%esi
call   1090 <_mm_sub_ps@plt>
mov    %eax,%edi
call   10e0 <_mm_cvtps_epi32@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_mm_cvtepi32_ps@plt>
mov    -0x2c(%rbp),%edi
mov    %eax,%esi
call   1090 <_mm_sub_ps@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    $0x7f,%edi
call   10a0 <_mm_set1_epi32@plt>
mov    -0x28(%rbp),%edi
mov    %eax,%esi
call   1050 <_mm_add_epi32@plt>
mov    %eax,%edi
mov    $0x17,%esi
call   10d0 <_mm_slli_epi32@plt>
mov    %eax,%edi
call   1040 <_mm_castsi128_ps@plt>
mov    %eax,-0x10(%rbp)
movss  0xd8b(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1080 <_mm_mul_ps@plt>
mov    %eax,-0x24(%rbp)
movss  0xd6d(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
call   10c0 <_mm_add_ps@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1080 <_mm_mul_ps@plt>
mov    %eax,-0x20(%rbp)
movss  0xd45(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
call   10c0 <_mm_add_ps@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1080 <_mm_mul_ps@plt>
mov    %eax,-0x1c(%rbp)
movss  0xd1d(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   10c0 <_mm_add_ps@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1080 <_mm_mul_ps@plt>
mov    %eax,-0x18(%rbp)
movss  0xcf5(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
call   10c0 <_mm_add_ps@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1080 <_mm_mul_ps@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_exp2_ps>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
movss  0xe32(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <_mm_min_ps@plt>
mov    %eax,%ebx
movss  0xe1e(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1070 <_mm_max_ps@plt>
mov    %eax,%ebx
movss  0xe0a(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1090 <_mm_sub_ps@plt>
mov    %eax,%edi
call   10e0 <_mm_cvtps_epi32@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <_mm_cvtepi32_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1090 <_mm_sub_ps@plt>
mov    %eax,%ebx
mov    $0x7f,%edi
call   10a0 <_mm_set1_epi32@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <_mm_add_epi32@plt>
mov    %eax,%edi
mov    $0x17,%esi
call   10d0 <_mm_slli_epi32@plt>
mov    %eax,%edi
call   1040 <_mm_castsi128_ps@plt>
mov    %eax,%r14d
movss  0xdb4(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1080 <_mm_mul_ps@plt>
mov    %eax,%ebp
movss  0xda0(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   10c0 <_mm_add_ps@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1080 <_mm_mul_ps@plt>
mov    %eax,%ebp
movss  0xd83(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   10c0 <_mm_add_ps@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1080 <_mm_mul_ps@plt>
mov    %eax,%ebp
movss  0xd66(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   10c0 <_mm_add_ps@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1080 <_mm_mul_ps@plt>
mov    %eax,%ebx
movss  0xd49(%rip),%xmm0
call   10b0 <_mm_set1_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   10c0 <_mm_add_ps@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1080 <_mm_mul_ps@plt>

LLVM IR (-O0):
define i32 @_mm_exp2_ps(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @_mm_set1_ps(float 1.290000e+02)
%9 = call i32 @_mm_min_ps(i32 %7, i32 %8)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = call i32 @_mm_set1_ps(float 0xC05FBFFFE0000000)
%12 = call i32 @_mm_max_ps(i32 %10, i32 %11)
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = call i32 @_mm_set1_ps(float 5.000000e-01)
%15 = call i32 @_mm_sub_ps(i32 %13, i32 %14)
%16 = call i32 @_mm_cvtps_epi32(i32 %15)
store i32 %16, i32* %3
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = call i32 @_mm_cvtepi32_ps(i32 %18)
%20 = call i32 @_mm_sub_ps(i32 %17, i32 %19)
store i32 %20, i32* %4
%21 = load i32, i32* %3
%22 = call i32 @_mm_set1_epi32(i32 127)
%23 = call i32 @_mm_add_epi32(i32 %21, i32 %22)
%24 = call i32 @_mm_slli_epi32(i32 %23, i32 23)
%25 = call i32 @_mm_castsi128_ps(i32 %24)
store i32 %25, i32* %5
%26 = call i32 @_mm_set1_ps(float 0x3F8BB7CD20000000)
%27 = load i32, i32* %4
%28 = call i32 @_mm_mul_ps(i32 %26, i32 %27)
%29 = call i32 @_mm_set1_ps(float 0x3FAAA13F20000000)
%30 = call i32 @_mm_add_ps(i32 %28, i32 %29)
%31 = load i32, i32* %4
%32 = call i32 @_mm_mul_ps(i32 %30, i32 %31)
%33 = call i32 @_mm_set1_ps(float 0x3FCEE798A0000000)
%34 = call i32 @_mm_add_ps(i32 %32, i32 %33)
%35 = load i32, i32* %4
%36 = call i32 @_mm_mul_ps(i32 %34, i32 %35)
%37 = call i32 @_mm_set1_ps(float 0x3FE62D1660000000)
%38 = call i32 @_mm_add_ps(i32 %36, i32 %37)
%39 = load i32, i32* %4
%40 = call i32 @_mm_mul_ps(i32 %38, i32 %39)
%41 = call i32 @_mm_set1_ps(float 0x3FF00002C0000000)
%42 = call i32 @_mm_add_ps(i32 %40, i32 %41)
store i32 %42, i32* %6
%43 = load i32, i32* %5
%44 = load i32, i32* %6
%45 = call i32 @_mm_mul_ps(i32 %43, i32 %44)
ret i32 %45
}

LLVM IR (-O2):
define i32 @_mm_exp2_ps(i32 %0) {
%2 = tail call i32 @_mm_set1_ps(float 1.290000e+02)
%3 = tail call i32 @_mm_min_ps(i32 %0, i32 %2)
%4 = tail call i32 @_mm_set1_ps(float 0xC05FBFFFE0000000)
%5 = tail call i32 @_mm_max_ps(i32 %3, i32 %4)
%6 = tail call i32 @_mm_set1_ps(float 5.000000e-01)
%7 = tail call i32 @_mm_sub_ps(i32 %5, i32 %6)
%8 = tail call i32 @_mm_cvtps_epi32(i32 %7)
%9 = tail call i32 @_mm_cvtepi32_ps(i32 %8)
%10 = tail call i32 @_mm_sub_ps(i32 %5, i32 %9)
%11 = tail call i32 @_mm_set1_epi32(i32 127)
%12 = tail call i32 @_mm_add_epi32(i32 %8, i32 %11)
%13 = tail call i32 @_mm_slli_epi32(i32 %12, i32 23)
%14 = tail call i32 @_mm_castsi128_ps(i32 %13)
%15 = tail call i32 @_mm_set1_ps(float 0x3F8BB7CD20000000)
%16 = tail call i32 @_mm_mul_ps(i32 %15, i32 %10)
%17 = tail call i32 @_mm_set1_ps(float 0x3FAAA13F20000000)
%18 = tail call i32 @_mm_add_ps(i32 %16, i32 %17)
%19 = tail call i32 @_mm_mul_ps(i32 %18, i32 %10)
%20 = tail call i32 @_mm_set1_ps(float 0x3FCEE798A0000000)
%21 = tail call i32 @_mm_add_ps(i32 %19, i32 %20)
%22 = tail call i32 @_mm_mul_ps(i32 %21, i32 %10)
%23 = tail call i32 @_mm_set1_ps(float 0x3FE62D1660000000)
%24 = tail call i32 @_mm_add_ps(i32 %22, i32 %23)
%25 = tail call i32 @_mm_mul_ps(i32 %24, i32 %10)
%26 = tail call i32 @_mm_set1_ps(float 0x3FF00002C0000000)
%27 = tail call i32 @_mm_add_ps(i32 %25, i32 %26)
%28 = tail call i32 @_mm_mul_ps(i32 %14, i32 %27)
ret i32 %28
}