#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 sqrt(double);
double babl_pow_1_24(double x) {
  double y = init_newton(x, -1. / 12, 0.9976800269, 0.9885126933, 0.5908575383);
  int i;
  double z;
  x = sqrt(x);
  z = (1. / 6.) * x;
  for (i = 0; i < 3; i++)
    y = (7. / 6.) * y - z * ((y * y) * (y * y) * (y * y * y));
  return x * y;
}


x86 assembly (clang, -O0):
<babl_pow_1_24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
movsd  0xecc(%rip),%xmm1
movsd  0xecc(%rip),%xmm2
movsd  0xecc(%rip),%xmm3
call   1030 <init_newton@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  0xe93(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    11fb <babl_pow_1_24+0xdb>
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
mulsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
mulsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm2
movsd  -0x10(%rbp),%xmm3
mulsd  -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  0xe40(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117e <babl_pow_1_24+0x5e>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<babl_pow_1_24>:
push   %rax
movsd  %xmm0,(%rsp)
movsd  0xed2(%rip),%xmm1
movsd  0xed2(%rip),%xmm2
movsd  0xed2(%rip),%xmm3
xor    %edi,%edi
call   1030 <init_newton@plt>
movapd %xmm0,%xmm5
xorpd  %xmm0,%xmm0
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
movapd %xmm1,%xmm0
jb     1162 <babl_pow_1_24+0x42>
sqrtsd %xmm0,%xmm0
jmp    1171 <babl_pow_1_24+0x51>
movsd  %xmm5,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm5
movsd  0xe9f(%rip),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm5,%xmm2
mulsd  %xmm5,%xmm2
movapd %xmm5,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm2
mulsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movsd  0xe7f(%rip),%xmm3
mulsd  %xmm3,%xmm5
addsd  %xmm2,%xmm5
movapd %xmm5,%xmm2
mulsd  %xmm5,%xmm2
movapd %xmm5,%xmm4
mulsd  %xmm2,%xmm4
mulsd  %xmm2,%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm5
addsd  %xmm2,%xmm5
movapd %xmm5,%xmm2
mulsd  %xmm5,%xmm2
movapd %xmm5,%xmm4
mulsd  %xmm2,%xmm4
mulsd  %xmm2,%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm5
addsd  %xmm2,%xmm5
mulsd  %xmm0,%xmm5
movapd %xmm5,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @babl_pow_1_24(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = call double @init_newton(double %6, i32 0, double 0x3FEFECFEA9ED0D85, double 0x3FEFA1E55F2CF0AB, double 0x3FE2E84E1172FE81)
store double %7, double* %3
%8 = load double, double* %2
%9 = call double @sqrt(double %8)
store double %9, double* %2
%10 = load double, double* %2
%11 = fmul double 0x3FC5555555555555, %10
store double %11, double* %5
store i32 0, i32* %4
br label %12
12: ; preds = %34, %1
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %37
15: ; preds = %12
%16 = load double, double* %3
%17 = load double, double* %5
%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 = load double, double* %3
%26 = load double, double* %3
%27 = fmul double %25, %26
%28 = load double, double* %3
%29 = fmul double %27, %28
%30 = fmul double %24, %29
%31 = fmul double %17, %30
%32 = fneg double %31
%33 = call double @llvm.fmuladd.f64(double 0x3FF2AAAAAAAAAAAB, double %16, double %32)
store double %33, double* %3
br label %34
34: ; preds = %15
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %12
37: ; preds = %12
%38 = load double, double* %2
%39 = load double, double* %3
%40 = fmul double %38, %39
ret double %40
}

LLVM IR (-O2):
define double @babl_pow_1_24(double %0) {
%2 = tail call double @init_newton(double %0, i32 0, double 0x3FEFECFEA9ED0D85, double 0x3FEFA1E55F2CF0AB, double 0x3FE2E84E1172FE81)
%3 = tail call double @sqrt(double %0)
%4 = fmul double %3, 0xBFC5555555555555
%5 = fmul double %2, %2
%6 = fmul double %5, %5
%7 = fmul double %2, %5
%8 = fmul double %6, %7
%9 = fmul double %4, %8
%10 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FF2AAAAAAAAAAAB, double %9)
%11 = fmul double %10, %10
%12 = fmul double %11, %11
%13 = fmul double %10, %11
%14 = fmul double %12, %13
%15 = fmul double %4, %14
%16 = tail call double @llvm.fmuladd.f64(double %10, double 0x3FF2AAAAAAAAAAAB, double %15)
%17 = fmul double %16, %16
%18 = fmul double %17, %17
%19 = fmul double %16, %17
%20 = fmul double %18, %19
%21 = fmul double %4, %20
%22 = tail call double @llvm.fmuladd.f64(double %16, double 0x3FF2AAAAAAAAAAAB, double %21)
%23 = fmul double %3, %22
ret double %23
}