// File: /workspace/github_c_makefile_star2_O2/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 0x138cf(%rip), %r14     # 0x1c308
movl 0x138d5(%rip), %ebp     # 0x1c314
movl 0x138d3(%rip), %ebx     # 0x1c318
callq 0xbcfc
testl %eax, %eax
je 0x8c13
movl 0x138bc(%rip), %edx     # 0x1c314
xorl %ecx, %ecx
movl $0x0, %eax
testl %edx, %edx
js 0x8a70
movl 0xf9eb(%rip), %eax      # 0x18454
decl %eax
cmpl %eax, %edx
cmovll %edx, %eax
movl %eax, 0x1389e(%rip)     # 0x1c314
movl 0x1389c(%rip), %edx     # 0x1c318
testl %edx, %edx
js 0x8a8d
movl 0xf9ca(%rip), %ecx      # 0x18450
decl %ecx
cmpl %ecx, %edx
cmovll %edx, %ecx
movl %ebp, 0x10(%rsp)
movl %ebx, 0x14(%rsp)
movl %ecx, 0x1387d(%rip)     # 0x1c318
movq 0xf9b6(%rip), %rdx      # 0x18458
movslq %ecx, %rcx
movq (%rdx,%rcx,8), %rcx
movslq %eax, %rsi
shlq $0x4, %rsi
testb $0x4, 0x5(%rcx,%rsi)
je 0x8abf
decl %eax
movl %eax, 0x13855(%rip)     # 0x1c314
movslq 0x13846(%rip), %rax     # 0x1c30c
movq (%rdx,%rax,8), %rax
movq %r14, 0x18(%rsp)
movq %r14, %rcx
shlq $0x4, %rcx
movl 0x4(%rax,%rcx), %eax
shll $0x5, %eax
movswl %ax, %r13d
sarl $0xf, %r13d
movl 0xf969(%rip), %ebx      # 0x18454
movl 0xf95f(%rip), %ebp      # 0x18450
xorl %r14d, %r14d
testl %ebp, %ebp
cmovlel %r14d, %ebp
leaq 0xf94f(%rip), %r15      # 0x18450
movl $0x7d0, %r12d           # imm = 0x7D0
cmpq %rbp, %r14
je 0x8b76
movq 0x137dd(%rip), %rax     # 0x1c2f0
cmpl $0x0, (%rax,%r14,4)
je 0x8b71
andl $0x0, (%rax,%r14,4)
movslq 0x137c6(%rip), %rax     # 0x1c2ec
cmpq %rax, %r14
jge 0x8b4f
movl 0x137b7(%rip), %ecx     # 0x1c2e8
movl %r14d, %edx
subl %eax, %edx
leal (%rdx,%rcx), %eax
addl $0x7d1, %eax            # imm = 0x7D1
cltd
idivl %r12d
movslq %edx, %rax
leaq (%r15,%rax,8), %rax
addq $0x18, %rax
jmp 0x8b62
movl %r14d, %ecx
subl %eax, %ecx
movslq %ecx, %rax
shlq $0x3, %rax
addq 0xf8f6(%rip), %rax      # 0x18458
movq (%rax), %rdi
xorl %esi, %esi
movl %r14d, %edx
movl %ebx, %ecx
callq 0xbd06
incq %r14
jmp 0x8b07
movq 0x18(%rsp), %r14
addl %r13d, %r14d
cmpl $0x0, 0x13767(%rip)     # 0x1c2ec
movl 0x13781(%rip), %eax     # 0x1c30c
jne 0x8be5
movslq %eax, %rsi
movq 0xf8c1(%rip), %rax      # 0x18458
movq (%rax,%rsi,8), %rcx
movslq %r14d, %rdi
movq %rdi, %r10
shlq $0x4, %r10
movslq 0x13768(%rip), %r8      # 0x1c314
movslq 0x13765(%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 0xb8c2
movl 0x13727(%rip), %eax     # 0x1c30c
movl 0x14(%rsp), %ebx
movl 0x10(%rsp), %ebp
movl %r14d, 0x13720(%rip)    # 0x1c314
movl %eax, 0x1371e(%rip)     # 0x1c318
callq 0xc63a
movl 0x1370f(%rip), %edi     # 0x1c314
movl 0x1370d(%rip), %esi     # 0x1c318
cmpl %edi, %ebp
jne 0x8c22
cmpl %esi, %ebx
jne 0x8c22
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 0xc6c5