// File: 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
subq $0x50, %rsp
movb %r8b, %al
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movb %dl, -0x9(%rbp)
movb %cl, -0xa(%rbp)
movb %al, -0xb(%rbp)
cmpb $0x0, -0x9(%rbp)
je 0x1073b
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
callq 0x11400
movzbl -0xb(%rbp), %eax
cmpl $0x20, %eax
jne 0x10749
jmp 0x1095e
movzbl -0xb(%rbp), %eax
cmpl $0x1, %eax
jne 0x10758
movb $-0x8, -0xb(%rbp)
jmp 0x10767
movzbl -0xb(%rbp), %eax
cmpl $0x1f, %eax
jne 0x10765
movb $-0xf, -0xb(%rbp)
jmp 0x10767
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x18(%rbp)
movzbl -0xb(%rbp), %eax
movl %eax, %ecx
leaq 0x1ae4fe(%rip), %rax    # 0x1bec80
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movb (%rax), %al
movb %al, -0x1d(%rbp)
movzbl -0x1d(%rbp), %eax
cmpl $0xff, %eax
jne 0x107a3
jmp 0x1095e
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movzbl -0x1d(%rbp), %eax
sarl $0x4, %eax
andl $0x7, %eax
movl %eax, -0x10(%rbp)
movzbl -0x1d(%rbp), %eax
andl $0x7, %eax
movl %eax, -0x14(%rbp)
cmpl $0x1, 0x271f4f(%rip)    # 0x28271c
jle 0x107dd
movl 0x271f47(%rip), %eax    # 0x28271c
shll $0x3, %eax
movl %eax, -0x2c(%rbp)
jmp 0x107e6
movl 0x26720d(%rip), %eax    # 0x2779f0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
imull -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
movzbl -0xb(%rbp), %eax
cmpl $0xb0, %eax
jl 0x10843
movzbl -0xb(%rbp), %eax
cmpl $0xdf, %eax
jg 0x10843
movzbl -0x1d(%rbp), %eax
sarl $0x4, %eax
andl $0x7, %eax
cmpl $0x7, %eax
jne 0x10841
cmpl $0x1, 0x271f00(%rip)    # 0x28271c
jle 0x1082c
movl 0x271ef8(%rip), %eax    # 0x28271c
shll $0x3, %eax
movl %eax, -0x30(%rbp)
jmp 0x10835
movl 0x2671be(%rip), %eax    # 0x2779f0
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
subl $0x1, %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x10843
movl -0x10(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x10(%rbp)
cmpl $0x1, 0x271ec4(%rip)    # 0x28271c
jle 0x10868
movl 0x271ebc(%rip), %eax    # 0x28271c
shll $0x4, %eax
movl %eax, -0x34(%rbp)
jmp 0x10871
movl 0x267186(%rip), %eax    # 0x2779f4
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
imull -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movzbl -0xb(%rbp), %eax
cmpl $0xb0, %eax
jl 0x108cb
movzbl -0xb(%rbp), %eax
cmpl $0xdf, %eax
jg 0x108cb
movzbl -0x1d(%rbp), %eax
andl $0x7, %eax
cmpl $0x7, %eax
jne 0x108c9
cmpl $0x1, 0x271e78(%rip)    # 0x28271c
jle 0x108b4
movl 0x271e70(%rip), %eax    # 0x28271c
shll $0x4, %eax
movl %eax, -0x38(%rbp)
jmp 0x108bd
movl 0x26713a(%rip), %eax    # 0x2779f4
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
subl $0x1, %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x108cb
movl -0x14(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x14(%rbp)
movzbl -0x1d(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x108f3
movl -0x10(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x10(%rbp), %eax
addl -0x4(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x14(%rbp), %eax
addl -0x8(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x18(%rbp), %eax
addl -0x4(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x1c(%rbp), %eax
addl -0x8(%rbp), %eax
movl %eax, -0x40(%rbp)
movb -0xa(%rbp), %al
movb %al, -0x39(%rbp)
callq 0x10970
movl -0x4c(%rbp), %edi
movl -0x48(%rbp), %esi
movl -0x44(%rbp), %edx
movl -0x40(%rbp), %ecx
movb -0x39(%rbp), %r8b
movzbl %r8b, %r8d
movzbl %al, %r9d
callq 0x114c0
movzbl -0x1d(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x1094d
jmp 0x1095e
movl -0x10(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x1078a
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)