#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 atoi(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  int load_contacts(char names[10][20], char addresses[10][200],
                    char phoneNumbers[10][10]);
  void save_contacts(char names[10][20], char addresses[10][200],
                     char phoneNumbers[10][10], int curLength);
  char name[10][20];
  char address[10][200];
  char phoneNumber[10][10];
  int curLength = load_contacts(name, address, phoneNumber);
  if (strcmp(argv[1], "create") == 0) {
    strcpy(name[curLength], argv[2]);
    strcpy(address[curLength], argv[3]);
    strcpy(phoneNumber[curLength], argv[4]);
    curLength++;
    save_contacts(name, address, phoneNumber, curLength);
  }
  if (strcmp(argv[1], "retrieve") == 0) {
    int item = atoi(argv[2]);
    printf(name[item]);
    printf(address[item]);
    printf(phoneNumber[item]);
  }
  if (strcmp(argv[1], "update") == 0) {
    int item = atoi(argv[2]) - 1;
    strcpy(name[item], argv[3]);
    strcpy(address[item], argv[4]);
    strcpy(phoneNumber[item], argv[5]);
    save_contacts(name, address, phoneNumber, curLength);
  }
  if (strcmp(argv[1], "delete") == 0) {
    int item = atoi(argv[2]) - 1;
    int i;
    for (i = item - 1; i++; i < curLength) {
      strcpy(name[i], name[i + 1]);
      strcpy(address[i], address[i + 1]);
      strcpy(phoneNumber[i], phoneNumber[i + 1]);
    }
    curLength--;
    save_contacts(name, address, phoneNumber, curLength);
  }
  if (strcmp(argv[1], "list") == 0) {
    int i;
    for (i = 0; i < curLength; i++) {
      printf("contact: ");
      char curItem[10];
      sprintf(curItem, "%d", i + 1);
      printf(curItem);
      printf("\n");
      printf(name[i]);
      printf("\n");
      printf(address[i]);
      printf("\n");
      printf(phoneNumber[i]);
      printf("\n");
      printf("\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x950,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xe0(%rbp),%rdi
lea    -0x8b0(%rbp),%rsi
lea    -0x920(%rbp),%rdx
call   1030 <load_contacts@plt>
mov    %eax,-0x924(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe48(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    125f <main+0xef>
movslq -0x924(%rbp),%rax
lea    -0xe0(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <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   1040 <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   1040 <strcpy@plt>
mov    -0x924(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x924(%rbp)
lea    -0xe0(%rbp),%rdi
lea    -0x8b0(%rbp),%rsi
lea    -0x920(%rbp),%rdx
mov    -0x924(%rbp),%ecx
call   1070 <save_contacts@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd99(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12e1 <main+0x171>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x928(%rbp)
movslq -0x928(%rbp),%rax
lea    -0xe0(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
call   1050 <printf@plt>
movslq -0x928(%rbp),%rax
lea    -0x8b0(%rbp),%rdi
imul   $0xc8,%rax,%rax
add    %rax,%rdi
call   1050 <printf@plt>
movslq -0x928(%rbp),%rax
lea    -0x920(%rbp),%rdi
imul   $0xa,%rax,%rax
add    %rax,%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd20(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    139e <main+0x22e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <atoi@plt>
sub    $0x1,%eax
mov    %eax,-0x92c(%rbp)
movslq -0x92c(%rbp),%rax
lea    -0xe0(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1040 <strcpy@plt>
movslq -0x92c(%rbp),%rax
lea    -0x8b0(%rbp),%rdi
imul   $0xc8,%rax,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
call   1040 <strcpy@plt>
movslq -0x92c(%rbp),%rax
lea    -0x920(%rbp),%rdi
imul   $0xa,%rax,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rsi
call   1040 <strcpy@plt>
lea    -0xe0(%rbp),%rdi
lea    -0x8b0(%rbp),%rsi
lea    -0x920(%rbp),%rdx
mov    -0x924(%rbp),%ecx
call   1070 <save_contacts@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xc6a(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    14ce <main+0x35e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <atoi@plt>
sub    $0x1,%eax
mov    %eax,-0x930(%rbp)
mov    -0x930(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x934(%rbp)
mov    -0x934(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x934(%rbp)
cmp    $0x0,%eax
je     149f <main+0x32f>
movslq -0x934(%rbp),%rax
lea    -0xe0(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
mov    -0x934(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0xe0(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
call   1040 <strcpy@plt>
movslq -0x934(%rbp),%rax
lea    -0x8b0(%rbp),%rdi
imul   $0xc8,%rax,%rax
add    %rax,%rdi
mov    -0x934(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x8b0(%rbp),%rsi
imul   $0xc8,%rax,%rax
add    %rax,%rsi
call   1040 <strcpy@plt>
movslq -0x934(%rbp),%rax
lea    -0x920(%rbp),%rdi
imul   $0xa,%rax,%rax
add    %rax,%rdi
mov    -0x934(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x920(%rbp),%rsi
imul   $0xa,%rax,%rax
add    %rax,%rsi
call   1040 <strcpy@plt>
jmp    13e1 <main+0x271>
mov    -0x924(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x924(%rbp)
lea    -0xe0(%rbp),%rdi
lea    -0x8b0(%rbp),%rsi
lea    -0x920(%rbp),%rdx
mov    -0x924(%rbp),%ecx
call   1070 <save_contacts@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xb41(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    15e2 <main+0x472>
movl   $0x0,-0x938(%rbp)
mov    -0x938(%rbp),%eax
cmp    -0x924(%rbp),%eax
jge    15dd <main+0x46d>
lea    0xb14(%rip),%rdi
call   1050 <printf@plt>
lea    -0x942(%rbp),%rdi
mov    -0x938(%rbp),%edx
add    $0x1,%edx
lea    0xb02(%rip),%rsi
call   1090 <sprintf@plt>
lea    -0x942(%rbp),%rdi
call   1050 <printf@plt>
lea    0xaed(%rip),%rdi
call   1050 <printf@plt>
movslq -0x938(%rbp),%rax
lea    -0xe0(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
call   1050 <printf@plt>
lea    0xac7(%rip),%rdi
call   1050 <printf@plt>
movslq -0x938(%rbp),%rax
lea    -0x8b0(%rbp),%rdi
imul   $0xc8,%rax,%rax
add    %rax,%rdi
call   1050 <printf@plt>
lea    0xa9e(%rip),%rdi
call   1050 <printf@plt>
movslq -0x938(%rbp),%rax
lea    -0x920(%rbp),%rdi
imul   $0xa,%rax,%rax
add    %rax,%rdi
call   1050 <printf@plt>
lea    0xa78(%rip),%rdi
call   1050 <printf@plt>
lea    0xa6c(%rip),%rdi
call   1050 <printf@plt>
mov    -0x938(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x938(%rbp)
jmp    14f6 <main+0x386>
jmp    15e2 <main+0x472>
mov    -0x4(%rbp),%eax
add    $0x950,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x928,%rsp
mov    %rsi,%rbp
lea    0x80(%rsp),%r15
lea    0x150(%rsp),%rbx
lea    0x10(%rsp),%rdx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <load_contacts@plt>
mov    %eax,%r12d
mov    0x8(%rbp),%rdi
lea    0xe3e(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    123b <main+0xbb>
movslq %r12d,%r13
lea    0x0(,%r13,4),%r14
add    %r13,%r14
lea    (%rsp,%r14,4),%rdi
add    $0x80,%rdi
mov    0x10(%rbp),%rsi
call   1050 <strcpy@plt>
imul   $0xc8,%r13,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x150,%rdi
mov    0x18(%rbp),%rsi
call   1050 <strcpy@plt>
lea    (%rsp,%r14,2),%rdi
add    $0x10,%rdi
mov    0x20(%rbp),%rsi
call   1050 <strcpy@plt>
add    $0x1,%r12d
lea    0x80(%rsp),%rdi
lea    0x150(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    %r12d,%ecx
call   1080 <save_contacts@plt>
mov    0x8(%rbp),%rdi
lea    0xdc1(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    129b <main+0x11b>
mov    0x10(%rbp),%rdi
call   1090 <atoi@plt>
movslq %eax,%r13
lea    0x0(,%r13,4),%r14
add    %r13,%r14
lea    (%rsp,%r14,4),%rdi
add    $0x80,%rdi
call   1060 <printf@plt>
imul   $0xc8,%r13,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x150,%rdi
call   1060 <printf@plt>
lea    (%rsp,%r14,2),%rdi
add    $0x10,%rdi
call   1060 <printf@plt>
mov    0x8(%rbp),%rdi
lea    0xd6a(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    1327 <main+0x1a7>
mov    0x10(%rbp),%rdi
call   1090 <atoi@plt>
add    $0xffffffff,%eax
movslq %eax,%r13
lea    0x0(,%r13,4),%r14
add    %r13,%r14
lea    (%rsp,%r14,4),%rdi
add    $0x80,%rdi
mov    0x18(%rbp),%rsi
call   1050 <strcpy@plt>
imul   $0xc8,%r13,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x150,%rdi
mov    0x20(%rbp),%rsi
call   1050 <strcpy@plt>
lea    (%rsp,%r14,2),%rdi
add    $0x10,%rdi
mov    0x28(%rbp),%rsi
call   1050 <strcpy@plt>
lea    0x80(%rsp),%rdi
lea    0x150(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    %r12d,%ecx
call   1080 <save_contacts@plt>
mov    0x8(%rbp),%rdi
lea    0xce5(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    142d <main+0x2ad>
mov    %r12d,0x4(%rsp)
mov    %rbp,0x8(%rsp)
mov    0x10(%rbp),%rdi
call   1090 <atoi@plt>
cmp    $0x2,%eax
je     13f2 <main+0x272>
mov    %eax,%ebp
add    $0xffffffff,%eax
cltq
lea    -0x1(%rax),%r15
lea    (%rax,%rax,4),%rcx
lea    (%rsp,%rcx,4),%r12
add    $0x80,%r12
imul   $0xc8,%rax,%rax
lea    (%rsp,%rax,1),%r13
add    $0x150,%r13
lea    (%rsp,%rcx,2),%r14
add    $0x10,%r14
movslq %ebp,%rbp
lea    0x0(,%rbp,4),%rbx
add    %rbp,%rbx
lea    (%rsp,%rbx,4),%rsi
add    $0x80,%rsi
mov    %r12,%rdi
call   1050 <strcpy@plt>
imul   $0xc8,%rbp,%rax
lea    (%rsp,%rax,1),%rsi
add    $0x150,%rsi
mov    %r13,%rdi
call   1050 <strcpy@plt>
lea    (%rsp,%rbx,2),%rsi
add    $0x10,%rsi
mov    %r14,%rdi
call   1050 <strcpy@plt>
add    $0x1,%ebp
add    $0x14,%r12
add    $0xc8,%r13
add    $0xa,%r14
inc    %r15
jne    1390 <main+0x210>
mov    0x4(%rsp),%r12d
add    $0xffffffff,%r12d
lea    0x80(%rsp),%rdi
lea    0x150(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    %r12d,%ecx
call   1080 <save_contacts@plt>
lea    0x80(%rsp),%r15
lea    0x150(%rsp),%rbx
mov    0x8(%rsp),%rbp
mov    0x8(%rbp),%rdi
lea    0xbe6(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
lea    0x10(%rsp),%r13
jne    14eb <main+0x36b>
test   %r12d,%r12d
jle    14eb <main+0x36b>
mov    %r12d,%r14d
xor    %ebp,%ebp
lea    0x76(%rsp),%r12
xchg   %ax,%ax
lea    0xbbc(%rip),%rdi
call   1060 <printf@plt>
add    $0x1,%rbp
mov    %r12,%rdi
lea    0xbb3(%rip),%rsi
mov    %ebp,%edx
call   10a0 <sprintf@plt>
mov    %r12,%rdi
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r13,%rdi
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x14,%r15
add    $0xc8,%rbx
add    $0xa,%r13
cmp    %rbp,%r14
jne    1460 <main+0x2e0>
xor    %eax,%eax
add    $0x928,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"create\00"
@.str.1 = [9 x i8] c"retrieve\00"
@.str.2 = [7 x i8] c"update\00"
@.str.3 = [7 x i8] c"delete\00"
@.str.4 = [5 x i8] c"list\00"
@.str.5 = [10 x i8] c"contact: \00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [2 x i8] c"\0A\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
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca [10 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %6, i64 0, i64 0
%17 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %7, i64 0, i64 0
%18 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %8, i64 0, i64 0
%19 = call i32 @load_contacts([20 x i8]* %16, [200 x i8]* %17, [10 x i8]* %18)
store i32 %19, i32* %9
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %56
25: ; preds = %2
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %6, i64 0, i64 %27
%29 = getelementptr inbounds [20 x i8], [20 x i8]* %28, i64 0, i64 0
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = call i32 @strcpy(i8* %29, i8* %32)
%34 = load i32, i32* %9
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %7, i64 0, i64 %35
%37 = getelementptr inbounds [200 x i8], [200 x i8]* %36, i64 0, i64 0
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 3
%40 = load i8*, i8** %39
%41 = call i32 @strcpy(i8* %37, i8* %40)
%42 = load i32, i32* %9
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %8, i64 0, i64 %43
%45 = getelementptr inbounds [10 x i8], [10 x i8]* %44, i64 0, i64 0
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 4
%48 = load i8*, i8** %47
%49 = call i32 @strcpy(i8* %45, i8* %48)
%50 = load i32, i32* %9
%51 = add nsw i32 %50, 1
store i32 %51, i32* %9
%52 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %6, i64 0, i64 0
%53 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %7, i64 0, i64 0
%54 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %8, i64 0, i64 0
%55 = load i32, i32* %9
br label %56
56: ; preds = %25, %2
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 1
%59 = load i8*, i8** %58
%60 = call i64 @strcmp(i8* %59, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %82
62: ; preds = %56
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 2
%65 = load i8*, i8** %64
%66 = call i32 @atoi(i8* %65)
store i32 %66, i32* %10
%67 = load i32, i32* %10
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %6, i64 0, i64 %68
%70 = getelementptr inbounds [20 x i8], [20 x i8]* %69, i64 0, i64 0
%71 = call i32 @printf(i8* %70)
%72 = load i32, i32* %10
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %7, i64 0, i64 %73
%75 = getelementptr inbounds [200 x i8], [200 x i8]* %74, i64 0, i64 0
%76 = call i32 @printf(i8* %75)
%77 = load i32, i32* %10
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %8, i64 0, i64 %78
%80 = getelementptr inbounds [10 x i8], [10 x i8]* %79, i64 0, i64 0
%81 = call i32 @printf(i8* %80)
br label %82
82: ; preds = %62, %56
%83 = load i8**, i8*** %5
%84 = getelementptr inbounds i8*, i8** %83, i64 1
%85 = load i8*, i8** %84
%86 = call i64 @strcmp(i8* %85, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%87 = icmp eq i64 %86, 0
br i1 %87, label %88, label %122
88: ; preds = %82
%89 = load i8**, i8*** %5
%90 = getelementptr inbounds i8*, i8** %89, i64 2
%91 = load i8*, i8** %90
%92 = call i32 @atoi(i8* %91)
%93 = sub nsw i32 %92, 1
store i32 %93, i32* %11
%94 = load i32, i32* %11
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %6, i64 0, i64 %95
%97 = getelementptr inbounds [20 x i8], [20 x i8]* %96, i64 0, i64 0
%98 = load i8**, i8*** %5
%99 = getelementptr inbounds i8*, i8** %98, i64 3
%100 = load i8*, i8** %99
%101 = call i32 @strcpy(i8* %97, i8* %100)
%102 = load i32, i32* %11
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %7, i64 0, i64 %103
%105 = getelementptr inbounds [200 x i8], [200 x i8]* %104, i64 0, i64 0
%106 = load i8**, i8*** %5
%107 = getelementptr inbounds i8*, i8** %106, i64 4
%108 = load i8*, i8** %107
%109 = call i32 @strcpy(i8* %105, i8* %108)
%110 = load i32, i32* %11
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %8, i64 0, i64 %111
%113 = getelementptr inbounds [10 x i8], [10 x i8]* %112, i64 0, i64 0
%114 = load i8**, i8*** %5
%115 = getelementptr inbounds i8*, i8** %114, i64 5
%116 = load i8*, i8** %115
%117 = call i32 @strcpy(i8* %113, i8* %116)
%118 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %6, i64 0, i64 0
%119 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %7, i64 0, i64 0
%120 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %8, i64 0, i64 0
%121 = load i32, i32* %9
br label %122
122: ; preds = %88, %82
%123 = load i8**, i8*** %5
%124 = getelementptr inbounds i8*, i8** %123, i64 1
%125 = load i8*, i8** %124
%126 = call i64 @strcmp(i8* %125, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%127 = icmp eq i64 %126, 0
br i1 %127, label %128, label %183
128: ; preds = %122
%129 = load i8**, i8*** %5
%130 = getelementptr inbounds i8*, i8** %129, i64 2
%131 = load i8*, i8** %130
%132 = call i32 @atoi(i8* %131)
%133 = sub nsw i32 %132, 1
store i32 %133, i32* %12
%134 = load i32, i32* %12
%135 = sub nsw i32 %134, 1
store i32 %135, i32* %13
br label %136
136: ; preds = %171, %128
%137 = load i32, i32* %13
%138 = add nsw i32 %137, 1
store i32 %138, i32* %13
%139 = icmp ne i32 %137, 0
br i1 %139, label %140, label %176
140: ; preds = %136
%141 = load i32, i32* %13
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %6, i64 0, i64 %142
%144 = getelementptr inbounds [20 x i8], [20 x i8]* %143, i64 0, i64 0
%145 = load i32, i32* %13
%146 = add nsw i32 %145, 1
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %6, i64 0, i64 %147
%149 = getelementptr inbounds [20 x i8], [20 x i8]* %148, i64 0, i64 0
%150 = call i32 @strcpy(i8* %144, i8* %149)
%151 = load i32, i32* %13
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %7, i64 0, i64 %152
%154 = getelementptr inbounds [200 x i8], [200 x i8]* %153, i64 0, i64 0
%155 = load i32, i32* %13
%156 = add nsw i32 %155, 1
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %7, i64 0, i64 %157
%159 = getelementptr inbounds [200 x i8], [200 x i8]* %158, i64 0, i64 0
%160 = call i32 @strcpy(i8* %154, i8* %159)
%161 = load i32, i32* %13
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %8, i64 0, i64 %162
%164 = getelementptr inbounds [10 x i8], [10 x i8]* %163, i64 0, i64 0
%165 = load i32, i32* %13
%166 = add nsw i32 %165, 1
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %8, i64 0, i64 %167
%169 = getelementptr inbounds [10 x i8], [10 x i8]* %168, i64 0, i64 0
%170 = call i32 @strcpy(i8* %164, i8* %169)
br label %171
171: ; preds = %140
%172 = load i32, i32* %13
%173 = load i32, i32* %9
%174 = icmp slt i32 %172, %173
%175 = zext i1 %174 to i32
br label %136
176: ; preds = %136
%177 = load i32, i32* %9
%178 = add nsw i32 %177, -1
store i32 %178, i32* %9
%179 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %6, i64 0, i64 0
%180 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %7, i64 0, i64 0
%181 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %8, i64 0, i64 0
%182 = load i32, i32* %9
br label %183
183: ; preds = %176, %122
%184 = load i8**, i8*** %5
%185 = getelementptr inbounds i8*, i8** %184, i64 1
%186 = load i8*, i8** %185
%187 = call i64 @strcmp(i8* %186, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%188 = icmp eq i64 %187, 0
br i1 %188, label %189, label %226
189: ; preds = %183
store i32 0, i32* %14
br label %190
190: ; preds = %222, %189
%191 = load i32, i32* %14
%192 = load i32, i32* %9
%193 = icmp slt i32 %191, %192
br i1 %193, label %194, label %225
194: ; preds = %190
%195 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%196 = getelementptr inbounds [10 x i8], [10 x i8]* %15, i64 0, i64 0
%197 = load i32, i32* %14
%198 = add nsw i32 %197, 1
%199 = call i32 @sprintf(i8* %196, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %198)
%200 = getelementptr inbounds [10 x i8], [10 x i8]* %15, i64 0, i64 0
%201 = call i32 @printf(i8* %200)
%202 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%203 = load i32, i32* %14
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %6, i64 0, i64 %204
%206 = getelementptr inbounds [20 x i8], [20 x i8]* %205, i64 0, i64 0
%207 = call i32 @printf(i8* %206)
%208 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%209 = load i32, i32* %14
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %7, i64 0, i64 %210
%212 = getelementptr inbounds [200 x i8], [200 x i8]* %211, i64 0, i64 0
%213 = call i32 @printf(i8* %212)
%214 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%215 = load i32, i32* %14
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %8, i64 0, i64 %216
%218 = getelementptr inbounds [10 x i8], [10 x i8]* %217, i64 0, i64 0
%219 = call i32 @printf(i8* %218)
%220 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%221 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %222
222: ; preds = %194
%223 = load i32, i32* %14
%224 = add nsw i32 %223, 1
store i32 %224, i32* %14
br label %190
225: ; preds = %190
br label %226
226: ; preds = %225, %183
%227 = load i32, i32* %3
ret i32 %227
}

LLVM IR (-O2):
@.str = [7 x i8] c"create\00"
@.str.1 = [9 x i8] c"retrieve\00"
@.str.2 = [7 x i8] c"update\00"
@.str.3 = [7 x i8] c"delete\00"
@.str.4 = [5 x i8] c"list\00"
@.str.5 = [10 x i8] c"contact: \00"
@.str.6 = [3 x i8] c"%d\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 = alloca [10 x i8]
%7 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %3, i64 0, i64 0, i64 0
%8 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %4, i64 0, i64 0, i64 0
%9 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %5, i64 0, i64 0, i64 0
%10 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %3, i64 0, i64 0
%11 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %4, i64 0, i64 0
%12 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %5, i64 0, i64 0
%13 = call i32 @load_contacts([20 x i8]* %10, [200 x i8]* %11, [10 x i8]* %12)
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %33
18: ; preds = %2
%19 = sext i32 %13 to i64
%20 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %3, i64 0, i64 %19, i64 0
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = call i32 @strcpy(i8* %20, i8* %22)
%24 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %4, i64 0, i64 %19, i64 0
%25 = getelementptr inbounds i8*, i8** %1, i64 3
%26 = load i8*, i8** %25
%27 = call i32 @strcpy(i8* %24, i8* %26)
%28 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %5, i64 0, i64 %19, i64 0
%29 = getelementptr inbounds i8*, i8** %1, i64 4
%30 = load i8*, i8** %29
%31 = call i32 @strcpy(i8* %28, i8* %30)
%32 = add nsw i32 %13, 1
br label %33
33: ; preds = %18, %2
%34 = phi i32 [ %32, %18 ], [ %13, %2 ]
%35 = load i8*, i8** %14
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %49
38: ; preds = %33
%39 = getelementptr inbounds i8*, i8** %1, i64 2
%40 = load i8*, i8** %39
%41 = call i32 @atoi(i8* %40)
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %3, i64 0, i64 %42, i64 0
%44 = call i32 @printf(i8* %43)
%45 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %4, i64 0, i64 %42, i64 0
%46 = call i32 @printf(i8* %45)
%47 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %5, i64 0, i64 %42, i64 0
%48 = call i32 @printf(i8* %47)
br label %49
49: ; preds = %38, %33
%50 = load i8*, i8** %14
%51 = call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %71
53: ; preds = %49
%54 = getelementptr inbounds i8*, i8** %1, i64 2
%55 = load i8*, i8** %54
%56 = call i32 @atoi(i8* %55)
%57 = add nsw i32 %56, -1
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %3, i64 0, i64 %58, i64 0
%60 = getelementptr inbounds i8*, i8** %1, i64 3
%61 = load i8*, i8** %60
%62 = call i32 @strcpy(i8* %59, i8* %61)
%63 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %4, i64 0, i64 %58, i64 0
%64 = getelementptr inbounds i8*, i8** %1, i64 4
%65 = load i8*, i8** %64
%66 = call i32 @strcpy(i8* %63, i8* %65)
%67 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %5, i64 0, i64 %58, i64 0
%68 = getelementptr inbounds i8*, i8** %1, i64 5
%69 = load i8*, i8** %68
%70 = call i32 @strcpy(i8* %67, i8* %69)
br label %71
71: ; preds = %53, %49
%72 = load i8*, i8** %14
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %103
75: ; preds = %71
%76 = getelementptr inbounds i8*, i8** %1, i64 2
%77 = load i8*, i8** %76
%78 = call i32 @atoi(i8* %77)
%79 = add nsw i32 %78, -2
%80 = icmp eq i32 %79, 0
br i1 %80, label %101, label %81
81: ; preds = %75
%82 = add i32 %78, -1
%83 = sext i32 %82 to i64
br label %84
84: ; preds = %81, %84
%85 = phi i64 [ %83, %81 ], [ %98, %84 ]
%86 = phi i32 [ %79, %81 ], [ %100, %84 ]
%87 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %3, i64 0, i64 %85, i64 0
%88 = add nsw i32 %86, 2
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %3, i64 0, i64 %89, i64 0
%91 = call i32 @strcpy(i8* %87, i8* %90)
%92 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %4, i64 0, i64 %85, i64 0
%93 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %4, i64 0, i64 %89, i64 0
%94 = call i32 @strcpy(i8* %92, i8* %93)
%95 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %5, i64 0, i64 %85, i64 0
%96 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %5, i64 0, i64 %89, i64 0
%97 = call i32 @strcpy(i8* %95, i8* %96)
%98 = add nsw i64 %85, 1
%99 = icmp eq i64 %85, 0
%100 = trunc i64 %85 to i32
br i1 %99, label %101, label %84
101: ; preds = %84, %75
%102 = add nsw i32 %34, -1
br label %103
103: ; preds = %101, %71
%104 = phi i32 [ %102, %101 ], [ %34, %71 ]
%105 = load i8*, i8** %14
%106 = call i64 @strcmp(i8* %105, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%107 = icmp eq i64 %106, 0
%108 = icmp sgt i32 %104, 0
%109 = select i1 %107, i1 %108, i1 false
br i1 %109, label %110, label %132
110: ; preds = %103
%111 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%112 = zext i32 %104 to i64
br label %113
113: ; preds = %110, %113
%114 = phi i64 [ 0, %110 ], [ %116, %113 ]
%115 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%116 = add nuw nsw i64 %114, 1
%117 = trunc i64 %116 to i32
%118 = call i32 @sprintf(i8* %111, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %117)
%119 = call i32 @printf(i8* %111)
%120 = call i32 @putchar(i32 10)
%121 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %3, i64 0, i64 %114, i64 0
%122 = call i32 @printf(i8* %121)
%123 = call i32 @putchar(i32 10)
%124 = getelementptr inbounds [10 x [200 x i8]], [10 x [200 x i8]]* %4, i64 0, i64 %114, i64 0
%125 = call i32 @printf(i8* %124)
%126 = call i32 @putchar(i32 10)
%127 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* %5, i64 0, i64 %114, i64 0
%128 = call i32 @printf(i8* %127)
%129 = call i32 @putchar(i32 10)
%130 = call i32 @putchar(i32 10)
%131 = icmp eq i64 %116, %112
br i1 %131, label %132, label %113
132: ; preds = %113, %103
ret i32 0
}