#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*/ AddCol();
int /*<<< orphan*/ AddRow();
int /*<<< orphan*/ ModCol(char);
int /*<<< orphan*/ PrintAll();
int /*<<< orphan*/ PrintIndex();
int /*<<< orphan*/ RemoveCol(char);
int /*<<< orphan*/ RemoveRow(char);
int /*<<< orphan*/ RenameRow(char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int mod_menu() {
  char sel;
  printf("* * * * * * * * * * * * * * * * * * *\n");
  printf("*           Modify Menu             *\n");
  printf("* 1. Append a column                *\n");
  printf("* 2. Append a row                   *\n");
  printf("* 3. Delete a column                *\n");
  printf("* 4. Delete a row                   *\n");
  printf("* 5. Modify a column                *\n");
  printf("* 6. Rename a row                   *\n");
  printf("* * * * * * * * * * * * * * * * * * *\n");
  printf("Please enter your choice:");
  scanf("%d", &sel);
  switch (sel) {
  case 1:
    AddCol();
    break;
  case 2:
    AddRow();
    break;
  case 3: {
    PrintAll();
    printf("Which Column?");
    scanf("%d", &sel);
    RemoveCol(sel);
    break;
  }
  case 4: {
    PrintIndex();
    printf("Which Row?");
    scanf("%d", &sel);
    RemoveRow(sel);
    break;
  }
  case 5: {
    PrintAll();
    printf("Which Column?");
    scanf("%d", &sel);
    ModCol(sel);
    break;
  }
  case 6: {
    PrintIndex();
    printf("Which Row?");
    scanf("%d", &sel);
    RenameRow(sel);
    break;
  }
  }
}


x86 assembly (clang, -O0):
<mod_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xe69(%rip),%rdi
mov    %rdi,-0x18(%rbp)
call   1040 <printf@plt>
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
lea    0xeec(%rip),%rdi
call   1040 <printf@plt>
lea    0xf07(%rip),%rdi
call   1040 <printf@plt>
lea    0xf22(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <printf@plt>
lea    0xf34(%rip),%rdi
call   1040 <printf@plt>
lea    0xf42(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1090 <scanf@plt>
movsbl -0x5(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1332 <mod_menu+0x192>
mov    -0x10(%rbp),%rax
lea    0xdae(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1030 <AddCol@plt>
jmp    1332 <mod_menu+0x192>
mov    $0x0,%al
call   10b0 <AddRow@plt>
jmp    1332 <mod_menu+0x192>
mov    $0x0,%al
call   1070 <PrintAll@plt>
lea    0xeec(%rip),%rdi
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1090 <scanf@plt>
movsbl -0x5(%rbp),%edi
call   10c0 <RemoveCol@plt>
jmp    1332 <mod_menu+0x192>
mov    $0x0,%al
call   10a0 <PrintIndex@plt>
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1090 <scanf@plt>
movsbl -0x5(%rbp),%edi
call   1050 <RemoveRow@plt>
jmp    1332 <mod_menu+0x192>
mov    $0x0,%al
call   1070 <PrintAll@plt>
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe7b(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1090 <scanf@plt>
movsbl -0x5(%rbp),%edi
call   1060 <ModCol@plt>
jmp    1332 <mod_menu+0x192>
mov    $0x0,%al
call   10a0 <PrintIndex@plt>
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
lea    0xe4a(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1090 <scanf@plt>
movsbl -0x5(%rbp),%edi
call   1080 <RenameRow@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_menu>:
push   %rbx
sub    $0x10,%rsp
lea    0xf9c(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe83(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1f(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xdf1(%rip),%rdi
call   1050 <printf@plt>
lea    0xdff(%rip),%rdi
lea    0xf(%rsp),%rsi
call   10a0 <scanf@plt>
movsbl 0xf(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x5,%eax
ja     1337 <mod_menu+0x187>
lea    0xdab(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1040 <AddCol@plt>
jmp    1337 <mod_menu+0x187>
xor    %eax,%eax
call   10c0 <AddRow@plt>
jmp    1337 <mod_menu+0x187>
xor    %eax,%eax
call   1080 <PrintAll@plt>
lea    0xdb1(%rip),%rdi
call   1050 <printf@plt>
lea    0xda2(%rip),%rdi
lea    0xf(%rsp),%rsi
call   10a0 <scanf@plt>
movsbl 0xf(%rsp),%edi
call   10d0 <RemoveCol@plt>
jmp    1337 <mod_menu+0x187>
xor    %eax,%eax
call   10b0 <PrintIndex@plt>
lea    0xd8c(%rip),%rdi
call   1050 <printf@plt>
lea    0xd6f(%rip),%rdi
lea    0xf(%rsp),%rsi
call   10a0 <scanf@plt>
movsbl 0xf(%rsp),%edi
call   1060 <RemoveRow@plt>
jmp    1337 <mod_menu+0x187>
xor    %eax,%eax
call   1080 <PrintAll@plt>
lea    0xd4e(%rip),%rdi
call   1050 <printf@plt>
lea    0xd3f(%rip),%rdi
lea    0xf(%rsp),%rsi
call   10a0 <scanf@plt>
movsbl 0xf(%rsp),%edi
call   1070 <ModCol@plt>
jmp    1337 <mod_menu+0x187>
xor    %eax,%eax
call   10b0 <PrintIndex@plt>
lea    0xd2c(%rip),%rdi
call   1050 <printf@plt>
lea    0xd0f(%rip),%rdi
lea    0xf(%rsp),%rsi
call   10a0 <scanf@plt>
movsbl 0xf(%rsp),%edi
call   1090 <RenameRow@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"* * * * * * * * * * * * * * * * * * *\0A\00"
@.str.1 = [39 x i8] c"* Modify Menu *\0A\00"
@.str.2 = [39 x i8] c"* 1. Append a column *\0A\00"
@.str.3 = [39 x i8] c"* 2. Append a row *\0A\00"
@.str.4 = [39 x i8] c"* 3. Delete a column *\0A\00"
@.str.5 = [39 x i8] c"* 4. Delete a row *\0A\00"
@.str.6 = [39 x i8] c"* 5. Modify a column *\0A\00"
@.str.7 = [39 x i8] c"* 6. Rename a row *\0A\00"
@.str.8 = [26 x i8] c"Please enter your choice:\00"
@.str.9 = [3 x i8] c"%d\00"
@.str.10 = [14 x i8] c"Which Column?\00"
@.str.11 = [11 x i8] c"Which Row?\00"
define i32 @mod_menu() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %2)
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
switch i32 %15, label %44 [
i32 1, label %16
i32 2, label %18
i32 3, label %20
i32 4, label %26
i32 5, label %32
i32 6, label %38
]
16: ; preds = %0
%17 = call i32 (...) @AddCol()
br label %44
18: ; preds = %0
%19 = call i32 (...) @AddRow()
br label %44
20: ; preds = %0
%21 = call i32 (...) @PrintAll()
%22 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %2)
%24 = load i8, i8* %2
%25 = call i32 @RemoveCol(i8 signext %24)
br label %44
26: ; preds = %0
%27 = call i32 (...) @PrintIndex()
%28 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %2)
%30 = load i8, i8* %2
%31 = call i32 @RemoveRow(i8 signext %30)
br label %44
32: ; preds = %0
%33 = call i32 (...) @PrintAll()
%34 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %2)
%36 = load i8, i8* %2
%37 = call i32 @ModCol(i8 signext %36)
br label %44
38: ; preds = %0
%39 = call i32 (...) @PrintIndex()
%40 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %2)
%42 = load i8, i8* %2
%43 = call i32 @RenameRow(i8 signext %42)
br label %44
44: ; preds = %0, %38, %32, %26, %20, %18, %16
%45 = load i32, i32* %1
ret i32 %45
}

LLVM IR (-O2):
@.str.8 = [26 x i8] c"Please enter your choice:\00"
@.str.9 = [3 x i8] c"%d\00"
@.str.10 = [14 x i8] c"Which Column?\00"
@.str.11 = [11 x i8] c"Which Row?\00"
@str.12 = [38 x i8] c"* Modify Menu *\00"
@str.13 = [38 x i8] c"* 1. Append a column *\00"
@str.14 = [38 x i8] c"* 2. Append a row *\00"
@str.15 = [38 x i8] c"* 3. Delete a column *\00"
@str.16 = [38 x i8] c"* 4. Delete a row *\00"
@str.17 = [38 x i8] c"* 5. Modify a column *\00"
@str.18 = [38 x i8] c"* 6. Rename a row *\00"
@str.19 = [38 x i8] c"* * * * * * * * * * * * * * * * * * *\00"
define i32 @mod_menu() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.19, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.12, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.13, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.14, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.15, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.16, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.17, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.18, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.19, i64 0, i64 0))
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %1)
%13 = load i8, i8* %1
%14 = sext i8 %13 to i32
switch i32 %14, label %43 [
i32 1, label %15
i32 2, label %17
i32 3, label %19
i32 4, label %25
i32 5, label %31
i32 6, label %37
]
15: ; preds = %0
%16 = call i32 (...) @AddCol()
br label %43
17: ; preds = %0
%18 = call i32 (...) @AddRow()
br label %43
19: ; preds = %0
%20 = call i32 (...) @PrintAll()
%21 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %1)
%23 = load i8, i8* %1
%24 = call i32 @RemoveCol(i8 signext %23)
br label %43
25: ; preds = %0
%26 = call i32 (...) @PrintIndex()
%27 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %1)
%29 = load i8, i8* %1
%30 = call i32 @RemoveRow(i8 signext %29)
br label %43
31: ; preds = %0
%32 = call i32 (...) @PrintAll()
%33 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %1)
%35 = load i8, i8* %1
%36 = call i32 @ModCol(i8 signext %35)
br label %43
37: ; preds = %0
%38 = call i32 (...) @PrintIndex()
%39 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %1)
%41 = load i8, i8* %1
%42 = call i32 @RenameRow(i8 signext %41)
br label %43
43: ; preds = %0, %37, %31, %25, %19, %17, %15
ret i32 undef
}