#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*/ aboutThisApp();
int /*<<< orphan*/ apps();
int /*<<< orphan*/ install();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ update();
void main() {
  char command[50];
  char input[7] = {0};
  aboutThisApp();
  update();
  while (1) {
    printf("<><><><><><><><><><><><><>\n");
    printf("Input command [install/update/apps/about/exit]: ");
    scanf("%s", input);
    if (!strcmp(input, "install")) {
      printf("INSTALL\n");
      install();
    } else if (!strcmp(input, "update")) {
      printf("UPDATE\n");
      update();
    } else if (!strcmp(input, "apps")) {
      printf("APPS\n");
      apps();
    } else if (!strcmp(input, "about")) {
      printf("ABOUT\n");
    } else if (!strcmp(input, "exit")) {
      printf("EXIT\n");
      break;
    } else {
      printf("Command not fount\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x47(%rbp),%rdi
xor    %esi,%esi
mov    $0x7,%edx
call   1050 <memset@plt>
mov    $0x0,%al
call   1090 <aboutThisApp@plt>
mov    $0x0,%al
call   1030 <update@plt>
lea    0xe53(%rip),%rdi
call   1040 <printf@plt>
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
lea    -0x47(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   10a0 <scanf@plt>
lea    -0x47(%rbp),%rdi
lea    0xe77(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    11ff <main+0x7f>
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <install@plt>
jmp    12d5 <main+0x155>
lea    -0x47(%rbp),%rdi
lea    0xe57(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    1230 <main+0xb0>
lea    0xe49(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <update@plt>
jmp    12d0 <main+0x150>
lea    -0x47(%rbp),%rdi
lea    0xe35(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    1261 <main+0xe1>
lea    0xe25(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <apps@plt>
jmp    12cb <main+0x14b>
lea    -0x47(%rbp),%rdi
lea    0xe0f(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    128b <main+0x10b>
lea    0xe00(%rip),%rdi
call   1040 <printf@plt>
jmp    12c6 <main+0x146>
lea    -0x47(%rbp),%rdi
lea    0xdf2(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    12b5 <main+0x135>
lea    0xde2(%rip),%rdi
call   1040 <printf@plt>
jmp    12da <main+0x15a>
lea    0xdd7(%rip),%rdi
call   1040 <printf@plt>
jmp    12c6 <main+0x146>
jmp    12cb <main+0x14b>
jmp    12d0 <main+0x150>
jmp    12d5 <main+0x155>
jmp    11a6 <main+0x26>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x3(%rsp)
movl   $0x0,(%rsp)
xor    %eax,%eax
call   1090 <aboutThisApp@plt>
xor    %eax,%eax
call   1030 <update@plt>
lea    0xea4(%rip),%r14
lea    0xe4a(%rip),%r15
lea    0xe74(%rip),%r12
mov    %rsp,%rbx
lea    0xe6d(%rip),%r13
mov    $0x657461,%ebp
jmp    11e3 <main+0x63>
xchg   %ax,%ax
lea    0xe97(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <install@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   10a0 <scanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
je     11d0 <main+0x50>
mov    (%rsp),%eax
mov    $0x61647075,%ecx
xor    %ecx,%eax
mov    0x3(%rsp),%ecx
xor    %ebp,%ecx
or     %eax,%ecx
je     1270 <main+0xf0>
mov    (%rsp),%eax
mov    $0x73707061,%ecx
xor    %ecx,%eax
movzbl 0x4(%rsp),%ecx
or     %eax,%ecx
je     1288 <main+0x108>
mov    (%rsp),%eax
mov    $0x756f6261,%ecx
xor    %ecx,%eax
movzwl 0x4(%rsp),%ecx
xor    $0x74,%ecx
or     %eax,%ecx
je     12a0 <main+0x120>
mov    (%rsp),%eax
mov    $0x74697865,%ecx
xor    %ecx,%eax
movzbl 0x4(%rsp),%ecx
or     %eax,%ecx
je     12b1 <main+0x131>
lea    0xe29(%rip),%rdi
call   1040 <puts@plt>
jmp    11e3 <main+0x63>
xchg   %ax,%ax
lea    0xdff(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <update@plt>
jmp    11e3 <main+0x63>
lea    0xdee(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <apps@plt>
jmp    11e3 <main+0x63>
lea    0xddb(%rip),%rdi
call   1040 <puts@plt>
jmp    11e3 <main+0x63>
lea    0xdd0(%rip),%rdi
call   1040 <puts@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"<><><><><><><><><><><><><>\0A\00"
@.str.1 = [49 x i8] c"Input command [install/update/apps/about/exit]: \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [8 x i8] c"install\00"
@.str.4 = [9 x i8] c"INSTALL\0A\00"
@.str.5 = [7 x i8] c"update\00"
@.str.6 = [8 x i8] c"UPDATE\0A\00"
@.str.7 = [5 x i8] c"apps\00"
@.str.8 = [6 x i8] c"APPS\0A\00"
@.str.9 = [6 x i8] c"about\00"
@.str.10 = [7 x i8] c"ABOUT\0A\00"
@.str.11 = [5 x i8] c"exit\00"
@.str.12 = [6 x i8] c"EXIT\0A\00"
@.str.13 = [19 x i8] c"Command not fount\0A\00"
define void @main() {
%1 = alloca [50 x i8]
%2 = alloca [7 x i8]
%3 = bitcast [7 x i8]* %2 to i8*
%4 = call i32 (...) @aboutThisApp()
%5 = call i32 (...) @update()
br label %6
6: ; preds = %0, %49
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %6
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (...) @install()
br label %49
17: ; preds = %6
%18 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%19 = call i32 @strcmp(i8* %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%20 = icmp ne i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %17
%22 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%23 = call i32 (...) @update()
br label %48
24: ; preds = %17
%25 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%26 = call i32 @strcmp(i8* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %31, label %28
28: ; preds = %24
%29 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%30 = call i32 (...) @apps()
br label %47
31: ; preds = %24
%32 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%33 = call i32 @strcmp(i8* %32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%34 = icmp ne i32 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %31
%36 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
br label %46
37: ; preds = %31
%38 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%39 = call i32 @strcmp(i8* %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%40 = icmp ne i32 %39, 0
br i1 %40, label %43, label %41
41: ; preds = %37
%42 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
br label %50
43: ; preds = %37
%44 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0))
br label %45
45: ; preds = %43
br label %46
46: ; preds = %45, %35
br label %47
47: ; preds = %46, %28
br label %48
48: ; preds = %47, %21
br label %49
49: ; preds = %48, %14
br label %6
50: ; preds = %41
ret void
}

LLVM IR (-O2):
@.str.1 = [49 x i8] c"Input command [install/update/apps/about/exit]: \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [8 x i8] c"install\00"
@.str.5 = [7 x i8] c"update\00"
@.str.7 = [5 x i8] c"apps\00"
@.str.9 = [6 x i8] c"about\00"
@.str.11 = [5 x i8] c"exit\00"
@str = [27 x i8] c"<><><><><><><><><><><><><>\00"
@str.14 = [8 x i8] c"INSTALL\00"
@str.15 = [7 x i8] c"UPDATE\00"
@str.16 = [5 x i8] c"APPS\00"
@str.17 = [6 x i8] c"ABOUT\00"
@str.18 = [5 x i8] c"EXIT\00"
@str.19 = [18 x i8] c"Command not fount\00"
define void @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @aboutThisApp()
%4 = tail call i32 (...) @update()
br label %5
5: ; preds = %20, %0
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%9 = call i32 @strcmp(i8* %2, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %5
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.14, i64 0, i64 0))
%13 = call i32 (...) @install()
br label %20
14: ; preds = %5
%15 = call i32 @bcmp(i8* dereferenceable(7) %2, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i64 7)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.15, i64 0, i64 0))
%19 = call i32 (...) @update()
br label %20
20: ; preds = %17, %30, %37, %24, %11
br label %5
21: ; preds = %14
%22 = call i32 @bcmp(i8* dereferenceable(5) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i64 5)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.16, i64 0, i64 0))
%26 = call i32 (...) @apps()
br label %20
27: ; preds = %21
%28 = call i32 @bcmp(i8* dereferenceable(6) %2, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i64 6)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.17, i64 0, i64 0))
br label %20
32: ; preds = %27
%33 = call i32 @bcmp(i8* dereferenceable(5) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i64 5)
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.18, i64 0, i64 0))
ret void
37: ; preds = %32
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.19, i64 0, i64 0))
br label %20
}