#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 */
int /*<<< orphan*/ printf(char *, char *);
void print_combinations_aux(unsigned char letters[], size_t letter_i,
                            char *buff, size_t buff_i) {
  size_t next_letter;
  for (next_letter = letter_i; next_letter < 26 && !letters[next_letter];
       next_letter++)
    ;
  if (next_letter == 26) {
    buff[buff_i] = '\0';
    if (buff_i != 0) {
      printf("%s\n", buff);
    }
    return;
  }
  print_combinations_aux(letters, next_letter + 1, buff, buff_i);
  buff[buff_i] = 'a' + next_letter;
  print_combinations_aux(letters, next_letter + 1, buff, buff_i + 1);
}


x86 assembly (clang, -O0):
<print_combinations_aux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmpq   $0x1a,-0x28(%rbp)
mov    %al,-0x29(%rbp)
jae    1164 <print_combinations_aux+0x44>
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
setne  %al
xor    $0xff,%al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    1174 <print_combinations_aux+0x54>
jmp    118a <print_combinations_aux+0x6a>
jmp    1179 <print_combinations_aux+0x59>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1140 <print_combinations_aux+0x20>
cmpq   $0x1a,-0x28(%rbp)
jne    11c1 <print_combinations_aux+0xa1>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
cmpq   $0x0,-0x20(%rbp)
je     11bc <print_combinations_aux+0x9c>
mov    -0x18(%rbp),%rsi
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
jmp    120c <print_combinations_aux+0xec>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
add    $0x1,%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <print_combinations_aux@plt>
mov    -0x28(%rbp),%rax
add    $0x61,%rax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
add    $0x1,%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
call   1040 <print_combinations_aux@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_combinations_aux>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r12
jmp    1169 <print_combinations_aux+0x49>
nopw   0x0(%rax,%rax,1)
cmp    $0x1a,%rbx
je     1181 <print_combinations_aux+0x61>
lea    0x1(%rbx),%r13
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1040 <print_combinations_aux@plt>
add    $0x61,%bl
mov    %bl,(%r14,%r15,1)
add    $0x1,%r15
mov    %r13,%rbx
cmp    $0x19,%rbx
ja     1140 <print_combinations_aux+0x20>
nop
cmpb   $0x0,(%r12,%rbx,1)
jne    1146 <print_combinations_aux+0x26>
add    $0x1,%rbx
cmp    $0x1a,%rbx
jne    1170 <print_combinations_aux+0x50>
movb   $0x0,(%r14,%r15,1)
test   %r15,%r15
je     11a3 <print_combinations_aux+0x83>
lea    0xe6e(%rip),%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <printf@plt>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @print_combinations_aux(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i64, i64* %6
store i64 %10, i64* %9
br label %11
11: ; preds = %24, %4
%12 = load i64, i64* %9
%13 = icmp ult i64 %12, 26
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i8*, i8** %5
%16 = load i64, i64* %9
%17 = getelementptr inbounds i8, i8* %15, i64 %16
%18 = load i8, i8* %17
%19 = icmp ne i8 %18, 0
%20 = xor i1 %19, true
br label %21
21: ; preds = %14, %11
%22 = phi i1 [ false, %11 ], [ %20, %14 ]
br i1 %22, label %23, label %27
23: ; preds = %21
br label %24
24: ; preds = %23
%25 = load i64, i64* %9
%26 = add i64 %25, 1
store i64 %26, i64* %9
br label %11
27: ; preds = %21
%28 = load i64, i64* %9
%29 = icmp eq i64 %28, 26
br i1 %29, label %30, label %40
30: ; preds = %27
%31 = load i8*, i8** %7
%32 = load i64, i64* %8
%33 = getelementptr inbounds i8, i8* %31, i64 %32
store i8 0, i8* %33
%34 = load i64, i64* %8
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %30
%37 = load i8*, i8** %7
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %37)
br label %39
39: ; preds = %36, %30
br label %58
40: ; preds = %27
%41 = load i8*, i8** %5
%42 = load i64, i64* %9
%43 = add i64 %42, 1
%44 = load i8*, i8** %7
%45 = load i64, i64* %8
%46 = load i64, i64* %9
%47 = add i64 97, %46
%48 = trunc i64 %47 to i8
%49 = load i8*, i8** %7
%50 = load i64, i64* %8
%51 = getelementptr inbounds i8, i8* %49, i64 %50
store i8 %48, i8* %51
%52 = load i8*, i8** %5
%53 = load i64, i64* %9
%54 = add i64 %53, 1
%55 = load i8*, i8** %7
%56 = load i64, i64* %8
%57 = add i64 %56, 1
br label %58
58: ; preds = %40, %39
ret void
}

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