// File: /workspace/github_cpp_makefile_star2_O3/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 $0xc8, %rsp
movl %esi, %ebx
andl $0x3, %ebx
je 0xe238
movq %rdi, %r14
leaq 0x8(%rdi), %r15
movl 0x48(%rdi), %eax
incl %ebx
movq 0x30(%r14), %rcx
movq 0x38(%r14), %rdx
cmpl $0x2, %eax
je 0xdd4b
cmpl $0x1, %eax
je 0xdb23
testl %eax, %eax
jne 0xdf5c
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe24a
movl 0x10(%rcx), %eax
movl 0x14(%rcx), %ecx
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
movq 0xa8(%rsp), %r8
andq %rdx, %r8
orq %rcx, %r8
movq 0xa0(%rsp), %rcx
shll $0x8, %ecx
shlq $0x20, %rax
leaq (%rax,%rcx), %rsi
addq $0x20, %rsi
movq %r15, %rdi
movq %r8, %rdx
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe24a
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
addl $-0x2, %ecx
movl %ecx, 0x10(%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 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jbe 0xe258
movl 0x18(%rax), %ecx
movl 0x1c(%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 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jbe 0xe258
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %edx
addl $-0x2, %ecx
movl %ecx, 0x18(%rax)
addl $-0x2, %edx
movl %edx, 0x1c(%rax)
shlq $0x18, %rcx
movq 0x60(%rsp), %rdi
andl $0xffffff, %edi         # imm = 0xFFFFFF
orq %rcx, %rdi
movabsq $0x100000000, %rax      # imm = 0x100000000
orq %rax, %rdx
movq %rdi, %rsi
movq %rdx, 0xa8(%rsp)
movq %rdi, 0x60(%rsp)
movq %rdi, 0xa0(%rsp)
jmp 0xe1f5
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0xe266
movl 0x8(%rcx), %eax
movl 0xc(%rcx), %ecx
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
movq 0x70(%rsp), %r8
andq %rdx, %r8
orq %rcx, %r8
movq 0x68(%rsp), %rcx
shll $0x8, %ecx
shlq $0x20, %rax
leaq (%rax,%rcx), %rsi
addq $0x20, %rsi
movq %r15, %rdi
movq %r8, %rdx
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0xe266
movl 0x8(%rax), %ecx
movl 0xc(%rax), %edx
addl $0x2, %edx
movl %edx, 0xc(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0xb8(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rsi, 0xb8(%rsp)
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe24a
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
shlq $0x18, %rcx
movq 0x90(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movq %rsi, 0x90(%rsp)
shlq $0x8, %rsi
orq $0x20, %rsi
movq %r15, %rdi
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe24a
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 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 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jbe 0xe258
movl 0x18(%rax), %ecx
movl 0x1c(%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 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jbe 0xe258
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %edx
incl %ecx
movl %ecx, 0x18(%rax)
incl %edx
movl %edx, 0x1c(%rax)
shlq $0x18, %rcx
movq 0x20(%rsp), %rdi
andl $0xffffff, %edi         # imm = 0xFFFFFF
orq %rcx, %rdi
movabsq $0x100000000, %rax      # imm = 0x100000000
orq %rax, %rdx
movq %rdi, %rsi
movq %rdx, 0x70(%rsp)
movq %rdi, 0x20(%rsp)
movq %rdi, 0x68(%rsp)
jmp 0xe1f5
cmpq %rcx, %rdx
movq 0x80(%rsp), %r8
movq 0x78(%rsp), %rsi
je 0xe274
movl (%rcx), %eax
movl 0x4(%rcx), %ecx
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
andq %rdx, %r8
orq %rcx, %r8
shll $0x8, %esi
shlq $0x20, %rax
addq %rax, %rsi
addq $0x20, %rsi
movq %r15, %rdi
movq %r8, %rdx
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
cmpq %rax, 0x38(%r14)
je 0xe274
movl (%rax), %ecx
movl 0x4(%rax), %edx
incl %ecx
movl %ecx, (%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0xb0(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rsi, 0xb0(%rsp)
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0xe266
movl 0x8(%rax), %ecx
movl 0xc(%rax), %edx
shlq $0x18, %rcx
movq 0x88(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movq %rsi, 0x88(%rsp)
shlq $0x8, %rsi
orq $0x20, %rsi
movq %r15, %rdi
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0xe266
movl 0x8(%rax), %ecx
movl 0xc(%rax), %edx
decl %edx
movl %edx, 0xc(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x50(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rsi, 0x50(%rsp)
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe24a
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 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe24a
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
decl %ecx
movl %ecx, 0x10(%rax)
decl %edx
movl %edx, 0x14(%rax)
shlq $0x18, %rcx
movq 0x18(%rsp), %rdi
andl $0xffffff, %edi         # imm = 0xFFFFFF
orq %rcx, %rdi
movabsq $0x100000000, %rax      # imm = 0x100000000
orq %rax, %rdx
movq %rdi, %rsi
movq %rdx, 0x80(%rsp)
movq %rdi, 0x18(%rsp)
movq %rdi, 0x78(%rsp)
jmp 0xe1f5
cmpq %rcx, %rdx
je 0xe274
movl (%rcx), %eax
movl 0x4(%rcx), %ecx
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
movq 0x48(%rsp), %r8
andq %rdx, %r8
orq %rcx, %r8
movq 0x40(%rsp), %rcx
shll $0x8, %ecx
shlq $0x20, %rax
leaq (%rax,%rcx), %rsi
addq $0x20, %rsi
movq %r15, %rdi
movq %r8, %rdx
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
cmpq %rax, 0x38(%r14)
je 0xe274
movl (%rax), %ecx
movl 0x4(%rax), %edx
decl %ecx
movl %ecx, (%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
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
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0xe266
movl 0x8(%rax), %ecx
movl 0xc(%rax), %edx
shlq $0x18, %rcx
andl $0xffffff, %r12d        # imm = 0xFFFFFF
orq %rcx, %r12
movq %r12, %rsi
shlq $0x8, %rsi
orq $0x20, %rsi
movq %r15, %rdi
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0xe266
movl 0x8(%rax), %ecx
movl 0xc(%rax), %edx
decl %edx
movl %edx, 0xc(%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, %rsi
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe24a
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
shlq $0x18, %rcx
movq 0x28(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movq %rsi, 0x28(%rsp)
shlq $0x8, %rsi
orq $0x20, %rsi
movq %r15, %rdi
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0xe24a
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
addl $0x2, %ecx
movl %ecx, 0x10(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x10(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rsi, 0x10(%rsp)
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jbe 0xe258
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %edx
shlq $0x18, %rcx
movq 0x8(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movq %rsi, 0x8(%rsp)
shlq $0x8, %rsi
orq $0x20, %rsi
movq %r15, %rdi
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jbe 0xe258
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %edx
incl %ecx
movl %ecx, 0x18(%rax)
incl %edx
movl %edx, 0x1c(%rax)
shlq $0x18, %rcx
movq (%rsp), %rdi
andl $0xffffff, %edi         # imm = 0xFFFFFF
orq %rcx, %rdi
movabsq $0x100000000, %rax      # imm = 0x100000000
orq %rax, %rdx
movq %rdi, %rsi
movq %rdx, 0x48(%rsp)
movq %rdi, (%rsp)
movq %rdi, 0x40(%rsp)
movzbl 0x4c(%r14), %eax
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x10e5a
movq %r15, %rdi
callq 0x10e2c
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 0xd982
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4f13(%rip), %rdi      # 0x13164
movl $0x2, %esi
jmp 0xe27f
leaq 0x4f05(%rip), %rdi      # 0x13164
movl $0x3, %esi
jmp 0xe27f
leaq 0x4ef7(%rip), %rdi      # 0x13164
movl $0x1, %esi
jmp 0xe27f
leaq 0x4ee9(%rip), %rdi      # 0x13164
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x53d0