#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 get_char_key(int, size_t);
int /*<<< orphan*/ printf(char *, char *);
void print_words_aux(int number[], size_t number_i, char *buff, size_t buff_i) {
  if (number_i == 7) {
    buff[buff_i] = '\0';
    printf("%s\n", buff);
    return;
  }
  if (number[number_i] < 2) {
    buff[buff_i] = '0' + number[number_i];
    print_words_aux(number, number_i + 1, buff, buff_i + 1);
  } else {
    size_t i;
    for (i = 1; i <= 3; i++) {
      buff[buff_i] = get_char_key(number[number_i], i);
      print_words_aux(number, number_i + 1, buff, buff_i + 1);
    }
  }
}


x86 assembly (clang, -O0):
<print_words_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)
cmpq   $0x7,-0x10(%rbp)
jne    1174 <print_words_aux+0x44>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1050 <printf@plt>
jmp    122a <print_words_aux+0xfa>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpl   $0x2,(%rax,%rcx,4)
jge    11c3 <print_words_aux+0x93>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x30,%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
call   1030 <print_words_aux@plt>
jmp    122a <print_words_aux+0xfa>
movq   $0x1,-0x28(%rbp)
cmpq   $0x3,-0x28(%rbp)
ja     1225 <print_words_aux+0xf5>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x28(%rbp),%rsi
call   1040 <get_char_key@plt>
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
call   1030 <print_words_aux@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11cb <print_words_aux+0x9b>
jmp    122a <print_words_aux+0xfa>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_words_aux>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r13
cmp    $0x7,%rsi
je     1187 <print_words_aux+0x57>
mov    %rdi,%r14
lea    (%rcx,%r13,1),%rbp
lea    (%rdi,%rsi,4),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r15,%rbx,4),%edi
cmp    $0x2,%edi
jge    11aa <print_words_aux+0x7a>
add    $0x30,%dil
mov    %dil,0x0(%rbp,%rbx,1)
lea    (%rsi,%rbx,1),%rax
add    $0x1,%rax
add    $0x1,%rbx
cmp    $0x7,%rax
jne    1160 <print_words_aux+0x30>
add    %rbx,%rcx
movb   $0x0,0x0(%r13,%rcx,1)
lea    0xe6c(%rip),%rdi
mov    %r13,%rsi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printf@plt>
lea    (%rsi,%rbx,1),%rax
add    $0x1,%rax
mov    %rax,0x8(%rsp)
lea    (%rcx,%rbx,1),%r12
add    $0x1,%r12
mov    %r12,0x10(%rsp)
mov    $0x1,%esi
call   1040 <get_char_key@plt>
mov    %al,(%rbx,%rbp,1)
mov    %r14,%rdi
mov    0x8(%rsp),%rsi
mov    %r13,%rdx
mov    %r12,%rcx
call   1030 <print_words_aux@plt>
mov    (%r15,%rbx,4),%edi
mov    $0x2,%esi
call   1040 <get_char_key@plt>
mov    %al,(%rbx,%rbp,1)
mov    %r14,%rdi
mov    0x8(%rsp),%r12
mov    %r12,%rsi
mov    %r13,%rdx
mov    0x10(%rsp),%rcx
call   1030 <print_words_aux@plt>
mov    (%r15,%rbx,4),%edi
mov    $0x3,%esi
call   1040 <get_char_key@plt>
mov    %al,(%rbx,%rbp,1)
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    0x10(%rsp),%rcx
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <print_words_aux@plt>

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

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