#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 */
double exp(double);
double init_newton(double, int, double, double, double);
double log(double);
double babl_pow_24(double x) {
  double y;
  int i;
  if (x > 16.0) {
    return exp(log(x) * 2.4);
  }
  y = init_newton(x, -1. / 5, 0.9953189663, 0.9594345146, 0.6742970332);
  for (i = 0; i < 3; i++)
    y = (1. + 1. / 5) * y - ((1. / 5) * x * (y * y)) * ((y * y) * (y * y));
  x *= y;
  return x * x * x;
}


x86 assembly (clang, -O0):
<babl_pow_24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1179 <babl_pow_24+0x49>
movsd  -0x10(%rbp),%xmm0
call   1050 <log@plt>
movsd  0xeca(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    124c <babl_pow_24+0x11c>
movsd  -0x10(%rbp),%xmm0
xor    %edi,%edi
movsd  0xe80(%rip),%xmm1
movsd  0xe80(%rip),%xmm2
movsd  0xe80(%rip),%xmm3
call   1030 <init_newton@plt>
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1229 <babl_pow_24+0xf9>
movsd  -0x18(%rbp),%xmm0
movsd  0xe68(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mulsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm2
mulsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
mulsd  -0x18(%rbp),%xmm3
mulsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe12(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a9 <babl_pow_24+0x79>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<babl_pow_24>:
push   %rax
ucomisd 0xec7(%rip),%xmm0
jbe    114e <babl_pow_24+0x1e>
call   1050 <log@plt>
mulsd  0xee8(%rip),%xmm0
pop    %rax
jmp    1040 <exp@plt>
movsd  0xeb2(%rip),%xmm1
movsd  0xeb2(%rip),%xmm2
movsd  0xeb2(%rip),%xmm3
movsd  %xmm0,(%rsp)
xor    %edi,%edi
call   1030 <init_newton@plt>
movsd  0xea6(%rip),%xmm1
movsd  (%rsp),%xmm5
mulsd  %xmm5,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm1,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm2
mulsd  %xmm3,%xmm2
movsd  0xe85(%rip),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm1,%xmm4
mulsd  %xmm2,%xmm4
mulsd  %xmm2,%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm5,%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @babl_pow_24(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
%6 = load double, double* %3
%7 = fcmp ogt double %6, 1.600000e+01
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load double, double* %3
%10 = call double @log(double %9)
%11 = fmul double %10, 2.400000e+00
%12 = call double @exp(double %11)
store double %12, double* %2
br label %49
13: ; preds = %1
%14 = load double, double* %3
%15 = call double @init_newton(double %14, i32 0, double 0x3FEFD9A7292B1AD7, double 0x3FEEB3B002DB8A51, double 0x3FE593D75F2C484E)
store double %15, double* %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 double, double* %4
%21 = load double, double* %3
%22 = fmul double 2.000000e-01, %21
%23 = load double, double* %4
%24 = load double, double* %4
%25 = fmul double %23, %24
%26 = fmul double %22, %25
%27 = load double, double* %4
%28 = load double, double* %4
%29 = fmul double %27, %28
%30 = load double, double* %4
%31 = load double, double* %4
%32 = fmul double %30, %31
%33 = fmul double %29, %32
%34 = fmul double %26, %33
%35 = fneg double %34
%36 = call double @llvm.fmuladd.f64(double 1.200000e+00, double %20, double %35)
store double %36, double* %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 double, double* %4
%42 = load double, double* %3
%43 = fmul double %42, %41
store double %43, double* %3
%44 = load double, double* %3
%45 = load double, double* %3
%46 = fmul double %44, %45
%47 = load double, double* %3
%48 = fmul double %46, %47
store double %48, double* %2
br label %49
49: ; preds = %40, %8
%50 = load double, double* %2
ret double %50
}

LLVM IR (-O2):
define double @babl_pow_24(double %0) {
%2 = fcmp ogt double %0, 1.600000e+01
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call double @log(double %0)
%5 = fmul double %4, 2.400000e+00
%6 = tail call double @exp(double %5)
br label %28
7: ; preds = %1
%8 = tail call double @init_newton(double %0, i32 0, double 0x3FEFD9A7292B1AD7, double 0x3FEEB3B002DB8A51, double 0x3FE593D75F2C484E)
%9 = fmul double %0, -2.000000e-01
%10 = fmul double %8, %8
%11 = fmul double %10, %10
%12 = fmul double %9, %10
%13 = fmul double %12, %11
%14 = tail call double @llvm.fmuladd.f64(double %8, double 1.200000e+00, double %13)
%15 = fmul double %14, %14
%16 = fmul double %15, %15
%17 = fmul double %9, %15
%18 = fmul double %17, %16
%19 = tail call double @llvm.fmuladd.f64(double %14, double 1.200000e+00, double %18)
%20 = fmul double %19, %19
%21 = fmul double %20, %20
%22 = fmul double %9, %20
%23 = fmul double %22, %21
%24 = tail call double @llvm.fmuladd.f64(double %19, double 1.200000e+00, double %23)
%25 = fmul double %24, %0
%26 = fmul double %25, %25
%27 = fmul double %25, %26
br label %28
28: ; preds = %7, %3
%29 = phi double [ %6, %3 ], [ %27, %7 ]
ret double %29
}