// File: /workspace/github_c_makefile_star2_O1/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 0x131aa(%rip), %r14     # 0x1c308
movl 0x131b0(%rip), %ebp     # 0x1c314
movl 0x131ae(%rip), %ebx     # 0x1c318
callq 0xc698
testl %eax, %eax
je 0x9358
movl 0x13197(%rip), %edx     # 0x1c314
xorl %ecx, %ecx
movl $0x0, %eax
testl %edx, %edx
js 0x9195
movl 0xf2c6(%rip), %eax      # 0x18454
decl %eax
cmpl %eax, %edx
cmovll %edx, %eax
movl %eax, 0x13179(%rip)     # 0x1c314
movl 0x13177(%rip), %edx     # 0x1c318
testl %edx, %edx
js 0x91b2
movl 0xf2a5(%rip), %ecx      # 0x18450
decl %ecx
cmpl %ecx, %edx
cmovll %edx, %ecx
movl %ebp, 0x10(%rsp)
movl %ebx, 0x14(%rsp)
movl %ecx, 0x13158(%rip)     # 0x1c318
movq 0xf291(%rip), %rdx      # 0x18458
movslq %ecx, %rcx
movq (%rdx,%rcx,8), %rcx
movslq %eax, %rsi
shlq $0x4, %rsi
testb $0x4, 0x5(%rcx,%rsi)
je 0x91e4
decl %eax
movl %eax, 0x13130(%rip)     # 0x1c314
movslq 0x13121(%rip), %rax     # 0x1c30c
movq (%rdx,%rax,8), %rax
movq %r14, %rcx
movq %r14, 0x18(%rsp)
shlq $0x4, %rcx
movl 0x4(%rax,%rcx), %eax
shll $0x5, %eax
movswl %ax, %r12d
sarl $0xf, %r12d
movslq 0xf23f(%rip), %r13      # 0x18450
testq %r13, %r13
jle 0x92c2
movl 0xf234(%rip), %ebx      # 0x18454
shlq $0x3, %r13
movl $0x7d1, %ebp            # imm = 0x7D1
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x130ba(%rip), %rax     # 0x1c2f0
cmpl $0x0, (%rax,%r15,4)
je 0x92b0
movl $0x0, (%rax,%r15,4)
movslq 0x130a0(%rip), %rax     # 0x1c2ec
cmpq %rax, %r15
jge 0x928d
movl 0x13091(%rip), %ecx     # 0x1c2e8
subl %eax, %ecx
addl %ebp, %ecx
movslq %ecx, %rax
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 0xf1cd(%rip), %rcx      # 0x18450
leaq (%rcx,%rax,8), %rcx
addq $0x18, %rcx
jmp 0x929e
movq 0xf1c4(%rip), %rcx      # 0x18458
shlq $0x3, %rax
subq %rax, %rcx
addq %r14, %rcx
movq (%rcx), %rdi
leal -0x7d1(%rbp), %edx
xorl %esi, %esi
movl %ebx, %ecx
callq 0xc6a2
incq %r15
addq $0x8, %r14
incl %ebp
cmpq %r14, %r13
jne 0x922f
addl 0x18(%rsp), %r12d
cmpl $0x0, 0x1301e(%rip)     # 0x1c2ec
jne 0x9326
movslq 0x13035(%rip), %rsi     # 0x1c30c
movq 0xf17a(%rip), %rax      # 0x18458
movq (%rax,%rsi,8), %rcx
movslq %r12d, %rdi
movq %rdi, %r10
shlq $0x4, %r10
movslq 0x13021(%rip), %r8      # 0x1c314
movslq 0x1301e(%rip), %r9      # 0x1c318
movq (%rax,%r9,8), %rax
movq %r8, %r11
shlq $0x4, %r11
movq (%rcx,%r10), %rdx
movq 0x8(%rcx,%r10), %rcx
movups (%rax,%r11), %xmm0
movaps %xmm0, 0x20(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xc23d
movl %r12d, 0x12fe7(%rip)    # 0x1c314
movl 0x12fd9(%rip), %eax     # 0x1c30c
movl %eax, 0x12fdf(%rip)     # 0x1c318
callq 0xd0d0
movl 0x12fd0(%rip), %edi     # 0x1c314
movl 0x12fce(%rip), %esi     # 0x1c318
cmpl %edi, 0x10(%rsp)
movl 0x14(%rsp), %eax
jne 0x9367
cmpl %esi, %eax
jne 0x9367
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 0xd151