#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*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ stdout;
void cube_print_solution(const int *path) {
  const int *t = path;
  char face = '\0';
  while (*t != -1) {
    switch (*t) {
    case 0:
    case 6:
    case 12:
      face = 'F';
      break;
    case 1:
    case 7:
    case 13:
      face = 'T';
      break;
    case 2:
    case 8:
    case 14:
      face = 'L';
      break;
    case 3:
    case 9:
    case 15:
      face = 'B';
      break;
    case 4:
    case 10:
    case 16:
      face = 'D';
      break;
    case 5:
    case 11:
    case 17:
      face = 'R';
      break;
    }
    if (*t >= 12) {
      fprintf(stdout, "2%c ", face);
    } else if (*t >= 6) {
      fprintf(stdout, "%c' ", face);
    } else {
      fprintf(stdout, "%c ", face);
    }
    ++t;
  }
}


x86 assembly (clang, -O0):
<cube_print_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     1213 <cube_print_solution+0x103>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x20(%rbp)
sub    $0x11,%rax
ja     118e <cube_print_solution+0x7e>
mov    -0x20(%rbp),%rax
lea    0xeac(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x46,-0x11(%rbp)
jmp    118e <cube_print_solution+0x7e>
movb   $0x54,-0x11(%rbp)
jmp    118e <cube_print_solution+0x7e>
movb   $0x4c,-0x11(%rbp)
jmp    118e <cube_print_solution+0x7e>
movb   $0x42,-0x11(%rbp)
jmp    118e <cube_print_solution+0x7e>
movb   $0x44,-0x11(%rbp)
jmp    118e <cube_print_solution+0x7e>
movb   $0x52,-0x11(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xc,(%rax)
jl     11b9 <cube_print_solution+0xa9>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
movsbl -0x11(%rbp),%edx
call   1030 <fprintf@plt>
jmp    1202 <cube_print_solution+0xf2>
mov    -0x10(%rbp),%rax
cmpl   $0x6,(%rax)
jl     11e4 <cube_print_solution+0xd4>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
lea    0xe77(%rip),%rsi
movsbl -0x11(%rbp),%edx
call   1030 <fprintf@plt>
jmp    11fd <cube_print_solution+0xed>
mov    0x2df5(%rip),%rax
mov    (%rax),%edi
lea    0xe55(%rip),%rsi
movsbl -0x11(%rbp),%edx
call   1030 <fprintf@plt>
jmp    1202 <cube_print_solution+0xf2>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1128 <cube_print_solution+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cube_print_solution>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %r15d,%r15d
mov    0x2eb8(%rip),%r13
lea    0xf1d(%rip),%r14
lea    0xf17(%rip),%r12
lea    0xec3(%rip),%rbp
jmp    1154 <cube_print_solution+0x44>
nop
mov    0x0(%r13),%edi
movsbl %r15b,%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
add    $0x4,%rbx
mov    (%rbx),%eax
lea    0x1(%rax),%ecx
cmp    $0x12,%ecx
ja     11a0 <cube_print_solution+0x90>
movslq 0x0(%rbp,%rcx,4),%rcx
add    %rbp,%rcx
jmp    *%rcx
mov    $0x46,%r15b
cmp    $0xc,%eax
jge    1140 <cube_print_solution+0x30>
jmp    11a5 <cube_print_solution+0x95>
mov    $0x54,%r15b
cmp    $0xc,%eax
jge    1140 <cube_print_solution+0x30>
jmp    11a5 <cube_print_solution+0x95>
mov    $0x4c,%r15b
cmp    $0xc,%eax
jge    1140 <cube_print_solution+0x30>
jmp    11a5 <cube_print_solution+0x95>
mov    $0x42,%r15b
cmp    $0xc,%eax
jge    1140 <cube_print_solution+0x30>
jmp    11a5 <cube_print_solution+0x95>
mov    $0x44,%r15b
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0xc,%eax
jge    1140 <cube_print_solution+0x30>
mov    0x0(%r13),%edi
movsbl %r15b,%edx
cmp    $0x6,%eax
jl     11c0 <cube_print_solution+0xb0>
lea    0xe98(%rip),%rsi
jmp    114b <cube_print_solution+0x3b>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rsi
jmp    114b <cube_print_solution+0x3b>
mov    $0x52,%r15b
cmp    $0xc,%eax
jge    1140 <cube_print_solution+0x30>
jmp    11a5 <cube_print_solution+0x95>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"2%c \00"
@.str.1 = [5 x i8] c"%c' \00"
@.str.2 = [4 x i8] c"%c \00"
define void @cube_print_solution(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32* %5, i32** %3
store i8 0, i8* %4
br label %6
6: ; preds = %40, %1
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, -1
br i1 %9, label %10, label %43
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
switch i32 %12, label %19 [
i32 0, label %13
i32 6, label %13
i32 12, label %13
i32 1, label %14
i32 7, label %14
i32 13, label %14
i32 2, label %15
i32 8, label %15
i32 14, label %15
i32 3, label %16
i32 9, label %16
i32 15, label %16
i32 4, label %17
i32 10, label %17
i32 16, label %17
i32 5, label %18
i32 11, label %18
i32 17, label %18
]
13: ; preds = %10, %10, %10
store i8 70, i8* %4
br label %19
14: ; preds = %10, %10, %10
store i8 84, i8* %4
br label %19
15: ; preds = %10, %10, %10
store i8 76, i8* %4
br label %19
16: ; preds = %10, %10, %10
store i8 66, i8* %4
br label %19
17: ; preds = %10, %10, %10
store i8 68, i8* %4
br label %19
18: ; preds = %10, %10, %10
store i8 82, i8* %4
br label %19
19: ; preds = %10, %18, %17, %16, %15, %14, %13
%20 = load i32*, i32** %3
%21 = load i32, i32* %20
%22 = icmp sge i32 %21, 12
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i32, i32* @stdout
%25 = load i8, i8* %4
%26 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %25)
br label %40
27: ; preds = %19
%28 = load i32*, i32** %3
%29 = load i32, i32* %28
%30 = icmp sge i32 %29, 6
br i1 %30, label %31, label %35
31: ; preds = %27
%32 = load i32, i32* @stdout
%33 = load i8, i8* %4
%34 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8 signext %33)
br label %39
35: ; preds = %27
%36 = load i32, i32* @stdout
%37 = load i8, i8* %4
%38 = call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext %37)
br label %39
39: ; preds = %35, %31
br label %40
40: ; preds = %39, %23
%41 = load i32*, i32** %3
%42 = getelementptr inbounds i32, i32* %41, i32 1
store i32* %42, i32** %3
br label %6
43: ; preds = %6
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"2%c \00"
@.str.1 = [5 x i8] c"%c' \00"
@.str.2 = [4 x i8] c"%c \00"
define void @cube_print_solution(i32* nocapture %0) {
br label %2
2: ; preds = %25, %1
%3 = phi i32* [ %0, %1 ], [ %26, %25 ]
%4 = phi i8 [ 0, %1 ], [ %13, %25 ]
%5 = load i32, i32* %3
switch i32 %5, label %12 [
i32 -1, label %27
i32 0, label %6
i32 6, label %6
i32 12, label %6
i32 1, label %7
i32 7, label %7
i32 13, label %7
i32 2, label %8
i32 8, label %8
i32 14, label %8
i32 3, label %9
i32 9, label %9
i32 15, label %9
i32 4, label %10
i32 10, label %10
i32 16, label %10
i32 5, label %11
i32 11, label %11
i32 17, label %11
]
6: ; preds = %2, %2, %2
br label %12
7: ; preds = %2, %2, %2
br label %12
8: ; preds = %2, %2, %2
br label %12
9: ; preds = %2, %2, %2
br label %12
10: ; preds = %2, %2, %2
br label %12
11: ; preds = %2, %2, %2
br label %12
12: ; preds = %2, %11, %10, %9, %8, %7, %6
%13 = phi i8 [ 82, %11 ], [ 68, %10 ], [ 66, %9 ], [ 76, %8 ], [ 84, %7 ], [ 70, %6 ], [ %4, %2 ]
%14 = icmp sgt i32 %5, 11
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* @stdout
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %13)
br label %25
18: ; preds = %12
%19 = icmp sgt i32 %5, 5
%20 = load i32, i32* @stdout
br i1 %19, label %21, label %23
21: ; preds = %18
%22 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8 signext %13)
br label %25
23: ; preds = %18
%24 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext %13)
br label %25
25: ; preds = %21, %23, %15
%26 = getelementptr inbounds i32, i32* %3, i64 1
br label %2
27: ; preds = %2
ret void
}