// File: /workspace/github_c_makefile_star2_O3/Edilbert[P]BS9/bs9.c
// Function: ParseLine
void ParseLine(char *cp)
{
   int i,l,v,m;
   char *start;

   am = -1;
   oc = -1;
   Label[0] = 0;
   OpText[0] = 0;
   Comment[0] = 0;
   cp = SkipHexCode(cp);        // Skip disassembly
   cp = SkipSpace(cp);          // Skip leading blanks
   start = cp;                  // Remember start of line
   if (df && *cp) fprintf(df,"%5d %4.4x Parse[%d]:%s\n",LiNo,pc&0xffff,Pass,cp);
   if (CheckCondition(cp)) return;
   if (Skipping)
   {
      PrintLiNo();
      if (ListOn && !Pass) fprintf(lf,"SKIP          %s\n",Line);
      if (df)         fprintf(df,"%5d SKIP          %s\n",LiNo,Line);
      return;
   }
   if (pf && !Pass && !MacLev)
   {
       fprintf(pf,"%s\n",Line); // write to preprocessed file
   }
   if (strncmp(cp,"/*",2) == 0 || strncmp(cp,"\\*",2) == 0) // SDDRIVE comment style
   {
      CodeStyle = 1;
      if (!Pass) PrintLine();
      return;
   }
   if (*cp == 0)  // Empty
   {
      if (!Pass)
      {
          PrintLiNo();
          fputc('\n',lf);
      }
      return;
   }
   if (*cp == ';')  // comment only
   {
      PrintLine();
      return;
   }

   if (*cp == '*')  // comment or setting of PC ?
   {
      if (!NeedChar(cp+1,'='))
      {
         PrintLine();  // no "* =" syntax
         return;
      }
   }

   // set local backward label

   if (*cp == '-')
   {
      l = strlen(cp);
      i = 0;
      while (*cp++ == '-' && i < 10 && i < l) ++i;
      minlab[i] = pc;
   }

   // set local forward label

   if (*cp == '+')
   {
      l = strlen(cp);
      i = 0;
      while (*cp++ == '+' && i < 10 && i < l) ++i;
      if (Pass)
      {
         plulab[i][plucnt[i]] = pc;
         if (++plucnt[i] > PLUMAX-2)
         {
            ++ErrNum;
            ErrorMsg("too many local labels\n");
            exit(1);
         }
      }
   }

   cp = CheckPseudo(cp);
   if (!cp) return;      // Pseudo Op successfull processed
   if (*cp == '.' || *cp == '_' || isalpha(*cp)) // Macro, Label or mnemonic
   {
      if (StrMatch(cp,"MACRO"))
      {
         RecordMacro(cp);
         return;
      }
      if ((MneIndex = IsInstruction(cp)) < 0)
      {
         m = ExpandMacro(cp);
         if (m < 0) // not a macro
         {
            if (cp == start) cp = DefineLabel(cp,&v,' ');
            else
            {
               if (StrKey(cp,"SET") || StrKey(cp,"ENUM") ||
                   StrKey(cp,"EQU") || strchr(cp,'='))
                  cp = DefineLabel(cp,&v,'C');
            }
            cp = SkipSpace(cp);         // Skip leading blanks
            if (*cp) m = ExpandMacro(cp);   // Macro after label
            if (m >= 0) cp += strlen(cp);         // advance to EOL
         }
         else cp += strlen(cp);         // advance to EOL
         if (m < 0 && (*cp == 0 || *cp == ';')) // no code or data
         {
            PrintLiNo();
            if (ListOn && !Pass)
               fprintf(lf,"%4.4x              %s\n",v&0xffff,Line);
            return;
         }
      }
   }
   if (ForcedEnd)  return;
   if (*cp ==  0 ) return;             // No code
   if (*cp == ';') return;             // No code
   if (*cp == '&') { cp = SetBSS(cp+1); return; }    // Set BSS counter
   if (*cp == '*') { cp = SetPC(cp+1) ; return; }    // Set PC
   cp = CheckPseudo(cp);
   if (!cp) return;      // Pseudo Op successfull processed
   if (MneIndex < 0) MneIndex = IsInstruction(cp); // Check for mnemonic after label
   if (MneIndex >= 0)
   {
      ExtractOpText(cp+strlen(Mat[MneIndex].Mne));
      cp += strlen(cp);
      GenerateCode(OpText);
   }
   if (ListOn && !Pass) fprintf(lf,"\n");
   if (*cp == 0 || *cp == ';' || *cp == '*') return; // end of code

   printf("<%s>\n",cp);
   ++ErrNum;
   ErrorLine(cp);
   ErrorMsg("Syntax error\n");
   exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x7b9bc(%rip)     # 0x85064
movl %eax, 0x1c36e(%rip)     # 0x25a1c
xorl %ebp, %ebp
movb %bpl, 0x7b8a9(%rip)     # 0x84f60
movb %bpl, 0x1b8e2(%rip)     # 0x24fa0
movb %bpl, 0x7e88b(%rip)     # 0x87f50
callq 0x2d40
movq %rax, %rbx
cmpb %bpl, (%rax)
je 0x9721
callq 0x2320
movq (%rax), %rcx
decq %rbx
movsbq 0x1(%rbx), %rax
incq %rbx
testb $0x20, 0x1(%rcx,%rax,2)
jne 0x96dd
movq 0x1c31d(%rip), %rdi     # 0x25a10
testq %rdi, %rdi
je 0x9721
testb %al, %al
je 0x9721
movl 0x1b656(%rip), %edx     # 0x24d58
movzwl 0xb02b(%rip), %ecx      # 0x14734
movl 0x1c308(%rip), %r8d     # 0x25a18
leaq 0x3e4a(%rip), %rsi      # 0xd561
movq %rbx, %r9
xorl %eax, %eax
callq 0x2210
movq %rbx, %rdi
callq 0x6abc
testl %eax, %eax
je 0x9738
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x7bd81(%rip)     # 0x854c0
je 0x97c8
cmpl $0x0, 0x1b610(%rip)     # 0x24d5c
je 0x9769
movq 0x1c2b3(%rip), %rdi     # 0x25a08
movl 0x1b5fd(%rip), %edx     # 0x24d58
leaq 0x2b08(%rip), %rsi      # 0xc26a
xorl %eax, %eax
callq 0x2210
cmpl $0x0, 0x8a48(%rip)      # 0x121b8
je 0x9797
cmpl $0x0, 0x1c29f(%rip)     # 0x25a18
jne 0x9797
movq 0x1c286(%rip), %rdi     # 0x25a08
leaq 0x3df4(%rip), %rsi      # 0xd57d
leaq 0x1b710(%rip), %rdx     # 0x24ea0
xorl %eax, %eax
callq 0x2210
movq 0x1c272(%rip), %rdi     # 0x25a10
testq %rdi, %rdi
je 0x972d
movl 0x1b5af(%rip), %edx     # 0x24d58
leaq 0x3dc9(%rip), %rsi      # 0xd579
leaq 0x1b6e9(%rip), %rcx     # 0x24ea0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2210
movq 0x7e009(%rip), %rdi     # 0x877d8
testq %rdi, %rdi
je 0x97fb
cmpl $0x0, 0x1c23d(%rip)     # 0x25a18
jne 0x97fb
cmpl $0x0, 0x7e124(%rip)     # 0x87908
jne 0x97fb
leaq 0x2aa4(%rip), %rsi      # 0xc291
leaq 0x1b6ac(%rip), %rdx     # 0x24ea0
xorl %eax, %eax
callq 0x2210
movb (%rbx), %al
movzbl %al, %ecx
cmpl $0x2e, %ecx
jg 0x9858
testl %ecx, %ecx
je 0x9927
cmpl $0x2a, %ecx
je 0x9973
movq %rbx, %r14
cmpl $0x2d, %ecx
jne 0x9897
movq %rbx, %rdi
callq 0x2110
xorl %edx, %edx
leaq 0x1(%rdx), %rcx
cmpb $0x2d, (%rbx,%rdx)
jne 0x983e
cmpl $0x9, %edx
ja 0x983e
cmpl %eax, %edx
movq %rcx, %rdx
jl 0x9828
movl 0xaef0(%rip), %eax      # 0x14734
leaq 0x7bcc5(%rip), %rdx     # 0x85510
movl %eax, -0x4(%rdx,%rcx,4)
leaq (%rbx,%rcx), %r14
movb (%rbx,%rcx), %al
jmp 0x9897
cmpl $0x5c, %ecx
je 0x986e
cmpl $0x3b, %ecx
je 0x99e4
movq %rbx, %r14
cmpl $0x2f, %ecx
jne 0x9897
cmpb $0x2a, 0x1(%rbx)
movq %rbx, %r14
jne 0x9989
movl $0x1, 0x7b6cf(%rip)     # 0x84f54
cmpl $0x0, 0x1c18c(%rip)     # 0x25a18
jne 0x972d
jmp 0x99e4
cmpb $0x2b, %al
jne 0x9989
movq %r14, %rdi
callq 0x2110
leaq 0x7b9a2(%rip), %rcx     # 0x85250
xorl %esi, %esi
addq $0x320, %rcx            # imm = 0x320
leaq 0x1(%rsi), %rdx
cmpb $0x2b, (%r14,%rsi)
jne 0x98ce
cmpl $0x9, %esi
ja 0x98ce
cmpl %eax, %esi
movq %rdx, %rsi
jl 0x98b0
addq %rdx, %r14
cmpl $0x0, 0x1c140(%rip)     # 0x25a18
je 0x9989
movl 0xae50(%rip), %eax      # 0x14734
leaq 0x7bc55(%rip), %rsi     # 0x85540
movslq -0x4(%rsi,%rdx,4), %rdi
leal 0x1(%rdi), %r8d
movl %eax, (%rcx,%rdi,4)
movl %r8d, -0x4(%rsi,%rdx,4)
cmpq $0xc6, %rdi
jl 0x9989
incl 0x1c11d(%rip)           # 0x25a2c
leaq 0x3c79(%rip), %rdi      # 0xd58f
xorl %eax, %eax
callq 0x2e72
movl $0x1, %edi
callq 0x22f0
cmpl $0x0, 0x1c0ea(%rip)     # 0x25a18
jne 0x972d
cmpl $0x0, 0x1b421(%rip)     # 0x24d5c
je 0x9958
movq 0x1c0c4(%rip), %rdi     # 0x25a08
movl 0x1b40e(%rip), %edx     # 0x24d58
leaq 0x2919(%rip), %rsi      # 0xc26a
xorl %eax, %eax
callq 0x2210
movq 0x1c0a9(%rip), %rsi     # 0x25a08
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21a0
leaq 0x1(%rbx), %rdi
movl $0x3d, %esi
callq 0x3351
movq %rbx, %r14
testq %rax, %rax
je 0x99e4
movq %r14, %rdi
callq 0x69d6
testq %rax, %rax
je 0x972d
movq %rax, %r14
movzbl (%rax), %eax
cmpl $0x2e, %eax
je 0x99be
cmpl $0x5f, %eax
je 0x99be
movsbq %al, %r15
callq 0x2320
movq (%rax), %rax
testb $0x4, 0x1(%rax,%r15,2)
je 0x9a20
leaq 0x3a76(%rip), %rsi      # 0xd43b
movq %r14, %rdi
callq 0x2969
testq %rax, %rax
je 0x99f3
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8e11
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x314b
movq %r14, %rdi
callq 0x32b5
movl %eax, 0x7baf7(%rip)     # 0x854f8
testl %eax, %eax
jns 0x9a20
movq %r14, %rdi
callq 0x93d6
testl %eax, %eax
js 0x9b3b
movq %r14, %rdi
callq 0x2110
addq %rax, %r14
cmpl $0x0, 0x7ba89(%rip)     # 0x854b0
jne 0x972d
movzbl (%r14), %eax
cmpl $0x29, %eax
jg 0x9a58
testl %eax, %eax
je 0x972d
cmpl $0x26, %eax
jne 0x9a6a
incq %r14
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3478
cmpl $0x2a, %eax
je 0x9b94
cmpl $0x3b, %eax
je 0x972d
movq %r14, %rdi
callq 0x69d6
testq %rax, %rax
je 0x972d
movq %rax, %rbx
movl 0x7ba74(%rip), %eax     # 0x854f8
testl %eax, %eax
jns 0x9a9a
movq %rbx, %rdi
callq 0x32b5
movl %eax, 0x7ba62(%rip)     # 0x854f8
testl %eax, %eax
js 0x9ad0
movl %eax, %eax
leaq (%rax,%rax,4), %rax
leaq 0x8719(%rip), %rcx      # 0x121c0
leaq (%rcx,%rax,8), %rdi
callq 0x2110
leaq (%rax,%rbx), %rdi
callq 0x36db
movq %rbx, %rdi
callq 0x2110
addq %rax, %rbx
leaq 0x1b4d5(%rip), %rdi     # 0x24fa0
callq 0x7930
cmpl $0x0, 0x86e1(%rip)      # 0x121b8
je 0x9af3
cmpl $0x0, 0x1bf38(%rip)     # 0x25a18
jne 0x9af3
movq 0x1bf1f(%rip), %rsi     # 0x25a08
movl $0xa, %edi
callq 0x21a0
movzbl (%rbx), %eax
cmpq $0x3b, %rax
ja 0x9b10
movabsq $0x800040000000001, %rcx # imm = 0x800040000000001
btq %rax, %rcx
jb 0x972d
leaq 0x3947(%rip), %rdi      # 0xd45e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2130
incl 0x1bf05(%rip)           # 0x25a2c
movq %rbx, %rdi
callq 0x2dde
leaq 0x3a7d(%rip), %rdi      # 0xd5b3
jmp 0x9916
movl %eax, %ebp
cmpq %rbx, %r14
je 0x9ba9
leaq 0x3a5d(%rip), %rsi      # 0xd5a6
movq %r14, %rdi
callq 0x2a12
movb $0x43, %bl
testq %rax, %rax
jne 0x9bab
leaq 0x3a4b(%rip), %rsi      # 0xd5aa
movq %r14, %rdi
callq 0x2a12
testq %rax, %rax
jne 0x9bab
leaq 0x3a3c(%rip), %rsi      # 0xd5af
movq %r14, %rdi
callq 0x2a12
testq %rax, %rax
jne 0x9bab
movq %r14, %rdi
movl $0x3d, %esi
callq 0x2120
testq %rax, %rax
jne 0x9bab
jmp 0x9bbe
incq %r14
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x68b9
movb $0x20, %bl
movzbl %bl, %edx
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x3852
movq %rax, %r14
movsbq (%r14), %rbx
testq %rbx, %rbx
je 0x9c15
callq 0x2320
movq (%rax), %rax
testb $0x20, 0x1(%rax,%rbx,2)
jne 0x9bda
xorl %eax, %eax
jmp 0x9bee
movsbq 0x1(%r14), %rcx
incq %r14
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x9bda
testb %cl, %cl
sete %al
testb %al, %al
jne 0x9bfc
movq %r14, %rdi
callq 0x93d6
movl %eax, %ebp
testl %ebp, %ebp
jns 0x9a15
movzbl (%r14), %eax
cmpl $0x3b, %eax
je 0x9c15
testl %eax, %eax
jne 0x9a20
cmpl $0x0, 0x1b140(%rip)     # 0x24d5c
je 0x9c39
movq 0x1bde3(%rip), %rdi     # 0x25a08
movl 0x1b12d(%rip), %edx     # 0x24d58
leaq 0x2638(%rip), %rsi      # 0xc26a
xorl %eax, %eax
callq 0x2210
cmpl $0x0, 0x8578(%rip)      # 0x121b8
je 0x972d
cmpl $0x0, 0x1bdcb(%rip)     # 0x25a18
jne 0x972d
movq 0x1bdae(%rip), %rdi     # 0x25a08
movzwl 0x4(%rsp), %edx
leaq 0x26a0(%rip), %rsi      # 0xc306
jmp 0x97b0