int main() {
  char keys[][8] = {"the", "a", "there", "answer", "any", "by", "bye", "their"};
  char output[][32] = {"Not present in trie", "Present in trie"};
  struct TrieNode *root = getNode();
  int i;
  for (i = 0; i < sizeof(keys) / sizeof(keys[0]); i++)
    insert(root, keys[i]);
  printf("%s --- %s\n", "the", output[search(root, "the")]);
  printf("%s --- %s\n", "these", output[search(root, "these")]);
  printf("%s --- %s\n", "their", output[search(root, "their")]);
  printf("%s --- %s\n", "thaw", output[search(root, "thaw")]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xe93(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
lea    -0x90(%rbp),%rdi
lea    0xebb(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
mov    $0x0,%al
call   1070 <getNode@plt>
cltq
mov    %rax,-0x98(%rbp)
movl   $0x0,-0x9c(%rbp)
movslq -0x9c(%rbp),%rax
cmp    $0x8,%rax
jae    11ee <main+0x9e>
mov    -0x98(%rbp),%rdi
movslq -0x9c(%rbp),%rax
lea    -0x50(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
mov    $0x0,%al
call   1060 <insert@plt>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    11a9 <main+0x59>
mov    -0x98(%rbp),%rdi
lea    0xe8f(%rip),%rsi
mov    $0x0,%al
call   1040 <search@plt>
cltq
lea    -0x90(%rbp),%rdx
shl    $0x5,%rax
add    %rax,%rdx
lea    0xe66(%rip),%rdi
lea    0xe6a(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x98(%rbp),%rdi
lea    0xe59(%rip),%rsi
mov    $0x0,%al
call   1040 <search@plt>
cltq
lea    -0x90(%rbp),%rdx
shl    $0x5,%rax
add    %rax,%rdx
lea    0xe2c(%rip),%rdi
lea    0xe34(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x98(%rbp),%rdi
lea    0xe25(%rip),%rsi
mov    $0x0,%al
call   1040 <search@plt>
cltq
lea    -0x90(%rbp),%rdx
shl    $0x5,%rax
add    %rax,%rdx
lea    0xdf2(%rip),%rdi
lea    0xe00(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x98(%rbp),%rdi
lea    0xdf1(%rip),%rsi
mov    $0x0,%al
call   1040 <search@plt>
cltq
lea    -0x90(%rbp),%rdx
shl    $0x5,%rax
add    %rax,%rdx
lea    0xdb8(%rip),%rdi
lea    0xdcc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x88,%rsp
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea3(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe87(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%r14
lea    0x20(%rsp),%r15
lea    0x10(%rsp),%r12
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe89(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
xor    %eax,%eax
call   1060 <getNode@plt>
movslq %eax,%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <insert@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <insert@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <insert@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <insert@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <insert@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <insert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <insert@plt>
lea    0x38(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <insert@plt>
lea    0xe4e(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <search@plt>
cltq
shl    $0x5,%rax
lea    (%rsp,%rax,1),%rdx
add    $0x40,%rdx
lea    0xe21(%rip),%r14
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe1c(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <search@plt>
cltq
shl    $0x5,%rax
lea    (%rsp,%rax,1),%rdx
add    $0x40,%rdx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdf3(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <search@plt>
cltq
shl    $0x5,%rax
lea    (%rsp,%rax,1),%rdx
add    $0x40,%rdx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdca(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <search@plt>
cltq
shl    $0x5,%rax
lea    (%rsp,%rax,1),%rdx
add    $0x40,%rdx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TrieNode = type opaque
@__const.main.keys = [8 x [8 x i8]] [[8 x i8] c"the\00\00\00\00\00", [8 x i8] c"a\00\00\00\00\00\00\00", [8 x i8] c"there\00\00\00", [8 x i8] c"answer\00\00", [8 x i8] c"any\00\00\00\00\00", [8 x i8] c"by\00\00\00\00\00\00", [8 x i8] c"bye\00\00\00\00\00", [8 x i8] c"their\00\00\00"]
@__const.main.output = [2 x [32 x i8]] [[32 x i8] c"Not present in trie\00\00\00\00\00\00\00\00\00\00\00\00\00", [32 x i8] c"Present in trie\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@.str = [11 x i8] c"%s --- %s\0A\00"
@.str.1 = [4 x i8] c"the\00"
@.str.2 = [6 x i8] c"these\00"
@.str.3 = [6 x i8] c"their\00"
@.str.4 = [5 x i8] c"thaw\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x [8 x i8]]
%3 = alloca [2 x [32 x i8]]
%4 = alloca %struct.TrieNode*
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [8 x [8 x i8]]* %2 to i8*
%7 = bitcast [2 x [32 x i8]]* %3 to i8*
%8 = call i32 (...) @getNode()
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to %struct.TrieNode*
store %struct.TrieNode* %10, %struct.TrieNode** %4
store i32 0, i32* %5
br label %11
11: ; preds = %22, %0
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = icmp ult i64 %13, 8
br i1 %14, label %15, label %25
15: ; preds = %11
%16 = load %struct.TrieNode*, %struct.TrieNode** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %2, i64 0, i64 %18
%20 = getelementptr inbounds [8 x i8], [8 x i8]* %19, i64 0, i64 0
%21 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @insert to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %16, i8* %20)
br label %22
22: ; preds = %15
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %11
25: ; preds = %11
%26 = load %struct.TrieNode*, %struct.TrieNode** %4
%27 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @search to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [2 x [32 x i8]], [2 x [32 x i8]]* %3, i64 0, i64 %28
%30 = getelementptr inbounds [32 x i8], [32 x i8]* %29, i64 0, i64 0
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %30)
%32 = load %struct.TrieNode*, %struct.TrieNode** %4
%33 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @search to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [2 x [32 x i8]], [2 x [32 x i8]]* %3, i64 0, i64 %34
%36 = getelementptr inbounds [32 x i8], [32 x i8]* %35, i64 0, i64 0
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %36)
%38 = load %struct.TrieNode*, %struct.TrieNode** %4
%39 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @search to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [2 x [32 x i8]], [2 x [32 x i8]]* %3, i64 0, i64 %40
%42 = getelementptr inbounds [32 x i8], [32 x i8]* %41, i64 0, i64 0
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %42)
%44 = load %struct.TrieNode*, %struct.TrieNode** %4
%45 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @search to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [2 x [32 x i8]], [2 x [32 x i8]]* %3, i64 0, i64 %46
%48 = getelementptr inbounds [32 x i8], [32 x i8]* %47, i64 0, i64 0
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %48)
ret i32 0
}

LLVM IR (-O2):
%struct.TrieNode = type opaque
@__const.main.keys = [8 x [8 x i8]] [[8 x i8] c"the\00\00\00\00\00", [8 x i8] c"a\00\00\00\00\00\00\00", [8 x i8] c"there\00\00\00", [8 x i8] c"answer\00\00", [8 x i8] c"any\00\00\00\00\00", [8 x i8] c"by\00\00\00\00\00\00", [8 x i8] c"bye\00\00\00\00\00", [8 x i8] c"their\00\00\00"]
@__const.main.output = [2 x [32 x i8]] [[32 x i8] c"Not present in trie\00\00\00\00\00\00\00\00\00\00\00\00\00", [32 x i8] c"Present in trie\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@.str = [11 x i8] c"%s --- %s\0A\00"
@.str.1 = [4 x i8] c"the\00"
@.str.2 = [6 x i8] c"these\00"
@.str.3 = [6 x i8] c"their\00"
@.str.4 = [5 x i8] c"thaw\00"
define i32 @main() {
%1 = alloca [8 x [8 x i8]]
%2 = alloca [2 x [32 x i8]]
%3 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 0, i64 0
%4 = getelementptr inbounds [2 x [32 x i8]], [2 x [32 x i8]]* %2, i64 0, i64 0, i64 0
%5 = tail call i32 (...) @getNode()
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.TrieNode*
%8 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @insert to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %7, i8* %3)
%9 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 1, i64 0
%10 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @insert to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %7, i8* %9)
%11 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 2, i64 0
%12 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @insert to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %7, i8* %11)
%13 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 3, i64 0
%14 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @insert to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %7, i8* %13)
%15 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 4, i64 0
%16 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @insert to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %7, i8* %15)
%17 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 5, i64 0
%18 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @insert to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %7, i8* %17)
%19 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 6, i64 0
%20 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @insert to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %7, i8* %19)
%21 = getelementptr inbounds [8 x [8 x i8]], [8 x [8 x i8]]* %1, i64 0, i64 7, i64 0
%22 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @insert to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %7, i8* %21)
%23 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @search to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [2 x [32 x i8]], [2 x [32 x i8]]* %2, i64 0, i64 %24, i64 0
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %25)
%27 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @search to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [2 x [32 x i8]], [2 x [32 x i8]]* %2, i64 0, i64 %28, i64 0
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %29)
%31 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @search to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [2 x [32 x i8]], [2 x [32 x i8]]* %2, i64 0, i64 %32, i64 0
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %33)
%35 = call i32 (%struct.TrieNode*, i8*, ...) bitcast (i32 (...)* @search to i32 (%struct.TrieNode*, i8*, ...)*)(%struct.TrieNode* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [2 x [32 x i8]], [2 x [32 x i8]]* %2, i64 0, i64 %36, i64 0
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %37)
ret i32 0
}