// File: /workspace/github_cpp_makefile_star2_O3/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 $0x88, %rsp
movl %esi, %ebx
andl $0x3, %ebx
je 0x1163d
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 0x112b5
cmpl $0x1, %eax
je 0x11166
subq %rcx, %rdx
sarq $0x3, %rdx
testl %eax, %eax
jne 0x114ae
cmpq $0x2, %rdx
jbe 0x1164f
movl 0x10(%rcx), %eax
movl 0x14(%rcx), %ecx
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
movq 0x80(%rsp), %r8
andq %rdx, %r8
orq %rcx, %r8
movq 0x78(%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 0x1164f
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
decl %ecx
movl %ecx, 0x10(%rax)
decl %edx
movl %edx, 0x14(%rax)
shlq $0x18, %rcx
movq 0x70(%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, 0x70(%rsp)
movq %rdi, 0x78(%rsp)
jmp 0x115fa
cmpq %rcx, %rdx
je 0x1165d
movl (%rcx), %eax
movl 0x4(%rcx), %ecx
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
movq 0x60(%rsp), %r8
andq %rdx, %r8
orq %rcx, %r8
movq 0x58(%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 0x1165d
movl (%rax), %ecx
movl 0x4(%rax), %edx
incl %ecx
movl %ecx, (%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 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0x1164f
movl 0x10(%rax), %ecx
movl 0x14(%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 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0x1164f
movl 0x10(%rax), %ecx
movl 0x14(%rax), %edx
addl $0x2, %ecx
movl %ecx, 0x10(%rax)
incl %edx
movl %edx, 0x14(%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, 0x60(%rsp)
movq %rdi, 0x20(%rsp)
movq %rdi, 0x58(%rsp)
jmp 0x115fa
cmpq %rcx, %rdx
movq 0x30(%rsp), %r8
movq 0x28(%rsp), %rsi
je 0x1165d
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 0x1165d
movl (%rax), %ecx
movl 0x4(%rax), %edx
decl %ecx
movl %ecx, (%rax)
movzbl 0x4c(%r14), %eax
shlq $0x18, %rcx
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
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 0x1164f
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 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jbe 0x1164f
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 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 0x10e5a
movq %r15, %rdi
callq 0x10e2c
movq 0x30(%r14), %rax
movq 0x38(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jbe 0x1166a
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 0x1166a
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %edx
decl %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, 0x30(%rsp)
movq %rdi, (%rsp)
movq %rdi, 0x28(%rsp)
jmp 0x115fa
cmpq $0x2, %rdx
jbe 0x1164f
movl 0x10(%rcx), %eax
movl 0x14(%rcx), %ecx
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
movq 0x50(%rsp), %r8
andq %rdx, %r8
orq %rcx, %r8
movq 0x48(%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 0x1164f
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
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 $0x3, %rdx
jbe 0x1166a
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %edx
shlq $0x18, %rcx
andl $0xffffff, %r13d        # imm = 0xFFFFFF
orq %rcx, %r13
movq %r13, %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 $0x3, %rdx
jbe 0x1166a
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %edx
incl %edx
movl %edx, 0x1c(%rax)
shlq $0x18, %rcx
movq 0x10(%rsp), %rdi
andl $0xffffff, %edi         # imm = 0xFFFFFF
orq %rcx, %rdi
movabsq $0x100000000, %rax      # imm = 0x100000000
orq %rax, %rdx
movq %rdi, %rsi
movq %rdi, 0x10(%rsp)
movq %rdi, 0x48(%rsp)
movq %rdx, 0x50(%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 0x1108c
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1b0e(%rip), %rdi      # 0x13164
movl $0x2, %esi
jmp 0x11676
leaq 0x1b00(%rip), %rdi      # 0x13164
xorl %esi, %esi
xorl %edx, %edx
jmp 0x11676
leaq 0x1af3(%rip), %rdi      # 0x13164
movl $0x3, %esi
xorl %eax, %eax
callq 0x53d0
nop