#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*/ save_contacts(char **, char **, char **, int);
int /*<<< orphan*/ strcpy(char *, char *);
int handle_create(char names[10][20], char addresses[10][200],
                  char phoneNumbers[10][10], char *newName, char *newAddress,
                  char *newPhone, int curLength) {
  strcpy(names[curLength], newName);
  strcpy(addresses[curLength], newAddress);
  strcpy(phoneNumbers[curLength], newPhone);
  curLength++;
  save_contacts(names, addresses, phoneNumbers, curLength);
  return curLength;
}


x86 assembly (clang, -O0):
<handle_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
movslq 0x10(%rbp),%rax
imul   $0x14,%rax,%rax
add    %rax,%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
movslq 0x10(%rbp),%rax
imul   $0xc8,%rax,%rax
add    %rax,%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
movslq 0x10(%rbp),%rax
imul   $0xa,%rax,%rax
add    %rax,%rdi
mov    -0x30(%rbp),%rsi
call   1030 <strcpy@plt>
mov    0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x10(%rbp),%ecx
call   1040 <save_contacts@plt>
mov    0x10(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_create>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,(%rsp)
mov    %r8,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
movslq 0x40(%rsp),%rbp
lea    0x0(,%rbp,4),%r14
add    %rbp,%r14
lea    (%rdi,%r14,4),%rdi
mov    %rcx,%rsi
call   1030 <strcpy@plt>
imul   $0xc8,%rbp,%rdi
add    %r13,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
lea    (%r12,%r14,2),%rdi
mov    (%rsp),%rsi
call   1030 <strcpy@plt>
add    $0x1,%ebp
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %ebp,%ecx
call   1040 <save_contacts@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @handle_create([20 x i8]* %0, [200 x i8]* %1, [10 x i8]* %2, i8* %3, i8* %4, i8* %5, i32 %6) {
%8 = alloca [20 x i8]*
%9 = alloca [200 x i8]*
%10 = alloca [10 x i8]*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
store [20 x i8]* %0, [20 x i8]** %8
store [200 x i8]* %1, [200 x i8]** %9
store [10 x i8]* %2, [10 x i8]** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%15 = load [20 x i8]*, [20 x i8]** %8
%16 = load i32, i32* %14
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %15, i64 %17
%19 = getelementptr inbounds [20 x i8], [20 x i8]* %18, i64 0, i64 0
%20 = load i8*, i8** %11
%21 = call i32 @strcpy(i8* %19, i8* %20)
%22 = load [200 x i8]*, [200 x i8]** %9
%23 = load i32, i32* %14
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [200 x i8], [200 x i8]* %22, i64 %24
%26 = getelementptr inbounds [200 x i8], [200 x i8]* %25, i64 0, i64 0
%27 = load i8*, i8** %12
%28 = call i32 @strcpy(i8* %26, i8* %27)
%29 = load [10 x i8]*, [10 x i8]** %10
%30 = load i32, i32* %14
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [10 x i8], [10 x i8]* %29, i64 %31
%33 = getelementptr inbounds [10 x i8], [10 x i8]* %32, i64 0, i64 0
%34 = load i8*, i8** %13
%35 = call i32 @strcpy(i8* %33, i8* %34)
%36 = load i32, i32* %14
%37 = add nsw i32 %36, 1
store i32 %37, i32* %14
%38 = load [20 x i8]*, [20 x i8]** %8
%39 = bitcast [20 x i8]* %38 to i8**
%40 = load [200 x i8]*, [200 x i8]** %9
%41 = bitcast [200 x i8]* %40 to i8**
%42 = load [10 x i8]*, [10 x i8]** %10
%43 = bitcast [10 x i8]* %42 to i8**
%44 = load i32, i32* %14
%45 = call i32 @save_contacts(i8** %39, i8** %41, i8** %43, i32 %44)
%46 = load i32, i32* %14
ret i32 %46
}

LLVM IR (-O2):
define i32 @handle_create([20 x i8]* %0, [200 x i8]* %1, [10 x i8]* %2, i8* %3, i8* %4, i8* %5, i32 %6) {
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %8, i64 0
%10 = tail call i32 @strcpy(i8* %9, i8* %3)
%11 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 %8, i64 0
%12 = tail call i32 @strcpy(i8* %11, i8* %4)
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 %8, i64 0
%14 = tail call i32 @strcpy(i8* %13, i8* %5)
%15 = add nsw i32 %6, 1
%16 = bitcast [20 x i8]* %0 to i8**
%17 = bitcast [200 x i8]* %1 to i8**
%18 = bitcast [10 x i8]* %2 to i8**
%19 = tail call i32 @save_contacts(i8** %16, i8** %17, i8** %18, i32 %15)
ret i32 %15
}