#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 get_rand(int, int);
unsigned short gr_what_is(void) {
  int percent;
  unsigned short what_is;
  percent = get_rand(1, 91);
  if (percent <= 30) {
    what_is = ((unsigned short)04);
  } else if (percent <= 60) {
    what_is = ((unsigned short)010);
  } else if (percent <= 64) {
    what_is = ((unsigned short)0100);
  } else if (percent <= 74) {
    what_is = ((unsigned short)02);
  } else if (percent <= 83) {
    what_is = ((unsigned short)01);
  } else if (percent <= 88) {
    what_is = ((unsigned short)040);
  } else {
    what_is = ((unsigned short)0200);
  }
  return (what_is);
}


x86 assembly (clang, -O0):
<gr_what_is>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x5b,%esi
call   1030 <get_rand@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1e,-0x4(%rbp)
jg     113f <gr_what_is+0x2f>
movw   $0x4,-0x6(%rbp)
jmp    11c7 <gr_what_is+0xb7>
cmpl   $0x3c,-0x4(%rbp)
jg     1154 <gr_what_is+0x44>
movw   $0x8,-0x6(%rbp)
jmp    11c2 <gr_what_is+0xb2>
cmpl   $0x40,-0x4(%rbp)
jg     1169 <gr_what_is+0x59>
movw   $0x40,-0x6(%rbp)
jmp    11bd <gr_what_is+0xad>
cmpl   $0x4a,-0x4(%rbp)
jg     117e <gr_what_is+0x6e>
movw   $0x2,-0x6(%rbp)
jmp    11b8 <gr_what_is+0xa8>
cmpl   $0x53,-0x4(%rbp)
jg     1193 <gr_what_is+0x83>
movw   $0x1,-0x6(%rbp)
jmp    11b3 <gr_what_is+0xa3>
cmpl   $0x58,-0x4(%rbp)
jg     11a8 <gr_what_is+0x98>
movw   $0x20,-0x6(%rbp)
jmp    11ae <gr_what_is+0x9e>
movw   $0x80,-0x6(%rbp)
jmp    11b3 <gr_what_is+0xa3>
jmp    11b8 <gr_what_is+0xa8>
jmp    11bd <gr_what_is+0xad>
jmp    11c2 <gr_what_is+0xb2>
jmp    11c7 <gr_what_is+0xb7>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gr_what_is>:
push   %rax
mov    $0x1,%edi
mov    $0x5b,%esi
call   1030 <get_rand@plt>
mov    %eax,%ecx
mov    $0x4,%ax
cmp    $0x1f,%ecx
jl     115f <gr_what_is+0x4f>
mov    $0x8,%ax
cmp    $0x3d,%ecx
jb     115f <gr_what_is+0x4f>
mov    $0x40,%ax
cmp    $0x41,%ecx
jb     115f <gr_what_is+0x4f>
mov    $0x2,%ax
cmp    $0x4b,%ecx
jb     115f <gr_what_is+0x4f>
mov    $0x1,%ax
cmp    $0x54,%ecx
jb     115f <gr_what_is+0x4f>
cmp    $0x59,%ecx
mov    $0x20,%ecx
mov    $0x80,%eax
cmovb  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @gr_what_is() {
%1 = alloca i32
%2 = alloca i16
%3 = call i32 @get_rand(i32 1, i32 91)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 30
br i1 %5, label %6, label %7
6: ; preds = %0
store i16 4, i16* %2
br label %33
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp sle i32 %8, 60
br i1 %9, label %10, label %11
10: ; preds = %7
store i16 8, i16* %2
br label %32
11: ; preds = %7
%12 = load i32, i32* %1
%13 = icmp sle i32 %12, 64
br i1 %13, label %14, label %15
14: ; preds = %11
store i16 64, i16* %2
br label %31
15: ; preds = %11
%16 = load i32, i32* %1
%17 = icmp sle i32 %16, 74
br i1 %17, label %18, label %19
18: ; preds = %15
store i16 2, i16* %2
br label %30
19: ; preds = %15
%20 = load i32, i32* %1
%21 = icmp sle i32 %20, 83
br i1 %21, label %22, label %23
22: ; preds = %19
store i16 1, i16* %2
br label %29
23: ; preds = %19
%24 = load i32, i32* %1
%25 = icmp sle i32 %24, 88
br i1 %25, label %26, label %27
26: ; preds = %23
store i16 32, i16* %2
br label %28
27: ; preds = %23
store i16 128, i16* %2
br label %28
28: ; preds = %27, %26
br label %29
29: ; preds = %28, %22
br label %30
30: ; preds = %29, %18
br label %31
31: ; preds = %30, %14
br label %32
32: ; preds = %31, %10
br label %33
33: ; preds = %32, %6
%34 = load i16, i16* %2
ret i16 %34
}

LLVM IR (-O2):
define zeroext i16 @gr_what_is() {
%1 = tail call i32 @get_rand(i32 1, i32 91)
%2 = icmp slt i32 %1, 31
br i1 %2, label %14, label %3
3: ; preds = %0
%4 = icmp ult i32 %1, 61
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = icmp ult i32 %1, 65
br i1 %6, label %14, label %7
7: ; preds = %5
%8 = icmp ult i32 %1, 75
br i1 %8, label %14, label %9
9: ; preds = %7
%10 = icmp ult i32 %1, 84
br i1 %10, label %14, label %11
11: ; preds = %9
%12 = icmp ult i32 %1, 89
%13 = select i1 %12, i16 32, i16 128
br label %14
14: ; preds = %11, %9, %7, %5, %3, %0
%15 = phi i16 [ 4, %0 ], [ 8, %3 ], [ 64, %5 ], [ 2, %7 ], [ 1, %9 ], [ %13, %11 ]
ret i16 %15
}