#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_l(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 = 1.0 - pow((1.0 - ind), nu);
  return func;
}


x86 assembly (clang, -O0):
<power_l>:
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_l+0x3c>
jp     114c <power_l+0x3c>
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1171 <power_l+0x61>
jp     1171 <power_l+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  0xe6e(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe54(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_l>:
push   %rax
movapd %xmm1,%xmm3
xorpd  %xmm4,%xmm4
movapd %xmm2,%xmm1
cmpeqsd %xmm4,%xmm1
movsd  0xed6(%rip),%xmm5
andpd  %xmm1,%xmm5
andnpd %xmm2,%xmm1
orpd   %xmm5,%xmm1
movsd  0xeca(%rip),%xmm5
ucomisd %xmm4,%xmm0
movapd %xmm5,%xmm2
jne    114a <power_l+0x3a>
jnp    1156 <power_l+0x46>
movsd  0xeb6(%rip),%xmm2
divsd  %xmm0,%xmm2
mulsd  %xmm3,%xmm2
movapd %xmm5,%xmm0
subsd  %xmm2,%xmm0
call   1030 <pow@plt>
movsd  0xe99(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @power_l(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 = fsub double 1.000000e+00, %22
%24 = load double, double* %6
%25 = call double @pow(double %23, double %24)
%26 = fsub double 1.000000e+00, %25
store double %26, double* %8
%27 = load double, double* %8
ret double %27
}

LLVM IR (-O2):
define double @power_l(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 = fsub double 1.000000e+00, %9
%11 = tail call double @pow(double %10, double %5)
%12 = fsub double 1.000000e+00, %11
ret double %12
}