#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 uint32_t;

/* Variables and functions */
float exp2(double);
float exp2f(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);
  union {
    float f;
    uint32_t i;
  } u = {n};
  if ((u.i >> 23 & 0xff) < 0x7f + 3) {
    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    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    -0xc(%rbp),%rdi
call   1030 <modff@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x17,%eax
and    $0xff,%eax
cmp    $0x82,%eax
jge    11e5 <exp10f+0xb5>
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11a8 <exp10f+0x78>
jp     11a8 <exp10f+0x78>
cvttss2si -0xc(%rbp),%eax
add    $0x7,%eax
movslq %eax,%rcx
lea    0xe77(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1204 <exp10f+0xd4>
movss  0xe58(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
call   1050 <exp2f@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvttss2si -0xc(%rbp),%eax
add    $0x7,%eax
movslq %eax,%rcx
lea    0xe3a(%rip),%rax
mulss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1204 <exp10f+0xd4>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe0a(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <exp2@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp10f>:
push   %rax
lea    0x4(%rsp),%rdi
movss  %xmm0,(%rsp)
call   1030 <modff@plt>
movd   0x4(%rsp),%xmm2
movd   %xmm2,%eax
and    $0x7f000000,%eax
cmp    $0x40ffffff,%eax
ja     1188 <exp10f+0x58>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1160 <exp10f+0x30>
jnp    119f <exp10f+0x6f>
mulss  0xea0(%rip),%xmm0
movss  %xmm2,(%rsp)
call   1050 <exp2f@plt>
cvttss2si (%rsp),%eax
cltq
lea    0xe90(%rip),%rcx
mulss  0x1c(%rcx,%rax,4),%xmm0
pop    %rax
ret
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe67(%rip),%xmm0
pop    %rax
jmp    1040 <exp2@plt>
cvttss2si %xmm2,%eax
cltq
lea    0xe64(%rip),%rcx
movss  0x1c(%rcx,%rax,4),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { float }
@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
%6 = alloca %union.anon
store float %0, float* %3
%7 = load float, float* %3
%8 = call float @modff(float %7, float* %4)
store float %8, float* %5
%9 = bitcast %union.anon* %6 to float*
%10 = load float, float* %4
store float %10, float* %9
%11 = bitcast %union.anon* %6 to i32*
%12 = load i32, i32* %11
%13 = ashr i32 %12, 23
%14 = and i32 %13, 255
%15 = icmp slt i32 %14, 130
br i1 %15, label %16, label %38
16: ; preds = %1
%17 = load float, float* %5
%18 = fcmp une float %17, 0.000000e+00
br i1 %18, label %26, label %19
19: ; preds = %16
%20 = load float, float* %4
%21 = fptosi float %20 to i32
%22 = add nsw i32 %21, 7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [15 x float], [15 x float]* @exp10f.p10, i64 0, i64 %23
%25 = load float, float* %24
store float %25, float* %2
br label %43
26: ; preds = %16
%27 = load float, float* %5
%28 = fmul float 0x400A934F00000000, %27
%29 = call float @exp2f(float %28)
store float %29, float* %5
%30 = load float, float* %5
%31 = load float, float* %4
%32 = fptosi float %31 to i32
%33 = add nsw i32 %32, 7
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [15 x float], [15 x float]* @exp10f.p10, i64 0, i64 %34
%36 = load float, float* %35
%37 = fmul float %30, %36
store float %37, float* %2
br label %43
38: ; preds = %1
%39 = load float, float* %3
%40 = fpext float %39 to double
%41 = fmul double 0x400A934F0979A371, %40
%42 = call float @exp2(double %41)
store float %42, float* %2
br label %43
43: ; preds = %38, %26, %19
%44 = load float, float* %2
ret float %44
}

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 = bitcast float %5 to i32
%7 = and i32 %6, 2130706432
%8 = icmp ult i32 %7, 1090519040
br i1 %8, label %9, label %26
9: ; preds = %1
%10 = fcmp une float %4, 0.000000e+00
br i1 %10, label %17, label %11
11: ; preds = %9
%12 = fptosi float %5 to i32
%13 = add nsw i32 %12, 7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [15 x float], [15 x float]* @exp10f.p10, i64 0, i64 %14
%16 = load float, float* %15
br label %30
17: ; preds = %9
%18 = fmul float %4, 0x400A934F00000000
%19 = tail call float @exp2f(float %18)
%20 = fptosi float %5 to i32
%21 = add nsw i32 %20, 7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [15 x float], [15 x float]* @exp10f.p10, i64 0, i64 %22
%24 = load float, float* %23
%25 = fmul float %19, %24
br label %30
26: ; preds = %1
%27 = fpext float %0 to double
%28 = fmul double %27, 0x400A934F0979A371
%29 = tail call float @exp2(double %28)
br label %30
30: ; preds = %26, %17, %11
%31 = phi float [ %25, %17 ], [ %16, %11 ], [ %29, %26 ]
ret float %31
}