// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movslq 0x13e1c(%rip), %rbx     # 0x1d2f8
movl 0x13e21(%rip), %r15d    # 0x1d304
movl 0x13e1e(%rip), %r14d    # 0x1d308
callq 0xccd9
testl %eax, %eax
je 0x96e4
movl 0x13e07(%rip), %edx     # 0x1d304
xorl %ecx, %ecx
movl $0x0, %eax
testl %edx, %edx
js 0x9515
movl 0xff36(%rip), %eax      # 0x19444
decl %eax
cmpl %eax, %edx
cmovll %edx, %eax
movl %eax, 0x13de9(%rip)     # 0x1d304
movl 0x13de7(%rip), %edx     # 0x1d308
testl %edx, %edx
js 0x9532
movl 0xff15(%rip), %ecx      # 0x19440
decl %ecx
cmpl %ecx, %edx
cmovll %edx, %ecx
movl %ecx, 0x13dd0(%rip)     # 0x1d308
movq 0xff09(%rip), %rdx      # 0x19448
movslq %ecx, %rcx
movq (%rdx,%rcx,8), %rcx
movslq %eax, %rsi
shlq $0x4, %rsi
testb $0x4, 0x5(%rcx,%rsi)
je 0x955c
decl %eax
movl %eax, 0x13da8(%rip)     # 0x1d304
movslq 0x13d99(%rip), %rax     # 0x1d2fc
movq (%rdx,%rax,8), %rcx
movq %rbx, %rdx
shlq $0x4, %rdx
movl 0x4(%rcx,%rdx), %ecx
shll $0x5, %ecx
movswl %cx, %r13d
sarl $0xf, %r13d
movslq 0xfebc(%rip), %rbp      # 0x19440
testq %rbp, %rbp
jle 0x9658
movq %rbx, 0x18(%rsp)
movl %r15d, 0x10(%rsp)
movl %r14d, 0x14(%rsp)
movl 0xfea2(%rip), %ebx      # 0x19444
movq 0x13d37(%rip), %rax     # 0x1d2e0
xorl %r15d, %r15d
leaq 0xfe8d(%rip), %r12      # 0x19440
xorl %r14d, %r14d
cmpl $0x0, (%rax,%r14,4)
je 0x9633
movl $0x0, (%rax,%r14,4)
movslq 0x13d10(%rip), %rax     # 0x1d2dc
cmpq %rax, %r14
jge 0x960c
movl 0x13d01(%rip), %ecx     # 0x1d2d8
subl %eax, %ecx
leal (%r14,%rcx), %eax
addl $0x7d1, %eax            # imm = 0x7D1
cltq
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x27, %rcx
addl %edx, %ecx
imull $0x7d0, %ecx, %ecx      # imm = 0x7D0
subl %ecx, %eax
cltq
leaq (%r12,%rax,8), %rcx
addq $0x18, %rcx
jmp 0x961d
movq 0xfe35(%rip), %rcx      # 0x19448
shlq $0x3, %rax
subq %rax, %rcx
addq %r15, %rcx
movq (%rcx), %rdi
xorl %esi, %esi
movl %r14d, %edx
movl %ebx, %ecx
callq 0xcce3
movq 0x13cad(%rip), %rax     # 0x1d2e0
incq %r14
addq $0x8, %r15
cmpq %r14, %rbp
jne 0x95b6
movl 0x13cb3(%rip), %eax     # 0x1d2fc
movl 0x14(%rsp), %r14d
movl 0x10(%rsp), %r15d
movq 0x18(%rsp), %rbx
addl %ebx, %r13d
cmpl $0x0, 0x13c7a(%rip)     # 0x1d2dc
jne 0x96bc
movq 0xfddd(%rip), %rcx      # 0x19448
movslq %eax, %rsi
movq (%rcx,%rsi,8), %rax
movslq %r13d, %rdi
movq %rdi, %r10
shlq $0x4, %r10
movslq 0x13c81(%rip), %r8      # 0x1d304
movslq 0x13c7e(%rip), %r9      # 0x1d308
movq (%rcx,%r9,8), %r11
movq %r8, %rbx
shlq $0x4, %rbx
movq (%rax,%r10), %rdx
movq 0x8(%rax,%r10), %rcx
movups (%r11,%rbx), %xmm0
movaps %xmm0, 0x20(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xc894
movl 0x13c40(%rip), %eax     # 0x1d2fc
movl %r13d, 0x13c41(%rip)    # 0x1d304
movl %eax, 0x13c3f(%rip)     # 0x1d308
callq 0xd704
movl 0x13c30(%rip), %edi     # 0x1d304
movl 0x13c2e(%rip), %esi     # 0x1d308
cmpl %edi, %r15d
jne 0x96f3
cmpl %esi, %r14d
jne 0x96f3
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd785