#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 abs(int);
int rand();
int Normal(void) {
  int r = abs(rand() % (100));
  if (r > 93)
    return (5);
  if (r > 87)
    return (4);
  if (r > 75)
    return (3);
  if (r > 50)
    return (2);
  return (1);
}


x86 assembly (clang, -O0):
<Normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <abs@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x5d,-0x8(%rbp)
jle    1157 <Normal+0x37>
movl   $0x5,-0x4(%rbp)
jmp    11a0 <Normal+0x80>
cmpl   $0x57,-0x8(%rbp)
jle    116d <Normal+0x4d>
movl   $0x4,-0x4(%rbp)
jmp    11a0 <Normal+0x80>
cmpl   $0x4b,-0x8(%rbp)
jle    1183 <Normal+0x63>
movl   $0x3,-0x4(%rbp)
jmp    11a0 <Normal+0x80>
cmpl   $0x32,-0x8(%rbp)
jle    1199 <Normal+0x79>
movl   $0x2,-0x4(%rbp)
jmp    11a0 <Normal+0x80>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Normal>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
mov    $0x5,%eax
cmp    $0x5d,%ecx
ja     1163 <Normal+0x53>
mov    $0x4,%eax
cmp    $0x57,%ecx
ja     1163 <Normal+0x53>
mov    $0x3,%eax
cmp    $0x4b,%ecx
ja     1163 <Normal+0x53>
cmp    $0x33,%ecx
mov    $0x1,%eax
sbb    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Normal() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 100
%5 = call i32 @abs(i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 93
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 5, i32* %1
br label %22
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 87
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 4, i32* %1
br label %22
13: ; preds = %9
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 75
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 3, i32* %1
br label %22
17: ; preds = %13
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, 50
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 2, i32* %1
br label %22
21: ; preds = %17
store i32 1, i32* %1
br label %22
22: ; preds = %21, %20, %16, %12, %8
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
define i32 @Normal() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 100
%3 = tail call i32 @llvm.abs.i32(i32 %2, i1 true)
%4 = icmp ugt i32 %3, 93
br i1 %4, label %12, label %5
5: ; preds = %0
%6 = icmp ugt i32 %3, 87
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp ugt i32 %3, 75
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ugt i32 %3, 50
%11 = select i1 %10, i32 2, i32 1
br label %12
12: ; preds = %9, %7, %5, %0
%13 = phi i32 [ 5, %0 ], [ 4, %5 ], [ 3, %7 ], [ %11, %9 ]
ret i32 %13
}