#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 init_newton(double, int, double, double, double);
double babl_pow_24(double x) {
  double y = init_newton(x, -1. / 5, 0.9953189663, 0.9594345146, 0.6742970332);
  int i;
  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,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
movsd  0xed4(%rip),%xmm1
movsd  0xed4(%rip),%xmm2
movsd  0xed4(%rip),%xmm3
call   1030 <init_newton@plt>
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    11cd <babl_pow_24+0xbd>
movsd  -0x10(%rbp),%xmm0
movsd  0xebc(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
mulsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  -0x10(%rbp),%xmm2
mulsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
mulsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe66(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <babl_pow_24+0x3d>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<babl_pow_24>:
push   %rax
movsd  %xmm0,(%rsp)
movsd  0xee2(%rip),%xmm1
movsd  0xee2(%rip),%xmm2
movsd  0xee2(%rip),%xmm3
xor    %edi,%edi
call   1030 <init_newton@plt>
movsd  0xedb(%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  0xeba(%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 i32
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @init_newton(double %5, i32 0, double 0x3FEFD9A7292B1AD7, double 0x3FEEB3B002DB8A51, double 0x3FE593D75F2C484E)
store double %6, double* %3
store i32 0, i32* %4
br label %7
7: ; preds = %28, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %31
10: ; preds = %7
%11 = load double, double* %3
%12 = load double, double* %2
%13 = fmul double 2.000000e-01, %12
%14 = load double, double* %3
%15 = load double, double* %3
%16 = fmul double %14, %15
%17 = fmul double %13, %16
%18 = load double, double* %3
%19 = load double, double* %3
%20 = fmul double %18, %19
%21 = load double, double* %3
%22 = load double, double* %3
%23 = fmul double %21, %22
%24 = fmul double %20, %23
%25 = fmul double %17, %24
%26 = fneg double %25
%27 = call double @llvm.fmuladd.f64(double 1.200000e+00, double %11, double %26)
store double %27, double* %3
br label %28
28: ; preds = %10
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %7
31: ; preds = %7
%32 = load double, double* %3
%33 = load double, double* %2
%34 = fmul double %33, %32
store double %34, double* %2
%35 = load double, double* %2
%36 = load double, double* %2
%37 = fmul double %35, %36
%38 = load double, double* %2
%39 = fmul double %37, %38
ret double %39
}

LLVM IR (-O2):
define double @babl_pow_24(double %0) {
%2 = tail call double @init_newton(double %0, i32 0, double 0x3FEFD9A7292B1AD7, double 0x3FEEB3B002DB8A51, double 0x3FE593D75F2C484E)
%3 = fmul double %0, -2.000000e-01
%4 = fmul double %2, %2
%5 = fmul double %4, %4
%6 = fmul double %3, %4
%7 = fmul double %6, %5
%8 = tail call double @llvm.fmuladd.f64(double %2, double 1.200000e+00, double %7)
%9 = fmul double %8, %8
%10 = fmul double %9, %9
%11 = fmul double %3, %9
%12 = fmul double %11, %10
%13 = tail call double @llvm.fmuladd.f64(double %8, double 1.200000e+00, double %12)
%14 = fmul double %13, %13
%15 = fmul double %14, %14
%16 = fmul double %3, %14
%17 = fmul double %16, %15
%18 = tail call double @llvm.fmuladd.f64(double %13, double 1.200000e+00, double %17)
%19 = fmul double %18, %0
%20 = fmul double %19, %19
%21 = fmul double %19, %20
ret double %21
}