#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 pow(int, int);
double sqrt(double);
int inverse_cubic(double x) {
  double a = 1.38739 * pow(10, 9) *
                 sqrt(1.20303 * pow(10, 19) * pow(x, 2) -
                      1.20976 * pow(10, 16) * x + 7.60966 * pow(10, 15)) -
             4.81213 * pow(10, 18) * x + 2.41952 * pow(10, 15);
  double b = pow(a, 0.33333);
  double term_one = 0.116402 - 0.0000176554 * b;
  double term_two = (4.31923 * pow(10, 6)) / b;
  double inverse_result = term_one + term_two;
  return (int)(5.12 * inverse_result);
}


x86 assembly (clang, -O0):
<inverse_cubic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0xa,%edi
mov    $0x9,%esi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xf01(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    $0xa,%edi
mov    $0x13,%esi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xed6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
cvttsd2si -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
movsd  %xmm0,-0x60(%rbp)
mov    $0xa,%edi
mov    $0x10,%esi
call   1030 <pow@plt>
movsd  -0x60(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x58(%rbp),%xmm0
movsd  0xe8d(%rip),%xmm1
mulsd  %xmm3,%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    $0xa,%edi
mov    $0xf,%esi
call   1030 <pow@plt>
movsd  -0x50(%rbp),%xmm1
movsd  0xe3c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
mov    $0xa,%edi
mov    $0x12,%esi
call   1030 <pow@plt>
movsd  -0x48(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x40(%rbp),%xmm0
movsd  0xdfe(%rip),%xmm1
mulsd  %xmm3,%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    $0xa,%edi
mov    $0xf,%esi
call   1030 <pow@plt>
movsd  -0x38(%rbp),%xmm1
movsd  0xdad(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%edi
xor    %esi,%esi
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xd72(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd6e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0xa,%edi
mov    $0x6,%esi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xd3b(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xd0e(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse_cubic>:
sub    $0x28,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0xa,%edi
mov    $0x9,%esi
call   1030 <pow@plt>
mulsd  0xebf(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    $0xa,%edi
mov    $0x13,%esi
call   1030 <pow@plt>
mulsd  0xeaa(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
cvttsd2si 0x8(%rsp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
movsd  %xmm0,0x18(%rsp)
mov    $0xa,%edi
mov    $0x10,%esi
call   1030 <pow@plt>
mulsd  0xe7f(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
mov    $0xa,%edi
mov    $0xf,%esi
call   1030 <pow@plt>
mulsd  0xe54(%rip),%xmm0
addsd  0x18(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11da <inverse_cubic+0xba>
sqrtsd %xmm0,%xmm0
jmp    11df <inverse_cubic+0xbf>
call   1040 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    $0xa,%edi
mov    $0x12,%esi
call   1030 <pow@plt>
mulsd  0xe1a(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0xa,%edi
mov    $0xf,%esi
call   1030 <pow@plt>
mulsd  0xdf9(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%edi
xor    %esi,%esi
call   1030 <pow@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0xde2(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xdde(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
mov    $0xa,%edi
mov    $0x6,%esi
call   1030 <pow@plt>
mulsd  0xdc9(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0xdbd(%rip),%xmm0
cvttsd2si %xmm0,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @inverse_cubic(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %2
%8 = call double @pow(i32 10, i32 9)
%9 = fmul double 1.387390e+00, %8
%10 = call double @pow(i32 10, i32 19)
%11 = fmul double 1.203030e+00, %10
%12 = load double, double* %2
%13 = fptosi double %12 to i32
%14 = call double @pow(i32 %13, i32 2)
%15 = call double @pow(i32 10, i32 16)
%16 = fmul double 1.209760e+00, %15
%17 = load double, double* %2
%18 = fmul double %16, %17
%19 = fneg double %18
%20 = call double @llvm.fmuladd.f64(double %11, double %14, double %19)
%21 = call double @pow(i32 10, i32 15)
%22 = call double @llvm.fmuladd.f64(double 7.609660e+00, double %21, double %20)
%23 = call double @sqrt(double %22)
%24 = call double @pow(i32 10, i32 18)
%25 = fmul double 4.812130e+00, %24
%26 = load double, double* %2
%27 = fmul double %25, %26
%28 = fneg double %27
%29 = call double @llvm.fmuladd.f64(double %9, double %23, double %28)
%30 = call double @pow(i32 10, i32 15)
%31 = call double @llvm.fmuladd.f64(double 2.419520e+00, double %30, double %29)
store double %31, double* %3
%32 = load double, double* %3
%33 = fptosi double %32 to i32
%34 = call double @pow(i32 %33, i32 0)
store double %34, double* %4
%35 = load double, double* %4
%36 = call double @llvm.fmuladd.f64(double -1.765540e-05, double %35, double 1.164020e-01)
store double %36, double* %5
%37 = call double @pow(i32 10, i32 6)
%38 = fmul double 4.319230e+00, %37
%39 = load double, double* %4
%40 = fdiv double %38, %39
store double %40, double* %6
%41 = load double, double* %5
%42 = load double, double* %6
%43 = fadd double %41, %42
store double %43, double* %7
%44 = load double, double* %7
%45 = fmul double 5.120000e+00, %44
%46 = fptosi double %45 to i32
ret i32 %46
}

LLVM IR (-O2):
define i32 @inverse_cubic(double %0) {
%2 = tail call double @pow(i32 10, i32 9)
%3 = fmul double %2, 1.387390e+00
%4 = tail call double @pow(i32 10, i32 19)
%5 = fmul double %4, 1.203030e+00
%6 = fptosi double %0 to i32
%7 = tail call double @pow(i32 %6, i32 2)
%8 = tail call double @pow(i32 10, i32 16)
%9 = fmul double %8, -1.209760e+00
%10 = fmul double %9, %0
%11 = tail call double @llvm.fmuladd.f64(double %5, double %7, double %10)
%12 = tail call double @pow(i32 10, i32 15)
%13 = tail call double @llvm.fmuladd.f64(double %12, double 7.609660e+00, double %11)
%14 = tail call double @sqrt(double %13)
%15 = tail call double @pow(i32 10, i32 18)
%16 = fmul double %15, -4.812130e+00
%17 = fmul double %16, %0
%18 = tail call double @llvm.fmuladd.f64(double %3, double %14, double %17)
%19 = tail call double @pow(i32 10, i32 15)
%20 = tail call double @llvm.fmuladd.f64(double %19, double 2.419520e+00, double %18)
%21 = fptosi double %20 to i32
%22 = tail call double @pow(i32 %21, i32 0)
%23 = tail call double @llvm.fmuladd.f64(double %22, double -1.765540e-05, double 1.164020e-01)
%24 = tail call double @pow(i32 10, i32 6)
%25 = fmul double %24, 4.319230e+00
%26 = fdiv double %25, %22
%27 = fadd double %23, %26
%28 = fmul double %27, 5.120000e+00
%29 = fptosi double %28 to i32
ret i32 %29
}