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

   p = SkipSpace(p);
   l = 0;
   while (*p && *p != ';') // Parse data line
   {
      if (CodeStyle == 1 && *p == ' ') break;
      else p = SkipSpace(p);
      Delimiter = *p;
      if (!strncmp(p,"$DATE",5))
      {
         strcpy((char *)ByteBuffer+l,datebuffer);
         l += strlen(datebuffer);
         p += 5;
      }
      else if (Delimiter == '"' || Delimiter == '\'')
      {
         i = l; // remember start of string
         p = ParseASCII(p,ByteBuffer,&l);
         if (df)
         {
            fprintf(df,"String $%4.4x:<",pc);
            for (j=i ; j < l ; ++j) fprintf(df,"%c",ByteBuffer[j]&0x7f);
            fprintf(df,"> [%d]\n",l-i);
         }
      }
      else
      {
         v = UNDEF;
         p = EvalOperand(p,&v,0);
         if (v == UNDEF && !Pass)
         {
            ErrorMsg("Undefined symbol in BYTE data\n");
            ErrorLine(p);
            exit(1);
         }
         if (v > 255 || v < -127) ByteBuffer[l++] = v >> 8;
         ByteBuffer[l++] = v & 0xff;
         if (df)
         {
            fprintf(df,"BYTE   $%4.4x: %2.2x\n",pc,v);
         }
      }
      if (CodeStyle == 1 && *p == ' ') break;
      p = SkipToComma(p);
      if (*p == ',') ++p;
   }
   if (l < 1)
   {
      ErrorMsg("Missing byte data\n");
      ErrorLine(p);
      exit(1);
   }
   j = AddressIndex(pc);
   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 (j >= 0 && df) fprintf(df,"Byte label [%s] $%4.4x $%4.4x %d bytes\n",
                   lab[j].Name,lab[j].Address,pc,l);
   if (!Pass)
   {
      for (i=0 ; i < l ; ++i)
      {
         PutByte(pc+i,ByteBuffer[i]);
         if (ListOn && i < 4) fprintf(lf," %2.2x",ByteBuffer[i]);
      }
      if (ListOn)
      {
         for (i=l ; i < 4 ; ++i) 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
callq 0x2675
movq %rax, %rbx
leaq 0x8(%rsp), %rbp
andl $0x0, (%rbp)
leaq 0x650c(%rip), %r15      # 0xba1c
pushq $0x5
popq %r12
movzbl (%rbx), %eax
testl %eax, %eax
je 0x56c8
cmpl $0x3b, %eax
je 0x56c8
cmpb $0x20, %al
jne 0x5539
cmpl $0x1, 0x7ea21(%rip)     # 0x83f54
je 0x56c8
movq %rbx, %rdi
callq 0x2675
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2080
testl %eax, %eax
je 0x55d0
movzbl (%rbx), %eax
cmpl $0x27, %eax
je 0x5567
cmpl $0x22, %eax
jne 0x5626
movslq 0x8(%rsp), %r13
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
movq %rbp, %rdx
callq 0x5422
movq %rax, %rbx
movq 0x1f48a(%rip), %rdi     # 0x24a10
testq %rdi, %rdi
je 0x56a2
movq %r15, %r12
movq %rbp, %r15
movl 0xe199(%rip), %edx      # 0x13734
leaq 0x6480(%rip), %rsi      # 0xba22
xorl %eax, %eax
callq 0x2210
movslq 0x8(%rsp), %rbp
movq %r13, %r14
movq 0x1f458(%rip), %rsi     # 0x24a10
cmpq %rbp, %r14
jge 0x5604
movzbl 0x10(%rsp,%r14), %edi
andl $0x7f, %edi
callq 0x21a0
incq %r14
jmp 0x55b1
movslq 0x8(%rsp), %r14
leaq (%rsp,%r14), %rdi
addq $0x10, %rdi
leaq 0x7ee7c(%rip), %r13     # 0x84460
movq %r13, %rsi
callq 0x2090
movq %r13, %rdi
callq 0x2110
addl %r14d, %eax
movl %eax, 0x8(%rsp)
addq $0x5, %rbx
jmp 0x56a2
subl %r13d, %ebp
movq %rsi, %rdi
leaq 0x6421(%rip), %rsi      # 0xba32
movl %ebp, %edx
xorl %eax, %eax
callq 0x2210
movq %r15, %rbp
movq %r12, %r15
pushq $0x5
popq %r12
jmp 0x56a2
movl $0xff0000, %r14d        # imm = 0xFF0000
movl %r14d, 0xc(%rsp)
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
xorl %edx, %edx
callq 0x37d5
movq %rax, %rbx
movl 0xc(%rsp), %ecx
cmpl %r14d, %ecx
jne 0x5659
cmpl $0x0, 0x1f3c5(%rip)     # 0x24a18
je 0x5821
leal -0x100(%rcx), %edx
movl 0x8(%rsp), %eax
cmpl $0xfffffe80, %edx       # imm = 0xFFFFFE80
ja 0x5675
movslq %eax, %rdx
leal 0x1(%rdx), %eax
movb %ch, 0x10(%rsp,%rdx)
leal 0x1(%rax), %edx
movl %edx, 0x8(%rsp)
cltq
movb %cl, 0x10(%rsp,%rax)
movq 0x1f387(%rip), %rdi     # 0x24a10
testq %rdi, %rdi
je 0x56a2
movl 0xe0a0(%rip), %edx      # 0x13734
leaq 0x63be(%rip), %rsi      # 0xba59
xorl %eax, %eax
callq 0x2210
cmpl $0x1, 0x7e8ab(%rip)     # 0x83f54
jne 0x56b0
cmpb $0x20, (%rbx)
je 0x56c8
movq %rbx, %rdi
callq 0x4266
xorl %ebx, %ebx
cmpb $0x2c, (%rax)
sete %bl
addq %rax, %rbx
jmp 0x5514
movslq 0x8(%rsp), %r14
testq %r14, %r14
jle 0x582a
movl 0xe058(%rip), %ebp      # 0x13734
movl %ebp, %edi
callq 0x3119
testl %eax, %eax
js 0x5715
movl 0x1f347(%rip), %ecx     # 0x24a34
movl %eax, %edx
imulq $0x30, %rdx, %rdx
leaq 0x1f346(%rip), %rsi     # 0x24a40
addq %rsi, %rdx
addq $0x10, %rdx
cmpl %eax, %ecx
jle 0x5715
cmpl %ebp, -0x4(%rdx)
jne 0x570d
movl %r14d, (%rdx)
addq $0x30, %rdx
incl %eax
jmp 0x5701
testl %eax, %eax
setns %cl
movq 0x1f2ef(%rip), %rdi     # 0x24a10
testq %rdi, %rdi
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x5757
movl %eax, %eax
imulq $0x30, %rax, %rax
leaq 0x1f305(%rip), %rcx     # 0x24a40
movq (%rax,%rcx), %rdx
movl 0xc(%rax,%rcx), %ecx
leaq 0x5ead(%rip), %rsi      # 0xb5f7
movl %ebp, %r8d
movl %r14d, %r9d
xorl %eax, %eax
callq 0x2210
cmpl $0x0, 0x1f2ba(%rip)     # 0x24a18
jne 0x5805
leaq 0xe4e5(%rip), %r12      # 0x13c50
leaq 0x5ab9(%rip), %r15      # 0xb22b
xorl %r13d, %r13d
cmpq %r13, %r14
je 0x57b4
movl 0xdfb4(%rip), %eax      # 0x13734
addl %r13d, %eax
movzbl 0x10(%rsp,%r13), %edx
cltq
movb %dl, (%rax,%r12)
cmpq $0x3, %r13
ja 0x57af
cmpl $0x0, 0xba1c(%rip)      # 0x111b8
je 0x57af
movq 0x1f263(%rip), %rdi     # 0x24a08
movq %r15, %rsi
xorl %eax, %eax
callq 0x2210
incq %r13
jmp 0x5775
cmpl $0x0, 0xb9fd(%rip)      # 0x111b8
je 0x5805
leaq 0x6e80(%rip), %r15      # 0xc644
pushq $0x3
popq %r12
pushq $0x1
popq %r13
movl %r14d, %ebp
movq 0x1f232(%rip), %rcx     # 0x24a08
cmpl $0x3, %ebp
jg 0x57ed
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2300
incl %ebp
jmp 0x57cf
leaq 0x5a2b(%rip), %rsi      # 0xb21f
leaq 0x1e6a5(%rip), %rdx     # 0x23ea0
movq %rcx, %rdi
xorl %eax, %eax
callq 0x2210
addl %r14d, 0xdf28(%rip)     # 0x13734
movq %rbx, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6212(%rip), %rdi      # 0xba3a
jmp 0x5831
leaq 0x623e(%rip), %rdi      # 0xba6f
xorl %eax, %eax
callq 0x2af7
movq %rbx, %rdi
callq 0x2a71
pushq $0x1
popq %rdi
callq 0x22f0