#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*/ input();
int /*<<< orphan*/ print();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ request();
int /*<<< orphan*/ safeseq();
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int ch;
  do {
    printf("\n menu:");
    printf("\n 1.Input:");
    printf("\n 2.Safe Seq:");
    printf("\n 3.Request:");
    printf("\n 4.Print:");
    printf("\n 5.exit:");
    printf("\n Ent choice");
    scanf("%d", &ch);
    switch (ch) {
    case 1:
      input();
      break;
    case 2:
      safeseq();
      break;
    case 3:
      request();
      break;
    case 4:
      print();
      break;
    case 5:
      return 0;
    }
  } while (1);
  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    0xe97(%rip),%rdi
call   1040 <printf@plt>
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
lea    0xe93(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x4,%eax
ja     123f <main+0xdf>
mov    -0x20(%rbp),%rax
lea    0xe06(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1030 <input@plt>
jmp    123f <main+0xdf>
mov    $0x0,%al
call   1080 <safeseq@plt>
jmp    123f <main+0xdf>
mov    $0x0,%al
call   1070 <request@plt>
jmp    123f <main+0xdf>
mov    $0x0,%al
call   1050 <print@plt>
jmp    123f <main+0xdf>
movl   $0x0,-0x4(%rbp)
jmp    125a <main+0xfa>
jmp    1244 <main+0xe4>
mov    $0x1,%al
test   $0x1,%al
jne    1176 <main+0x16>
jmp    1253 <main+0xf3>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xed0(%rip),%rbx
lea    0xed4(%rip),%rbp
lea    0xed7(%rip),%r14
lea    0xedd(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xe6d(%rip),%r13
jmp    11a0 <main+0x40>
xor    %eax,%eax
call   1050 <print@plt>
nopl   0x0(%rax)
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbp,%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     11a0 <main+0x40>
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
jmp    *%rax
xor    %eax,%eax
call   1030 <input@plt>
jmp    11a0 <main+0x40>
xor    %eax,%eax
call   1080 <safeseq@plt>
jmp    11a0 <main+0x40>
xor    %eax,%eax
call   1070 <request@plt>
jmp    11a0 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\0A menu:\00"
@.str.1 = [11 x i8] c"\0A 1.Input:\00"
@.str.2 = [14 x i8] c"\0A 2.Safe Seq:\00"
@.str.3 = [13 x i8] c"\0A 3.Request:\00"
@.str.4 = [11 x i8] c"\0A 4.Print:\00"
@.str.5 = [10 x i8] c"\0A 5.exit:\00"
@.str.6 = [13 x i8] c"\0A Ent choice\00"
@.str.7 = [3 x i8] c"%d\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
br label %7
7: ; preds = %27, %2
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %6)
%16 = load i32, i32* %6
switch i32 %16, label %26 [
i32 1, label %17
i32 2, label %19
i32 3, label %21
i32 4, label %23
i32 5, label %25
]
17: ; preds = %7
%18 = call i32 (...) @input()
br label %26
19: ; preds = %7
%20 = call i32 (...) @safeseq()
br label %26
21: ; preds = %7
%22 = call i32 (...) @request()
br label %26
23: ; preds = %7
%24 = call i32 (...) @print()
br label %26
25: ; preds = %7
store i32 0, i32* %3
br label %29
26: ; preds = %7, %23, %21, %19, %17
br label %27
27: ; preds = %26
br i1 true, label %7, label %28
28: ; preds = %27
store i32 0, i32* %3
br label %29
29: ; preds = %28, %25
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0A menu:\00"
@.str.1 = [11 x i8] c"\0A 1.Input:\00"
@.str.2 = [14 x i8] c"\0A 2.Safe Seq:\00"
@.str.3 = [13 x i8] c"\0A 3.Request:\00"
@.str.4 = [11 x i8] c"\0A 4.Print:\00"
@.str.5 = [10 x i8] c"\0A 5.exit:\00"
@.str.6 = [13 x i8] c"\0A Ent choice\00"
@.str.7 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %17, %2
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %3)
%14 = load i32, i32* %3
switch i32 %14, label %17 [
i32 1, label %15
i32 2, label %18
i32 3, label %20
i32 4, label %22
i32 5, label %24
]
15: ; preds = %5
%16 = call i32 (...) @input()
br label %17
17: ; preds = %15, %18, %20, %22, %5
br label %5
18: ; preds = %5
%19 = call i32 (...) @safeseq()
br label %17
20: ; preds = %5
%21 = call i32 (...) @request()
br label %17
22: ; preds = %5
%23 = call i32 (...) @print()
br label %17
24: ; preds = %5
ret i32 0
}