// File: /workspace/github_cpp_makefile_star2_O1/EstherJin[P]TetrisRemake/j.cc
// Function: J::turn(int)
void J::turn(int shift){
  if (shift > 0){
    shift = shift % 4;
  } else{
    shift = ((-4 * shift) - (shift * -1)) % 4;
  }
  while (shift > 0){
    if (position == 0){
      State stat = {' ', coords.at(2), false};
      setState(stat);
      notifyObservers();
      coords.at(2).row -= 2;
      stat = {c, coords.at(2), true};
      setState(stat);
      notifyObservers();
      stat = {' ', coords.at(3), false};
      setState(stat);
      notifyObservers();
      coords.at(3).row -= 2;
      coords.at(3).col -= 2;
      stat = {c, coords.at(3), true};
      setState(stat);
      notifyObservers();
    } else if (position == 1) {
      State stat = {' ', coords.at(1), false};
      setState(stat);
      notifyObservers();
      coords.at(1).col += 2;
      stat = {c, coords.at(1), true};
      setState(stat);
      notifyObservers();
      stat = {' ', coords.at(2), false};
      setState(stat);
      notifyObservers();
      coords.at(2).row += 1;
      coords.at(2).col += 1;
      stat = {c, coords.at(2), true};
      setState(stat);
      notifyObservers();
      stat = {' ', coords.at(3), false};
      setState(stat);
      notifyObservers();
      coords.at(3).row += 1;
      coords.at(3).col += 1;
      stat = {c, coords.at(3), true};
      setState(stat);
      notifyObservers();
    } else if (position == 2) {
      State stat = {' ', coords.at(0), false};
      setState(stat);
      notifyObservers();
      coords.at(0).row += 1;
      stat = {c, coords.at(0), true};
      setState(stat);
      notifyObservers();
      stat = {' ', coords.at(1), false};
      setState(stat);
      notifyObservers();
      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 -= 1;
      coords.at(2).col -= 1;
      stat = {c, coords.at(2), true};
      setState(stat);
      notifyObservers();
    } else {
      State stat = {' ', coords.at(0), false};
      setState(stat);
      notifyObservers();
      coords.at(0).row -= 1;
      stat = {c, coords.at(0), true};
      setState(stat);
      notifyObservers();
      stat = {' ', coords.at(1), false};
      setState(stat);
      notifyObservers();
      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;
      stat = {c, coords.at(2), true};
      setState(stat);
      notifyObservers();
      stat = {' ', coords.at(3), false};
      setState(stat);
      notifyObservers();
      coords.at(3).row += 1;
      coords.at(3).col += 1;
      stat = {c, coords.at(3), true};
      setState(stat);
      notifyObservers();
    }
    position = (position + 1) % 4;
    --shift;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %esi, %ebx
movq %rdi, %r14
testl %esi, %esi
jle 0xdacd
andl $0x3, %ebx
jmp 0xdae3
leal (%rbx,%rbx,2), %ebx
movl $0x3, %eax
subl %ebx, %eax
negl %ebx
testl %ebx, %ebx
cmovnsl %ebx, %eax
andl $-0x4, %eax
subl %eax, %ebx
testl %ebx, %ebx
jle 0xe41d
leaq 0x8(%r14), %r15
incl %ebx
movl 0x48(%r14), %eax
cmpl $0x2, %eax
je 0xdee9
cmpl $0x1, %eax
je 0xdc9e
testl %eax, %eax
jne 0xe11a
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe42f
movl 0x10(%rax), %ecx
movl 0x14(%rax), %eax
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
movq 0xb8(%rsp), %r8
andq %rdx, %r8
orq %rax, %r8
movq 0xb0(%rsp), %rax
shll $0x8, %eax
shlq $0x20, %rcx
leaq (%rcx,%rax), %rsi
addq $0x20, %rsi
movq %r15, %rdi
movq %r8, %rdx
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe42f
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
addl $-0x2, %ecx
movl %ecx, 0x10(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
andl $0xffffff, %ebp         # imm = 0xFFFFFF
orq %rcx, %rbp
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rbp, %r12
movq %rbp, %rsi
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jbe 0xe43d
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %edx
shlq $0x18, %rcx
andl $0xffffff, %r13d        # imm = 0xFFFFFF
orq %rcx, %r13
movq %r13, %rbp
movq %r13, %rsi
shlq $0x8, %rsi
orq $0x20, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jbe 0xe43d
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %edx
addl $-0x2, %ecx
movl %ecx, 0x18(%rax)
addl $-0x2, %edx
movl %edx, 0x1c(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x70(%rsp), %r13
andl $0xffffff, %r13d        # imm = 0xFFFFFF
orq %rcx, %r13
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %r13, %rsi
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
movq %rdx, 0xb8(%rsp)
callq 0x11102
movq %r13, 0x70(%rsp)
movq %r13, 0xb0(%rsp)
movq %rbp, %r13
movq %r12, %rbp
jmp 0xe3ee
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0xe44b
movl 0x8(%rax), %ecx
movl 0xc(%rax), %eax
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
movq 0x80(%rsp), %r8
andq %rdx, %r8
orq %rax, %r8
movq 0x78(%rsp), %rax
shll $0x8, %eax
shlq $0x20, %rcx
leaq (%rcx,%rax), %rsi
addq $0x20, %rsi
movq %r15, %rdi
movq %r8, %rdx
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0xe44b
movl 0x8(%rax), %ecx
movl 0xc(%rax), %edx
addl $0x2, %edx
movl %edx, 0xc(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0xd0(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rsi, 0xd0(%rsp)
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe42f
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
shlq $0x18, %rcx
movq 0xa8(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movq %rsi, 0xa8(%rsp)
shlq $0x8, %rsi
orq $0x20, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe42f
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
incl %ecx
movl %ecx, 0x10(%rax)
incl %edx
movl %edx, 0x14(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x68(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rsi, 0x68(%rsp)
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jbe 0xe43d
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %edx
shlq $0x18, %rcx
movq 0x40(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movq %rsi, 0x40(%rsp)
shlq $0x8, %rsi
orq $0x20, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jbe 0xe43d
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %edx
incl %ecx
movl %ecx, 0x18(%rax)
incl %edx
movl %edx, 0x1c(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x28(%rsp), %r12
andl $0xffffff, %r12d        # imm = 0xFFFFFF
orq %rcx, %r12
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %r12, %rsi
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
movq %rdx, 0x80(%rsp)
callq 0x11102
movq %r12, 0x28(%rsp)
movq %r12, 0x78(%rsp)
jmp 0xe3ee
movq 0x30(%r14), %rax
cmpq %rax, 0x38(%r14)
movq 0x90(%rsp), %rsi
je 0xe459
movl (%rax), %ecx
movl 0x4(%rax), %eax
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
movq 0x88(%rsp), %r8
andq %rdx, %r8
orq %rax, %r8
shll $0x8, %esi
shlq $0x20, %rcx
addq %rcx, %rsi
addq $0x20, %rsi
movq %r15, %rdi
movq %r8, %rdx
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
cmpq %rax, 0x38(%r14)
je 0xe459
movl (%rax), %ecx
movl 0x4(%rax), %edx
incl %ecx
movl %ecx, (%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0xc8(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rsi, 0xc8(%rsp)
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0xe44b
movl 0x8(%rax), %ecx
movl 0xc(%rax), %edx
shlq $0x18, %rcx
movq 0xa0(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movq %rsi, 0xa0(%rsp)
shlq $0x8, %rsi
orq $0x20, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0xe44b
movl 0x8(%rax), %ecx
movl 0xc(%rax), %edx
decl %edx
movl %edx, 0xc(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x60(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rsi, 0x60(%rsp)
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe42f
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
shlq $0x18, %rcx
movq 0x38(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movq %rsi, 0x38(%rsp)
shlq $0x8, %rsi
orq $0x20, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe42f
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
decl %ecx
movl %ecx, 0x10(%rax)
decl %edx
movl %edx, 0x14(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x20(%rsp), %r12
andl $0xffffff, %r12d        # imm = 0xFFFFFF
orq %rcx, %r12
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %r12, %rsi
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
movq %rdx, 0x88(%rsp)
callq 0x11102
movq %r12, 0x20(%rsp)
movq %r12, 0x90(%rsp)
jmp 0xe3ee
movq 0x30(%r14), %rax
cmpq %rax, 0x38(%r14)
je 0xe459
movl (%rax), %ecx
movl 0x4(%rax), %eax
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
movq 0x50(%rsp), %r8
andq %rdx, %r8
orq %rax, %r8
movq 0x48(%rsp), %rax
shll $0x8, %eax
shlq $0x20, %rcx
leaq (%rcx,%rax), %rsi
addq $0x20, %rsi
movq %r15, %rdi
movq %r8, %rdx
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
cmpq %rax, 0x38(%r14)
je 0xe459
movl (%rax), %ecx
movl 0x4(%rax), %edx
decl %ecx
movl %ecx, (%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0xc0(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rsi, 0xc0(%rsp)
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0xe44b
movl 0x8(%rax), %ecx
movl 0xc(%rax), %edx
shlq $0x18, %rcx
movq 0x98(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movq %rsi, 0x98(%rsp)
shlq $0x8, %rsi
orq $0x20, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0xe44b
movl 0x8(%rax), %ecx
movl 0xc(%rax), %edx
decl %edx
movl %edx, 0xc(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x58(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rsi, 0x58(%rsp)
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe42f
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
shlq $0x18, %rcx
movq 0x30(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movq %rsi, 0x30(%rsp)
shlq $0x8, %rsi
orq $0x20, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe42f
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
addl $0x2, %ecx
movl %ecx, 0x10(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x18(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rsi, 0x18(%rsp)
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jbe 0xe43d
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %edx
shlq $0x18, %rcx
movq 0x10(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movq %rsi, 0x10(%rsp)
shlq $0x8, %rsi
orq $0x20, %rsi
movq %r15, %rdi
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jbe 0xe43d
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %edx
incl %ecx
movl %ecx, 0x18(%rax)
incl %edx
movl %edx, 0x1c(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x8(%rsp), %r12
andl $0xffffff, %r12d        # imm = 0xFFFFFF
orq %rcx, %r12
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %r12, %rsi
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
movq %rdx, 0x50(%rsp)
callq 0x11102
movq %r12, 0x8(%rsp)
movq %r12, 0x48(%rsp)
movq %r15, %rdi
callq 0x110d4
movl 0x48(%r14), %eax
leal 0x1(%rax), %ecx
leal 0x4(%rax), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
andl $-0x4, %edx
negl %edx
addl %edx, %eax
incl %eax
movl %eax, 0x48(%r14)
decl %ebx
cmpl $0x1, %ebx
jg 0xdaf1
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4d2e(%rip), %rdi      # 0x13164
movl $0x2, %esi
jmp 0xe464
leaq 0x4d20(%rip), %rdi      # 0x13164
movl $0x3, %esi
jmp 0xe464
leaq 0x4d12(%rip), %rdi      # 0x13164
movl $0x1, %esi
jmp 0xe464
leaq 0x4d04(%rip), %rdi      # 0x13164
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x53d0
nop