#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 /*<<< orphan*/ RoundRobin();
int /*<<< orphan*/ ShortestJobFirst();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int choice;
  printf("Enter your choice :\n");
  printf("1. RoundRobin\n");
  printf("2. ShortestJobFirst\n");
  scanf("%d", &choice);
  switch (choice) {
  case 1:
    RoundRobin();
    break;
  case 2:
    ShortestJobFirst();
    break;
  default:
    printf("Exit.\n");
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     11af <main+0x6f>
jmp    119e <main+0x5e>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     11bb <main+0x7b>
jmp    11c7 <main+0x87>
mov    $0x0,%al
call   1030 <RoundRobin@plt>
jmp    11df <main+0x9f>
mov    $0x0,%al
call   1060 <ShortestJobFirst@plt>
jmp    11df <main+0x9f>
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11e6 <main+0xa6>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xe94(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
je     118d <main+0x4d>
cmp    $0x1,%eax
jne    1196 <main+0x56>
xor    %eax,%eax
call   1040 <RoundRobin@plt>
jmp    11a2 <main+0x62>
xor    %eax,%eax
call   1060 <ShortestJobFirst@plt>
jmp    11a2 <main+0x62>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Enter your choice :\0A\00"
@.str.1 = [15 x i8] c"1. RoundRobin\0A\00"
@.str.2 = [21 x i8] c"2. ShortestJobFirst\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [7 x i8] c"Exit.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%11 = load i32, i32* %6
switch i32 %11, label %16 [
i32 1, label %12
i32 2, label %14
]
12: ; preds = %2
%13 = call i32 (...) @RoundRobin()
br label %18
14: ; preds = %2
%15 = call i32 (...) @ShortestJobFirst()
br label %18
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %3
br label %19
18: ; preds = %14, %12
store i32 0, i32* %3
br label %19
19: ; preds = %18, %16
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str.3 = [3 x i8] c"%d\00"
@str = [20 x i8] c"Enter your choice :\00"
@str.5 = [14 x i8] c"1. RoundRobin\00"
@str.6 = [20 x i8] c"2. ShortestJobFirst\00"
@str.7 = [6 x i8] c"Exit.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.5, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
switch i32 %9, label %14 [
i32 1, label %10
i32 2, label %12
]
10: ; preds = %2
%11 = call i32 (...) @RoundRobin()
br label %16
12: ; preds = %2
%13 = call i32 (...) @ShortestJobFirst()
br label %16
14: ; preds = %2
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.7, i64 0, i64 0))
br label %16
16: ; preds = %10, %12, %14
ret i32 0
}