// File: /workspace/github_c_makefile_star2_O1/Edilbert[P]BS9/bs9.c
// Function: ParseLongData
char *ParseLongData(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 >> 24;
      ByteBuffer[l++] = v >> 16;
      ByteBuffer[l++] = v >>  8;
      ByteBuffer[l++] = v;
      p = SkipToComma(p);
      if (*p == ',') ++p;
   }
   if (l < 4)
   {
      ErrorMsg("Missing LONG data\n");
      ErrorLine(p);
      exit(1);
   }
   j = AddressIndex(pc);
   if (j >= 0 && df) fprintf(df,"LONG 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)
      {
         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 0x4ea5
callq 0x2320
movq (%rax), %rax
decq %rbx
movsbq 0x1(%rbx), %rcx
incq %rbx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x4e96
xorl %ebp, %ebp
leaq 0xc(%rsp), %r14
movabsq $0x800100000000001, %r15 # imm = 0x800100000000001
movzbl (%rbx), %eax
testl %eax, %eax
je 0x4f14
cmpl $0x3b, %eax
je 0x4f14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3daa
movq %rax, %rbx
movl 0xc(%rsp), %eax
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, 0x10(%rsp,%rbp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x11(%rsp,%rbp)
movb %ah, 0x12(%rsp,%rbp)
movb %al, 0x13(%rsp,%rbp)
addq $0x4, %rbp
movzbl (%rbx), %eax
cmpq $0x3b, %rax
ja 0x4f03
btq %rax, %r15
jb 0x4f08
incq %rbx
jmp 0x4ef4
xorl %ecx, %ecx
cmpb $0x2c, %al
sete %cl
addq %rcx, %rbx
jmp 0x4eb6
testq %rbp, %rbp
je 0x50ae
movl 0xf810(%rip), %r8d      # 0x14734
movslq 0x20b09(%rip), %rax     # 0x25a34
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testq %rax, %rax
jle 0x4f55
leaq 0x20b0f(%rip), %rdx     # 0x25a4c
xorl %ecx, %ecx
cmpl %r8d, (%rdx)
je 0x4f52
incq %rcx
addq $0x30, %rdx
cmpq %rcx, %rax
jne 0x4f3f
jmp 0x4f55
movl %ecx, %r14d
testl %r14d, %r14d
setns %al
movq 0x20aae(%rip), %rdi     # 0x25a10
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x4f9a
movl %r14d, %eax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq 0x20abf(%rip), %rcx     # 0x25a40
movq (%rax,%rcx), %rdx
movl 0xc(%rax,%rcx), %ecx
leaq 0x7732(%rip), %rsi      # 0xc6c2
movl %ebp, %r9d
xorl %eax, %eax
callq 0x2210
testl %r14d, %r14d
js 0x4fdc
movl 0x20a8f(%rip), %eax     # 0x25a34
cmpl %eax, %r14d
jge 0x4fdc
movl 0xf784(%rip), %ecx      # 0x14734
movl %r14d, %esi
leaq (%rsi,%rsi,2), %rdx
shlq $0x4, %rdx
leaq 0x20a7e(%rip), %rdi     # 0x25a40
addq %rdi, %rdx
addq $0x10, %rdx
subq %rsi, %rax
cmpl %ecx, -0x4(%rdx)
jne 0x4fd3
movl %ebp, (%rdx)
addq $0x30, %rdx
decq %rax
jne 0x4fcc
cmpl $0x0, 0x20a35(%rip)     # 0x25a18
jne 0x5093
cmpq $0x1, %rbp
movq %rbp, %rcx
adcq $0x0, %rcx
leaq 0xfc55(%rip), %r15      # 0x14c50
leaq 0x76a1(%rip), %r14      # 0xc6a3
xorl %r12d, %r12d
movl 0xf729(%rip), %eax      # 0x14734
addl %r12d, %eax
movzbl 0x10(%rsp,%r12), %edx
cltq
movb %dl, (%rax,%r15)
testl $0x7ffffffd, %r12d      # imm = 0x7FFFFFFD
jne 0x5049
cmpl $0x0, 0xd18e(%rip)      # 0x121b8
je 0x5049
movq 0x209d5(%rip), %rdi     # 0x25a08
movq %rcx, %r13
movzbl 0x11(%rsp,%r12), %ecx
movq %r14, %rsi
xorl %eax, %eax
callq 0x2210
movq %r13, %rcx
incq %r12
cmpq %r12, %rcx
jne 0x5005
cmpl $0x0, 0xd160(%rip)      # 0x121b8
je 0x5093
movq 0x209a7(%rip), %rcx     # 0x25a08
leaq 0x8666(%rip), %rdi      # 0xd6ce
movl $0x3, %esi
movl $0x1, %edx
callq 0x2300
movq 0x2098a(%rip), %rdi     # 0x25a08
leaq 0x721f(%rip), %rsi      # 0xc2a4
leaq 0x1fe14(%rip), %rdx     # 0x24ea0
xorl %eax, %eax
callq 0x2210
addl %ebp, 0xf69b(%rip)      # 0x14734
movq %rbx, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x75fa(%rip), %rdi      # 0xc6af
xorl %eax, %eax
callq 0x2e63
movq %rbx, %rdi
callq 0x2dcf
movl $0x1, %edi
callq 0x22f0