#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 */
char **letterCombinations(char *, int *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int i;
  char **strs = letterCombinations(argv[1], &i);
  while (i-- > 0)
    printf("%s\n", strs[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <letterCombinations@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jle    117c <main+0x5c>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
jmp    114b <main+0x2b>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x8(%rsi),%rdi
lea    0x4(%rsp),%rsi
call   1040 <letterCombinations@plt>
mov    %rax,%rbx
mov    0x4(%rsp),%ecx
lea    -0x1(%rcx),%eax
mov    %eax,0x4(%rsp)
test   %ecx,%ecx
jle    116d <main+0x4d>
lea    0xeb5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %eax,%eax
mov    (%rbx,%rax,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%ecx
lea    -0x1(%rcx),%eax
mov    %eax,0x4(%rsp)
test   %ecx,%ecx
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i8** @letterCombinations(i8* %6, i32* %3)
%8 = load i32, i32* %3
%9 = add nsw i32 %8, -1
store i32 %9, i32* %3
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %20
11: ; preds = %2, %11
%12 = phi i32 [ %18, %11 ], [ %9, %2 ]
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %7, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i32, i32* %3
%18 = add nsw i32 %17, -1
store i32 %18, i32* %3
%19 = icmp sgt i32 %17, 0
br i1 %19, label %11, label %20
20: ; preds = %11, %2
ret i32 0
}