#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();
int coinflip();
float lRand(int, int, int);
float mRand(int min, int max, int median) {
  checkSeed();
  float num = 0;
  if (coinflip() == 1)
    num = num + lRand(min, (median - 1), 1);
  else
    num = num + lRand(median, max, 0);
  return num;
}


x86 assembly (clang, -O0):
<mRand>:
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)
mov    $0x0,%al
call   1050 <coinflip@plt>
cmp    $0x1,%eax
jne    1193 <mRand+0x63>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    $0x1,%edx
call   1030 <lRand@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11bb <mRand+0x8b>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <lRand@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mRand>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <checkSeed@plt>
xor    %eax,%eax
call   1050 <coinflip@plt>
cmp    $0x1,%eax
jne    115c <mRand+0x2c>
add    $0xffffffff,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x1,%edx
jmp    1163 <mRand+0x33>
mov    %ebx,%edi
mov    %r14d,%esi
xor    %edx,%edx
call   1030 <lRand@plt>
xorps  %xmm1,%xmm1
addss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define float @mRand(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 (...) @checkSeed()
store float 0.000000e+00, float* %7
%9 = call i32 (...) @coinflip()
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %18
11: ; preds = %3
%12 = load float, float* %7
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 1
%16 = call float @lRand(i32 %13, i32 %15, i32 1)
%17 = fadd float %12, %16
store float %17, float* %7
br label %24
18: ; preds = %3
%19 = load float, float* %7
%20 = load i32, i32* %6
%21 = load i32, i32* %5
%22 = call float @lRand(i32 %20, i32 %21, i32 0)
%23 = fadd float %19, %22
store float %23, float* %7
br label %24
24: ; preds = %18, %11
%25 = load float, float* %7
ret float %25
}

LLVM IR (-O2):
define float @mRand(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @checkSeed()
%5 = tail call i32 (...) @coinflip()
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = add nsw i32 %2, -1
%9 = tail call float @lRand(i32 %0, i32 %8, i32 1)
br label %12
10: ; preds = %3
%11 = tail call float @lRand(i32 %2, i32 %1, i32 0)
br label %12
12: ; preds = %10, %7
%13 = phi float [ %9, %7 ], [ %11, %10 ]
%14 = fadd float %13, 0.000000e+00
ret float %14
}