#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ input();
int /*<<< orphan*/ print();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ request();
int /*<<< orphan*/ safseq();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int ch;
  while (1) {
    printf("\n\nMenu\n1.Input\n2.Safe seq\n3.Request\n4.Print\n5.Exit\n");
    printf("Enter your choice : ");
    scanf("%d", &ch);
    switch (ch) {
    case 1:
      input();
      break;
    case 2:
      safseq();
      break;
    case 3:
      request();
      break;
    case 4:
      print();
      break;
    case 5:
      exit(0);
    default:
      printf("Invalid choice \n");
      continue;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     1207 <main+0x97>
mov    -0x10(%rbp),%rax
lea    0xe39(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1030 <input@plt>
jmp    1218 <main+0xa8>
mov    $0x0,%al
call   1060 <safseq@plt>
jmp    1218 <main+0xa8>
mov    $0x0,%al
call   1080 <request@plt>
jmp    1218 <main+0xa8>
mov    $0x0,%al
call   1050 <print@plt>
jmp    1218 <main+0xa8>
xor    %edi,%edi
call   1090 <exit@plt>
lea    0xe52(%rip),%rdi
call   1040 <printf@plt>
jmp    117f <main+0xf>
jmp    117f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe9a(%rip),%r14
lea    0xe7b(%rip),%r15
lea    0xe89(%rip),%r12
lea    0x4(%rsp),%rbx
lea    0xeb3(%rip),%r13
lea    0xe4d(%rip),%rbp
jmp    11c0 <main+0x40>
xor    %eax,%eax
call   1060 <print@plt>
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     1203 <main+0x83>
movslq 0x0(%rbp,%rax,4),%rax
add    %rbp,%rax
jmp    *%rax
xor    %eax,%eax
call   1030 <input@plt>
jmp    11c0 <main+0x40>
xor    %eax,%eax
call   1090 <request@plt>
jmp    11c0 <main+0x40>
mov    %r13,%rdi
call   1040 <puts@plt>
jmp    11c0 <main+0x40>
xor    %eax,%eax
call   1070 <safseq@plt>
jmp    11c0 <main+0x40>
xor    %edi,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"\0A\0AMenu\0A1.Input\0A2.Safe seq\0A3.Request\0A4.Print\0A5.Exit\0A\00"
@.str.1 = [21 x i8] c"Enter your choice : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [17 x i8] c"Invalid choice \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %18, %20
%4 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
switch i32 %7, label %18 [
i32 1, label %8
i32 2, label %10
i32 3, label %12
i32 4, label %14
i32 5, label %16
]
8: ; preds = %3
%9 = call i32 (...) @input()
br label %20
10: ; preds = %3
%11 = call i32 (...) @safseq()
br label %20
12: ; preds = %3
%13 = call i32 (...) @request()
br label %20
14: ; preds = %3
%15 = call i32 (...) @print()
br label %20
16: ; preds = %3
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %3
%19 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %3
20: ; preds = %14, %12, %10, %8
br label %3
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"Enter your choice : \00"
@.str.2 = [3 x i8] c"%d\00"
@str = [51 x i8] c"\0A\0AMenu\0A1.Input\0A2.Safe seq\0A3.Request\0A4.Print\0A5.Exit\00"
@str.4 = [16 x i8] c"Invalid choice \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %10, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
switch i32 %7, label %19 [
i32 1, label %8
i32 2, label %11
i32 3, label %13
i32 4, label %15
i32 5, label %17
]
8: ; preds = %3
%9 = call i32 (...) @input()
br label %10
10: ; preds = %8, %11, %13, %15, %19
br label %3
11: ; preds = %3
%12 = call i32 (...) @safseq()
br label %10
13: ; preds = %3
%14 = call i32 (...) @request()
br label %10
15: ; preds = %3
%16 = call i32 (...) @print()
br label %10
17: ; preds = %3
%18 = call i32 @exit(i32 0)
unreachable
19: ; preds = %3
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0))
br label %10
}