#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 gr_what_is() {
  int percent;
  unsigned 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     1140 <gr_what_is+0x30>
movl   $0x4,-0x8(%rbp)
jmp    11ce <gr_what_is+0xbe>
cmpl   $0x3c,-0x4(%rbp)
jg     1156 <gr_what_is+0x46>
movl   $0x8,-0x8(%rbp)
jmp    11c9 <gr_what_is+0xb9>
cmpl   $0x40,-0x4(%rbp)
jg     116c <gr_what_is+0x5c>
movl   $0x40,-0x8(%rbp)
jmp    11c4 <gr_what_is+0xb4>
cmpl   $0x4a,-0x4(%rbp)
jg     1182 <gr_what_is+0x72>
movl   $0x2,-0x8(%rbp)
jmp    11bf <gr_what_is+0xaf>
cmpl   $0x53,-0x4(%rbp)
jg     1198 <gr_what_is+0x88>
movl   $0x1,-0x8(%rbp)
jmp    11ba <gr_what_is+0xaa>
cmpl   $0x58,-0x4(%rbp)
jg     11ae <gr_what_is+0x9e>
movl   $0x20,-0x8(%rbp)
jmp    11b5 <gr_what_is+0xa5>
movl   $0x80,-0x8(%rbp)
jmp    11ba <gr_what_is+0xaa>
jmp    11bf <gr_what_is+0xaf>
jmp    11c4 <gr_what_is+0xb4>
jmp    11c9 <gr_what_is+0xb9>
jmp    11ce <gr_what_is+0xbe>
mov    -0x8(%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    $0x4,%ecx
cmp    $0x1f,%eax
jl     1162 <gr_what_is+0x52>
mov    $0x8,%ecx
cmp    $0x3d,%eax
jb     1162 <gr_what_is+0x52>
mov    $0x40,%ecx
cmp    $0x41,%eax
jb     1162 <gr_what_is+0x52>
mov    $0x2,%ecx
cmp    $0x4b,%eax
jb     1162 <gr_what_is+0x52>
mov    $0x1,%ecx
cmp    $0x54,%eax
jb     1162 <gr_what_is+0x52>
cmp    $0x59,%eax
mov    $0x20,%eax
mov    $0x80,%ecx
cmovb  %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gr_what_is() {
%1 = alloca i32
%2 = alloca i32
%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 i32 4, i32* %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 i32 8, i32* %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 i32 64, i32* %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 i32 2, i32* %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 i32 1, i32* %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 i32 32, i32* %2
br label %28
27: ; preds = %23
store i32 128, i32* %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 i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @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, i32 32, i32 128
br label %14
14: ; preds = %11, %9, %7, %5, %3, %0
%15 = phi i32 [ 4, %0 ], [ 8, %3 ], [ 64, %5 ], [ 2, %7 ], [ 1, %9 ], [ %13, %11 ]
ret i32 %15
}