// File: /workspace/github_cpp_makefile_star2_O1/EstherJin[P]TetrisRemake/graphicsDisplay.cc
// Function: GraphicsDisplay::notify(Subject&)
void GraphicsDisplay::notify (Subject &whoNotified) {
    State st = whoNotified.getState();

    if (st.add) {
        if (st.type == 'T') {
            window->fillRectangle(xmar + st.coords.col * cellLength,
                                  ymar + st.coords.row * cellLength,
                                  cellLength, cellLength, 2);
        } else if (st.type == 'L') {
            window->fillRectangle(xmar + st.coords.col * cellLength,
                                  ymar + st.coords.row * cellLength,
                                  cellLength, cellLength, 3);
        } else if (st.type == 'Z') {
            window->fillRectangle(xmar + st.coords.col * cellLength,
                                  ymar + st.coords.row * cellLength,
                                  cellLength, cellLength, 4);
        } else if (st.type == 'O') {
            window->fillRectangle(xmar + st.coords.col * cellLength,
                                  ymar + st.coords.row * cellLength,
                                  cellLength, cellLength, 5);
        } else if (st.type == 'S') {
            window->fillRectangle(xmar + st.coords.col * cellLength,
                                  ymar + st.coords.row * cellLength,
                                  cellLength, cellLength, 6);
        } else if (st.type == 'J') {
            window->fillRectangle(xmar + st.coords.col * cellLength,
                                  ymar + st.coords.row * cellLength,
                                  cellLength, cellLength, 7);
        } else if (st.type == 'I') {
            window->fillRectangle(xmar + st.coords.col * cellLength,
                                  ymar + st.coords.row * cellLength,
                                  cellLength, cellLength, 8);
        } else if (st.type == '*') {
            window->fillRectangle(xmar + st.coords.col * cellLength,
                                  ymar + st.coords.row * cellLength,
                                  cellLength, cellLength, 11);
        }
    } else {
        window->fillRectangle(xmar + st.coords.col * cellLength,
                              ymar + st.coords.row * cellLength,
                              cellLength, cellLength, 0);

    }
    for (int i = 1; i < row; i++) {

        window->fillRectangle(xmar,ymar+i*34,375,1,10);
    }
    for (int j = 1; j < col; j++) {
        window->fillRectangle(xmar+j*34,ymar,1,612,10);
    }


}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1110c
xorl %r9d, %r9d
btq $0x20, %rdx
jb 0x1241f
movq 0x20(%rbx), %rdi
movl 0x8(%rbx), %ecx
imull %ecx, %edx
addl 0x14(%rbx), %edx
shrq $0x20, %rax
imull %ecx, %eax
addl 0x18(%rbx), %eax
movl %edx, %esi
movl %eax, %edx
movl %ecx, %r8d
callq 0x12ec6
cmpl $0x2, 0xc(%rbx)
jl 0x123db
movl $0x1, %ebp
movl $0x22, %r14d
movq 0x20(%rbx), %rdi
movl 0x14(%rbx), %esi
movl 0x18(%rbx), %edx
addl %r14d, %edx
movl $0x177, %ecx            # imm = 0x177
movl $0x1, %r8d
movl $0xa, %r9d
callq 0x12ec6
incl %ebp
addl $0x22, %r14d
cmpl 0xc(%rbx), %ebp
jl 0x123ad
cmpl $0x2, 0x10(%rbx)
jl 0x1241a
movl $0x1, %ebp
movl $0x22, %r14d
movq 0x20(%rbx), %rdi
movl 0x14(%rbx), %esi
addl %r14d, %esi
movl 0x18(%rbx), %edx
movl $0x1, %ecx
movl $0x264, %r8d            # imm = 0x264
movl $0xa, %r9d
callq 0x12ec6
incl %ebp
addl $0x22, %r14d
cmpl 0x10(%rbx), %ebp
jl 0x123ec
popq %rbx
popq %r14
popq %rbp
retq
movzbl %al, %ecx
leal -0x49(%rcx), %esi
cmpl $0xb, %esi
ja 0x12445
leaq 0x141f(%rip), %rcx      # 0x13850
movslq (%rcx,%rsi,4), %rsi
addq %rcx, %rsi
jmpq *%rsi
movl $0x8, %r9d
jmp 0x12379
cmpl $0x2a, %ecx
je 0x12495
cmpl $0x5a, %ecx
jne 0x1239c
movl $0x4, %r9d
jmp 0x12379
movl $0x5, %r9d
jmp 0x12379
movl $0x7, %r9d
jmp 0x12379
movl $0x6, %r9d
jmp 0x12379
movl $0x3, %r9d
jmp 0x12379
movl $0x2, %r9d
jmp 0x12379
movl $0xb, %r9d
jmp 0x12379