// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: vchar(int, int, unsigned char, unsigned char, unsigned char)
void vchar(int xoffset,int yoffset, u08 erase, u08 color, u08 c)  // draw a vector character
{
int x1,y1, x2,y2;
u08 VByte;
u08 *VIndex;  // char gen table offset

   // draw a vector graphics character

   if(erase) erase_vchar(xoffset, yoffset);
   if(c == ' ') return;
if(c == DEG_CODE) c = 0xF8;
else if(c == PLUS_MINUS) c = 0xF1;

   x2 = y2 = 0;

   VIndex = vgen[c];  // pointer to strokes for the char

   while(1) {  // draw the character strokes
      VByte = *VIndex;
      if(VByte == 0xFF) break;
      ++VIndex;

      x1 = (VByte >> 4) & 0x07;
      y1 = (VByte & 0x07);

      x1 *= VCharWidth;
      if((c >= 0xB0) && (c <= 0xDF)) {  // make sure line drawing chars touch
         if(((VByte>>4) & 0x07) == (VCHAR_W-1)) x1 += (VCharWidth-1);
      }
      x1 /= VCHAR_W;

      y1 *= VCharHeight;
      if((c >= 0xB0) && (c <= 0xDF)) { // make sure line drawing chars touch
         if((VByte & 0x07) == (VCHAR_H-1)) y1 += (VCharHeight-1);
      }
      y1 /= VCHAR_H;

      if((VByte & 0x80) == 0x00) {  // move to point and draw a dot
         x2 = x1;   // we do dots as a single point line
         y2 = y1;
      }

/////      thick_line(x1+xoffset,y1+yoffset, x2+xoffset,y2+yoffset, color, VCharThickness);
      xthick_line(x1+xoffset,y1+yoffset, x2+xoffset,y2+yoffset, color, VCharThickness);

      if(VByte & 0x08) break;  // end of list

      x2 = x1;  // prepare for next stroke in the character
      y2 = y1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, %r12d
movl %ecx, -0x2c(%rbp)
movl %esi, %ebx
movl %edi, %r14d
testl %edx, %edx
je 0xe23b
movl %r14d, %edi
movl %ebx, %esi
callq 0xea9f
movq %r14, -0x40(%rbp)
movq %rbx, -0x48(%rbp)
cmpb $0x1, %r12b
je 0xe264
movzbl %r12b, %eax
cmpl $0x20, %eax
je 0xe385
cmpb $0x1f, %r12b
movl $0xf1, %ecx
cmovel %ecx, %eax
jmp 0xe266
movb $-0x8, %al
movzbl %al, %ecx
leaq 0x151a20(%rip), %rax    # 0x15fc90
movq (%rax,%rcx,8), %r13
addb $0x50, %cl
movq %rcx, -0x38(%rbp)
xorl %ebx, %ebx
xorl %edx, %edx
xorl %ecx, %ecx
movzbl (%r13), %r12d
cmpl $0xff, %r12d
je 0xe385
movl 0x2152a3(%rip), %eax    # 0x22353c
cmpl $0x2, %eax
jge 0xe2ad
movl 0x20a56b(%rip), %r14d   # 0x218810
movl 0x20a569(%rip), %esi    # 0x218814
jmp 0xe2ba
leal (,%rax,8), %r14d
movl %eax, %esi
shll $0x4, %esi
movl %r12d, %r8d
shrl $0x4, %r8d
andl $0x7, %r8d
movl %r12d, %edi
andl $0x7, %edi
movl %r14d, %r9d
imull %r8d, %r9d
decl %r14d
cmpl $0x7, %r8d
cmovnel %ebx, %r14d
leal -0x1(%rsi), %r8d
cmpl $0x7, %edi
cmovnel %ebx, %r8d
cmpb $0x30, -0x38(%rbp)
cmovael %ebx, %r14d
cmovael %ebx, %r8d
leal (%r14,%r9), %r10d
addl $0x7, %r10d
addl %r9d, %r14d
cmovsl %r10d, %r14d
sarl $0x3, %r14d
imull %esi, %edi
leal (%r8,%rdi), %r15d
addl $0x7, %r15d
movl %r8d, %esi
addl %edi, %esi
cmovnsl %esi, %r15d
sarl $0x3, %r15d
testb %r12b, %r12b
cmovnsl %r14d, %edx
cmovnsl %r15d, %ecx
movb $0x1, %r9b
cmpl $0x2, %eax
jl 0xe34f
movl %eax, %r9d
shrl %r9d
cmpl $0x65, 0x215205(%rip)   # 0x223544
movl $0x2, %esi
cmovgel %esi, %r9d
cmpl $0x4, %eax
cmovll %esi, %r9d
incq %r13
movq -0x40(%rbp), %r8
leal (%r14,%r8), %edi
movq -0x48(%rbp), %rax
leal (%r15,%rax), %esi
addl %r8d, %edx
addl %eax, %ecx
movzbl -0x2c(%rbp), %r8d
movzbl %r9b, %r9d
callq 0xeb58
movl %r14d, %edx
movl %r15d, %ecx
testb $0x8, %r12b
je 0xe281
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq