#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*/ debloatMenu();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int advancedMenu(void) {
  int user_key;
  system("@cls||clear");
  printf("=======================================\n");
  printf("   Advanced Menu             |\n");
  printf("=======================================\n");
  printf("| [1] Edit build.prop        |\n");
  printf("| [2] Debloat Menu           |\n");
  printf("| [3] Edit updater-script    |\n");
  printf("| [4] Add Kernel Adiutor     |\n");
  printf("| [9] Information about menu |\n");
  printf("=======================================\n");
  printf("\n[0] Exit\n");
  printf("\nWhat you want?: ");
  scanf("%d", &user_key);
  switch (user_key) {
  case 9:
    printf("1. Press [1] to edit build.prop file.\n");
    printf("2. Press [2] to enter to Debloat Menu.\n");
    printf("3. Press [3] to edit updater-script.\n");
    printf("4. Press [4] to add Kernel Adiutor in your ROM.\n");
  case 0:
    printf("Goodbye ;P\n");
    return 0;
    break;
  case 1:
    system("gedit ~/*/workspace/system/build.prop");
    getchar();
    break;
  case 2:
    debloatMenu();
    break;
  case 3:
    system("gedit ~/*/workspace/META-INF/com/google/android/updater-script");
    break;
  case 4:
    system("cp ~/*/insides/rom/KernelAdiutor/* ~/*/workspace/system/priv-app");
    break;
  default:
    printf("Make a choice\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<advancedMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec9(%rip),%rdi
call   1030 <system@plt>
lea    0xec9(%rip),%rdi
mov    %rdi,-0x18(%rbp)
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <printf@plt>
lea    0xeed(%rip),%rdi
call   1040 <printf@plt>
lea    0xf01(%rip),%rdi
call   1040 <printf@plt>
lea    0xf15(%rip),%rdi
call   1040 <printf@plt>
lea    0xf29(%rip),%rdi
call   1040 <printf@plt>
lea    0xf3d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <printf@plt>
lea    0xf48(%rip),%rdi
call   1040 <printf@plt>
lea    0xf47(%rip),%rdi
call   1040 <printf@plt>
lea    0xf4d(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x9,%rax
ja     12a9 <advancedMenu+0x159>
mov    -0x10(%rbp),%rax
lea    0xdee(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf1b(%rip),%rdi
call   1040 <printf@plt>
lea    0xf36(%rip),%rdi
call   1040 <printf@plt>
lea    0xf52(%rip),%rdi
call   1040 <printf@plt>
lea    0xf6c(%rip),%rdi
call   1040 <printf@plt>
lea    0xf91(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    12bc <advancedMenu+0x16c>
lea    0xf85(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
jmp    12b5 <advancedMenu+0x165>
mov    $0x0,%al
call   1070 <debloatMenu@plt>
jmp    12b5 <advancedMenu+0x165>
lea    0xf87(%rip),%rdi
call   1030 <system@plt>
jmp    12b5 <advancedMenu+0x165>
lea    0xfb5(%rip),%rdi
call   1030 <system@plt>
jmp    12b5 <advancedMenu+0x165>
lea    0xfe5(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<advancedMenu>:
push   %rbx
sub    $0x10,%rsp
lea    0xebc(%rip),%rdi
call   1040 <system@plt>
lea    0x1031(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xf68(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xf73(%rip),%rdi
call   1030 <puts@plt>
lea    0xf86(%rip),%rdi
call   1030 <puts@plt>
lea    0xf99(%rip),%rdi
call   1030 <puts@plt>
lea    0xfac(%rip),%rdi
call   1030 <puts@plt>
lea    0xfbf(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xff2(%rip),%rdi
call   1030 <puts@plt>
lea    0xe49(%rip),%rdi
call   1050 <printf@plt>
lea    0xe4f(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x9,%rax
ja     1255 <advancedMenu+0xf5>
lea    0xdee(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe27(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
jmp    129a <advancedMenu+0x13a>
xor    %eax,%eax
call   1080 <debloatMenu@plt>
jmp    129a <advancedMenu+0x13a>
lea    0xe2f(%rip),%rdi
call   1040 <system@plt>
jmp    129a <advancedMenu+0x13a>
lea    0xe60(%rip),%rdi
call   1040 <system@plt>
jmp    129a <advancedMenu+0x13a>
lea    0x102c(%rip),%rdi
jmp    1295 <advancedMenu+0x135>
lea    0xf81(%rip),%rdi
call   1030 <puts@plt>
lea    0xf9b(%rip),%rdi
call   1030 <puts@plt>
lea    0xfb6(%rip),%rdi
call   1030 <puts@plt>
lea    0xfcf(%rip),%rdi
call   1030 <puts@plt>
lea    0xf46(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"@cls||clear\00"
@.str.1 = [41 x i8] c"=======================================\0A\00"
@.str.2 = [32 x i8] c" Advanced Menu |\0A\00"
@.str.3 = [32 x i8] c"| [1] Edit build.prop |\0A\00"
@.str.4 = [32 x i8] c"| [2] Debloat Menu |\0A\00"
@.str.5 = [32 x i8] c"| [3] Edit updater-script |\0A\00"
@.str.6 = [32 x i8] c"| [4] Add Kernel Adiutor |\0A\00"
@.str.7 = [32 x i8] c"| [9] Information about menu |\0A\00"
@.str.8 = [11 x i8] c"\0A[0] Exit\0A\00"
@.str.9 = [18 x i8] c"\0AWhat you want?: \00"
@.str.10 = [3 x i8] c"%d\00"
@.str.11 = [39 x i8] c"1. Press [1] to edit build.prop file.\0A\00"
@.str.12 = [40 x i8] c"2. Press [2] to enter to Debloat Menu.\0A\00"
@.str.13 = [38 x i8] c"3. Press [3] to edit updater-script.\0A\00"
@.str.14 = [49 x i8] c"4. Press [4] to add Kernel Adiutor in your ROM.\0A\00"
@.str.15 = [12 x i8] c"Goodbye ;P\0A\00"
@.str.16 = [38 x i8] c"gedit ~/*/workspace/system/build.prop\00"
@.str.17 = [63 x i8] c"gedit ~/*/workspace/META-INF/com/google/android/updater-script\00"
@.str.18 = [65 x i8] c"cp ~/*/insides/rom/KernelAdiutor/* ~/*/workspace/system/priv-app\00"
@.str.19 = [15 x i8] c"Make a choice\0A\00"
define i32 @advancedMenu() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %2)
%16 = load i32, i32* %2
switch i32 %16, label %33 [
i32 9, label %17
i32 0, label %22
i32 1, label %24
i32 2, label %27
i32 3, label %29
i32 4, label %31
]
17: ; preds = %0
%18 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.12, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.13, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.14, i64 0, i64 0))
br label %22
22: ; preds = %0, %17
%23 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0))
store i32 0, i32* %1
br label %36
24: ; preds = %0
%25 = call i32 @system(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.16, i64 0, i64 0))
%26 = call i32 (...) @getchar()
br label %35
27: ; preds = %0
%28 = call i32 (...) @debloatMenu()
br label %35
29: ; preds = %0
%30 = call i32 @system(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.17, i64 0, i64 0))
br label %35
31: ; preds = %0
%32 = call i32 @system(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.18, i64 0, i64 0))
br label %35
33: ; preds = %0
%34 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.19, i64 0, i64 0))
br label %35
35: ; preds = %33, %31, %29, %27, %24
store i32 0, i32* %1
br label %36
36: ; preds = %35, %22
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
@.str = [12 x i8] c"@cls||clear\00"
@.str.9 = [18 x i8] c"\0AWhat you want?: \00"
@.str.10 = [3 x i8] c"%d\00"
@.str.16 = [38 x i8] c"gedit ~/*/workspace/system/build.prop\00"
@.str.17 = [63 x i8] c"gedit ~/*/workspace/META-INF/com/google/android/updater-script\00"
@.str.18 = [65 x i8] c"cp ~/*/insides/rom/KernelAdiutor/* ~/*/workspace/system/priv-app\00"
@str.20 = [31 x i8] c" Advanced Menu |\00"
@str.22 = [31 x i8] c"| [1] Edit build.prop |\00"
@str.23 = [31 x i8] c"| [2] Debloat Menu |\00"
@str.24 = [31 x i8] c"| [3] Edit updater-script |\00"
@str.25 = [31 x i8] c"| [4] Add Kernel Adiutor |\00"
@str.26 = [31 x i8] c"| [9] Information about menu |\00"
@str.27 = [40 x i8] c"=======================================\00"
@str.28 = [10 x i8] c"\0A[0] Exit\00"
@str.29 = [11 x i8] c"Goodbye ;P\00"
@str.30 = [38 x i8] c"1. Press [1] to edit build.prop file.\00"
@str.31 = [39 x i8] c"2. Press [2] to enter to Debloat Menu.\00"
@str.32 = [37 x i8] c"3. Press [3] to edit updater-script.\00"
@str.33 = [48 x i8] c"4. Press [4] to add Kernel Adiutor in your ROM.\00"
@str.34 = [14 x i8] c"Make a choice\00"
define i32 @advancedMenu() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.27, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.20, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.27, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.22, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.23, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.24, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.25, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.26, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.27, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.28, i64 0, i64 0))
%14 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %1)
%16 = load i32, i32* %1
switch i32 %16, label %33 [
i32 9, label %17
i32 0, label %22
i32 1, label %24
i32 2, label %27
i32 3, label %29
i32 4, label %31
]
17: ; preds = %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.30, i64 0, i64 0))
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.31, i64 0, i64 0))
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.32, i64 0, i64 0))
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.33, i64 0, i64 0))
br label %22
22: ; preds = %0, %17
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.29, i64 0, i64 0))
br label %35
24: ; preds = %0
%25 = call i32 @system(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.16, i64 0, i64 0))
%26 = call i32 (...) @getchar()
br label %35
27: ; preds = %0
%28 = call i32 (...) @debloatMenu()
br label %35
29: ; preds = %0
%30 = call i32 @system(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.17, i64 0, i64 0))
br label %35
31: ; preds = %0
%32 = call i32 @system(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.18, i64 0, i64 0))
br label %35
33: ; preds = %0
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.34, i64 0, i64 0))
br label %35
35: ; preds = %24, %27, %29, %31, %33, %22
ret i32 0
}