#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 randJain(int /*<<< orphan*/);
double pareto(double a, double k) {
  double z;
  double rv;
  do {
    z = randJain(0);
  } while ((z == 0) || (z == 1));
  rv = k / pow(z, (1.0 / a));
  return (rv);
}


x86 assembly (clang, -O0):
<pareto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xor    %edi,%edi
call   1030 <randJain@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x21(%rbp)
jne    1160 <pareto+0x40>
jp     1160 <pareto+0x40>
jmp    117c <pareto+0x5c>
movsd  -0x18(%rbp),%xmm0
movsd  0xe93(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1132 <pareto+0x12>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe62(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pareto>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %edi,%edi
call   1030 <randJain@plt>
ucomisd 0xec9(%rip),%xmm0
jne    1143 <pareto+0x23>
jnp    1130 <pareto+0x10>
ucomisd 0xeb5(%rip),%xmm0
jne    114f <pareto+0x2f>
jnp    1130 <pareto+0x10>
movsd  0xea9(%rip),%xmm1
divsd  0x8(%rsp),%xmm1
call   1040 <pow@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @pareto(double %0, double %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call double @randJain(i32 0)
%5 = fcmp oeq double %4, 0.000000e+00
%6 = fcmp oeq double %4, 1.000000e+00
%7 = or i1 %5, %6
br i1 %7, label %3, label %8
8: ; preds = %3
%9 = fdiv double 1.000000e+00, %0
%10 = tail call double @pow(double %4, double %9)
%11 = fdiv double %1, %10
ret double %11
}