#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*/ decrypt(char **, char **);
int /*<<< orphan*/ encrypt(char **, char **);
int /*<<< orphan*/ input(char **, int *);
int menu();
int /*<<< orphan*/ printMatrix(char **);
int main(int argc, char *argv[]) {
  int option = 9;
  int numberRows = 0;
  int *pointerRows = &numberRows;
  char str[50][50];
  char encrypted[50][50];
  char decrypted[50][50];
  do {
    option = menu();
    switch (option) {
    case 1:
      input(str, pointerRows);
      printMatrix(str);
      break;
    case 2:
      encrypt(str, encrypted);
      printMatrix(encrypted);
      break;
    case 3:
      decrypt(encrypted, decrypted);
      printMatrix(decrypted);
      break;
    }
  } while (option != 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1da0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x9,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
call   1050 <menu@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1d94(%rbp)
sub    $0x1,%eax
je     11c8 <main+0x78>
jmp    11a0 <main+0x50>
mov    -0x1d94(%rbp),%eax
sub    $0x2,%eax
je     11e9 <main+0x99>
jmp    11b4 <main+0x64>
mov    -0x1d94(%rbp),%eax
sub    $0x3,%eax
je     120d <main+0xbd>
jmp    122c <main+0xdc>
lea    -0x9f0(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <input@plt>
lea    -0x9f0(%rbp),%rdi
call   1070 <printMatrix@plt>
jmp    122c <main+0xdc>
lea    -0x9f0(%rbp),%rdi
lea    -0x13c0(%rbp),%rsi
call   1060 <encrypt@plt>
lea    -0x13c0(%rbp),%rdi
call   1070 <printMatrix@plt>
jmp    122c <main+0xdc>
lea    -0x13c0(%rbp),%rdi
lea    -0x1d90(%rbp),%rsi
call   1030 <decrypt@plt>
lea    -0x1d90(%rbp),%rdi
call   1070 <printMatrix@plt>
jmp    1231 <main+0xe1>
cmpl   $0x4,-0x14(%rbp)
jne    117f <main+0x2f>
xor    %eax,%eax
add    $0x1da0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1d80,%rsp
movl   $0x0,0xc(%rsp)
lea    0xe91(%rip),%rbx
lea    0x13b0(%rsp),%r15
lea    0xc(%rsp),%r14
lea    0x9e0(%rsp),%r13
lea    0x10(%rsp),%r12
jmp    11a3 <main+0x53>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r13,%rsi
call   1060 <encrypt@plt>
mov    %r13,%rdi
call   1070 <printMatrix@plt>
xor    %eax,%eax
call   1050 <menu@plt>
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     11a3 <main+0x53>
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <input@plt>
mov    %r15,%rdi
call   1070 <printMatrix@plt>
jmp    11a3 <main+0x53>
mov    %r13,%rdi
mov    %r12,%rsi
call   1030 <decrypt@plt>
mov    %r12,%rdi
call   1070 <printMatrix@plt>
jmp    11a3 <main+0x53>
xor    %eax,%eax
add    $0x1d80,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca [50 x [50 x i8]]
%10 = alloca [50 x [50 x i8]]
%11 = alloca [50 x [50 x i8]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 9, i32* %6
store i32 0, i32* %7
store i32* %7, i32** %8
br label %12
12: ; preds = %42, %2
%13 = call i32 (...) @menu()
store i32 %13, i32* %6
%14 = load i32, i32* %6
switch i32 %14, label %41 [
i32 1, label %15
i32 2, label %23
i32 3, label %32
]
15: ; preds = %12
%16 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %9, i64 0, i64 0
%17 = bitcast [50 x i8]* %16 to i8**
%18 = load i32*, i32** %8
%19 = call i32 @input(i8** %17, i32* %18)
%20 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %9, i64 0, i64 0
%21 = bitcast [50 x i8]* %20 to i8**
%22 = call i32 @printMatrix(i8** %21)
br label %41
23: ; preds = %12
%24 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %9, i64 0, i64 0
%25 = bitcast [50 x i8]* %24 to i8**
%26 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %10, i64 0, i64 0
%27 = bitcast [50 x i8]* %26 to i8**
%28 = call i32 @encrypt(i8** %25, i8** %27)
%29 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %10, i64 0, i64 0
%30 = bitcast [50 x i8]* %29 to i8**
%31 = call i32 @printMatrix(i8** %30)
br label %41
32: ; preds = %12
%33 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %10, i64 0, i64 0
%34 = bitcast [50 x i8]* %33 to i8**
%35 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %11, i64 0, i64 0
%36 = bitcast [50 x i8]* %35 to i8**
%37 = call i32 @decrypt(i8** %34, i8** %36)
%38 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %11, i64 0, i64 0
%39 = bitcast [50 x i8]* %38 to i8**
%40 = call i32 @printMatrix(i8** %39)
br label %41
41: ; preds = %12, %32, %23, %15
br label %42
42: ; preds = %41
%43 = load i32, i32* %6
%44 = icmp ne i32 %43, 4
br i1 %44, label %12, label %45
45: ; preds = %42
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [50 x [50 x i8]]
%5 = alloca [50 x [50 x i8]]
%6 = alloca [50 x [50 x i8]]
%7 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%8 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %4, i64 0, i64 0, i64 0
%9 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %5, i64 0, i64 0, i64 0
%10 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %6, i64 0, i64 0, i64 0
%11 = bitcast [50 x [50 x i8]]* %5 to i8**
%12 = bitcast [50 x [50 x i8]]* %6 to i8**
%13 = bitcast [50 x [50 x i8]]* %4 to i8**
br label %14
14: ; preds = %19, %2
%15 = call i32 (...) @menu()
switch i32 %15, label %19 [
i32 1, label %20
i32 2, label %22
i32 3, label %24
i32 4, label %26
]
16: ; preds = %20, %22, %24
%17 = phi i8** [ %12, %24 ], [ %11, %22 ], [ %13, %20 ]
%18 = call i32 @printMatrix(i8** %17)
br label %19
19: ; preds = %16, %14
br label %14
20: ; preds = %14
%21 = call i32 @input(i8** %13, i32* %3)
br label %16
22: ; preds = %14
%23 = call i32 @encrypt(i8** %13, i8** %11)
br label %16
24: ; preds = %14
%25 = call i32 @decrypt(i8** %11, i8** %12)
br label %16
26: ; preds = %14
ret i32 0
}