// File: /workspace/github_c_makefile_star2_O1/Edilbert[P]BS9/bs9.c
// Function: ParseWordData
char *ParseWordData(char *p)
{
   int i,j,l,v;
   unsigned char ByteBuffer[ML];

   l = 0;
   p = SkipSpace(p);
   while (*p && *p != ';') // Parse data line
   {
      p = EvalOperand(p,&v,0);
      ByteBuffer[l++] = v >> 8;
      ByteBuffer[l++] = v;
      p = SkipToComma(p);
      if (*p == ',') ++p;
   }
   if (l < 1)
   {
      ErrorMsg("Missing WORD data\n");
      ErrorLine(p);
      exit(1);
   }
   j = AddressIndex(pc);
   if (j >= 0 && df) fprintf(df,"Byte label [%s] $%4.4x $%4.4x %d bytes\n",
                   lab[j].Name,lab[j].Address,pc,l);
   if (j >= 0)
   for ( ; j < Labels ; ++j) // There may be multiple lables on this address
   {
       if (lab[j].Address == pc) lab[j].Bytes = l;
   }
   if (!Pass)
   {
      for (i=0 ; i < l ; ++i)
      {
         PutByte(pc+i,ByteBuffer[i]);
         if (ListOn && (i == 0 || i == 2))
            fprintf(lf," %2.2x%2.2x",ByteBuffer[i],ByteBuffer[i+1]);
      }
      if (ListOn)
      {
         if (l == 2) fprintf(lf,"        ");
         else        fprintf(lf,"   ");
         fprintf(lf," %s\n",Line);
      }
   }
   pc += l;

   return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %rbx
cmpb $0x0, (%rdi)
je 0x4c53
callq 0x2320
movq (%rax), %rax
decq %rbx
movsbq 0x1(%rbx), %rcx
incq %rbx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x4c44
xorl %r14d, %r14d
leaq 0xc(%rsp), %r15
movabsq $0x800100000000001, %r12 # imm = 0x800100000000001
movzbl (%rbx), %eax
testl %eax, %eax
je 0x4cb4
cmpl $0x3b, %eax
je 0x4cb4
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3daa
movq %rax, %rbx
movzwl 0xc(%rsp), %eax
rolw $0x8, %ax
movw %ax, 0x10(%rsp,%r14)
addq $0x2, %r14
movzbl (%rbx), %eax
cmpq $0x3b, %rax
ja 0x4ca3
btq %rax, %r12
jb 0x4ca8
incq %rbx
jmp 0x4c94
xorl %ecx, %ecx
cmpb $0x2c, %al
sete %cl
addq %rcx, %rbx
jmp 0x4c65
testq %r14, %r14
je 0x4e52
movl 0xfa70(%rip), %r8d      # 0x14734
movslq 0x20d69(%rip), %rax     # 0x25a34
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
jle 0x4cf3
leaq 0x20d70(%rip), %rdx     # 0x25a4c
xorl %ecx, %ecx
cmpl %r8d, (%rdx)
je 0x4cf1
incq %rcx
addq $0x30, %rdx
cmpq %rcx, %rax
jne 0x4cde
jmp 0x4cf3
movl %ecx, %ebp
testl %ebp, %ebp
setns %al
movq 0x20d11(%rip), %rdi     # 0x25a10
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x4d36
movl %ebp, %eax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq 0x20d23(%rip), %rcx     # 0x25a40
movq (%rax,%rcx), %rdx
movl 0xc(%rax,%rcx), %ecx
leaq 0x794f(%rip), %rsi      # 0xc67b
movl %r14d, %r9d
xorl %eax, %eax
callq 0x2210
testl %ebp, %ebp
js 0x4d76
movl 0x20cf4(%rip), %eax     # 0x25a34
cmpl %eax, %ebp
jge 0x4d76
movl 0xf9ea(%rip), %ecx      # 0x14734
movl %ebp, %esi
leaq (%rsi,%rsi,2), %rdx
shlq $0x4, %rdx
leaq 0x20ce5(%rip), %rdi     # 0x25a40
addq %rdi, %rdx
addq $0x10, %rdx
subq %rsi, %rax
cmpl %ecx, -0x4(%rdx)
jne 0x4d6d
movl %r14d, (%rdx)
addq $0x30, %rdx
decq %rax
jne 0x4d65
cmpl $0x0, 0x20c9b(%rip)     # 0x25a18
jne 0x4e36
cmpq $0x1, %r14
movq %r14, %r12
adcq $0x0, %r12
leaq 0xfebb(%rip), %r13      # 0x14c50
leaq 0x7907(%rip), %r15      # 0xc6a3
xorl %ebp, %ebp
movl 0xf990(%rip), %eax      # 0x14734
addl %ebp, %eax
movzbl 0x10(%rsp,%rbp), %edx
cltq
movb %dl, (%rax,%r13)
testl $0x7ffffffd, %ebp       # imm = 0x7FFFFFFD
jne 0x4dd8
cmpl $0x0, 0xd3f8(%rip)      # 0x121b8
je 0x4dd8
movq 0x20c3f(%rip), %rdi     # 0x25a08
movzbl 0x11(%rsp,%rbp), %ecx
movq %r15, %rsi
xorl %eax, %eax
callq 0x2210
incq %rbp
cmpq %rbp, %r12
jne 0x4d9e
cmpl $0x0, 0xd3d1(%rip)      # 0x121b8
je 0x4e36
movq 0x20c18(%rip), %rcx     # 0x25a08
cmpq $0x2, %r14
jne 0x4e04
leaq 0x88cc(%rip), %rdi      # 0xd6c9
movl $0x8, %esi
jmp 0x4e10
leaq 0x88c3(%rip), %rdi      # 0xd6ce
movl $0x3, %esi
movl $0x1, %edx
callq 0x2300
movq 0x20be7(%rip), %rdi     # 0x25a08
leaq 0x747c(%rip), %rsi      # 0xc2a4
leaq 0x20071(%rip), %rdx     # 0x24ea0
xorl %eax, %eax
callq 0x2210
addl %r14d, 0xf8f7(%rip)     # 0x14734
movq %rbx, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x780f(%rip), %rdi      # 0xc668
xorl %eax, %eax
callq 0x2e63
movq %rbx, %rdi
callq 0x2dcf
movl $0x1, %edi
callq 0x22f0