int main() {
  char **strings;
  int n, i;
  n = readLines(&strings);
  printf("Your strings: \n");
  for (i = 0; i < n; i++)
    printf("%s\n", strings[i]);
  for (i = 0; i < n; i++)
    free(strings[i]);
  free(strings);
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <readLines@plt>
mov    %eax,-0x14(%rbp)
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11a6 <main+0x66>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1172 <main+0x32>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11d8 <main+0x98>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11ad <main+0x6d>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1050 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1050 <readLines@plt>
mov    %eax,%r14d
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
test   %r14d,%r14d
jle    11a7 <main+0x67>
mov    %r14d,%ebx
xor    %ebp,%ebp
nopl   (%rax)
mov    0x8(%rsp),%rax
mov    (%rax,%rbp,8),%rdi
call   1040 <puts@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1170 <main+0x30>
test   %r14d,%r14d
jle    11a7 <main+0x67>
xor    %ebp,%ebp
xchg   %ax,%ax
mov    0x8(%rsp),%rax
mov    (%rax,%rbp,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1190 <main+0x50>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
lea    0xe48(%rip),%rdi
xor    %eax,%eax
call   1060 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Your strings: \0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8***, ...) bitcast (i32 (...)* @readLines to i32 (i8***, ...)*)(i8*** %2)
store i32 %5, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %7
7: ; preds = %18, %0
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8**, i8*** %2
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %7
21: ; preds = %7
store i32 0, i32* %4
br label %22
22: ; preds = %32, %21
%23 = load i32, i32* %4
%24 = load i32, i32* %3
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %35
26: ; preds = %22
%27 = load i8**, i8*** %2
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
br label %32
32: ; preds = %26
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 1
store i32 %34, i32* %4
br label %22
35: ; preds = %22
%36 = load i8**, i8*** %2
%37 = bitcast i8** %36 to i8*
%38 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"PAUSE\00"
@str = [15 x i8] c"Your strings: \00"
define i32 @main() {
%1 = alloca i8**
%2 = bitcast i8*** %1 to i8*
%3 = call i32 (i8***, ...) bitcast (i32 (...)* @readLines to i32 (i8***, ...)*)(i8*** %1)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %26
6: ; preds = %0
%7 = zext i32 %3 to i64
br label %11
8: ; preds = %11
br i1 %5, label %9, label %26
9: ; preds = %8
%10 = zext i32 %3 to i64
br label %19
11: ; preds = %6, %11
%12 = phi i64 [ 0, %6 ], [ %17, %11 ]
%13 = load i8**, i8*** %1
%14 = getelementptr inbounds i8*, i8** %13, i64 %12
%15 = load i8*, i8** %14
%16 = call i32 @puts(i8* dereferenceable(1) %15)
%17 = add nuw nsw i64 %12, 1
%18 = icmp eq i64 %17, %7
br i1 %18, label %8, label %11
19: ; preds = %9, %19
%20 = phi i64 [ 0, %9 ], [ %24, %19 ]
%21 = load i8**, i8*** %1
%22 = getelementptr inbounds i8*, i8** %21, i64 %20
%23 = load i8*, i8** %22
%24 = add nuw nsw i64 %20, 1
%25 = icmp eq i64 %24, %10
br i1 %25, label %26, label %19
26: ; preds = %19, %0, %8
%27 = bitcast i8*** %1 to i8**
%28 = load i8*, i8** %27
%29 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}