#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 */
unsigned int get_random();
unsigned int get_input_space_partitioned_random(void) {
  unsigned int cl = get_random() % (unsigned int)5;
  switch (cl) {
  case 0: {
    return get_random();
  }
  case 1: {
    return (unsigned int)0;
  }
  case 2: {
    return (unsigned int)1;
  }
  case 3: {
    return 4294967295u;
  }
  case 4: {
    return get_random() % (unsigned int)300;
  }
  default: {
    return 0;
  }
  }
}


x86 assembly (clang, -O0):
<get_input_space_partitioned_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <get_random@plt>
mov    %eax,%ecx
mov    $0xcccccccd,%edx
imul   %rdx,%rcx
shr    $0x22,%rcx
mov    %ecx,%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x4,%rax
ja     11aa <get_input_space_partitioned_random+0x9a>
mov    -0x10(%rbp),%rax
lea    0xeaa(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1030 <get_random@plt>
mov    %eax,-0x4(%rbp)
jmp    11b1 <get_input_space_partitioned_random+0xa1>
movl   $0x0,-0x4(%rbp)
jmp    11b1 <get_input_space_partitioned_random+0xa1>
movl   $0x1,-0x4(%rbp)
jmp    11b1 <get_input_space_partitioned_random+0xa1>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b1 <get_input_space_partitioned_random+0xa1>
mov    $0x0,%al
call   1030 <get_random@plt>
mov    $0x12c,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x4(%rbp)
jmp    11b1 <get_input_space_partitioned_random+0xa1>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_input_space_partitioned_random>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <get_random@plt>
mov    %eax,%ecx
mov    $0xcccccccd,%edx
imul   %rcx,%rdx
shr    $0x22,%rdx
lea    (%rdx,%rdx,4),%ecx
sub    %ecx,%eax
cmp    $0x4,%eax
ja     1177 <get_input_space_partitioned_random+0x67>
lea    0xec6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
pop    %rbx
jmp    1030 <get_random@plt>
mov    $0x1,%ebx
jmp    1177 <get_input_space_partitioned_random+0x67>
mov    $0xffffffff,%ebx
jmp    1177 <get_input_space_partitioned_random+0x67>
xor    %eax,%eax
call   1030 <get_random@plt>
mov    %eax,%ebx
mov    %eax,%eax
imul   $0x1b4e81b5,%rax,%rax
shr    $0x25,%rax
imul   $0x12c,%eax,%eax
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_input_space_partitioned_random() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @get_random()
%4 = urem i32 %3, 5
store i32 %4, i32* %2
%5 = load i32, i32* %2
switch i32 %5, label %14 [
i32 0, label %6
i32 1, label %8
i32 2, label %9
i32 3, label %10
i32 4, label %11
]
6: ; preds = %0
%7 = call i32 (...) @get_random()
store i32 %7, i32* %1
br label %15
8: ; preds = %0
store i32 0, i32* %1
br label %15
9: ; preds = %0
store i32 1, i32* %1
br label %15
10: ; preds = %0
store i32 -1, i32* %1
br label %15
11: ; preds = %0
%12 = call i32 (...) @get_random()
%13 = urem i32 %12, 300
store i32 %13, i32* %1
br label %15
14: ; preds = %0
store i32 0, i32* %1
br label %15
15: ; preds = %14, %11, %10, %9, %8, %6
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_input_space_partitioned_random() {
%1 = tail call i32 (...) @get_random()
%2 = urem i32 %1, 5
switch i32 %2, label %10 [
i32 0, label %3
i32 4, label %7
i32 2, label %5
i32 3, label %6
]
3: ; preds = %0
%4 = tail call i32 (...) @get_random()
br label %10
5: ; preds = %0
br label %10
6: ; preds = %0
br label %10
7: ; preds = %0
%8 = tail call i32 (...) @get_random()
%9 = urem i32 %8, 300
br label %10
10: ; preds = %0, %7, %6, %5, %3
%11 = phi i32 [ %9, %7 ], [ -1, %6 ], [ 1, %5 ], [ %4, %3 ], [ 0, %0 ]
ret i32 %11
}