#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 expf(float);
float init_newtonf(float, float, float, float, float);
float logf(float);
float babl_pow_24f(float x) {
  float y;
  int i;
  if (x > 16.0f) {
    return expf(logf(x) * 2.4f);
  }
  y = init_newtonf(x, -1.f / 5, 0.9953189663f, 0.9594345146f, 0.6742970332f);
  for (i = 0; i < 3; i++)
    y = (1.f + 1.f / 5) * y - ((1.f / 5) * x * (y * y)) * ((y * y) * (y * y));
  x *= y;
  return x * x * x;
}


x86 assembly (clang, -O0):
<babl_pow_24f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xeb6(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1178 <babl_pow_24f+0x48>
movss  -0x8(%rbp),%xmm0
call   1030 <logf@plt>
movss  0xeb7(%rip),%xmm1
mulss  %xmm1,%xmm0
call   1040 <expf@plt>
movss  %xmm0,-0x4(%rbp)
jmp    1247 <babl_pow_24f+0x117>
movss  -0x8(%rbp),%xmm0
movss  0xe7f(%rip),%xmm1
movss  0xe7b(%rip),%xmm2
movss  0xe77(%rip),%xmm3
movss  0xe73(%rip),%xmm4
call   1050 <init_newtonf@plt>
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1224 <babl_pow_24f+0xf4>
movss  -0xc(%rbp),%xmm0
movss  0xe53(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
mulss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm1
movss  -0xc(%rbp),%xmm2
mulss  -0xc(%rbp),%xmm2
movss  -0xc(%rbp),%xmm3
mulss  -0xc(%rbp),%xmm3
mulss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  0xe0b(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ae <babl_pow_24f+0x7e>
movss  -0xc(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<babl_pow_24f>:
push   %rax
ucomiss 0xec8(%rip),%xmm0
jbe    114d <babl_pow_24f+0x1d>
call   1030 <logf@plt>
mulss  0xed1(%rip),%xmm0
pop    %rax
jmp    1040 <expf@plt>
movss  0xeaf(%rip),%xmm1
movss  0xeab(%rip),%xmm2
movss  0xea7(%rip),%xmm3
movss  0xea3(%rip),%xmm4
movss  %xmm0,0x4(%rsp)
call   1050 <init_newtonf@plt>
movss  0x4(%rsp),%xmm4
movss  0xe7e(%rip),%xmm3
mulss  %xmm4,%xmm3
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
movaps %xmm3,%xmm2
movaps %xmm3,%xmm5
mulss  %xmm1,%xmm2
mulss  %xmm1,%xmm1
mulss  %xmm2,%xmm1
movss  0xe69(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm3
mulss  %xmm1,%xmm1
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm5
mulss  %xmm1,%xmm1
mulss  %xmm5,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm4,%xmm0
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @babl_pow_24f(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %3
%6 = load float, float* %3
%7 = fcmp ogt float %6, 1.600000e+01
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load float, float* %3
%10 = call float @logf(float %9)
%11 = fmul float %10, 0x4003333340000000
%12 = call float @expf(float %11)
store float %12, float* %2
br label %49
13: ; preds = %1
%14 = load float, float* %3
%15 = call float @init_newtonf(float %14, float 0xBFC99999A0000000, float 0x3FEFD9A720000000, float 0x3FEEB3B000000000, float 0x3FE593D760000000)
store float %15, float* %4
store i32 0, i32* %5
br label %16
16: ; preds = %37, %13
%17 = load i32, i32* %5
%18 = icmp slt i32 %17, 3
br i1 %18, label %19, label %40
19: ; preds = %16
%20 = load float, float* %4
%21 = load float, float* %3
%22 = fmul float 0x3FC99999A0000000, %21
%23 = load float, float* %4
%24 = load float, float* %4
%25 = fmul float %23, %24
%26 = fmul float %22, %25
%27 = load float, float* %4
%28 = load float, float* %4
%29 = fmul float %27, %28
%30 = load float, float* %4
%31 = load float, float* %4
%32 = fmul float %30, %31
%33 = fmul float %29, %32
%34 = fmul float %26, %33
%35 = fneg float %34
%36 = call float @llvm.fmuladd.f32(float 0x3FF3333340000000, float %20, float %35)
store float %36, float* %4
br label %37
37: ; preds = %19
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
store i32 %39, i32* %5
br label %16
40: ; preds = %16
%41 = load float, float* %4
%42 = load float, float* %3
%43 = fmul float %42, %41
store float %43, float* %3
%44 = load float, float* %3
%45 = load float, float* %3
%46 = fmul float %44, %45
%47 = load float, float* %3
%48 = fmul float %46, %47
store float %48, float* %2
br label %49
49: ; preds = %40, %8
%50 = load float, float* %2
ret float %50
}

LLVM IR (-O2):
define float @babl_pow_24f(float %0) {
%2 = fcmp ogt float %0, 1.600000e+01
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call float @logf(float %0)
%5 = fmul float %4, 0x4003333340000000
%6 = tail call float @expf(float %5)
br label %28
7: ; preds = %1
%8 = tail call float @init_newtonf(float %0, float 0xBFC99999A0000000, float 0x3FEFD9A720000000, float 0x3FEEB3B000000000, float 0x3FE593D760000000)
%9 = fmul float %0, 0xBFC99999A0000000
%10 = fmul float %8, %8
%11 = fmul float %10, %10
%12 = fmul float %9, %10
%13 = fmul float %12, %11
%14 = tail call float @llvm.fmuladd.f32(float %8, float 0x3FF3333340000000, float %13)
%15 = fmul float %14, %14
%16 = fmul float %15, %15
%17 = fmul float %9, %15
%18 = fmul float %17, %16
%19 = tail call float @llvm.fmuladd.f32(float %14, float 0x3FF3333340000000, float %18)
%20 = fmul float %19, %19
%21 = fmul float %20, %20
%22 = fmul float %9, %20
%23 = fmul float %22, %21
%24 = tail call float @llvm.fmuladd.f32(float %19, float 0x3FF3333340000000, float %23)
%25 = fmul float %24, %0
%26 = fmul float %25, %25
%27 = fmul float %25, %26
br label %28
28: ; preds = %7, %3
%29 = phi float [ %6, %3 ], [ %27, %7 ]
ret float %29
}