#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*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char name[10][20];
  char address[10][200];
  char phoneNumber[10][10];
  int curLength = 1;
  printf("here");
  strcpy(name[0], "Test");
  strcpy(address[0], "address");
  strcpy(phoneNumber[0], "phoneNumber");
  if (strcmp(argv[1], "create") == 0) {
    strcpy(name[curLength], argv[2]);
    strcpy(address[curLength], argv[3]);
    strcpy(phoneNumber[curLength], argv[4]);
    curLength++;
    printf("Added Record");
  }
  if (strcmp(argv[1], "retrieve") == 0) {
    printf("user wants to retrieve");
  }
  if (strcmp(argv[1], "update") == 0) {
    printf("user wants to update");
  }
  if (strcmp(argv[1], "delete") == 0) {
    printf("user wants to delete");
  }
  if (strcmp(argv[1], "list") == 0) {
    printf("here");
    int i;
    for (i = 0; i < curLength; i++) {
      printf(name[i]);
      printf(address[i]);
      printf(phoneNumber[i]);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x930,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x924(%rbp)
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
lea    -0xe0(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x8b0(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x920(%rbp),%rdi
lea    0xe7f(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe77(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    123a <main+0x10a>
movslq -0x924(%rbp),%rax
lea    -0xe0(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
movslq -0x924(%rbp),%rax
lea    -0x8b0(%rbp),%rdi
imul   $0xc8,%rax,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1030 <strcpy@plt>
movslq -0x924(%rbp),%rax
lea    -0x920(%rbp),%rdi
imul   $0xa,%rax,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x924(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x924(%rbp)
lea    0xdf0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf7(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1264 <main+0x134>
lea    0xdd3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde4(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    128e <main+0x15e>
lea    0xdc0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdcf(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12b8 <main+0x188>
lea    0xdab(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdac(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1368 <main+0x238>
lea    0xd23(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x928(%rbp)
mov    -0x928(%rbp),%eax
cmp    -0x924(%rbp),%eax
jge    1363 <main+0x233>
movslq -0x928(%rbp),%rax
lea    -0xe0(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
call   1040 <printf@plt>
movslq -0x928(%rbp),%rax
lea    -0x8b0(%rbp),%rdi
imul   $0xc8,%rax,%rax
add    %rax,%rdi
call   1040 <printf@plt>
movslq -0x928(%rbp),%rax
lea    -0x920(%rbp),%rdi
imul   $0xa,%rax,%rax
add    %rax,%rdi
call   1040 <printf@plt>
mov    -0x928(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x928(%rbp)
jmp    12ec <main+0x1bc>
jmp    1368 <main+0x238>
mov    -0x4(%rbp),%eax
add    $0x930,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x910,%rsp
mov    %rsi,%r12
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
lea    0xeaf(%rip),%rsi
lea    0x70(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
lea    0xea0(%rip),%rsi
lea    0x140(%rsp),%r15
mov    %r15,%rdi
call   1030 <strcpy@plt>
lea    0xe91(%rip),%rsi
mov    %rsp,%r13
mov    %r13,%rdi
call   1030 <strcpy@plt>
mov    0x8(%r12),%rdi
lea    0xe86(%rip),%rsi
call   1050 <strcmp@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    11eb <main+0xbb>
lea    0x84(%rsp),%rdi
mov    0x10(%r12),%rsi
call   1030 <strcpy@plt>
lea    0x208(%rsp),%rdi
mov    0x18(%r12),%rsi
call   1030 <strcpy@plt>
lea    0xa(%rsp),%rdi
mov    0x20(%r12),%rsi
call   1030 <strcpy@plt>
lea    0xe44(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%ebx
mov    0x8(%r12),%rdi
lea    0xe49(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    120d <main+0xdd>
lea    0xe2a(%rip),%rdi
call   1040 <printf@plt>
mov    0x8(%r12),%rdi
lea    0xe3e(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    122f <main+0xff>
lea    0xe1f(%rip),%rdi
call   1040 <printf@plt>
mov    0x8(%r12),%rdi
lea    0xe31(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1251 <main+0x121>
lea    0xe12(%rip),%rdi
call   1040 <printf@plt>
mov    0x8(%r12),%rdi
lea    0xe16(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    12ad <main+0x17d>
lea    0xd92(%rip),%rdi
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
call   1040 <printf@plt>
mov    %r13,%rdi
call   1040 <printf@plt>
add    $0x14,%r14
add    $0xc8,%r15
add    $0xa,%r13
add    $0xffffffffffffffff,%rbx
jne    1280 <main+0x150>
xor    %eax,%eax
add    $0x910,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"here\00"
@.str.1 = [5 x i8] c"Test\00"
@.str.2 = [8 x i8] c"address\00"
@.str.3 = [12 x i8] c"phoneNumber\00"
@.str.4 = [7 x i8] c"create\00"
@.str.5 = [13 x i8] c"Added Record\00"
@.str.6 = [9 x i8] c"retrieve\00"
@.str.7 = [23 x i8] c"user wants to retrieve\00"
@.str.8 = [7 x i8] c"update\00"
@.str.9 = [21 x i8] c"user wants to update\00"
@.str.10 = [7 x i8] c"delete\00"
@.str.11 = [21 x i8] c"user wants to delete\00"
@.str.12 = [5 x i8] c"list\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x [20 x i8]]
%7 = alloca [10 x [200 x i8]]
%8 = alloca [10 x [10 x i8]]
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %6, i64 0, i64 0
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0, i64 0
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %7, i64 0, i64 0
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%18 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %8, i64 0, i64 0
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %18, i64 0, i64 0
%20 = call i32 @strcpy(i8* %19, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %54
26: ; preds = %2
%27 = load i32, i32* %9
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %6, i64 0, i64 %28
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %29, i64 0, i64 0
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
%34 = call i32 @strcpy(i8* %30, i8* %33)
%35 = load i32, i32* %9
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %7, i64 0, i64 %36
%38 = getelementptr inbounds [200 x i8], [200 x i8]* %37, i64 0, i64 0
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 3
%41 = load i8*, i8** %40
%42 = call i32 @strcpy(i8* %38, i8* %41)
%43 = load i32, i32* %9
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %8, i64 0, i64 %44
%46 = getelementptr inbounds [10 x i8], [10 x i8]* %45, i64 0, i64 0
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 4
%49 = load i8*, i8** %48
%50 = call i32 @strcpy(i8* %46, i8* %49)
%51 = load i32, i32* %9
%52 = add nsw i32 %51, 1
store i32 %52, i32* %9
%53 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %54
54: ; preds = %26, %2
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 1
%57 = load i8*, i8** %56
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %54
%61 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
br label %62
62: ; preds = %60, %54
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 1
%65 = load i8*, i8** %64
%66 = call i64 @strcmp(i8* %65, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %62
%69 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
br label %70
70: ; preds = %68, %62
%71 = load i8**, i8*** %5
%72 = getelementptr inbounds i8*, i8** %71, i64 1
%73 = load i8*, i8** %72
%74 = call i64 @strcmp(i8* %73, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %76, label %78
76: ; preds = %70
%77 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0))
br label %78
78: ; preds = %76, %70
%79 = load i8**, i8*** %5
%80 = getelementptr inbounds i8*, i8** %79, i64 1
%81 = load i8*, i8** %80
%82 = call i64 @strcmp(i8* %81, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %110
84: ; preds = %78
%85 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %10
br label %86
86: ; preds = %106, %84
%87 = load i32, i32* %10
%88 = load i32, i32* %9
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %109
90: ; preds = %86
%91 = load i32, i32* %10
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %6, i64 0, i64 %92
%94 = getelementptr inbounds [20 x i8], [20 x i8]* %93, i64 0, i64 0
%95 = call i32 @printf(i8* %94)
%96 = load i32, i32* %10
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %7, i64 0, i64 %97
%99 = getelementptr inbounds [200 x i8], [200 x i8]* %98, i64 0, i64 0
%100 = call i32 @printf(i8* %99)
%101 = load i32, i32* %10
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %8, i64 0, i64 %102
%104 = getelementptr inbounds [10 x i8], [10 x i8]* %103, i64 0, i64 0
%105 = call i32 @printf(i8* %104)
br label %106
106: ; preds = %90
%107 = load i32, i32* %10
%108 = add nsw i32 %107, 1
store i32 %108, i32* %10
br label %86
109: ; preds = %86
br label %110
110: ; preds = %109, %78
%111 = load i32, i32* %3
ret i32 %111
}

LLVM IR (-O2):
@.str = [5 x i8] c"here\00"
@.str.1 = [5 x i8] c"Test\00"
@.str.2 = [8 x i8] c"address\00"
@.str.3 = [12 x i8] c"phoneNumber\00"
@.str.4 = [7 x i8] c"create\00"
@.str.5 = [13 x i8] c"Added Record\00"
@.str.6 = [9 x i8] c"retrieve\00"
@.str.7 = [23 x i8] c"user wants to retrieve\00"
@.str.8 = [7 x i8] c"update\00"
@.str.9 = [21 x i8] c"user wants to update\00"
@.str.10 = [7 x i8] c"delete\00"
@.str.11 = [21 x i8] c"user wants to delete\00"
@.str.12 = [5 x i8] c"list\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x [20 x i8]]
%4 = alloca [10 x [200 x i8]]
%5 = alloca [10 x [10 x i8]]
%6 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %3, i64 0, i64 0, i64 0
%7 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %4, i64 0, i64 0, i64 0
%8 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %5, i64 0, i64 0, i64 0
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %31
17: ; preds = %2
%18 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %3, i64 0, i64 1, i64 0
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = call i32 @strcpy(i8* %18, i8* %20)
%22 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %4, i64 0, i64 1, i64 0
%23 = getelementptr inbounds i8*, i8** %1, i64 3
%24 = load i8*, i8** %23
%25 = call i32 @strcpy(i8* %22, i8* %24)
%26 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %5, i64 0, i64 1, i64 0
%27 = getelementptr inbounds i8*, i8** %1, i64 4
%28 = load i8*, i8** %27
%29 = call i32 @strcpy(i8* %26, i8* %28)
%30 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %31
31: ; preds = %17, %2
%32 = phi i64 [ 2, %17 ], [ 1, %2 ]
%33 = load i8*, i8** %13
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %31
%37 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
br label %38
38: ; preds = %36, %31
%39 = load i8*, i8** %13
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %38
%43 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
br label %44
44: ; preds = %42, %38
%45 = load i8*, i8** %13
%46 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %44
%49 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0))
br label %50
50: ; preds = %48, %44
%51 = load i8*, i8** %13
%52 = call i64 @strcmp(i8* %51, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %66
54: ; preds = %50
%55 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %56
56: ; preds = %54, %56
%57 = phi i64 [ 0, %54 ], [ %64, %56 ]
%58 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %3, i64 0, i64 %57, i64 0
%59 = call i32 @printf(i8* %58)
%60 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %4, i64 0, i64 %57, i64 0
%61 = call i32 @printf(i8* %60)
%62 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %5, i64 0, i64 %57, i64 0
%63 = call i32 @printf(i8* %62)
%64 = add nuw nsw i64 %57, 1
%65 = icmp eq i64 %64, %32
br i1 %65, label %66, label %56
66: ; preds = %56, %50
ret i32 0
}