#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*/ displayCube(int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rotate(int **, int, int);
void testRuns(int **cube) {
  displayCube(cube);
  printf("rotate white face\n");
  rotate(cube, 0, 0);
  rotate(cube, 0, 1);
  displayCube(cube);
  printf("rotate green face\n");
  rotate(cube, 1, 0);
  rotate(cube, 1, 1);
  displayCube(cube);
  printf("rotate red face\n");
  rotate(cube, 2, 0);
  rotate(cube, 2, 1);
  displayCube(cube);
  printf("rotate yellow face\n");
  rotate(cube, 3, 0);
  rotate(cube, 3, 1);
  displayCube(cube);
  printf("rotate blue face\n");
  rotate(cube, 4, 0);
  rotate(cube, 4, 1);
  displayCube(cube);
  printf("rotate orange face\n");
  rotate(cube, 5, 0);
  rotate(cube, 5, 1);
  displayCube(cube);
}


x86 assembly (clang, -O0):
<testRuns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <displayCube@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <rotate@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <rotate@plt>
mov    -0x8(%rbp),%rdi
call   1050 <displayCube@plt>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <rotate@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <rotate@plt>
mov    -0x8(%rbp),%rdi
call   1050 <displayCube@plt>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <rotate@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1040 <rotate@plt>
mov    -0x8(%rbp),%rdi
call   1050 <displayCube@plt>
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
xor    %edx,%edx
call   1040 <rotate@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1040 <rotate@plt>
mov    -0x8(%rbp),%rdi
call   1050 <displayCube@plt>
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1040 <rotate@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <rotate@plt>
mov    -0x8(%rbp),%rdi
call   1050 <displayCube@plt>
lea    0xe02(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
xor    %edx,%edx
call   1040 <rotate@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
call   1040 <rotate@plt>
mov    -0x8(%rbp),%rdi
call   1050 <displayCube@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testRuns>:
push   %rbx
mov    %rdi,%rbx
call   1050 <displayCube@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <rotate@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <rotate@plt>
mov    %rbx,%rdi
call   1050 <displayCube@plt>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <rotate@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1040 <rotate@plt>
mov    %rbx,%rdi
call   1050 <displayCube@plt>
lea    0xe80(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <rotate@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1040 <rotate@plt>
mov    %rbx,%rdi
call   1050 <displayCube@plt>
lea    0xe5b(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %edx,%edx
call   1040 <rotate@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1040 <rotate@plt>
mov    %rbx,%rdi
call   1050 <displayCube@plt>
lea    0xe39(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1040 <rotate@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <rotate@plt>
mov    %rbx,%rdi
call   1050 <displayCube@plt>
lea    0xe15(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %edx,%edx
call   1040 <rotate@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x1,%edx
call   1040 <rotate@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <displayCube@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"rotate white face\0A\00"
@.str.1 = [19 x i8] c"rotate green face\0A\00"
@.str.2 = [17 x i8] c"rotate red face\0A\00"
@.str.3 = [20 x i8] c"rotate yellow face\0A\00"
@.str.4 = [18 x i8] c"rotate blue face\0A\00"
@.str.5 = [20 x i8] c"rotate orange face\0A\00"
define void @testRuns(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = call i32 @displayCube(i32** %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = load i32**, i32*** %2
%7 = call i32 @rotate(i32** %6, i32 0, i32 0)
%8 = load i32**, i32*** %2
%9 = call i32 @rotate(i32** %8, i32 0, i32 1)
%10 = load i32**, i32*** %2
%11 = call i32 @displayCube(i32** %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32**, i32*** %2
%14 = call i32 @rotate(i32** %13, i32 1, i32 0)
%15 = load i32**, i32*** %2
%16 = call i32 @rotate(i32** %15, i32 1, i32 1)
%17 = load i32**, i32*** %2
%18 = call i32 @displayCube(i32** %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32**, i32*** %2
%21 = call i32 @rotate(i32** %20, i32 2, i32 0)
%22 = load i32**, i32*** %2
%23 = call i32 @rotate(i32** %22, i32 2, i32 1)
%24 = load i32**, i32*** %2
%25 = call i32 @displayCube(i32** %24)
%26 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%27 = load i32**, i32*** %2
%28 = call i32 @rotate(i32** %27, i32 3, i32 0)
%29 = load i32**, i32*** %2
%30 = call i32 @rotate(i32** %29, i32 3, i32 1)
%31 = load i32**, i32*** %2
%32 = call i32 @displayCube(i32** %31)
%33 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%34 = load i32**, i32*** %2
%35 = call i32 @rotate(i32** %34, i32 4, i32 0)
%36 = load i32**, i32*** %2
%37 = call i32 @rotate(i32** %36, i32 4, i32 1)
%38 = load i32**, i32*** %2
%39 = call i32 @displayCube(i32** %38)
%40 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%41 = load i32**, i32*** %2
%42 = call i32 @rotate(i32** %41, i32 5, i32 0)
%43 = load i32**, i32*** %2
%44 = call i32 @rotate(i32** %43, i32 5, i32 1)
%45 = load i32**, i32*** %2
%46 = call i32 @displayCube(i32** %45)
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"rotate white face\00"
@str.6 = [18 x i8] c"rotate green face\00"
@str.7 = [16 x i8] c"rotate red face\00"
@str.8 = [19 x i8] c"rotate yellow face\00"
@str.9 = [17 x i8] c"rotate blue face\00"
@str.10 = [19 x i8] c"rotate orange face\00"
define void @testRuns(i32** %0) {
%2 = tail call i32 @displayCube(i32** %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @rotate(i32** %0, i32 0, i32 0)
%5 = tail call i32 @rotate(i32** %0, i32 0, i32 1)
%6 = tail call i32 @displayCube(i32** %0)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0))
%8 = tail call i32 @rotate(i32** %0, i32 1, i32 0)
%9 = tail call i32 @rotate(i32** %0, i32 1, i32 1)
%10 = tail call i32 @displayCube(i32** %0)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.7, i64 0, i64 0))
%12 = tail call i32 @rotate(i32** %0, i32 2, i32 0)
%13 = tail call i32 @rotate(i32** %0, i32 2, i32 1)
%14 = tail call i32 @displayCube(i32** %0)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.8, i64 0, i64 0))
%16 = tail call i32 @rotate(i32** %0, i32 3, i32 0)
%17 = tail call i32 @rotate(i32** %0, i32 3, i32 1)
%18 = tail call i32 @displayCube(i32** %0)
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.9, i64 0, i64 0))
%20 = tail call i32 @rotate(i32** %0, i32 4, i32 0)
%21 = tail call i32 @rotate(i32** %0, i32 4, i32 1)
%22 = tail call i32 @displayCube(i32** %0)
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.10, i64 0, i64 0))
%24 = tail call i32 @rotate(i32** %0, i32 5, i32 0)
%25 = tail call i32 @rotate(i32** %0, i32 5, i32 1)
%26 = tail call i32 @displayCube(i32** %0)
ret void
}