// File: EstherJin[P]TetrisRemake/t.cc
// Function: T::turnPos(int)
vector<Coordinates> T::turnPos(int shift){
  vector<Coordinates> cds = coords;
  if (shift > 0){
    shift = shift % 4;
  } else{
    shift = ((-4 * shift) - (shift * -1)) % 4;
  }
  int pos = position;
  while (shift > 0){
    if (pos == 0){
      cds.at(2).row -= 1;
      cds.at(2).col -= 1;
    } else if (pos == 1) {
      cds.at(0).row += 1;
      cds.at(2).row += 2;
      cds.at(2).col += 1;
    } else if (pos == 2) {
      cds.at(0).row -= 1;
      cds.at(2).row -= 2;
      cds.at(2).col -= 2;
      cds.at(3).col -= 1;
    } else {
      cds.at(2).row += 1;
      cds.at(2).col += 2;
      cds.at(3).col += 1;
    }
    pos = (pos + 1) % 4;
    --shift;
  }
  return cds;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x48(%rbp)
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0x38(%rbp)
movb $0x0, -0x15(%rbp)
addq $0x30, %rsi
callq 0x13660
cmpl $0x0, -0x14(%rbp)
jle 0x2a49c
movl -0x14(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, -0x14(%rbp)
jmp 0x2a4b4
imull $0xfffffffc, -0x14(%rbp), %eax # imm = 0xFFFFFFFC
imull $-0x1, -0x14(%rbp), %ecx
subl %ecx, %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, -0x14(%rbp)
movq -0x38(%rbp), %rax
movl 0x48(%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x14(%rbp)
jle 0x2a6bf
cmpl $0x0, -0x1c(%rbp)
jne 0x2a52c
movq -0x48(%rbp), %rdi
movl $0x2, %esi
callq 0xa800
movq %rax, -0x50(%rbp)
jmp 0x2a4e2
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rax
movl (%rax), %ecx
decl %ecx
movl %ecx, (%rax)
movl $0x2, %esi
callq 0xa800
movq %rax, -0x58(%rbp)
jmp 0x2a500
movq -0x58(%rbp), %rax
movl 0x4(%rax), %ecx
subl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x2a6a0
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0xa880
jmp 0x2a6df
cmpl $0x1, -0x1c(%rbp)
jne 0x2a594
movq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa800
movq %rax, -0x60(%rbp)
jmp 0x2a545
movq -0x48(%rbp), %rdi
movq -0x60(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movl $0x2, %esi
callq 0xa800
movq %rax, -0x68(%rbp)
jmp 0x2a563
movq -0x48(%rbp), %rdi
movq -0x68(%rbp), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movl %ecx, (%rax)
movl $0x2, %esi
callq 0xa800
movq %rax, -0x70(%rbp)
jmp 0x2a582
movq -0x70(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x2a69e
cmpl $0x2, -0x1c(%rbp)
jne 0x2a62a
movq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa800
movq %rax, -0x78(%rbp)
jmp 0x2a5b1
movq -0x48(%rbp), %rdi
movq -0x78(%rbp), %rax
movl (%rax), %ecx
decl %ecx
movl %ecx, (%rax)
movl $0x2, %esi
callq 0xa800
movq %rax, -0x80(%rbp)
jmp 0x2a5cf
movq -0x48(%rbp), %rdi
movq -0x80(%rbp), %rax
movl (%rax), %ecx
addl $-0x2, %ecx
movl %ecx, (%rax)
movl $0x2, %esi
callq 0xa800
movq %rax, -0x88(%rbp)
jmp 0x2a5f1
movq -0x48(%rbp), %rdi
movq -0x88(%rbp), %rax
movl 0x4(%rax), %ecx
addl $-0x2, %ecx
movl %ecx, 0x4(%rax)
movl $0x3, %esi
callq 0xa800
movq %rax, -0x90(%rbp)
jmp 0x2a618
movq -0x90(%rbp), %rax
movl 0x4(%rax), %ecx
subl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x2a69c
movq -0x48(%rbp), %rdi
movl $0x2, %esi
callq 0xa800
movq %rax, -0x98(%rbp)
jmp 0x2a641
movq -0x48(%rbp), %rdi
movq -0x98(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movl $0x2, %esi
callq 0xa800
movq %rax, -0xa0(%rbp)
jmp 0x2a665
movq -0x48(%rbp), %rdi
movq -0xa0(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x2, %ecx
movl %ecx, 0x4(%rax)
movl $0x3, %esi
callq 0xa800
movq %rax, -0xa8(%rbp)
jmp 0x2a68c
movq -0xa8(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x2a69e
jmp 0x2a6a0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, -0x1c(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2a4be
movb $0x1, -0x15(%rbp)
testb $0x1, -0x15(%rbp)
jne 0x2a6d2
movq -0x48(%rbp), %rdi
callq 0xa880
movq -0x40(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x65c0
nopl (%rax,%rax)