#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*/ accept();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rr();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ sjf();
void main() {
  int ch;
  printf("\n      ****MENU****\n1.Shortest Job First\n2.Round Robin "
         "Scheduling\n3.Exit\n\nEnter your choice:");
  scanf("%d", &ch);
  switch (ch) {
  case 1:
    accept();
    sjf();
    break;
  case 2:
    rr();
    break;
  case 3:
    break;
  default:
    printf("\nInvalid choice\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     11aa <main+0x5a>
jmp    1188 <main+0x38>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     11bd <main+0x6d>
jmp    1199 <main+0x49>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     11c9 <main+0x79>
jmp    11ce <main+0x7e>
mov    $0x0,%al
call   1060 <accept@plt>
mov    $0x0,%al
call   1070 <sjf@plt>
jmp    11da <main+0x8a>
mov    $0x0,%al
call   1040 <rr@plt>
jmp    11da <main+0x8a>
jmp    11da <main+0x8a>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
je     11b6 <main+0x56>
cmp    $0x2,%eax
je     11a1 <main+0x41>
cmp    $0x1,%eax
jne    11aa <main+0x4a>
xor    %eax,%eax
call   1070 <accept@plt>
xor    %eax,%eax
call   1080 <sjf@plt>
pop    %rax
ret
xor    %eax,%eax
call   1050 <rr@plt>
pop    %rax
ret
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [93 x i8] c"\0A ****MENU****\0A1.Shortest Job First\0A2.Round Robin Scheduling\0A3.Exit\0A\0AEnter your choice:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"\0AInvalid choice\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
switch i32 %4, label %11 [
i32 1, label %5
i32 2, label %8
i32 3, label %10
]
5: ; preds = %0
%6 = call i32 (...) @accept()
%7 = call i32 (...) @sjf()
br label %13
8: ; preds = %0
%9 = call i32 (...) @rr()
br label %13
10: ; preds = %0
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %10, %8, %5
ret void
}

LLVM IR (-O2):
@.str = [93 x i8] c"\0A ****MENU****\0A1.Shortest Job First\0A2.Round Robin Scheduling\0A3.Exit\0A\0AEnter your choice:\00"
@.str.1 = [3 x i8] c"%d\00"
@str = [16 x i8] c"\0AInvalid choice\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
switch i32 %5, label %11 [
i32 1, label %6
i32 2, label %9
i32 3, label %13
]
6: ; preds = %0
%7 = call i32 (...) @accept()
%8 = call i32 (...) @sjf()
br label %13
9: ; preds = %0
%10 = call i32 (...) @rr()
br label %13
11: ; preds = %0
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %13
13: ; preds = %11, %0, %9, %6
ret void
}