#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 */
struct rubikCube {
  int dummy;
};

/* Variables and functions */
int getSquare(struct rubikCube *, unsigned char, unsigned char, unsigned char);
int /*<<< orphan*/ printf(char *, ...);
void printCube(struct rubikCube *cube) {
  unsigned char face, row, col;
  printf("\n{\n");
  for (face = 0; face < 6; face++) {
    printf("    \"Face %d\": [\n", face);
    for (row = 0; row < 3; row++) {
      printf("        [");
      for (col = 0; col < 3; col++) {
        printf("%d", getSquare(cube, face, row, col));
        if (col < 3 - 1) {
          printf(", ");
        }
      }
      printf("]");
      if (row < 3 - 1) {
        printf(",");
      }
      printf("\n");
    }
    printf("    ]");
    if (face < 6 - 1) {
      printf(",");
    }
    printf("\n");
  }
  printf("}\n\n");
}


x86 assembly (clang, -O0):
<printCube>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x0,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x6,%eax
jge    126b <printCube+0x14b>
movzbl -0x9(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x0,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
cmp    $0x3,%eax
jge    1227 <printCube+0x107>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x0,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
cmp    $0x3,%eax
jge    11e3 <printCube+0xc3>
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%cl
mov    -0xa(%rbp),%al
movzbl %cl,%esi
movzbl %al,%edx
movzbl -0xb(%rbp),%ecx
call   1040 <getSquare@plt>
mov    %eax,%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0xb(%rbp),%eax
cmp    $0x2,%eax
jge    11d1 <printCube+0xb1>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d6 <printCube+0xb6>
mov    -0xb(%rbp),%al
add    $0x1,%al
mov    %al,-0xb(%rbp)
jmp    1180 <printCube+0x60>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0xa(%rbp),%eax
cmp    $0x2,%eax
jge    120c <printCube+0xec>
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xa(%rbp),%al
add    $0x1,%al
mov    %al,-0xa(%rbp)
jmp    1161 <printCube+0x41>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x9(%rbp),%eax
cmp    $0x5,%eax
jge    1250 <printCube+0x130>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    113e <printCube+0x1e>
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCube>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed3(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb1(%rip),%r15
lea    0xeb4(%rip),%r12
lea    0xeb0(%rip),%r13
xor    %r14d,%r14d
jmp    1198 <printCube+0x58>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
cmp    $0x6,%r14d
je     138c <printCube+0x24c>
lea    0xe61(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl %r14b,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1060 <getSquare@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1060 <getSquare@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
mov    $0x2,%ecx
call   1060 <getSquare@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5d,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1060 <getSquare@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1060 <getSquare@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1060 <getSquare@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5d,%edi
call   1030 <putchar@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1060 <getSquare@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1060 <getSquare@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
call   1060 <getSquare@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5d,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcb6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x4,%r14d
ja     1180 <printCube+0x40>
mov    $0x2c,%edi
call   1030 <putchar@plt>
jmp    1180 <printCube+0x40>
lea    0xc98(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
%struct.rubikCube = type { i32 }
@.str.1 = [18 x i8] c" \22Face %d\22: [\0A\00"
@.str.2 = [10 x i8] c" [\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [3 x i8] c", \00"
@.str.8 = [6 x i8] c" ]\00"
@str = [3 x i8] c"\0A{\00"
@str.10 = [3 x i8] c"}\0A\00"
define void @printCube(%struct.rubikCube* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %3
3: ; preds = %1, %46
%4 = phi i32 [ 0, %1 ], [ %48, %46 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%7 = trunc i32 %4 to i8
%8 = tail call i32 @getSquare(%struct.rubikCube* %0, i8 zeroext %7, i8 zeroext 0, i8 zeroext 0)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i32 @getSquare(%struct.rubikCube* %0, i8 zeroext %7, i8 zeroext 0, i8 zeroext 1)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%14 = tail call i32 @getSquare(%struct.rubikCube* %0, i8 zeroext %7, i8 zeroext 0, i8 zeroext 2)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = tail call i32 @putchar(i32 93)
%17 = tail call i32 @putchar(i32 44)
%18 = tail call i32 @putchar(i32 10)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%20 = tail call i32 @getSquare(%struct.rubikCube* %0, i8 zeroext %7, i8 zeroext 1, i8 zeroext 0)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%23 = tail call i32 @getSquare(%struct.rubikCube* %0, i8 zeroext %7, i8 zeroext 1, i8 zeroext 1)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %23)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%26 = tail call i32 @getSquare(%struct.rubikCube* %0, i8 zeroext %7, i8 zeroext 1, i8 zeroext 2)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %26)
%28 = tail call i32 @putchar(i32 93)
%29 = tail call i32 @putchar(i32 44)
%30 = tail call i32 @putchar(i32 10)
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%32 = tail call i32 @getSquare(%struct.rubikCube* %0, i8 zeroext %7, i8 zeroext 2, i8 zeroext 0)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %32)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%35 = tail call i32 @getSquare(%struct.rubikCube* %0, i8 zeroext %7, i8 zeroext 2, i8 zeroext 1)
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%38 = tail call i32 @getSquare(%struct.rubikCube* %0, i8 zeroext %7, i8 zeroext 2, i8 zeroext 2)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %38)
%40 = tail call i32 @putchar(i32 93)
%41 = tail call i32 @putchar(i32 10)
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%43 = icmp ult i32 %4, 5
br i1 %43, label %44, label %46
44: ; preds = %3
%45 = tail call i32 @putchar(i32 44)
br label %46
46: ; preds = %44, %3
%47 = tail call i32 @putchar(i32 10)
%48 = add nuw nsw i32 %4, 1
%49 = icmp eq i32 %48, 6
br i1 %49, label %50, label %3
50: ; preds = %46
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.10, i64 0, i64 0))
ret void
}