void letterCombinationsMain(void) {
  char digits[] = "";
  int returnSize = 0;
  char **result = letterCombinations(digits, &returnSize);
  int i = 0;
  for (i = 0; i < returnSize; i++) {
    printf("%s\n", result[i]);
    free(result[i]);
  }
  free(result);
}


x86 assembly (clang, -O0):
<letterCombinationsMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x1(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <memset@plt>
movl   $0x0,-0x8(%rbp)
lea    -0x1(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <letterCombinations@plt>
cltq
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c7 <letterCombinationsMain+0x87>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1182 <letterCombinationsMain+0x42>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<letterCombinationsMain>:
push   %r14
push   %rbx
push   %rax
movb   $0x0,0x3(%rsp)
movl   $0x0,0x4(%rsp)
lea    0x3(%rsp),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <letterCombinations@plt>
movslq %eax,%r14
cmpl   $0x0,0x4(%rsp)
jle    1180 <letterCombinationsMain+0x50>
xor    %ebx,%ebx
xchg   %ax,%ax
mov    (%r14,%rbx,8),%rdi
call   1040 <puts@plt>
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
movslq 0x4(%rsp),%rax
cmp    %rax,%rbx
jl     1160 <letterCombinationsMain+0x30>
mov    %r14,%rdi
call   1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @letterCombinationsMain() {
%1 = alloca [1 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 0, i8* %3
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 (i8*, i32*, ...) bitcast (i32 (...)* @letterCombinations to i32 (i8*, i32*, ...)*)(i8* %3, i32* %2)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8**
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %0, %10
%11 = phi i64 [ %16, %10 ], [ 0, %0 ]
%12 = getelementptr inbounds i8*, i8** %7, i64 %11
%13 = load i8*, i8** %12
%14 = call i32 @puts(i8* dereferenceable(1) %13)
%15 = load i8*, i8** %12
%16 = add nuw nsw i64 %11, 1
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = icmp slt i64 %16, %18
br i1 %19, label %10, label %20
20: ; preds = %10, %0
%21 = inttoptr i64 %6 to i8*
ret void
}