// File: eugene87222[P]Game-of-Life/gol.cpp
// Function: draw(int, int, char*, int, int)
void draw(int height, int width, char *status_background, int gen, int ms) {
	int not_first;
    for(int i=0; i<=height+1; i++) {
		for(int j=0; j<=width+1; j++) {
            not_first = (int)(j>0);
            if(i==0 && j==0) mvaddstr(i, j, "╔");
            else if(i==height+1 && j==0) mvaddstr(i, j, "╚");
            else if(i==0 && j==width+1) mvaddstr(i, j*2-not_first, "╗");
            else if(i==height+1 && j==width+1) mvaddstr(i, j*2-not_first, "╝");
            else if(i==0 || i==height+1) mvaddstr(i, j*2-not_first, "══");
            else if(j==0 || j==width+1) mvaddstr(i, j*2-not_first, "║");
            else if(board[i][j] == 0) mvaddstr(i, j*2-not_first, "  ");
            else mvaddstr(i, j*2-not_first, "██");
		}
    }
	status(status_background, gen, ms);
	refresh();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x390d
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x38fd
cmpl $0x0, -0x24(%rbp)
setg %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x36a0
cmpl $0x0, -0x24(%rbp)
jne 0x36a0
movq 0xa95d(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
callq 0x20e0
cmpl $-0x1, %eax
jne 0x3680
jmp 0x369b
movq 0xa941(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
leaq 0x5a2b(%rip), %rsi      # 0x90bc
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2260
jmp 0x38ed
movl -0x20(%rbp), %eax
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x36ef
cmpl $0x0, -0x24(%rbp)
jne 0x36ef
movq 0xa90e(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
callq 0x20e0
cmpl $-0x1, %eax
jne 0x36cf
jmp 0x36ea
movq 0xa8f2(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
leaq 0x59e0(%rip), %rsi      # 0x90c0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2260
jmp 0x38eb
cmpl $0x0, -0x20(%rbp)
jne 0x3743
movl -0x24(%rbp), %eax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3743
movq 0xa8bf(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
shll %edx
subl -0x1c(%rbp), %edx
callq 0x20e0
cmpl $-0x1, %eax
jne 0x3723
jmp 0x373e
movq 0xa89e(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
leaq 0x5990(%rip), %rsi      # 0x90c4
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2260
jmp 0x38e9
movl -0x20(%rbp), %eax
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x379e
movl -0x24(%rbp), %eax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x379e
movq 0xa864(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
shll %edx
subl -0x1c(%rbp), %edx
callq 0x20e0
cmpl $-0x1, %eax
jne 0x377e
jmp 0x3799
movq 0xa843(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
leaq 0x5939(%rip), %rsi      # 0x90c8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2260
jmp 0x38e7
cmpl $0x0, -0x20(%rbp)
je 0x37b1
movl -0x20(%rbp), %eax
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x37f2
movq 0xa810(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
shll %edx
subl -0x1c(%rbp), %edx
callq 0x20e0
cmpl $-0x1, %eax
jne 0x37d2
jmp 0x37ed
movq 0xa7ef(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
leaq 0x592f(%rip), %rsi      # 0x9112
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2260
jmp 0x38e5
cmpl $0x0, -0x24(%rbp)
je 0x3805
movl -0x24(%rbp), %eax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3846
movq 0xa7bc(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
shll %edx
subl -0x1c(%rbp), %edx
callq 0x20e0
cmpl $-0x1, %eax
jne 0x3826
jmp 0x3841
movq 0xa79b(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
leaq 0x5895(%rip), %rsi      # 0x90cc
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2260
jmp 0x38e3
movslq -0x20(%rbp), %rsi
leaq 0xa92f(%rip), %rdi      # 0xe180
callq 0x4270
movq %rax, %rdi
movslq -0x24(%rbp), %rsi
callq 0x4290
cmpl $0x0, (%rax)
jne 0x38a5
movq 0xa75a(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
shll %edx
subl -0x1c(%rbp), %edx
callq 0x20e0
cmpl $-0x1, %eax
jne 0x3888
jmp 0x38a3
movq 0xa739(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
leaq 0x5837(%rip), %rsi      # 0x90d0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2260
jmp 0x38e1
movq 0xa71c(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
shll %edx
subl -0x1c(%rbp), %edx
callq 0x20e0
cmpl $-0x1, %eax
jne 0x38c6
jmp 0x38e1
movq 0xa6fb(%rip), %rax      # 0xdfc8
movq (%rax), %rdi
leaq 0x57fc(%rip), %rsi      # 0x90d3
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2260
jmp 0x38e3
jmp 0x38e5
jmp 0x38e7
jmp 0x38e9
jmp 0x38eb
jmp 0x38ed
jmp 0x38ef
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x3638
jmp 0x38ff
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3620
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x35a0
callq 0x2030
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)