// File: /workspace/github_c_makefile_star2_O0/odknt[P]st/st.c
// Function: draw
void
draw(void)
{
	int cx = term.c.x, ocx = term.ocx, ocy = term.ocy;

	if (!xstartdraw())
		return;

	/* adjust cursor position */
	LIMIT(term.ocx, 0, term.col-1);
	LIMIT(term.ocy, 0, term.row-1);
	if (term.line[term.ocy][term.ocx].mode & ATTR_WDUMMY)
		term.ocx--;
	if (term.line[term.c.y][cx].mode & ATTR_WDUMMY)
		cx--;

	drawregion(0, 0, term.col, term.row);
	if (term.scr == 0)
		xdrawcursor(cx, term.c.y, term.line[term.c.y][cx],
				term.ocx, term.ocy, term.line[term.ocy][term.ocx]);
	term.ocx = cx;
	term.ocy = term.c.y;
	xfinishdraw();
	if (ocx != term.ocx || ocy != term.ocy)
		xximspot(term.ocx, term.ocy);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x164aa(%rip), %eax     # 0x20098
movl %eax, -0x4(%rbp)
movl 0x164ad(%rip), %eax     # 0x200a4
movl %eax, -0x8(%rbp)
movl 0x164a8(%rip), %eax     # 0x200a8
movl %eax, -0xc(%rbp)
callq 0xeb30
cmpl $0x0, %eax
jne 0x9c12
jmp 0x9dfb
cmpl $0x0, 0x1648b(%rip)     # 0x200a4
jge 0x9c22
xorl %eax, %eax
movl %eax, -0x24(%rbp)
jmp 0x9c52
movl 0x1647c(%rip), %eax     # 0x200a4
movl 0x125b6(%rip), %ecx     # 0x1c1e4
subl $0x1, %ecx
cmpl %ecx, %eax
jle 0x9c43
movl 0x125a9(%rip), %eax     # 0x1c1e4
subl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x9c4c
movl 0x1645b(%rip), %eax     # 0x200a4
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, 0x16449(%rip)     # 0x200a4
cmpl $0x0, 0x16446(%rip)     # 0x200a8
jge 0x9c6b
xorl %eax, %eax
movl %eax, -0x2c(%rbp)
jmp 0x9c9b
movl 0x16437(%rip), %eax     # 0x200a8
movl 0x12569(%rip), %ecx     # 0x1c1e0
subl $0x1, %ecx
cmpl %ecx, %eax
jle 0x9c8c
movl 0x1255c(%rip), %eax     # 0x1c1e0
subl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x9c95
movl 0x16416(%rip), %eax     # 0x200a8
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, 0x16404(%rip)     # 0x200a8
movq 0x1253d(%rip), %rax     # 0x1c1e8
movslq 0x163f6(%rip), %rcx     # 0x200a8
movq (%rax,%rcx,8), %rax
movslq 0x163e7(%rip), %rcx     # 0x200a4
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x9ce1
movl 0x163cc(%rip), %eax     # 0x200a4
addl $-0x1, %eax
movl %eax, 0x163c3(%rip)     # 0x200a4
movq 0x12500(%rip), %rax     # 0x1c1e8
movslq 0x163ad(%rip), %rcx     # 0x2009c
movq (%rax,%rcx,8), %rax
movslq -0x4(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x9d15
movl -0x4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4(%rbp)
movl 0x124c9(%rip), %edx     # 0x1c1e4
movl 0x124bf(%rip), %ecx     # 0x1c1e0
xorl %esi, %esi
movl %esi, %edi
callq 0x9e10
cmpl $0x0, 0x1634b(%rip)     # 0x2007c
jne 0x9dba
movl -0x4(%rbp), %edi
movl 0x1635c(%rip), %esi     # 0x2009c
movq 0x124a1(%rip), %rax     # 0x1c1e8
movslq 0x1634e(%rip), %rcx     # 0x2009c
movq (%rax,%rcx,8), %rcx
movslq -0x4(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movl 0x16340(%rip), %r8d     # 0x200a4
movl 0x1633d(%rip), %r9d     # 0x200a8
movq 0x12476(%rip), %rax     # 0x1c1e8
movslq 0x1632f(%rip), %rdx     # 0x200a8
movq (%rax,%rdx,8), %rax
movslq 0x16320(%rip), %rdx     # 0x200a4
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
movq (%rax), %r10
movq %r10, -0x20(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
leaq -0x20(%rbp), %rax
movq (%rax), %r10
movq %r10, (%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
callq 0xe5e0
movl -0x4(%rbp), %eax
movl %eax, 0x162e1(%rip)     # 0x200a4
movl 0x162d3(%rip), %eax     # 0x2009c
movl %eax, 0x162d9(%rip)     # 0x200a8
callq 0xf5f0
movl -0x8(%rbp), %eax
cmpl 0x162c7(%rip), %eax     # 0x200a4
jne 0x9dea
movl -0xc(%rbp), %eax
cmpl 0x162c0(%rip), %eax     # 0x200a8
je 0x9dfb
movl 0x162b4(%rip), %edi     # 0x200a4
movl 0x162b2(%rip), %esi     # 0x200a8
callq 0xf6b0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)