#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 */
scalar_t__ frexp(float, int *);
scalar_t__ ldexp(float, int);
float CubeRoot(float x) {
  float fr, r;
  int ex, shx;
  fr = (float)frexp(x, &ex);
  shx = ex % 3;
  if (shx > 0)
    shx -= 3;
  ex = (ex - shx) / 3;
  fr = (float)ldexp(fr, shx);
  fr = (float)(((((45.2548339756803022511987494 * fr +
                   192.2798368355061050458134625) *
                      fr +
                  119.1654824285581628956914143) *
                     fr +
                 13.43250139086239872172837314) *
                    fr +
                0.1636161226585754240958355063) /
               ((((14.80884093219134573786480845 * fr +
                   151.9714051044435648658557668) *
                      fr +
                  168.5254414101568283957668343) *
                     fr +
                 33.9905941350215598754191872) *
                    fr +
                1.0));
  r = (float)ldexp(fr, ex);
  return r;
}


x86 assembly (clang, -O0):
<CubeRoot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
call   1040 <frexp@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1166 <CubeRoot+0x46>
mov    -0x14(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1030 <ldexp@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9d(%rip),%xmm1
addsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe74(%rip),%xmm1
addsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe53(%rip),%xmm1
addsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe32(%rip),%xmm1
addsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe0d(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe09(%rip),%xmm2
addsd  %xmm2,%xmm1
movss  -0x8(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xde0(%rip),%xmm2
addsd  %xmm2,%xmm1
movss  -0x8(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xdbf(%rip),%xmm2
addsd  %xmm2,%xmm1
movss  -0x8(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd9e(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%edi
call   1030 <ldexp@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CubeRoot>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
call   1040 <frexp@plt>
movslq 0xc(%rsp),%rcx
imul   $0x55555556,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x20,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,2),%edx
mov    %ecx,%esi
sub    %edx,%esi
neg    %edx
test   %esi,%esi
lea    -0x3(%rcx,%rdx,1),%edi
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
cmovle %esi,%edi
sub    %edi,%ecx
movslq %ecx,%rax
imul   $0x55555556,%rax,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
shr    $0x20,%rbx
add    %eax,%ebx
call   1030 <ldexp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movlhps %xmm0,%xmm0
movapd 0xe69(%rip),%xmm1
mulpd  %xmm0,%xmm1
addpd  0xe6d(%rip),%xmm1
mulpd  %xmm0,%xmm1
addpd  0xe71(%rip),%xmm1
mulpd  %xmm0,%xmm1
addpd  0xe75(%rip),%xmm1
mulpd  %xmm0,%xmm1
addpd  0xe79(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
mov    %ebx,%edi
call   1030 <ldexp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @CubeRoot(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store float %0, float* %2
%7 = load float, float* %2
%8 = call i64 @frexp(float %7, i32* %5)
%9 = sitofp i64 %8 to float
store float %9, float* %3
%10 = load i32, i32* %5
%11 = srem i32 %10, 3
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = load i32, i32* %6
%16 = sub nsw i32 %15, 3
store i32 %16, i32* %6
br label %17
17: ; preds = %14, %1
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = sub nsw i32 %18, %19
%21 = sdiv i32 %20, 3
store i32 %21, i32* %5
%22 = load float, float* %3
%23 = load i32, i32* %6
%24 = call i64 @ldexp(float %22, i32 %23)
%25 = sitofp i64 %24 to float
store float %25, float* %3
%26 = load float, float* %3
%27 = fpext float %26 to double
%28 = call double @llvm.fmuladd.f64(double 0x4046A09E6653BA70, double %27, double 0x406808F46C6116E0)
%29 = load float, float* %3
%30 = fpext float %29 to double
%31 = call double @llvm.fmuladd.f64(double %28, double %30, double 0x405DCA97439CAE14)
%32 = load float, float* %3
%33 = fpext float %32 to double
%34 = call double @llvm.fmuladd.f64(double %31, double %33, double 0x402ADD70D2827500)
%35 = load float, float* %3
%36 = fpext float %35 to double
%37 = call double @llvm.fmuladd.f64(double %34, double %36, double 0x3FC4F15F83F55D2D)
%38 = load float, float* %3
%39 = fpext float %38 to double
%40 = call double @llvm.fmuladd.f64(double 0x402D9E20660EDB21, double %39, double 0x4062FF15C0285815)
%41 = load float, float* %3
%42 = fpext float %41 to double
%43 = call double @llvm.fmuladd.f64(double %40, double %42, double 0x406510D06A8112CE)
%44 = load float, float* %3
%45 = fpext float %44 to double
%46 = call double @llvm.fmuladd.f64(double %43, double %45, double 0x4040FECBC9E2C375)
%47 = load float, float* %3
%48 = fpext float %47 to double
%49 = call double @llvm.fmuladd.f64(double %46, double %48, double 1.000000e+00)
%50 = fdiv double %37, %49
%51 = fptrunc double %50 to float
store float %51, float* %3
%52 = load float, float* %3
%53 = load i32, i32* %5
%54 = call i64 @ldexp(float %52, i32 %53)
%55 = sitofp i64 %54 to float
store float %55, float* %4
%56 = load float, float* %4
ret float %56
}

LLVM IR (-O2):
define float @CubeRoot(float %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i64 @frexp(float %0, i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 3
%7 = icmp sgt i32 %6, 0
%8 = add nsw i32 %6, -3
%9 = select i1 %7, i32 %8, i32 %6
%10 = sitofp i64 %4 to float
%11 = sub nsw i32 %5, %9
%12 = sdiv i32 %11, 3
%13 = tail call i64 @ldexp(float %10, i32 %9)
%14 = sitofp i64 %13 to float
%15 = fpext float %14 to double
%16 = insertelement <2 x double> poison, double %15, i64 0
%17 = shufflevector <2 x double> %16, <2 x double> poison, <2 x i32> zeroinitializer
%18 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %17, <2 x double> <double 0x4046A09E6653BA70, double 0x402D9E20660EDB21>, <2 x double> <double 0x406808F46C6116E0, double 0x4062FF15C0285815>)
%19 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %18, <2 x double> %17, <2 x double> <double 0x405DCA97439CAE14, double 0x406510D06A8112CE>)
%20 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %19, <2 x double> %17, <2 x double> <double 0x402ADD70D2827500, double 0x4040FECBC9E2C375>)
%21 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %20, <2 x double> %17, <2 x double> <double 0x3FC4F15F83F55D2D, double 1.000000e+00>)
%22 = extractelement <2 x double> %21, i64 0
%23 = extractelement <2 x double> %21, i64 1
%24 = fdiv double %22, %23
%25 = fptrunc double %24 to float
%26 = tail call i64 @ldexp(float %25, i32 %12)
%27 = sitofp i64 %26 to float
ret float %27
}