#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(double, double);
double power_r(double n_sub, double ind, double nu) {
  double bin_size, func;
  if (nu == 0.0)
    nu = 1e-14;
  if (n_sub == 0.0)
    n_sub = 1.0;
  bin_size = 1.0 / n_sub;
  ind *= bin_size;
  func = pow(ind, nu);
  return func;
}


x86 assembly (clang, -O0):
<power_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114c <power_r+0x3c>
jp     114c <power_r+0x3c>
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1171 <power_r+0x61>
jp     1171 <power_r+0x61>
movsd  0xe9c(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe8f(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_r>:
xorpd  %xmm3,%xmm3
movapd %xmm2,%xmm4
cmpeqsd %xmm3,%xmm4
movsd  0xedb(%rip),%xmm5
andpd  %xmm4,%xmm5
andnpd %xmm2,%xmm4
orpd   %xmm5,%xmm4
ucomisd %xmm3,%xmm0
jne    1143 <power_r+0x33>
jp     1143 <power_r+0x33>
movsd  0xec7(%rip),%xmm3
jmp    114f <power_r+0x3f>
movsd  0xebd(%rip),%xmm3
divsd  %xmm0,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm3,%xmm0
movapd %xmm4,%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @power_r(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %6
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %3
store double 0x3D06849B86A12B9B, double* %6
br label %12
12: ; preds = %11, %3
%13 = load double, double* %4
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %12
store double 1.000000e+00, double* %4
br label %16
16: ; preds = %15, %12
%17 = load double, double* %4
%18 = fdiv double 1.000000e+00, %17
store double %18, double* %7
%19 = load double, double* %7
%20 = load double, double* %5
%21 = fmul double %20, %19
store double %21, double* %5
%22 = load double, double* %5
%23 = load double, double* %6
%24 = call double @pow(double %22, double %23)
store double %24, double* %8
%25 = load double, double* %8
ret double %25
}

LLVM IR (-O2):
define double @power_r(double %0, double %1, double %2) {
%4 = fcmp oeq double %2, 0.000000e+00
%5 = select i1 %4, double 0x3D06849B86A12B9B, double %2
%6 = fcmp oeq double %0, 0.000000e+00
%7 = fdiv double 1.000000e+00, %0
%8 = select i1 %6, double 1.000000e+00, double %7
%9 = fmul double %8, %1
%10 = tail call double @pow(double %9, double %5)
ret double %10
}