#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 sqrtf(float);
float babl_pow_1_24f(float x) {
  float y;
  int i;
  float z;
  if (x > 1024.0f) {
    return expf(logf(x) * (1.0f / 2.4f));
  }
  y = init_newtonf(x, -1.f / 12, 0.9976800269f, 0.9885126933f, 0.5908575383f);
  x = sqrtf(x);
  z = (1.f / 6.f) * x;
  for (i = 0; i < 3; i++)
    y = (7.f / 6.f) * y - z * ((y * y) * (y * y) * (y * y * y));
  return x * y;
}


x86 assembly (clang, -O0):
<babl_pow_1_24f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xea6(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1188 <babl_pow_1_24f+0x48>
movss  -0x8(%rbp),%xmm0
call   1030 <logf@plt>
movss  0xea7(%rip),%xmm1
mulss  %xmm1,%xmm0
call   1040 <expf@plt>
movss  %xmm0,-0x4(%rbp)
jmp    1261 <babl_pow_1_24f+0x121>
movss  -0x8(%rbp),%xmm0
movss  0xe73(%rip),%xmm1
movss  0xe6f(%rip),%xmm2
movss  0xe6b(%rip),%xmm3
movss  0xe67(%rip),%xmm4
call   1060 <init_newtonf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <sqrtf@plt>
movss  %xmm0,-0x8(%rbp)
movss  0xe36(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1252 <babl_pow_1_24f+0x112>
movss  -0xc(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
mulss  -0xc(%rbp),%xmm2
movss  -0xc(%rbp),%xmm3
mulss  -0xc(%rbp),%xmm3
mulss  %xmm3,%xmm2
movss  -0xc(%rbp),%xmm3
mulss  -0xc(%rbp),%xmm3
mulss  -0xc(%rbp),%xmm3
mulss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  0xde1(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11df <babl_pow_1_24f+0x9f>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<babl_pow_1_24f>:
push   %rax
ucomiss 0xeb8(%rip),%xmm0
jbe    115d <babl_pow_1_24f+0x1d>
call   1030 <logf@plt>
mulss  0xec5(%rip),%xmm0
pop    %rax
jmp    1040 <expf@plt>
movss  0xe9f(%rip),%xmm1
movss  0xe9b(%rip),%xmm2
movss  0xe97(%rip),%xmm3
movss  0xe93(%rip),%xmm4
movss  %xmm0,0x4(%rsp)
movss  0x4(%rsp),%xmm0
call   1060 <init_newtonf@plt>
movaps %xmm0,%xmm5
xorps  %xmm0,%xmm0
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
jb     11ab <babl_pow_1_24f+0x6b>
sqrtss %xmm0,%xmm0
jmp    11bc <babl_pow_1_24f+0x7c>
movss  %xmm5,0x4(%rsp)
call   1050 <sqrtf@plt>
movss  0x4(%rsp),%xmm5
movss  0xe50(%rip),%xmm1
mulss  %xmm0,%xmm1
movaps %xmm5,%xmm2
mulss  %xmm5,%xmm2
movaps %xmm5,%xmm3
mulss  %xmm2,%xmm3
mulss  %xmm2,%xmm2
mulss  %xmm3,%xmm2
mulss  %xmm1,%xmm2
movss  0xe2e(%rip),%xmm3
mulss  %xmm3,%xmm5
addss  %xmm2,%xmm5
movaps %xmm5,%xmm2
mulss  %xmm5,%xmm2
movaps %xmm5,%xmm4
mulss  %xmm2,%xmm4
mulss  %xmm2,%xmm2
mulss  %xmm4,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm3,%xmm5
addss  %xmm2,%xmm5
movaps %xmm5,%xmm2
mulss  %xmm5,%xmm2
movaps %xmm5,%xmm4
mulss  %xmm2,%xmm4
mulss  %xmm2,%xmm2
mulss  %xmm4,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm3,%xmm5
addss  %xmm2,%xmm5
mulss  %xmm0,%xmm5
movaps %xmm5,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @babl_pow_1_24f(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca float
store float %0, float* %3
%7 = load float, float* %3
%8 = fcmp ogt float %7, 1.024000e+03
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load float, float* %3
%11 = call float @logf(float %10)
%12 = fmul float %11, 0x3FDAAAAAA0000000
%13 = call float @expf(float %12)
store float %13, float* %2
br label %50
14: ; preds = %1
%15 = load float, float* %3
%16 = call float @init_newtonf(float %15, float 0xBFB5555560000000, float 0x3FEFECFEA0000000, float 0x3FEFA1E560000000, float 0x3FE2E84E20000000)
store float %16, float* %4
%17 = load float, float* %3
%18 = call float @sqrtf(float %17)
store float %18, float* %3
%19 = load float, float* %3
%20 = fmul float 0x3FC5555560000000, %19
store float %20, float* %6
store i32 0, i32* %5
br label %21
21: ; preds = %43, %14
%22 = load i32, i32* %5
%23 = icmp slt i32 %22, 3
br i1 %23, label %24, label %46
24: ; preds = %21
%25 = load float, float* %4
%26 = load float, float* %6
%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 = load float, float* %4
%35 = load float, float* %4
%36 = fmul float %34, %35
%37 = load float, float* %4
%38 = fmul float %36, %37
%39 = fmul float %33, %38
%40 = fmul float %26, %39
%41 = fneg float %40
%42 = call float @llvm.fmuladd.f32(float 0x3FF2AAAAA0000000, float %25, float %41)
store float %42, float* %4
br label %43
43: ; preds = %24
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %21
46: ; preds = %21
%47 = load float, float* %3
%48 = load float, float* %4
%49 = fmul float %47, %48
store float %49, float* %2
br label %50
50: ; preds = %46, %9
%51 = load float, float* %2
ret float %51
}

LLVM IR (-O2):
define float @babl_pow_1_24f(float %0) {
%2 = fcmp ogt float %0, 1.024000e+03
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call float @logf(float %0)
%5 = fmul float %4, 0x3FDAAAAAA0000000
%6 = tail call float @expf(float %5)
br label %30
7: ; preds = %1
%8 = tail call float @init_newtonf(float %0, float 0xBFB5555560000000, float 0x3FEFECFEA0000000, float 0x3FEFA1E560000000, float 0x3FE2E84E20000000)
%9 = tail call float @sqrtf(float %0)
%10 = fmul float %9, 0xBFC5555560000000
%11 = fmul float %8, %8
%12 = fmul float %11, %11
%13 = fmul float %8, %11
%14 = fmul float %12, %13
%15 = fmul float %10, %14
%16 = tail call float @llvm.fmuladd.f32(float %8, float 0x3FF2AAAAA0000000, float %15)
%17 = fmul float %16, %16
%18 = fmul float %17, %17
%19 = fmul float %16, %17
%20 = fmul float %18, %19
%21 = fmul float %10, %20
%22 = tail call float @llvm.fmuladd.f32(float %16, float 0x3FF2AAAAA0000000, float %21)
%23 = fmul float %22, %22
%24 = fmul float %23, %23
%25 = fmul float %22, %23
%26 = fmul float %24, %25
%27 = fmul float %10, %26
%28 = tail call float @llvm.fmuladd.f32(float %22, float 0x3FF2AAAAA0000000, float %27)
%29 = fmul float %9, %28
br label %30
30: ; preds = %7, %3
%31 = phi float [ %6, %3 ], [ %29, %7 ]
ret float %31
}