// File: /workspace/github_c_makefile_star2_O1/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, 0x7ba63(%rip)     # 0x85064
movl %eax, 0x1c415(%rip)     # 0x25a1c
xorl %ebp, %ebp
movb %bpl, 0x7b950(%rip)     # 0x84f60
movb %bpl, 0x1b989(%rip)     # 0x24fa0
movb %bpl, 0x7e932(%rip)     # 0x87f50
callq 0x2d31
movq %rax, %rbx
cmpb %bpl, (%rax)
je 0x9645
callq 0x2320
movq (%rax), %rax
decq %rbx
movsbq 0x1(%rbx), %rcx
incq %rbx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x9636
movq 0x1c3c4(%rip), %rdi     # 0x25a10
testq %rdi, %rdi
je 0x967b
cmpb $0x0, (%rbx)
je 0x967b
movl 0x1b6fc(%rip), %edx     # 0x24d58
movzwl 0xb0d1(%rip), %ecx      # 0x14734
movl 0x1c3ae(%rip), %r8d     # 0x25a18
leaq 0x3f04(%rip), %rsi      # 0xd575
movq %rbx, %r9
xorl %eax, %eax
callq 0x2210
movq %rbx, %rdi
callq 0x69c9
testl %eax, %eax
je 0x9692
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x7be27(%rip)     # 0x854c0
je 0x9722
cmpl $0x0, 0x1b6b6(%rip)     # 0x24d5c
je 0x96c3
movq 0x1c359(%rip), %rdi     # 0x25a08
movl 0x1b6a3(%rip), %edx     # 0x24d58
leaq 0x2bc2(%rip), %rsi      # 0xc27e
xorl %eax, %eax
callq 0x2210
cmpl $0x0, 0x8aee(%rip)      # 0x121b8
je 0x96f1
cmpl $0x0, 0x1c345(%rip)     # 0x25a18
jne 0x96f1
movq 0x1c32c(%rip), %rdi     # 0x25a08
leaq 0x3eae(%rip), %rsi      # 0xd591
leaq 0x1b7b6(%rip), %rdx     # 0x24ea0
xorl %eax, %eax
callq 0x2210
movq 0x1c318(%rip), %rdi     # 0x25a10
testq %rdi, %rdi
je 0x9687
movl 0x1b655(%rip), %edx     # 0x24d58
leaq 0x3e83(%rip), %rsi      # 0xd58d
leaq 0x1b78f(%rip), %rcx     # 0x24ea0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2210
movq 0x7e0af(%rip), %rdi     # 0x877d8
testq %rdi, %rdi
je 0x9755
cmpl $0x0, 0x1c2e3(%rip)     # 0x25a18
jne 0x9755
cmpl $0x0, 0x7e1ca(%rip)     # 0x87908
jne 0x9755
leaq 0x2b5e(%rip), %rsi      # 0xc2a5
leaq 0x1b752(%rip), %rdx     # 0x24ea0
xorl %eax, %eax
callq 0x2210
leaq 0x3e47(%rip), %rsi      # 0xd5a3
movl $0x2, %edx
movq %rbx, %rdi
callq 0x2080
testl %eax, %eax
je 0x97c3
leaq 0x3e32(%rip), %rsi      # 0xd5a6
movl $0x2, %edx
movq %rbx, %rdi
callq 0x2080
testl %eax, %eax
je 0x97c3
movb (%rbx), %bpl
movzbl %bpl, %eax
cmpl $0x2c, %eax
jg 0x97dc
testl %eax, %eax
je 0x98f8
movq %rbx, %r14
cmpl $0x2a, %eax
jne 0x982d
leaq 0x1(%rbx), %rdi
movl $0x3d, %esi
callq 0x3342
testq %rax, %rax
je 0x97e9
movq %rbx, %r14
cmpb $0x2d, %bpl
je 0x97f8
jmp 0x982d
movl $0x1, 0x7b787(%rip)     # 0x84f54
cmpl $0x0, 0x1c244(%rip)     # 0x25a18
jne 0x9687
jmp 0x97e9
cmpl $0x2d, %eax
je 0x97f8
movq %rbx, %r14
cmpl $0x3b, %eax
jne 0x982d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x313c
movq %rbx, %rdi
callq 0x2110
xorl %ecx, %ecx
leaq 0x1(%rcx), %r14
cmpb $0x2d, (%rbx,%rcx)
jne 0x9818
cmpl $0x9, %ecx
ja 0x9818
cmpl %eax, %ecx
movq %r14, %rcx
jl 0x9802
movl 0xaf16(%rip), %eax      # 0x14734
leaq 0x7bceb(%rip), %rcx     # 0x85510
movl %eax, -0x4(%rcx,%r14,4)
addq %rbx, %r14
cmpb $0x2b, (%r14)
jne 0x9899
movq %r14, %rdi
callq 0x2110
leaq 0x7ba0e(%rip), %rcx     # 0x85250
xorl %esi, %esi
addq $0x320, %rcx            # imm = 0x320
leaq 0x1(%rsi), %rdx
cmpb $0x2b, (%r14,%rsi)
jne 0x9862
cmpl $0x9, %esi
ja 0x9862
cmpl %eax, %esi
movq %rdx, %rsi
jl 0x9844
addq %rdx, %r14
cmpl $0x0, 0x1c1ac(%rip)     # 0x25a18
je 0x9899
movl 0xaec0(%rip), %eax      # 0x14734
leaq 0x7bcc5(%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
jge 0x9bbd
movq %r14, %rdi
callq 0x68e3
testq %rax, %rax
je 0x9687
movq %rax, %r14
movzbl (%rax), %eax
cmpl $0x2e, %eax
je 0x98d2
cmpl $0x5f, %eax
je 0x98d2
movsbq %al, %r15
callq 0x2320
movq (%rax), %rax
testb $0x4, 0x1(%rax,%r15,2)
je 0x9a84
leaq 0x3b76(%rip), %rsi      # 0xd44f
movq %r14, %rdi
callq 0x2969
testq %rax, %rax
je 0x9944
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8d9f
cmpl $0x0, 0x1c119(%rip)     # 0x25a18
jne 0x9687
cmpl $0x0, 0x1b450(%rip)     # 0x24d5c
je 0x9929
movq 0x1c0f3(%rip), %rdi     # 0x25a08
movl 0x1b43d(%rip), %edx     # 0x24d58
leaq 0x295c(%rip), %rsi      # 0xc27e
xorl %eax, %eax
callq 0x2210
movq 0x1c0d8(%rip), %rsi     # 0x25a08
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21a0
movq %r14, %rdi
callq 0x32a6
movl %eax, 0x7bba6(%rip)     # 0x854f8
testl %eax, %eax
jns 0x9a84
movq %r14, %rdi
callq 0x935c
testl %eax, %eax
jns 0x9a10
movl %eax, %ebp
cmpq %rbx, %r14
je 0x99c3
leaq 0x3c48(%rip), %rsi      # 0xd5c0
movq %r14, %rdi
callq 0x2a15
movb $0x43, %bl
testq %rax, %rax
jne 0x99c5
leaq 0x3c36(%rip), %rsi      # 0xd5c4
movq %r14, %rdi
callq 0x2a15
testq %rax, %rax
jne 0x99c5
leaq 0x3c27(%rip), %rsi      # 0xd5c9
movq %r14, %rdi
callq 0x2a15
testq %rax, %rax
jne 0x99c5
movq %r14, %rdi
movl $0x3d, %esi
callq 0x2120
testq %rax, %rax
jne 0x99c5
jmp 0x99d8
movb $0x20, %bl
movzbl %bl, %edx
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x380d
movq %rax, %r14
cmpb $0x0, (%r14)
je 0x99f8
callq 0x2320
movq (%rax), %rax
decq %r14
movsbq 0x1(%r14), %rcx
incq %r14
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x99e9
cmpb $0x0, (%r14)
je 0x9a08
movq %r14, %rdi
callq 0x935c
movl %eax, %ebp
testl %ebp, %ebp
js 0x9bb6
movq %r14, %rdi
callq 0x2110
addq %rax, %r14
xorl %eax, %eax
testb %al, %al
je 0x9a84
movzbl (%r14), %eax
cmpl $0x3b, %eax
je 0x9a2e
testl %eax, %eax
jne 0x9a84
cmpl $0x0, 0x1b327(%rip)     # 0x24d5c
je 0x9a52
movq 0x1bfca(%rip), %rdi     # 0x25a08
movl 0x1b314(%rip), %edx     # 0x24d58
leaq 0x2833(%rip), %rsi      # 0xc27e
xorl %eax, %eax
callq 0x2210
cmpl $0x0, 0x875f(%rip)      # 0x121b8
je 0x9687
cmpl $0x0, 0x1bfb2(%rip)     # 0x25a18
jne 0x9687
movq 0x1bf95(%rip), %rdi     # 0x25a08
movzwl 0x4(%rsp), %edx
leaq 0x289b(%rip), %rsi      # 0xc31a
jmp 0x970a
cmpl $0x0, 0x7ba25(%rip)     # 0x854b0
jne 0x9687
movzbl (%r14), %eax
cmpl $0x29, %eax
jg 0x9abc
testl %eax, %eax
je 0x9687
cmpl $0x26, %eax
jne 0x9ace
incq %r14
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x344f
cmpl $0x2a, %eax
je 0x9ba1
cmpl $0x3b, %eax
je 0x9687
movq %r14, %rdi
callq 0x68e3
testq %rax, %rax
je 0x9687
movq %rax, %rbx
cmpl $0x0, 0x7ba0f(%rip)     # 0x854f8
jns 0x9af9
movq %rbx, %rdi
callq 0x32a6
movl %eax, 0x7b9ff(%rip)     # 0x854f8
movslq 0x7b9f8(%rip), %rax     # 0x854f8
testq %rax, %rax
js 0x9b39
leaq (%rax,%rax,4), %rax
leaq 0x86b0(%rip), %rcx      # 0x121c0
leaq (%rcx,%rax,8), %rdi
callq 0x2110
leaq (%rax,%rbx), %rdi
callq 0x369b
movq %rbx, %rdi
callq 0x2110
addq %rax, %rbx
leaq 0x1b46c(%rip), %rdi     # 0x24fa0
callq 0x7871
cmpl $0x0, 0x8678(%rip)      # 0x121b8
je 0x9b5c
cmpl $0x0, 0x1becf(%rip)     # 0x25a18
jne 0x9b5c
movq 0x1beb6(%rip), %rsi     # 0x25a08
movl $0xa, %edi
callq 0x21a0
movzbl (%rbx), %eax
cmpq $0x3b, %rax
ja 0x9b79
movabsq $0x800040000000001, %rcx # imm = 0x800040000000001
btq %rax, %rcx
jb 0x9687
leaq 0x38f2(%rip), %rdi      # 0xd472
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2130
incl 0x1be9c(%rip)           # 0x25a2c
movq %rbx, %rdi
callq 0x2dcf
leaq 0x3a2e(%rip), %rdi      # 0xd5cd
jmp 0x9bca
incq %r14
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x67d4
movb $0x1, %al
jmp 0x9a1d
incl 0x1be69(%rip)           # 0x25a2c
leaq 0x39df(%rip), %rdi      # 0xd5a9
xorl %eax, %eax
callq 0x2e63
movl $0x1, %edi
callq 0x22f0