// File: /workspace/github_c_makefile_star2_O1/mcaimi[P]st/st.c
// Function: draw
void
draw(void)
{
  int cx = term.c.x;
  int 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();

  // update xim cursor only if position is actually changed
  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 0x154ae(%rip), %r14     # 0x1e6d8
movl 0x154b4(%rip), %ebp     # 0x1e6e4
movl 0x154b2(%rip), %ebx     # 0x1e6e8
callq 0xc89f
testl %eax, %eax
je 0x9402
movl 0x1549b(%rip), %edx     # 0x1e6e4
xorl %ecx, %ecx
movl $0x0, %eax
testl %edx, %edx
js 0x9261
movl 0x15442(%rip), %eax     # 0x1e69c
decl %eax
cmpl %eax, %edx
cmovll %edx, %eax
movl %eax, 0x1547d(%rip)     # 0x1e6e4
movl 0x1547b(%rip), %edx     # 0x1e6e8
testl %edx, %edx
js 0x927e
movl 0x15421(%rip), %ecx     # 0x1e698
decl %ecx
cmpl %ecx, %edx
cmovll %edx, %ecx
movl %ebp, 0x10(%rsp)
movl %ebx, 0x14(%rsp)
movl %ecx, 0x1545c(%rip)     # 0x1e6e8
movq 0x1540d(%rip), %rdx     # 0x1e6a0
movslq %ecx, %rcx
movq (%rdx,%rcx,8), %rcx
movslq %eax, %rsi
shlq $0x4, %rsi
testb $0x4, 0x5(%rcx,%rsi)
je 0x92b0
decl %eax
movl %eax, 0x15434(%rip)     # 0x1e6e4
movslq 0x15425(%rip), %rax     # 0x1e6dc
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, %r13d
sarl $0xf, %r13d
movslq 0x153bb(%rip), %rbp     # 0x1e698
testq %rbp, %rbp
jle 0x936c
movl 0x153b0(%rip), %ebx     # 0x1e69c
xorl %r15d, %r15d
leaq 0x1428a(%rip), %r12     # 0x1d580
xorl %r14d, %r14d
movq 0x153c0(%rip), %rax     # 0x1e6c0
cmpl $0x0, (%rax,%r14,4)
je 0x9360
movl $0x0, (%rax,%r14,4)
movslq 0x153a6(%rip), %rax     # 0x1e6bc
cmpq %rax, %r14
jge 0x9340
movl (%r12), %ecx
movl 0x15393(%rip), %edx     # 0x1e6b8
addl %ecx, %edx
subl %eax, %edx
leal (%r14,%rdx), %eax
incl %eax
xorl %edx, %edx
divl %ecx
shlq $0x3, %rdx
addq 0x15372(%rip), %rdx     # 0x1e6b0
jmp 0x9351
movq 0x15359(%rip), %rdx     # 0x1e6a0
shlq $0x3, %rax
subq %rax, %rdx
addq %r15, %rdx
movq (%rdx), %rdi
xorl %esi, %esi
movl %r14d, %edx
movl %ebx, %ecx
callq 0xc8a9
incq %r14
addq $0x8, %r15
cmpq %r14, %rbp
jne 0x92f9
addl 0x18(%rsp), %r13d
cmpl $0x0, 0x15344(%rip)     # 0x1e6bc
jne 0x93d0
movslq 0x1535b(%rip), %rsi     # 0x1e6dc
movq 0x15318(%rip), %rax     # 0x1e6a0
movq (%rax,%rsi,8), %rcx
movslq %r13d, %rdi
movq %rdi, %r10
shlq $0x4, %r10
movslq 0x15347(%rip), %r8      # 0x1e6e4
movslq 0x15344(%rip), %r9      # 0x1e6e8
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 0xc36b
movl %r13d, 0x1530d(%rip)    # 0x1e6e4
movl 0x152ff(%rip), %eax     # 0x1e6dc
movl %eax, 0x15305(%rip)     # 0x1e6e8
callq 0xd55c
movl 0x152f6(%rip), %edi     # 0x1e6e4
movl 0x152f4(%rip), %esi     # 0x1e6e8
cmpl %edi, 0x10(%rsp)
movl 0x14(%rsp), %eax
jne 0x9411
cmpl %esi, %eax
jne 0x9411
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 0xd5dd