// File: EstherJin[P]TetrisRemake/j.cc
// Function: J::turnPos(int)
vector<Coordinates> J::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 -= 2;
      cds.at(3).row -= 2;
      cds.at(3).col -= 2;
    } else if (pos == 1) {
      cds.at(1).col += 2;
      cds.at(2).row += 1;
      cds.at(2).col += 1;
      cds.at(3).row += 1;
      cds.at(3).col += 1;
    } else if (pos == 2) {
      cds.at(0).row += 1;
      cds.at(1).col -= 1;
      cds.at(2).row -= 1;
      cds.at(2).col -= 1;
    } else {
      cds.at(0).row -= 1;
      cds.at(1).col -= 1;
      cds.at(2).row += 2;
      cds.at(3).row += 1;
      cds.at(3).col += 1;
    }
    pos = (pos + 1) % 4;
    --shift;
  }
  return cds;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %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 0x21f4c
movl -0x14(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, -0x14(%rbp)
jmp 0x21f64
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 0x2222e
cmpl $0x0, -0x1c(%rbp)
jne 0x21ffc
movq -0x48(%rbp), %rdi
movl $0x2, %esi
callq 0xa800
movq %rax, -0x50(%rbp)
jmp 0x21f92
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rax
movl (%rax), %ecx
addl $-0x2, %ecx
movl %ecx, (%rax)
movl $0x3, %esi
callq 0xa800
movq %rax, -0x58(%rbp)
jmp 0x21fb1
movq -0x48(%rbp), %rdi
movq -0x58(%rbp), %rax
movl (%rax), %ecx
addl $-0x2, %ecx
movl %ecx, (%rax)
movl $0x3, %esi
callq 0xa800
movq %rax, -0x60(%rbp)
jmp 0x21fd0
movq -0x60(%rbp), %rax
movl 0x4(%rax), %ecx
subl $0x2, %ecx
movl %ecx, 0x4(%rax)
jmp 0x2220f
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0xa880
jmp 0x2224e
cmpl $0x1, -0x1c(%rbp)
jne 0x220af
movq -0x48(%rbp), %rdi
movl $0x1, %esi
callq 0xa800
movq %rax, -0x68(%rbp)
jmp 0x2201a
movq -0x48(%rbp), %rdi
movq -0x68(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x2, %ecx
movl %ecx, 0x4(%rax)
movl $0x2, %esi
callq 0xa800
movq %rax, -0x70(%rbp)
jmp 0x2203b
movq -0x48(%rbp), %rdi
movq -0x70(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movl $0x2, %esi
callq 0xa800
movq %rax, -0x78(%rbp)
jmp 0x22059
movq -0x48(%rbp), %rdi
movq -0x78(%rbp), %rax
movl 0x4(%rax), %ecx
incl %ecx
movl %ecx, 0x4(%rax)
movl $0x3, %esi
callq 0xa800
movq %rax, -0x80(%rbp)
jmp 0x22079
movq -0x48(%rbp), %rdi
movq -0x80(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movl $0x3, %esi
callq 0xa800
movq %rax, -0x88(%rbp)
jmp 0x2209a
movq -0x88(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x2220d
cmpl $0x2, -0x1c(%rbp)
jne 0x22152
movq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa800
movq %rax, -0x90(%rbp)
jmp 0x220cf
movq -0x48(%rbp), %rdi
movq -0x90(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movl $0x1, %esi
callq 0xa800
movq %rax, -0x98(%rbp)
jmp 0x220f3
movq -0x48(%rbp), %rdi
movq -0x98(%rbp), %rax
movl 0x4(%rax), %ecx
decl %ecx
movl %ecx, 0x4(%rax)
movl $0x2, %esi
callq 0xa800
movq %rax, -0xa0(%rbp)
jmp 0x22119
movq -0x48(%rbp), %rdi
movq -0xa0(%rbp), %rax
movl (%rax), %ecx
decl %ecx
movl %ecx, (%rax)
movl $0x2, %esi
callq 0xa800
movq %rax, -0xa8(%rbp)
jmp 0x2213d
movq -0xa8(%rbp), %rax
movl 0x4(%rax), %ecx
subl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x2220b
movq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa800
movq %rax, -0xb0(%rbp)
jmp 0x22168
movq -0x48(%rbp), %rdi
movq -0xb0(%rbp), %rax
movl (%rax), %ecx
decl %ecx
movl %ecx, (%rax)
movl $0x1, %esi
callq 0xa800
movq %rax, -0xb8(%rbp)
jmp 0x2218c
movq -0x48(%rbp), %rdi
movq -0xb8(%rbp), %rax
movl 0x4(%rax), %ecx
decl %ecx
movl %ecx, 0x4(%rax)
movl $0x2, %esi
callq 0xa800
movq %rax, -0xc0(%rbp)
jmp 0x221b2
movq -0x48(%rbp), %rdi
movq -0xc0(%rbp), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movl %ecx, (%rax)
movl $0x3, %esi
callq 0xa800
movq %rax, -0xc8(%rbp)
jmp 0x221d7
movq -0x48(%rbp), %rdi
movq -0xc8(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movl $0x3, %esi
callq 0xa800
movq %rax, -0xd0(%rbp)
jmp 0x221fb
movq -0xd0(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x2220d
jmp 0x2220f
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 0x21f6e
movb $0x1, -0x15(%rbp)
testb $0x1, -0x15(%rbp)
jne 0x22241
movq -0x48(%rbp), %rdi
callq 0xa880
movq -0x40(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x65c0
nopw (%rax,%rax)