// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/display.c
// Function: display_refresh
void
display_refresh(void)
{
    int cx = 0;
    int cy = 0;
    device_move(cx, cy);
    for (int y = 0; y < DISPLAY_HEIGHT; y++) {
        for (int x = 0; x < DISPLAY_WIDTH; x++) {
            panel_t *p = display.panels;
            while (p->tiles[x][y].transparent)
                p = p->next;
            uint16_t oldc = display.current[x][y].c;
            uint16_t newc = p->tiles[x][y].c;
            font_t oldf = display.current[x][y].font;
            font_t newf = p->tiles[x][y].font;
            if (oldc != newc || !font_equal(oldf, newf)) {
                if (cx != x || cy != y)
                    device_move(cx = x, cy = y);
                device_putc(newf, newc);
                display.current[x][y].font = newf;
                display.current[x][y].c = newc;
                cx++;
            }
        }
    }
    device_flush();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
callq 0x8830
movl $0x0, -0xc(%rbp)
cmpl $0x18, -0xc(%rbp)
jge 0x46e5
movl $0x0, -0x10(%rbp)
cmpl $0x50, -0x10(%rbp)
jge 0x46d5
movq 0x11c96(%rip), %rax     # 0x161f0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x10, %rax
movslq -0x10(%rbp), %rcx
imulq $0xc0, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
testb $0x1, 0x2(%rax,%rcx,8)
je 0x4590
movq -0x18(%rbp), %rax
movq 0x3c10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x455e
movslq -0x10(%rbp), %rcx
leaq 0xb33d(%rip), %rax      # 0xf8d8
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movw (%rax), %ax
movw %ax, -0x1a(%rbp)
movq -0x18(%rbp), %rax
addq $0x10, %rax
movslq -0x10(%rbp), %rcx
imulq $0xc0, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
movw (%rax,%rcx,8), %ax
movw %ax, -0x1c(%rbp)
movslq -0x10(%rbp), %rcx
leaq 0xb2f4(%rip), %rax      # 0xf8d8
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movl 0x2(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x10, %rax
movslq -0x10(%rbp), %rcx
imulq $0xc0, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
movl 0x3(%rax,%rcx,8), %eax
movl %eax, -0x24(%rbp)
movzwl -0x1a(%rbp), %eax
movzwl -0x1c(%rbp), %ecx
cmpl %ecx, %eax
jne 0x463f
movl -0x20(%rbp), %edi
movl -0x24(%rbp), %esi
callq 0x4850
testb $0x1, %al
jne 0x46c5
movl -0x4(%rbp), %eax
cmpl -0x10(%rbp), %eax
jne 0x464f
movl -0x8(%rbp), %eax
cmpl -0xc(%rbp), %eax
je 0x4660
movl -0x10(%rbp), %edi
movl %edi, -0x4(%rbp)
movl -0xc(%rbp), %esi
movl %esi, -0x8(%rbp)
callq 0x8830
movw -0x1c(%rbp), %ax
movl -0x24(%rbp), %edi
movzwl %ax, %esi
callq 0x88d0
movslq -0x10(%rbp), %rcx
leaq 0xb25e(%rip), %rax      # 0xf8d8
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movl -0x24(%rbp), %ecx
movl %ecx, 0x2(%rax)
movw -0x1c(%rbp), %cx
movslq -0x10(%rbp), %rdx
leaq 0xb234(%rip), %rax      # 0xf8d8
imulq $0x90, %rdx, %rdx
addq %rdx, %rax
movslq -0xc(%rbp), %rdx
imulq $0x6, %rdx, %rdx
addq %rdx, %rax
movw %cx, (%rax)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x46c7
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x4549
jmp 0x46d7
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4538
callq 0x8b40
addq $0x30, %rsp
popq %rbp
retq