int main(void) {
  int wordCount = 7, i = 0;
  char stringList[][64] = {"Hi",           "Bye",  "Good Day", "My name is...",
                           "Civilization", "Snow", "School"};
  char *stringPointers[64];
  for (i = 0; i < wordCount; i++) {
    stringPointers[i] = (char *)malloc(strlen(stringList[i]) + 1);
    stringPointers[i] = stringList[i];
  }
  printStrings(stringPointers, wordCount);
  sortStrings(&stringPointers, wordCount);
  printStrings(stringPointers, wordCount);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3d0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x1d0(%rbp),%rdi
lea    0xe82(%rip),%rsi
mov    $0x1c0,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f9 <main+0xa9>
movslq -0xc(%rbp),%rax
lea    -0x1d0(%rbp),%rdi
shl    $0x6,%rax
add    %rax,%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
mov    %rcx,-0x3d0(%rbp,%rax,8)
ff
movslq -0xc(%rbp),%rax
lea    -0x1d0(%rbp),%rcx
shl    $0x6,%rax
add    %rax,%rcx
movslq -0xc(%rbp),%rax
mov    %rcx,-0x3d0(%rbp,%rax,8)
ff
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118f <main+0x3f>
lea    -0x3d0(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1070 <printStrings@plt>
mov    -0x8(%rbp),%esi
lea    -0x3d0(%rbp),%rdi
mov    $0x0,%al
call   1040 <sortStrings@plt>
lea    -0x3d0(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1070 <printStrings@plt>
xor    %eax,%eax
add    $0x3d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3c0,%rsp
lea    0xec1(%rip),%rsi
lea    0x200(%rsp),%rbx
mov    $0x1c0,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
mov    %rbx,(%rsp)
lea    0x240(%rsp),%rax
mov    %rax,0x8(%rsp)
lea    0x280(%rsp),%rax
mov    %rax,0x10(%rsp)
lea    0x2c0(%rsp),%rax
mov    %rax,0x18(%rsp)
lea    0x300(%rsp),%rax
mov    %rax,0x20(%rsp)
lea    0x340(%rsp),%rax
mov    %rax,0x28(%rsp)
lea    0x380(%rsp),%rax
mov    %rax,0x30(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printStrings@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1030 <sortStrings@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printStrings@plt>
xor    %eax,%eax
add    $0x3c0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.stringList = [7 x [64 x i8]] [[64 x i8] c"Hi\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"Bye\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"Good Day\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"My name is...\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"Civilization\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"Snow\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"School\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [7 x [64 x i8]]
%5 = alloca [64 x i8*]
store i32 0, i32* %1
store i32 7, i32* %2
store i32 0, i32* %3
%6 = bitcast [7 x [64 x i8]]* %4 to i8*
store i32 0, i32* %3
br label %7
7: ; preds = %29, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %32
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [7 x [64 x i8]], [7 x [64 x i8]]* %4, i64 0, i64 %13
%15 = getelementptr inbounds [64 x i8], [64 x i8]* %14, i64 0, i64 0
%16 = call i64 @strlen(i8* %15)
%17 = add i64 %16, 1
%18 = call i8* @malloc(i64 %17)
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [64 x i8*], [64 x i8*]* %5, i64 0, i64 %20
store i8* %18, i8** %21
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [7 x [64 x i8]], [7 x [64 x i8]]* %4, i64 0, i64 %23
%25 = getelementptr inbounds [64 x i8], [64 x i8]* %24, i64 0, i64 0
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [64 x i8*], [64 x i8*]* %5, i64 0, i64 %27
store i8* %25, i8** %28
br label %29
29: ; preds = %11
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %7
32: ; preds = %7
%33 = getelementptr inbounds [64 x i8*], [64 x i8*]* %5, i64 0, i64 0
%34 = load i32, i32* %2
%35 = call i32 (i8**, i32, ...) bitcast (i32 (...)* @printStrings to i32 (i8**, i32, ...)*)(i8** %33, i32 %34)
%36 = load i32, i32* %2
%37 = call i32 ([64 x i8*]*, i32, ...) bitcast (i32 (...)* @sortStrings to i32 ([64 x i8*]*, i32, ...)*)([64 x i8*]* %5, i32 %36)
%38 = getelementptr inbounds [64 x i8*], [64 x i8*]* %5, i64 0, i64 0
%39 = load i32, i32* %2
%40 = call i32 (i8**, i32, ...) bitcast (i32 (...)* @printStrings to i32 (i8**, i32, ...)*)(i8** %38, i32 %39)
ret i32 0
}

LLVM IR (-O2):
@__const.main.stringList = [7 x [64 x i8]] [[64 x i8] c"Hi\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"Bye\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"Good Day\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"My name is...\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"Civilization\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"Snow\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"School\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
define i32 @main() {
%1 = alloca [7 x [64 x i8]]
%2 = alloca [64 x i8*]
%3 = getelementptr inbounds [7 x [64 x i8]], [7 x [64 x i8]]* %1, i64 0, i64 0, i64 0
%4 = bitcast [64 x i8*]* %2 to i8*
%5 = getelementptr inbounds [64 x i8*], [64 x i8*]* %2, i64 0, i64 0
store i8* %3, i8** %5
%6 = getelementptr inbounds [7 x [64 x i8]], [7 x [64 x i8]]* %1, i64 0, i64 1, i64 0
%7 = getelementptr inbounds [64 x i8*], [64 x i8*]* %2, i64 0, i64 1
store i8* %6, i8** %7
%8 = getelementptr inbounds [7 x [64 x i8]], [7 x [64 x i8]]* %1, i64 0, i64 2, i64 0
%9 = getelementptr inbounds [64 x i8*], [64 x i8*]* %2, i64 0, i64 2
store i8* %8, i8** %9
%10 = getelementptr inbounds [7 x [64 x i8]], [7 x [64 x i8]]* %1, i64 0, i64 3, i64 0
%11 = getelementptr inbounds [64 x i8*], [64 x i8*]* %2, i64 0, i64 3
store i8* %10, i8** %11
%12 = getelementptr inbounds [7 x [64 x i8]], [7 x [64 x i8]]* %1, i64 0, i64 4, i64 0
%13 = getelementptr inbounds [64 x i8*], [64 x i8*]* %2, i64 0, i64 4
store i8* %12, i8** %13
%14 = getelementptr inbounds [7 x [64 x i8]], [7 x [64 x i8]]* %1, i64 0, i64 5, i64 0
%15 = getelementptr inbounds [64 x i8*], [64 x i8*]* %2, i64 0, i64 5
store i8* %14, i8** %15
%16 = getelementptr inbounds [7 x [64 x i8]], [7 x [64 x i8]]* %1, i64 0, i64 6, i64 0
%17 = getelementptr inbounds [64 x i8*], [64 x i8*]* %2, i64 0, i64 6
store i8* %16, i8** %17
%18 = call i32 (i8**, i32, ...) bitcast (i32 (...)* @printStrings to i32 (i8**, i32, ...)*)(i8** %5, i32 7)
%19 = call i32 ([64 x i8*]*, i32, ...) bitcast (i32 (...)* @sortStrings to i32 ([64 x i8*]*, i32, ...)*)([64 x i8*]* %2, i32 7)
%20 = call i32 (i8**, i32, ...) bitcast (i32 (...)* @printStrings to i32 (i8**, i32, ...)*)(i8** %5, i32 7)
ret i32 0
}