#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 */
short get_rand(int, int);
unsigned short gr_what_is(void) {
  short 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    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x1e,%eax
jg     1143 <gr_what_is+0x33>
movw   $0x4,-0x4(%rbp)
jmp    11da <gr_what_is+0xca>
movswl -0x2(%rbp),%eax
cmp    $0x3c,%eax
jg     115b <gr_what_is+0x4b>
movw   $0x8,-0x4(%rbp)
jmp    11d5 <gr_what_is+0xc5>
movswl -0x2(%rbp),%eax
cmp    $0x40,%eax
jg     1173 <gr_what_is+0x63>
movw   $0x40,-0x4(%rbp)
jmp    11d0 <gr_what_is+0xc0>
movswl -0x2(%rbp),%eax
cmp    $0x4a,%eax
jg     118b <gr_what_is+0x7b>
movw   $0x2,-0x4(%rbp)
jmp    11cb <gr_what_is+0xbb>
movswl -0x2(%rbp),%eax
cmp    $0x53,%eax
jg     11a3 <gr_what_is+0x93>
movw   $0x1,-0x4(%rbp)
jmp    11c6 <gr_what_is+0xb6>
movswl -0x2(%rbp),%eax
cmp    $0x58,%eax
jg     11bb <gr_what_is+0xab>
movw   $0x20,-0x4(%rbp)
jmp    11c1 <gr_what_is+0xb1>
movw   $0x80,-0x4(%rbp)
jmp    11c6 <gr_what_is+0xb6>
jmp    11cb <gr_what_is+0xbb>
jmp    11d0 <gr_what_is+0xc0>
jmp    11d5 <gr_what_is+0xc5>
jmp    11da <gr_what_is+0xca>
movzwl -0x4(%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,%cx
jl     1165 <gr_what_is+0x55>
mov    $0x8,%ax
cmp    $0x3d,%cx
jb     1165 <gr_what_is+0x55>
mov    $0x40,%ax
cmp    $0x41,%cx
jb     1165 <gr_what_is+0x55>
mov    $0x2,%ax
cmp    $0x4b,%cx
jb     1165 <gr_what_is+0x55>
mov    $0x1,%ax
cmp    $0x54,%cx
jb     1165 <gr_what_is+0x55>
cmp    $0x59,%cx
mov    $0x20,%ecx
mov    $0x80,%eax
cmovb  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define zeroext i16 @gr_what_is() {
%1 = tail call signext i16 @get_rand(i32 1, i32 91)
%2 = icmp slt i16 %1, 31
br i1 %2, label %14, label %3
3: ; preds = %0
%4 = icmp ult i16 %1, 61
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = icmp ult i16 %1, 65
br i1 %6, label %14, label %7
7: ; preds = %5
%8 = icmp ult i16 %1, 75
br i1 %8, label %14, label %9
9: ; preds = %7
%10 = icmp ult i16 %1, 84
br i1 %10, label %14, label %11
11: ; preds = %9
%12 = icmp ult i16 %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
}