#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 */
int /*<<< orphan*/ checkSeed();
float uRand(int, int);
float lRand(int min, int max, int direction) {
  checkSeed();
  float num = 0;
  float x = 0;
  float y = 0;
  if (direction == 1)
    do {
      x = uRand(min, max);
      y = uRand(min, max);
    } while (y > x);
  else {
    do {
      x = uRand(min, max);
      y = uRand(min, max);
    } while (x > y);
  }
  num = x;
  return num;
}


x86 assembly (clang, -O0):
<lRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1040 <checkSeed@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1193 <lRand+0x73>
jmp    115f <lRand+0x3f>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <uRand@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <uRand@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
ucomiss -0x14(%rbp),%xmm0
ja     115f <lRand+0x3f>
jmp    11cc <lRand+0xac>
jmp    1198 <lRand+0x78>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <uRand@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <uRand@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
ja     1198 <lRand+0x78>
jmp    11cc <lRand+0xac>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lRand>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <checkSeed@plt>
cmp    $0x1,%r14d
jne    1170 <lRand+0x50>
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <uRand@plt>
movss  %xmm0,0xc(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <uRand@plt>
movss  0xc(%rsp),%xmm1
ucomiss %xmm1,%xmm0
ja     1140 <lRand+0x20>
jmp    1193 <lRand+0x73>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <uRand@plt>
movss  %xmm0,0xc(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <uRand@plt>
movss  0xc(%rsp),%xmm1
ucomiss %xmm0,%xmm1
ja     1170 <lRand+0x50>
movaps %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define float @lRand(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = call i32 (...) @checkSeed()
store float 0.000000e+00, float* %7
store float 0.000000e+00, float* %8
store float 0.000000e+00, float* %9
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %26
13: ; preds = %3
br label %14
14: ; preds = %21, %13
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call float @uRand(i32 %15, i32 %16)
store float %17, float* %8
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = call float @uRand(i32 %18, i32 %19)
store float %20, float* %9
br label %21
21: ; preds = %14
%22 = load float, float* %9
%23 = load float, float* %8
%24 = fcmp ogt float %22, %23
br i1 %24, label %14, label %25
25: ; preds = %21
br label %39
26: ; preds = %3
br label %27
27: ; preds = %34, %26
%28 = load i32, i32* %4
%29 = load i32, i32* %5
%30 = call float @uRand(i32 %28, i32 %29)
store float %30, float* %8
%31 = load i32, i32* %4
%32 = load i32, i32* %5
%33 = call float @uRand(i32 %31, i32 %32)
store float %33, float* %9
br label %34
34: ; preds = %27
%35 = load float, float* %8
%36 = load float, float* %9
%37 = fcmp ogt float %35, %36
br i1 %37, label %27, label %38
38: ; preds = %34
br label %39
39: ; preds = %38, %25
%40 = load float, float* %8
store float %40, float* %7
%41 = load float, float* %7
ret float %41
}

LLVM IR (-O2):
define float @lRand(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @checkSeed()
%5 = icmp eq i32 %2, 1
br i1 %5, label %6, label %10
6: ; preds = %3, %6
%7 = tail call float @uRand(i32 %0, i32 %1)
%8 = tail call float @uRand(i32 %0, i32 %1)
%9 = fcmp ogt float %8, %7
br i1 %9, label %6, label %14
10: ; preds = %3, %10
%11 = tail call float @uRand(i32 %0, i32 %1)
%12 = tail call float @uRand(i32 %0, i32 %1)
%13 = fcmp ogt float %11, %12
br i1 %13, label %10, label %14
14: ; preds = %10, %6
%15 = phi float [ %7, %6 ], [ %11, %10 ]
ret float %15
}