int main() {
  char words[][16] = {"Remember",   "what", "should",     "be",
                      "remembered", "and",  "forget",     "what",
                      "should",     "be",   "forgotten",  "Alter",
                      "what",       "is",   "changeable", "and",
                      "accept",     "what", "is",         "unchangeable"};
  for (unsigned i = 0; i < sizeof(words) / 16; i++) {
    appendWord(words[i]);
  }
  printWords();
  deleteWord("be");
  printWords();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x150(%rbp),%rdi
lea    0xea0(%rip),%rsi
mov    $0x140,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x154(%rbp)
mov    -0x154(%rbp),%eax
cmp    $0x14,%rax
jae    11b3 <main+0x73>
mov    -0x154(%rbp),%eax
lea    -0x150(%rbp),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    $0x0,%al
call   1030 <appendWord@plt>
mov    -0x154(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x154(%rbp)
jmp    1174 <main+0x34>
mov    $0x0,%al
call   1050 <printWords@plt>
lea    0xf7f(%rip),%rdi
mov    $0x0,%al
call   1060 <deleteWord@plt>
mov    $0x0,%al
call   1050 <printWords@plt>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x140,%rsp
lea    0xeb1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x140,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0x10(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0x20(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0x30(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0x40(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0x50(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0x60(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0x70(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0x80(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0x90(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0xa0(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0xb0(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0xc0(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0xd0(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0xe0(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0xf0(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0x100(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0x110(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0x120(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
lea    0x130(%rsp),%rdi
xor    %eax,%eax
call   1030 <appendWord@plt>
xor    %eax,%eax
call   1050 <printWords@plt>
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1060 <deleteWord@plt>
xor    %eax,%eax
call   1050 <printWords@plt>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.words = [20 x [16 x i8]] [[16 x i8] c"Remember\00\00\00\00\00\00\00\00", [16 x i8] c"what\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"should\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"be\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"remembered\00\00\00\00\00\00", [16 x i8] c"and\00\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"forget\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"what\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"should\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"be\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"forgotten\00\00\00\00\00\00\00", [16 x i8] c"Alter\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"what\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"is\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"changeable\00\00\00\00\00\00", [16 x i8] c"and\00\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"accept\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"what\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"is\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"unchangeable\00\00\00\00"]
@.str = [3 x i8] c"be\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x [16 x i8]]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [20 x [16 x i8]]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = icmp ult i64 %7, 20
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i32, i32* %3
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %2, i64 0, i64 %11
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 0
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %13)
br label %15
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = call i32 (...) @printWords()
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @deleteWord to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%21 = call i32 (...) @printWords()
ret i32 0
}

LLVM IR (-O2):
@__const.main.words = [20 x [16 x i8]] [[16 x i8] c"Remember\00\00\00\00\00\00\00\00", [16 x i8] c"what\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"should\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"be\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"remembered\00\00\00\00\00\00", [16 x i8] c"and\00\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"forget\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"what\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"should\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"be\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"forgotten\00\00\00\00\00\00\00", [16 x i8] c"Alter\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"what\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"is\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"changeable\00\00\00\00\00\00", [16 x i8] c"and\00\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"accept\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"what\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"is\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [16 x i8] c"unchangeable\00\00\00\00"]
@.str = [3 x i8] c"be\00"
define i32 @main() {
%1 = alloca [20 x [16 x i8]]
%2 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 0, i64 0
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %2)
%4 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 1, i64 0
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %4)
%6 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 2, i64 0
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %6)
%8 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 3, i64 0
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %8)
%10 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 4, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %10)
%12 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 5, i64 0
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %12)
%14 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 6, i64 0
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %14)
%16 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 7, i64 0
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %16)
%18 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 8, i64 0
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %18)
%20 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 9, i64 0
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %20)
%22 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 10, i64 0
%23 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %22)
%24 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 11, i64 0
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %24)
%26 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 12, i64 0
%27 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %26)
%28 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 13, i64 0
%29 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %28)
%30 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 14, i64 0
%31 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %30)
%32 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 15, i64 0
%33 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %32)
%34 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 16, i64 0
%35 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %34)
%36 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 17, i64 0
%37 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %36)
%38 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 18, i64 0
%39 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %38)
%40 = getelementptr inbounds [20 x [16 x i8]], [20 x [16 x i8]]* %1, i64 0, i64 19, i64 0
%41 = call i32 (i8*, ...) bitcast (i32 (...)* @appendWord to i32 (i8*, ...)*)(i8* %40)
%42 = call i32 (...) @printWords()
%43 = call i32 (i8*, ...) bitcast (i32 (...)* @deleteWord to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%44 = call i32 (...) @printWords()
ret i32 0
}