// File: /workspace/github_cpp_makefile_star2_O1/EstherJin[P]TetrisRemake/t.cc
// Function: T::turn(int)
void T::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 -= 1;
      coords.at(2).col -= 1;
      stat = {c, coords.at(2), true};
      setState(stat);
      notifyObservers();
    } else if (position == 1) {
      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(2), false};
      setState(stat);
      notifyObservers();
      coords.at(2).row += 2;
      coords.at(2).col += 1;
      stat = {c, coords.at(2), 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(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).col -= 1;
      stat = {c, coords.at(3), true};
      setState(stat);
      notifyObservers();
    } else {
      State stat = {' ', coords.at(2), false};
      setState(stat);
      notifyObservers();
      coords.at(2).row += 1;
      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).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 $0x98, %rsp
movl %esi, %ebx
movq %rdi, %r14
testl %esi, %esi
jle 0x11323
andl $0x3, %ebx
jmp 0x11339
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 0x11973
leaq 0x8(%r14), %r15
incl %ebx
movl 0x48(%r14), %eax
cmpl $0x2, %eax
je 0x115af
cmpl $0x1, %eax
je 0x11446
testl %eax, %eax
jne 0x117ca
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0x11985
movl 0x10(%rax), %ecx
movl 0x14(%rax), %eax
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
movq 0x90(%rsp), %r8
andq %rdx, %r8
orq %rax, %r8
movq 0x88(%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 0x11985
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 0x80(%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, 0x90(%rsp)
callq 0x11102
movq %r13, 0x80(%rsp)
movq %r13, 0x88(%rsp)
jmp 0x11944
movq 0x30(%r14), %rax
cmpq %rax, 0x38(%r14)
je 0x11993
movl (%rax), %ecx
movl 0x4(%rax), %eax
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
movq 0x60(%rsp), %r8
andq %rdx, %r8
orq %rax, %r8
movq 0x58(%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 0x11993
movl (%rax), %ecx
movl 0x4(%rax), %edx
incl %ecx
movl %ecx, (%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x78(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rsi, 0x78(%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 0x11985
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
shlq $0x18, %rcx
movq 0x48(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movq %rsi, 0x48(%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 0x11985
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
addl $0x2, %ecx
movl %ecx, 0x10(%rax)
incl %edx
movl %edx, 0x14(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x28(%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, 0x60(%rsp)
callq 0x11102
movq %r13, 0x28(%rsp)
movq %r13, 0x58(%rsp)
jmp 0x11944
movq 0x30(%r14), %rax
cmpq %rax, 0x38(%r14)
movq 0x38(%rsp), %rsi
je 0x11993
movl (%rax), %ecx
movl 0x4(%rax), %eax
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
andq %rdx, %r12
orq %rax, %r12
shll $0x8, %esi
shlq $0x20, %rcx
addq %rcx, %rsi
addq $0x20, %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
cmpq %rax, 0x38(%r14)
je 0x11993
movl (%rax), %ecx
movl 0x4(%rax), %edx
decl %ecx
movl %ecx, (%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x70(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rsi, 0x70(%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
movq 0x30(%rsp), %r12
jbe 0x11985
movl 0x10(%rax), %ecx
movl 0x14(%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 0x11102
movq %r15, %rdi
callq 0x110d4
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0x11985
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
addl $-0x2, %ecx
movl %ecx, 0x10(%rax)
addl $-0x2, %edx
movl %edx, 0x14(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x20(%rsp), %rsi
andl $0xffffff, %esi         # imm = 0xFFFFFF
orq %rcx, %rsi
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rdx
movq %rsi, 0x20(%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 0x119a0
movq %r12, 0x30(%rsp)
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 0x119a0
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %r12d
decl %r12d
movl %r12d, 0x1c(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x8(%rsp), %r13
andl $0xffffff, %r13d        # imm = 0xFFFFFF
orq %rcx, %r13
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %r12
movq %r13, %rsi
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x11102
movq %r13, 0x8(%rsp)
movq %r13, 0x38(%rsp)
jmp 0x11944
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0x11985
movl 0x10(%rax), %ecx
movl 0x14(%rax), %eax
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
andq %rdx, %rbp
orq %rax, %rbp
movq 0x50(%rsp), %rax
shll $0x8, %eax
shlq $0x20, %rcx
leaq (%rcx,%rax), %rsi
addq $0x20, %rsi
movq %r15, %rdi
movq %rbp, %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 0x11985
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
incl %ecx
movl %ecx, 0x10(%rax)
addl $0x2, %edx
movl %edx, 0x14(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x68(%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
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 0x119a0
movq %r13, 0x68(%rsp)
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 0x119a0
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %ebp
incl %ebp
movl %ebp, 0x1c(%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
movq 0x18(%rsp), %r13
andl $0xffffff, %r13d        # imm = 0xFFFFFF
orq %rcx, %r13
movabsq $0x100000000, %rcx      # imm = 0x100000000
orq %rcx, %rbp
movq %r13, %rsi
shlq $0x8, %rsi
orq %rax, %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x11102
movq %r13, 0x18(%rsp)
movq %r13, 0x50(%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 0x11347
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17d8(%rip), %rdi      # 0x13164
movl $0x2, %esi
jmp 0x119ac
leaq 0x17ca(%rip), %rdi      # 0x13164
xorl %esi, %esi
xorl %edx, %edx
jmp 0x119ac
leaq 0x17bd(%rip), %rdi      # 0x13164
movl $0x3, %esi
xorl %eax, %eax
callq 0x53d0
nop