// File: chuckwolber[P]Cube/test/../Cube.cpp
// Function: Cube::initializeCube()
void Cube::initializeCube() {
    cube = new CubieColor*[LAYERS_PER_COL*cubeSize];
    for (unsigned int i=0; i<(LAYERS_PER_COL*cubeSize); i++)
        cube[i] = new CubieColor[LAYERS_PER_ROW*cubeSize];

    for (unsigned int row=0; row<LAYERS_PER_COL*cubeSize; row++)
        for (unsigned int col=0; col<LAYERS_PER_ROW*cubeSize; col++)
            cube[row][col] = CubieColor::NOCOLOR;
   
    initializeLayers();
    initializeEdges();

    getLayerUpperLeft(fUpperLeft, Layer::F);
    fUpperLeftMax.row = fUpperLeft.row + cubeSize;
    fUpperLeftMax.col = fUpperLeft.col + cubeSize;

    getLayerUpperLeft(uUpperLeft, Layer::U);
    uUpperLeftMax.row = uUpperLeft.row + cubeSize;
    uUpperLeftMax.col = uUpperLeft.col + cubeSize;

    getLayerUpperLeft(lUpperLeft, Layer::L);
    lUpperLeftMax.row = lUpperLeft.row + cubeSize;
    lUpperLeftMax.col = lUpperLeft.col + cubeSize;

    getLayerUpperLeft(rUpperLeft, Layer::R);
    rUpperLeftMax.row = rUpperLeft.row + cubeSize;
    rUpperLeftMax.col = rUpperLeft.col + cubeSize;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movl 0x28(%rcx), %eax
imull 0x8(%rcx), %eax
movl %eax, %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, -0xc(%rbp)
movq -0x20(%rbp), %rdx
movl -0xc(%rbp), %eax
movl 0x28(%rdx), %ecx
imull 0x8(%rdx), %ecx
cmpl %ecx, %eax
jae 0x7bc3
movq -0x20(%rbp), %rcx
movl 0x2c(%rcx), %eax
imull 0x8(%rcx), %eax
movl %eax, %eax
movl %eax, %edi
callq 0x2030
movq %rax, %rdx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7b80
movl $0x0, -0x10(%rbp)
movq -0x20(%rbp), %rdx
movl -0x10(%rbp), %eax
movl 0x28(%rdx), %ecx
imull 0x8(%rdx), %ecx
cmpl %ecx, %eax
jae 0x7c23
movl $0x0, -0x14(%rbp)
movq -0x20(%rbp), %rdx
movl -0x14(%rbp), %eax
movl 0x2c(%rdx), %ecx
imull 0x8(%rdx), %ecx
cmpl %ecx, %eax
jae 0x7c16
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x10(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x14(%rbp), %ecx
movb $0x20, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x7be3
jmp 0x7c18
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x7bca
movq -0x20(%rbp), %rdi
callq 0x8ce0
movq -0x20(%rbp), %rdi
callq 0x8e50
movq -0x20(%rbp), %rdi
movq %rdi, %rsi
addq $0x34, %rsi
movl $0x5, %edx
callq 0x8af0
movq -0x20(%rbp), %rdi
movl 0x34(%rdi), %eax
addl 0x8(%rdi), %eax
movl %eax, 0x3c(%rdi)
movl 0x38(%rdi), %eax
addl 0x8(%rdi), %eax
movl %eax, 0x40(%rdi)
movq %rdi, %rsi
addq $0x44, %rsi
movl $0x1, %edx
callq 0x8af0
movq -0x20(%rbp), %rdi
movl 0x44(%rdi), %eax
addl 0x8(%rdi), %eax
movl %eax, 0x4c(%rdi)
movl 0x48(%rdi), %eax
addl 0x8(%rdi), %eax
movl %eax, 0x50(%rdi)
movq %rdi, %rsi
addq $0x54, %rsi
movl $0x4, %edx
callq 0x8af0
movq -0x20(%rbp), %rdi
movl 0x54(%rdi), %eax
addl 0x8(%rdi), %eax
movl %eax, 0x5c(%rdi)
movl 0x58(%rdi), %eax
addl 0x8(%rdi), %eax
movl %eax, 0x60(%rdi)
movq %rdi, %rsi
addq $0x64, %rsi
movl $0x6, %edx
callq 0x8af0
movq -0x20(%rbp), %rax
movl 0x64(%rax), %ecx
addl 0x8(%rax), %ecx
movl %ecx, 0x6c(%rax)
movl 0x68(%rax), %ecx
addl 0x8(%rax), %ecx
movl %ecx, 0x70(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)