#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 exp2(double);
float exp2f(float);
int fabsf(float);
float modff(float, float *);
float exp10f(float x) {
  static const float p10[] = {1e-7f, 1e-6f, 1e-5f, 1e-4f, 1e-3f,
                              1e-2f, 1e-1f, 1,     1e1,   1e2,
                              1e3,   1e4,   1e5,   1e6,   1e7};
  float n, y = modff(x, &n);
  if (fabsf(n) < 8) {
    if (!y)
      return p10[(int)n + 7];
    y = exp2f(3.32192809488736234787031942948939f * y);
    return y * p10[(int)n + 7];
  }
  return exp2(3.32192809488736234787031942948939 * x);
}


x86 assembly (clang, -O0):
<exp10f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    -0xc(%rbp),%rdi
call   1040 <modff@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <fabsf@plt>
cmp    $0x8,%eax
jge    11e8 <exp10f+0xa8>
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11ab <exp10f+0x6b>
jp     11ab <exp10f+0x6b>
cvttss2si -0xc(%rbp),%eax
add    $0x7,%eax
movslq %eax,%rcx
lea    0xe74(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1207 <exp10f+0xc7>
movss  0xe55(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
call   1060 <exp2f@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvttss2si -0xc(%rbp),%eax
add    $0x7,%eax
movslq %eax,%rcx
lea    0xe37(%rip),%rax
mulss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1207 <exp10f+0xc7>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe07(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <exp2@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp10f>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rdi
movss  %xmm0,0xc(%rsp)
call   1040 <modff@plt>
movss  %xmm0,0x10(%rsp)
movss  0x14(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
call   1030 <fabsf@plt>
cmp    $0x7,%eax
jg     11aa <exp10f+0x6a>
xorps  %xmm0,%xmm0
movss  0x10(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jne    1180 <exp10f+0x40>
jnp    11c5 <exp10f+0x85>
movaps %xmm1,%xmm0
mulss  0xe7d(%rip),%xmm0
call   1060 <exp2f@plt>
cvttss2si 0x8(%rsp),%eax
cltq
lea    0xe71(%rip),%rcx
mulss  0x1c(%rcx,%rax,4),%xmm0
add    $0x18,%rsp
ret
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe44(%rip),%xmm0
add    $0x18,%rsp
jmp    1050 <exp2@plt>
cvttss2si 0x8(%rsp),%eax
cltq
lea    0xe3c(%rip),%rcx
movss  0x1c(%rcx,%rax,4),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@exp10f.p10 = internal constant [15 x float] [float 0x3E7AD7F2A0000000, float 0x3EB0C6F7A0000000, float 0x3EE4F8B580000000, float 0x3F1A36E2E0000000, float 0x3F50624DE0000000, float 0x3F847AE140000000, float 0x3FB99999A0000000, float 1.000000e+00, float 1.000000e+01, float 1.000000e+02, float 1.000000e+03, float 1.000000e+04, float 1.000000e+05, float 1.000000e+06, float 1.000000e+07]
define float @exp10f(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
%6 = load float, float* %3
%7 = call float @modff(float %6, float* %4)
store float %7, float* %5
%8 = load float, float* %4
%9 = call i32 @fabsf(float %8)
%10 = icmp slt i32 %9, 8
br i1 %10, label %11, label %33
11: ; preds = %1
%12 = load float, float* %5
%13 = fcmp une float %12, 0.000000e+00
br i1 %13, label %21, label %14
14: ; preds = %11
%15 = load float, float* %4
%16 = fptosi float %15 to i32
%17 = add nsw i32 %16, 7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [15 x float], [15 x float]* @exp10f.p10, i64 0, i64 %18
%20 = load float, float* %19
store float %20, float* %2
br label %38
21: ; preds = %11
%22 = load float, float* %5
%23 = fmul float 0x400A934F00000000, %22
%24 = call float @exp2f(float %23)
store float %24, float* %5
%25 = load float, float* %5
%26 = load float, float* %4
%27 = fptosi float %26 to i32
%28 = add nsw i32 %27, 7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [15 x float], [15 x float]* @exp10f.p10, i64 0, i64 %29
%31 = load float, float* %30
%32 = fmul float %25, %31
store float %32, float* %2
br label %38
33: ; preds = %1
%34 = load float, float* %3
%35 = fpext float %34 to double
%36 = fmul double 0x400A934F0979A371, %35
%37 = call float @exp2(double %36)
store float %37, float* %2
br label %38
38: ; preds = %33, %21, %14
%39 = load float, float* %2
ret float %39
}

LLVM IR (-O2):
@exp10f.p10 = internal unnamed_addr constant [15 x float] [float 0x3E7AD7F2A0000000, float 0x3EB0C6F7A0000000, float 0x3EE4F8B580000000, float 0x3F1A36E2E0000000, float 0x3F50624DE0000000, float 0x3F847AE140000000, float 0x3FB99999A0000000, float 1.000000e+00, float 1.000000e+01, float 1.000000e+02, float 1.000000e+03, float 1.000000e+04, float 1.000000e+05, float 1.000000e+06, float 1.000000e+07]
define float @exp10f(float %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call float @modff(float %0, float* %2)
%5 = load float, float* %2
%6 = tail call i32 @fabsf(float %5)
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %25
8: ; preds = %1
%9 = fcmp une float %4, 0.000000e+00
br i1 %9, label %16, label %10
10: ; preds = %8
%11 = fptosi float %5 to i32
%12 = add nsw i32 %11, 7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [15 x float], [15 x float]* @exp10f.p10, i64 0, i64 %13
%15 = load float, float* %14
br label %29
16: ; preds = %8
%17 = fmul float %4, 0x400A934F00000000
%18 = tail call float @exp2f(float %17)
%19 = fptosi float %5 to i32
%20 = add nsw i32 %19, 7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [15 x float], [15 x float]* @exp10f.p10, i64 0, i64 %21
%23 = load float, float* %22
%24 = fmul float %18, %23
br label %29
25: ; preds = %1
%26 = fpext float %0 to double
%27 = fmul double %26, 0x400A934F0979A371
%28 = tail call float @exp2(double %27)
br label %29
29: ; preds = %25, %16, %10
%30 = phi float [ %24, %16 ], [ %15, %10 ], [ %28, %25 ]
ret float %30
}