#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 fmax(int, double);
double myrand();
double pow(int, double);
double FUniform(double Ftrue, double alpha, double beta) {
  double Fval = pow(myrand(), beta) * Ftrue *
                fmax(1., pow(1e9 / (Ftrue + 1e-99), alpha * myrand()));
  Fval += 1.01 * 1e-8;
  if (Ftrue < 1e-8) {
    Fval = Ftrue;
  }
  return Fval;
}


x86 assembly (clang, -O0):
<FUniform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    $0x0,%al
call   1030 <myrand@plt>
cvttsd2si %xmm0,%edi
movsd  -0x18(%rbp),%xmm0
call   1050 <pow@plt>
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeaa(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  0xe95(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x34(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    $0x0,%al
call   1030 <myrand@plt>
mov    -0x34(%rbp),%edi
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <pow@plt>
mov    $0x1,%edi
call   1040 <fmax@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe3a(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe20(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11f5 <FUniform+0xc5>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FUniform>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x8(%rsp)
movapd %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <myrand@plt>
cvttsd2si %xmm0,%edi
movsd  (%rsp),%xmm0
call   1050 <pow@plt>
movapd 0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe8e(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe8a(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%ebx
xor    %eax,%eax
call   1030 <myrand@plt>
mulsd  0x8(%rsp),%xmm0
mov    %ebx,%edi
call   1050 <pow@plt>
mov    $0x1,%edi
call   1040 <fmax@plt>
mulsd  (%rsp),%xmm0
addsd  0xe5f(%rip),%xmm0
movapd 0x10(%rsp),%xmm3
movapd %xmm3,%xmm1
cmpltsd 0xe54(%rip),%xmm1
movapd %xmm1,%xmm2
andnpd %xmm0,%xmm2
andpd  %xmm3,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @FUniform(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = call double (...) @myrand()
%9 = fptosi double %8 to i32
%10 = load double, double* %6
%11 = call double @pow(i32 %9, double %10)
%12 = load double, double* %4
%13 = fmul double %11, %12
%14 = load double, double* %4
%15 = fadd double %14, 1.000000e-99
%16 = fdiv double 1.000000e+09, %15
%17 = fptosi double %16 to i32
%18 = load double, double* %5
%19 = call double (...) @myrand()
%20 = fmul double %18, %19
%21 = call double @pow(i32 %17, double %20)
%22 = call double @fmax(i32 1, double %21)
%23 = fmul double %13, %22
store double %23, double* %7
%24 = load double, double* %7
%25 = fadd double %24, 0x3E45B088A1E43BB6
store double %25, double* %7
%26 = load double, double* %4
%27 = fcmp olt double %26, 1.000000e-08
br i1 %27, label %28, label %30
28: ; preds = %3
%29 = load double, double* %4
store double %29, double* %7
br label %30
30: ; preds = %28, %3
%31 = load double, double* %7
ret double %31
}

LLVM IR (-O2):
define double @FUniform(double %0, double %1, double %2) {
%4 = tail call double (...) @myrand()
%5 = fptosi double %4 to i32
%6 = tail call double @pow(i32 %5, double %2)
%7 = fmul double %6, %0
%8 = fadd double %0, 1.000000e-99
%9 = fdiv double 1.000000e+09, %8
%10 = fptosi double %9 to i32
%11 = tail call double (...) @myrand()
%12 = fmul double %11, %1
%13 = tail call double @pow(i32 %10, double %12)
%14 = tail call double @fmax(i32 1, double %13)
%15 = fmul double %7, %14
%16 = fadd double %15, 0x3E45B088A1E43BB6
%17 = fcmp olt double %0, 1.000000e-08
%18 = select i1 %17, double %0, double %16
ret double %18
}