// File: Doug0855[P]TigerZone/Tile_Structure/Tile.cpp
// Function: Tile::rotate()
void Tile::rotate()
{
	std::vector<std::vector<Block> > unrotated = innerBlocks;

  // Top row
  innerBlocks[0][0] = Block(unrotated[0][2]);
  innerBlocks[0][1] = Block(unrotated[1][2]);
  innerBlocks[0][2] = Block(unrotated[2][2]);

  this->upFace.setType(innerBlocks[0][1].getType());

  // Middle row except center block (doesn't rotate)
  innerBlocks[1][0] = Block(unrotated[0][1]);
  innerBlocks[1][2] = Block(unrotated[2][1]);

  this->leftFace.setType(innerBlocks[1][0].getType());
  this->rightFace.setType(innerBlocks[1][2].getType());

  // Bottom row
  innerBlocks[2][0] = Block(unrotated[0][0]);
  innerBlocks[2][1] = Block(unrotated[1][0]);
  innerBlocks[2][2] = Block(unrotated[2][0]);

  this->downFace.setType(innerBlocks[2][1].getType());

  if (rotation < 3)
    rotation++;
  else
    rotation = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x200(%rbp)
addq $0xd0, %rsi
leaq -0x20(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x8eb0
movq -0x1f8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x17390
movq %rax, %rdi
movl $0x2, %esi
callq 0x173b0
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x9d20
jmp 0x2692c
movq -0x200(%rbp), %rdi
addq $0xd0, %rdi
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x208(%rbp)
callq 0x17390
movq -0x208(%rbp), %rsi
movq %rax, %rdi
callq 0x173b0
movq %rax, %rdi
leaq -0x48(%rbp), %rsi
callq 0xb5c0
jmp 0x26967
leaq -0x48(%rbp), %rdi
callq 0x28420
leaq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x17390
movq %rax, %rdi
movl $0x2, %esi
callq 0x173b0
movq %rax, %rsi
leaq -0x80(%rbp), %rdi
callq 0x9d20
jmp 0x26999
movq -0x200(%rbp), %rdi
addq $0xd0, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x17390
movq %rax, %rdi
movl $0x1, %esi
callq 0x173b0
movq %rax, %rdi
leaq -0x80(%rbp), %rsi
callq 0xb5c0
jmp 0x269cb
leaq -0x80(%rbp), %rdi
callq 0x28420
leaq -0x20(%rbp), %rdi
movl $0x2, %esi
movq %rsi, -0x210(%rbp)
callq 0x17390
movq -0x210(%rbp), %rsi
movq %rax, %rdi
callq 0x173b0
movq %rax, %rsi
leaq -0xa8(%rbp), %rdi
callq 0x9d20
jmp 0x26a09
movq -0x200(%rbp), %rdi
addq $0xd0, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x17390
movq %rax, %rdi
movl $0x2, %esi
callq 0x173b0
movq %rax, %rdi
leaq -0xa8(%rbp), %rsi
callq 0xb5c0
jmp 0x26a3e
leaq -0xa8(%rbp), %rdi
callq 0x28420
movq -0x200(%rbp), %rdi
movq %rdi, %rax
addq $0x10, %rax
movq %rax, -0x218(%rbp)
addq $0xd0, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x17390
movq %rax, %rdi
movl $0x1, %esi
callq 0x173b0
movq %rax, %rsi
leaq -0xc8(%rbp), %rdi
callq 0x15490
jmp 0x26a8d
movq -0x218(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x281a0
jmp 0x26aa2
leaq -0xc8(%rbp), %rdi
callq 0x3210
xorl %eax, %eax
movl %eax, %esi
leaq -0x20(%rbp), %rdi
callq 0x17390
movq %rax, %rdi
movl $0x1, %esi
callq 0x173b0
movq %rax, %rsi
leaq -0xf0(%rbp), %rdi
callq 0x9d20
jmp 0x26ad9
movq -0x200(%rbp), %rdi
addq $0xd0, %rdi
movl $0x1, %esi
callq 0x17390
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x173b0
movq %rax, %rdi
leaq -0xf0(%rbp), %rsi
callq 0xb5c0
jmp 0x26b0e
leaq -0xf0(%rbp), %rdi
callq 0x28420
leaq -0x20(%rbp), %rdi
movl $0x2, %esi
callq 0x17390
movq %rax, %rdi
movl $0x1, %esi
callq 0x173b0
movq %rax, %rsi
leaq -0x118(%rbp), %rdi
callq 0x9d20
jmp 0x26b46
movq -0x200(%rbp), %rdi
addq $0xd0, %rdi
movl $0x1, %esi
callq 0x17390
movq %rax, %rdi
movl $0x2, %esi
callq 0x173b0
movq %rax, %rdi
leaq -0x118(%rbp), %rsi
callq 0xb5c0
jmp 0x26b7c
leaq -0x118(%rbp), %rdi
callq 0x28420
movq -0x200(%rbp), %rdi
movq %rdi, %rax
addq $0x60, %rax
movq %rax, -0x220(%rbp)
addq $0xd0, %rdi
movl $0x1, %esi
callq 0x17390
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x173b0
movq %rax, %rsi
leaq -0x138(%rbp), %rdi
callq 0x15490
jmp 0x26bcb
movq -0x220(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x281a0
jmp 0x26be0
leaq -0x138(%rbp), %rdi
callq 0x3210
movq -0x200(%rbp), %rdi
movq %rdi, %rax
addq $0x88, %rax
movq %rax, -0x228(%rbp)
addq $0xd0, %rdi
movl $0x1, %esi
callq 0x17390
movq %rax, %rdi
movl $0x2, %esi
callq 0x173b0
movq %rax, %rsi
leaq -0x158(%rbp), %rdi
callq 0x15490
jmp 0x26c32
movq -0x228(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x281a0
jmp 0x26c47
leaq -0x158(%rbp), %rdi
callq 0x3210
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x230(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x17390
movq -0x230(%rbp), %rsi
movq %rax, %rdi
callq 0x173b0
movq %rax, %rsi
leaq -0x180(%rbp), %rdi
callq 0x9d20
jmp 0x26c87
movq -0x200(%rbp), %rdi
addq $0xd0, %rdi
movl $0x2, %esi
callq 0x17390
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x173b0
movq %rax, %rdi
leaq -0x180(%rbp), %rsi
callq 0xb5c0
jmp 0x26cbc
leaq -0x180(%rbp), %rdi
callq 0x28420
leaq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x17390
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x173b0
movq %rax, %rsi
leaq -0x1a8(%rbp), %rdi
callq 0x9d20
jmp 0x26cf3
movq -0x200(%rbp), %rdi
addq $0xd0, %rdi
movl $0x2, %esi
callq 0x17390
movq %rax, %rdi
movl $0x1, %esi
callq 0x173b0
movq %rax, %rdi
leaq -0x1a8(%rbp), %rsi
callq 0xb5c0
jmp 0x26d29
leaq -0x1a8(%rbp), %rdi
callq 0x28420
leaq -0x20(%rbp), %rdi
movl $0x2, %esi
callq 0x17390
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x173b0
movq %rax, %rsi
leaq -0x1d0(%rbp), %rdi
callq 0x9d20
jmp 0x26d60
movq -0x200(%rbp), %rdi
addq $0xd0, %rdi
movl $0x2, %esi
movq %rsi, -0x238(%rbp)
callq 0x17390
movq -0x238(%rbp), %rsi
movq %rax, %rdi
callq 0x173b0
movq %rax, %rdi
leaq -0x1d0(%rbp), %rsi
callq 0xb5c0
jmp 0x26d9f
leaq -0x1d0(%rbp), %rdi
callq 0x28420
movq -0x200(%rbp), %rdi
movq %rdi, %rax
addq $0x38, %rax
movq %rax, -0x240(%rbp)
addq $0xd0, %rdi
movl $0x2, %esi
callq 0x17390
movq %rax, %rdi
movl $0x1, %esi
callq 0x173b0
movq %rax, %rsi
leaq -0x1f0(%rbp), %rdi
callq 0x15490
jmp 0x26def
movq -0x240(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x281a0
jmp 0x26e04
leaq -0x1f0(%rbp), %rdi
callq 0x3210
movq -0x200(%rbp), %rax
cmpl $0x3, (%rax)
jge 0x26f8e
movq -0x200(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x26f9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x26fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x28420
jmp 0x26fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x28420
jmp 0x26fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x28420
jmp 0x26fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x3210
jmp 0x26fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x28420
jmp 0x26fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x28420
jmp 0x26fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x3210
jmp 0x26fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x3210
jmp 0x26fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x28420
jmp 0x26fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x28420
jmp 0x26fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x28420
jmp 0x26fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x3210
jmp 0x26fad
movq -0x200(%rbp), %rax
movl $0x0, (%rax)
leaq -0x20(%rbp), %rdi
callq 0x20710
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
leaq -0x20(%rbp), %rdi
callq 0x20710
movq -0x50(%rbp), %rdi
callq 0x34f0
nop