#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 */
scalar_t__ malloc(int);
int minimumLengthEncoding(char **, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char **words = (char **)malloc(sizeof(char *) * 3);
  words[0] = "time";
  words[1] = "me";
  words[2] = "bell";
  int max = minimumLengthEncoding(words, 3);
  printf("max %d\n", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x18,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xea8(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
lea    0xe9c(%rip),%rcx
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
lea    0xe90(%rip),%rcx
mov    %rcx,0x10(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1040 <minimumLengthEncoding@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x18,%edi
call   1050 <malloc@plt>
lea    0xebe(%rip),%rcx
mov    %rcx,(%rax)
lea    0xeb6(%rip),%rcx
mov    %rcx,0x8(%rax)
lea    0xeae(%rip),%rcx
mov    %rcx,0x10(%rax)
mov    %rax,%rdi
mov    $0x3,%esi
call   1040 <minimumLengthEncoding@plt>
lea    0xe9b(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"time\00"
@.str.1 = [3 x i8] c"me\00"
@.str.2 = [5 x i8] c"bell\00"
@.str.3 = [8 x i8] c"max %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8**
%3 = alloca i32
store i32 0, i32* %1
%4 = call i64 @malloc(i32 24)
%5 = inttoptr i64 %4 to i8**
store i8** %5, i8*** %2
%6 = load i8**, i8*** %2
%7 = getelementptr inbounds i8*, i8** %6, i64 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i8**, i8*** %2
%9 = getelementptr inbounds i8*, i8** %8, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %9
%10 = load i8**, i8*** %2
%11 = getelementptr inbounds i8*, i8** %10, i64 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %11
%12 = load i8**, i8*** %2
%13 = call i32 @minimumLengthEncoding(i8** %12, i32 3)
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"time\00"
@.str.1 = [3 x i8] c"me\00"
@.str.2 = [5 x i8] c"bell\00"
@.str.3 = [8 x i8] c"max %d\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 24)
%2 = inttoptr i64 %1 to i8**
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = getelementptr inbounds i8*, i8** %2, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds i8*, i8** %2, i64 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %4
%5 = tail call i32 @minimumLengthEncoding(i8** %2, i32 3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %5)
ret i32 0
}