// File: EstherJin[P]TetrisRemake/i.cc
// Function: I::turn(int)
void I::turn(int shift){
  if (shift > 0){
    shift = shift % 4;
  } else{
    shift = ((-4 * shift) - (shift * -1)) % 4;
  }
  if ((shift % 2) != 0){
    if (position == 0){
      State stat = {' ', coords.at(1), false};
      setState(stat);
      notifyObservers();
      coords.at(1).row -= 1;
      coords.at(1).col -= 1;
      stat = {c, coords.at(1), true};
      setState(stat);
      notifyObservers();
      stat = {' ', coords.at(2), false};
      setState(stat);
      notifyObservers();
      coords.at(2).row -= 2;
      coords.at(2).col -= 2;
      stat = {c, coords.at(2), true};
      setState(stat);
      notifyObservers();
      stat = {' ', coords.at(3), false};
      setState(stat);
      notifyObservers();
      coords.at(3).row -= 3;
      coords.at(3).col -= 3;
      stat = {c, coords.at(3), true};
      setState(stat);
      notifyObservers();
      position = 1;
    } else {
      State stat = {' ', coords.at(1), false};
      setState(stat);
      notifyObservers();
      coords.at(1).row += 1;
      coords.at(1).col += 1;
      stat = {c, coords.at(1), true};
      setState(stat);
      notifyObservers();
      stat = {' ', coords.at(2), false};
      setState(stat);
      notifyObservers();
      coords.at(2).row += 2;
      coords.at(2).col += 2;
      stat = {c, coords.at(2), true};
      setState(stat);
      notifyObservers();
      stat = {' ', coords.at(3), false};
      setState(stat);
      notifyObservers();
      coords.at(3).row += 3;
      coords.at(3).col += 3;
      stat = {c, coords.at(3), true};
      setState(stat);
      notifyObservers();
      position = 0;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x198(%rbp)
cmpl $0x0, -0xc(%rbp)
jle 0x19a73
movl -0xc(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, -0xc(%rbp)
jmp 0x19a8b
imull $0xfffffffc, -0xc(%rbp), %eax # imm = 0xFFFFFFFC
imull $-0x1, -0xc(%rbp), %ecx
subl %ecx, %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x1a24b
movq -0x198(%rbp), %rax
cmpl $0x0, 0x48(%rax)
jne 0x19e31
movq -0x198(%rbp), %rdi
movb $0x20, -0x1c(%rbp)
addq $0x30, %rdi
movl $0x1, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movb $0x0, -0x10(%rbp)
addq $0x8, %rdi
movq -0x1c(%rbp), %rax
movq %rax, -0x2c(%rbp)
movq -0x14(%rbp), %rax
movq %rax, -0x24(%rbp)
movq -0x2c(%rbp), %rsi
movq -0x24(%rbp), %rdx
callq 0x29140
movq -0x198(%rbp), %rdi
addq $0x8, %rdi
callq 0x290c0
movq -0x198(%rbp), %rdi
addq $0x30, %rdi
movl $0x1, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movl (%rax), %ecx
subl $0x1, %ecx
movl %ecx, (%rax)
addq $0x30, %rdi
movl $0x1, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movl 0x4(%rax), %ecx
subl $0x1, %ecx
movl %ecx, 0x4(%rax)
movb 0x4c(%rdi), %al
movb %al, -0x3c(%rbp)
addq $0x30, %rdi
movl $0x1, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movb $0x1, -0x30(%rbp)
movq -0x3c(%rbp), %rax
movq %rax, -0x1c(%rbp)
movq -0x34(%rbp), %rax
movq %rax, -0x14(%rbp)
addq $0x8, %rdi
movq -0x1c(%rbp), %rax
movq %rax, -0x4c(%rbp)
movq -0x14(%rbp), %rax
movq %rax, -0x44(%rbp)
movq -0x4c(%rbp), %rsi
movq -0x44(%rbp), %rdx
callq 0x29140
movq -0x198(%rbp), %rdi
addq $0x8, %rdi
callq 0x290c0
movq -0x198(%rbp), %rdi
movb $0x20, -0x5c(%rbp)
addq $0x30, %rdi
movl $0x2, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movb $0x0, -0x50(%rbp)
movq -0x5c(%rbp), %rax
movq %rax, -0x1c(%rbp)
movq -0x54(%rbp), %rax
movq %rax, -0x14(%rbp)
addq $0x8, %rdi
movq -0x1c(%rbp), %rax
movq %rax, -0x6c(%rbp)
movq -0x14(%rbp), %rax
movq %rax, -0x64(%rbp)
movq -0x6c(%rbp), %rsi
movq -0x64(%rbp), %rdx
callq 0x29140
movq -0x198(%rbp), %rdi
addq $0x8, %rdi
callq 0x290c0
movq -0x198(%rbp), %rdi
addq $0x30, %rdi
movl $0x2, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movl (%rax), %ecx
subl $0x2, %ecx
movl %ecx, (%rax)
addq $0x30, %rdi
movl $0x2, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movl 0x4(%rax), %ecx
subl $0x2, %ecx
movl %ecx, 0x4(%rax)
movb 0x4c(%rdi), %al
movb %al, -0x7c(%rbp)
addq $0x30, %rdi
movl $0x2, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movb $0x1, -0x70(%rbp)
movq -0x7c(%rbp), %rax
movq %rax, -0x1c(%rbp)
movq -0x74(%rbp), %rax
movq %rax, -0x14(%rbp)
addq $0x8, %rdi
movq -0x1c(%rbp), %rax
movq %rax, -0x8c(%rbp)
movq -0x14(%rbp), %rax
movq %rax, -0x84(%rbp)
movq -0x8c(%rbp), %rsi
movq -0x84(%rbp), %rdx
callq 0x29140
movq -0x198(%rbp), %rdi
addq $0x8, %rdi
callq 0x290c0
movq -0x198(%rbp), %rdi
movb $0x20, -0x9c(%rbp)
addq $0x30, %rdi
movl $0x3, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movb $0x0, -0x90(%rbp)
movq -0x9c(%rbp), %rax
movq %rax, -0x1c(%rbp)
movq -0x94(%rbp), %rax
movq %rax, -0x14(%rbp)
addq $0x8, %rdi
movq -0x1c(%rbp), %rax
movq %rax, -0xac(%rbp)
movq -0x14(%rbp), %rax
movq %rax, -0xa4(%rbp)
movq -0xac(%rbp), %rsi
movq -0xa4(%rbp), %rdx
callq 0x29140
movq -0x198(%rbp), %rdi
addq $0x8, %rdi
callq 0x290c0
movq -0x198(%rbp), %rdi
addq $0x30, %rdi
movl $0x3, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movl (%rax), %ecx
subl $0x3, %ecx
movl %ecx, (%rax)
addq $0x30, %rdi
movl $0x3, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movl 0x4(%rax), %ecx
subl $0x3, %ecx
movl %ecx, 0x4(%rax)
movb 0x4c(%rdi), %al
movb %al, -0xbc(%rbp)
addq $0x30, %rdi
movl $0x3, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xb8(%rbp)
movb $0x1, -0xb0(%rbp)
movq -0xbc(%rbp), %rax
movq %rax, -0x1c(%rbp)
movq -0xb4(%rbp), %rax
movq %rax, -0x14(%rbp)
addq $0x8, %rdi
movq -0x1c(%rbp), %rax
movq %rax, -0xcc(%rbp)
movq -0x14(%rbp), %rax
movq %rax, -0xc4(%rbp)
movq -0xcc(%rbp), %rsi
movq -0xc4(%rbp), %rdx
callq 0x29140
movq -0x198(%rbp), %rdi
addq $0x8, %rdi
callq 0x290c0
movq -0x198(%rbp), %rax
movl $0x1, 0x48(%rax)
jmp 0x1a249
movq -0x198(%rbp), %rdi
movb $0x20, -0xdc(%rbp)
addq $0x30, %rdi
movl $0x1, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xd8(%rbp)
movb $0x0, -0xd0(%rbp)
addq $0x8, %rdi
movq -0xdc(%rbp), %rax
movq %rax, -0xec(%rbp)
movq -0xd4(%rbp), %rax
movq %rax, -0xe4(%rbp)
movq -0xec(%rbp), %rsi
movq -0xe4(%rbp), %rdx
callq 0x29140
movq -0x198(%rbp), %rdi
addq $0x8, %rdi
callq 0x290c0
movq -0x198(%rbp), %rdi
addq $0x30, %rdi
movl $0x1, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
addq $0x30, %rdi
movl $0x1, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movb 0x4c(%rdi), %al
movb %al, -0xfc(%rbp)
addq $0x30, %rdi
movl $0x1, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xf8(%rbp)
movb $0x1, -0xf0(%rbp)
movq -0xfc(%rbp), %rax
movq %rax, -0xdc(%rbp)
movq -0xf4(%rbp), %rax
movq %rax, -0xd4(%rbp)
addq $0x8, %rdi
movq -0xdc(%rbp), %rax
movq %rax, -0x10c(%rbp)
movq -0xd4(%rbp), %rax
movq %rax, -0x104(%rbp)
movq -0x10c(%rbp), %rsi
movq -0x104(%rbp), %rdx
callq 0x29140
movq -0x198(%rbp), %rdi
addq $0x8, %rdi
callq 0x290c0
movq -0x198(%rbp), %rdi
movb $0x20, -0x11c(%rbp)
addq $0x30, %rdi
movl $0x2, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x118(%rbp)
movb $0x0, -0x110(%rbp)
movq -0x11c(%rbp), %rax
movq %rax, -0xdc(%rbp)
movq -0x114(%rbp), %rax
movq %rax, -0xd4(%rbp)
addq $0x8, %rdi
movq -0xdc(%rbp), %rax
movq %rax, -0x12c(%rbp)
movq -0xd4(%rbp), %rax
movq %rax, -0x124(%rbp)
movq -0x12c(%rbp), %rsi
movq -0x124(%rbp), %rdx
callq 0x29140
movq -0x198(%rbp), %rdi
addq $0x8, %rdi
callq 0x290c0
movq -0x198(%rbp), %rdi
addq $0x30, %rdi
movl $0x2, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movl (%rax), %ecx
addl $0x2, %ecx
movl %ecx, (%rax)
addq $0x30, %rdi
movl $0x2, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movl 0x4(%rax), %ecx
addl $0x2, %ecx
movl %ecx, 0x4(%rax)
movb 0x4c(%rdi), %al
movb %al, -0x13c(%rbp)
addq $0x30, %rdi
movl $0x2, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x138(%rbp)
movb $0x1, -0x130(%rbp)
movq -0x13c(%rbp), %rax
movq %rax, -0xdc(%rbp)
movq -0x134(%rbp), %rax
movq %rax, -0xd4(%rbp)
addq $0x8, %rdi
movq -0xdc(%rbp), %rax
movq %rax, -0x14c(%rbp)
movq -0xd4(%rbp), %rax
movq %rax, -0x144(%rbp)
movq -0x14c(%rbp), %rsi
movq -0x144(%rbp), %rdx
callq 0x29140
movq -0x198(%rbp), %rdi
addq $0x8, %rdi
callq 0x290c0
movq -0x198(%rbp), %rdi
movb $0x20, -0x15c(%rbp)
addq $0x30, %rdi
movl $0x3, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x158(%rbp)
movb $0x0, -0x150(%rbp)
movq -0x15c(%rbp), %rax
movq %rax, -0xdc(%rbp)
movq -0x154(%rbp), %rax
movq %rax, -0xd4(%rbp)
addq $0x8, %rdi
movq -0xdc(%rbp), %rax
movq %rax, -0x16c(%rbp)
movq -0xd4(%rbp), %rax
movq %rax, -0x164(%rbp)
movq -0x16c(%rbp), %rsi
movq -0x164(%rbp), %rdx
callq 0x29140
movq -0x198(%rbp), %rdi
addq $0x8, %rdi
callq 0x290c0
movq -0x198(%rbp), %rdi
addq $0x30, %rdi
movl $0x3, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movl (%rax), %ecx
addl $0x3, %ecx
movl %ecx, (%rax)
addq $0x30, %rdi
movl $0x3, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movl 0x4(%rax), %ecx
addl $0x3, %ecx
movl %ecx, 0x4(%rax)
movb 0x4c(%rdi), %al
movb %al, -0x17c(%rbp)
addq $0x30, %rdi
movl $0x3, %esi
callq 0xa800
movq -0x198(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x178(%rbp)
movb $0x1, -0x170(%rbp)
movq -0x17c(%rbp), %rax
movq %rax, -0xdc(%rbp)
movq -0x174(%rbp), %rax
movq %rax, -0xd4(%rbp)
addq $0x8, %rdi
movq -0xdc(%rbp), %rax
movq %rax, -0x18c(%rbp)
movq -0xd4(%rbp), %rax
movq %rax, -0x184(%rbp)
movq -0x18c(%rbp), %rsi
movq -0x184(%rbp), %rdx
callq 0x29140
movq -0x198(%rbp), %rdi
addq $0x8, %rdi
callq 0x290c0
movq -0x198(%rbp), %rax
movl $0x0, 0x48(%rax)
jmp 0x1a24b
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopw %cs:(%rax,%rax)