// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
orl $-0x1, 0x7b95b(%rip)    # 0x84064
orl $-0x1, 0x1c30c(%rip)    # 0x24a1c
xorl %eax, %eax
movb %al, 0x7b848(%rip)      # 0x83f60
movb %al, 0x1b882(%rip)      # 0x23fa0
movb %al, 0x7e82c(%rip)      # 0x86f50
callq 0x29d3
movq %rax, %rdi
callq 0x2675
movq %rax, %rbx
movq %rax, %r14
movq 0x1c2d2(%rip), %rdi     # 0x24a10
testq %rdi, %rdi
je 0x876e
cmpb $0x0, (%r14)
je 0x876e
movl 0x1b609(%rip), %edx     # 0x23d58
movzwl 0xafde(%rip), %ecx      # 0x13734
movl 0x1c2bb(%rip), %r8d     # 0x24a18
leaq 0x3d8d(%rip), %rsi      # 0xc4f1
movq %r14, %r9
xorl %eax, %eax
callq 0x2210
movq %r14, %rdi
callq 0x5ebf
testl %eax, %eax
je 0x8784
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
cmpl $0x0, 0x7bd35(%rip)     # 0x844c0
je 0x87f0
callq 0x2c67
cmpl $0x0, 0x8a1f(%rip)      # 0x111b8
je 0x87c0
cmpl $0x0, 0x1c276(%rip)     # 0x24a18
jne 0x87c0
movq 0x1c25d(%rip), %rdi     # 0x24a08
leaq 0x3d5b(%rip), %rsi      # 0xc50d
leaq 0x1b6e7(%rip), %rdx     # 0x23ea0
xorl %eax, %eax
callq 0x2210
movq 0x1c249(%rip), %rdi     # 0x24a10
testq %rdi, %rdi
je 0x877a
movl 0x1b586(%rip), %edx     # 0x23d58
leaq 0x3d30(%rip), %rsi      # 0xc509
leaq 0x1b6c0(%rip), %rcx     # 0x23ea0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2210
movq 0x7dfe1(%rip), %rdi     # 0x867d8
testq %rdi, %rdi
je 0x8823
cmpl $0x0, 0x1c215(%rip)     # 0x24a18
jne 0x8823
cmpl $0x0, 0x7e0fc(%rip)     # 0x86908
jne 0x8823
leaq 0x2a0c(%rip), %rsi      # 0xb221
leaq 0x1b684(%rip), %rdx     # 0x23ea0
xorl %eax, %eax
callq 0x2210
movzbl (%r14), %eax
testl %eax, %eax
je 0x89b4
cmpl $0x2a, %eax
je 0x8937
cmpl $0x2d, %eax
je 0x8877
cmpl $0x5c, %eax
je 0x8850
cmpl $0x3b, %eax
je 0x89a6
cmpl $0x2f, %eax
jne 0x88b1
cmpb $0x2a, 0x1(%r14)
jne 0x8948
movl $0x1, 0x7b6ef(%rip)     # 0x83f54
cmpl $0x0, 0x1c1ac(%rip)     # 0x24a18
jne 0x877a
jmp 0x89a6
movq %r14, %rdi
callq 0x2110
xorl %edx, %edx
leaq 0x1(%rdx), %rcx
cmpb $0x2d, (%r14,%rdx)
jne 0x8898
cmpl $0x9, %edx
ja 0x8898
cmpl %eax, %edx
movq %rcx, %rdx
jl 0x8881
movl 0xae96(%rip), %eax      # 0x13734
leaq 0x7bc6b(%rip), %rdx     # 0x84510
movl %eax, -0x4(%rdx,%rcx,4)
movb (%r14,%rcx), %al
leaq (%rbx,%rcx), %r14
cmpb $0x2b, %al
jne 0x8948
movq %r14, %rdi
callq 0x2110
leaq 0x7b988(%rip), %rcx     # 0x84250
xorl %esi, %esi
addq $0x320, %rcx            # imm = 0x320
leaq 0x1(%rsi), %rdx
cmpb $0x2b, (%r14,%rsi)
jne 0x88e8
cmpl $0x9, %esi
ja 0x88e8
cmpl %eax, %esi
movq %rdx, %rsi
jl 0x88ca
addq %rdx, %r14
cmpl $0x0, 0x1c126(%rip)     # 0x24a18
je 0x8948
movl 0xae3a(%rip), %eax      # 0x13734
leaq 0x7bc3f(%rip), %rsi     # 0x84540
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 0x8948
incl 0x1c10b(%rip)           # 0x24a2c
leaq 0x3bf7(%rip), %rdi      # 0xc51f
xorl %eax, %eax
callq 0x2af7
pushq $0x1
popq %rdi
callq 0x22f0
leaq 0x1(%rbx), %rdi
pushq $0x3d
popq %rsi
callq 0x2f15
testq %rax, %rax
je 0x89a6
movq %r14, %rdi
callq 0x5dfd
testq %rax, %rax
je 0x877a
movq %rax, %r14
movzbl (%rax), %eax
cmpl $0x2e, %eax
je 0x8981
cmpl $0x5f, %eax
je 0x8981
movsbq %al, %r15
callq 0x2320
movq (%rax), %rax
testb $0x4, 0x1(%rax,%r15,2)
je 0x8a07
leaq 0x3a43(%rip), %rsi      # 0xc3cb
movq %r14, %rdi
callq 0x269d
testq %rax, %rax
je 0x89de
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x7f23
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2d99
cmpl $0x0, 0x1c05d(%rip)     # 0x24a18
jne 0x877a
callq 0x2c67
movq 0x1c03b(%rip), %rsi     # 0x24a08
pushq $0xa
popq %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x21a0
movq %r14, %rdi
callq 0x2ea3
movl %eax, 0x7bb0c(%rip)     # 0x844f8
testl %eax, %eax
jns 0x8a07
movq %r14, %rdi
callq 0x8473
testl %eax, %eax
js 0x8a4f
movq %r14, %rdi
callq 0x2110
addq %rax, %r14
cmpl $0x0, 0x7baa2(%rip)     # 0x844b0
jne 0x877a
movzbl (%r14), %eax
testl %eax, %eax
je 0x877a
cmpl $0x3b, %eax
je 0x877a
cmpl $0x2a, %eax
je 0x8abb
cmpl $0x26, %eax
jne 0x8acf
incq %r14
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2fc3
cmpq %rbx, %r14
je 0x8b9d
leaq 0x3ad7(%rip), %rsi      # 0xc536
movq %r14, %rdi
callq 0x274c
movb $0x43, %bl
testq %rax, %rax
jne 0x8b9f
leaq 0x3ac1(%rip), %rsi      # 0xc53a
movq %r14, %rdi
callq 0x274c
testq %rax, %rax
jne 0x8b9f
leaq 0x3aae(%rip), %rsi      # 0xc53f
movq %r14, %rdi
callq 0x274c
testq %rax, %rax
jne 0x8b9f
pushq $0x3d
popq %rsi
movq %r14, %rdi
callq 0x2120
testq %rax, %rax
jne 0x8b9f
jmp 0x8bb2
incq %r14
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x5d0c
movq %r14, %rdi
callq 0x5dfd
testq %rax, %rax
je 0x877a
movq %rax, %rbx
movl 0x7ba0f(%rip), %eax     # 0x844f8
testl %eax, %eax
jns 0x8aff
movq %rbx, %rdi
callq 0x2ea3
movl %eax, 0x7b9fd(%rip)     # 0x844f8
testl %eax, %eax
js 0x8b34
movl %eax, %eax
imulq $0x28, %rax, %rax
leaq 0x86b4(%rip), %rdi      # 0x111c0
addq %rax, %rdi
callq 0x2110
leaq (%rax,%rbx), %rdi
callq 0x31b3
movq %rbx, %rdi
callq 0x2110
addq %rax, %rbx
leaq 0x1b471(%rip), %rdi     # 0x23fa0
callq 0x6b3c
cmpl $0x0, 0x867d(%rip)      # 0x111b8
je 0x8b55
cmpl $0x0, 0x1bed4(%rip)     # 0x24a18
jne 0x8b55
movq 0x1bebb(%rip), %rsi     # 0x24a08
pushq $0xa
popq %rdi
callq 0x21a0
movzbl (%rbx), %eax
cmpq $0x3b, %rax
ja 0x8b72
movabsq $0x800040000000001, %rcx # imm = 0x800040000000001
btq %rax, %rcx
jb 0x877a
leaq 0x3875(%rip), %rdi      # 0xc3ee
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2130
incl 0x1bea3(%rip)           # 0x24a2c
movq %rbx, %rdi
callq 0x2a71
leaq 0x39ab(%rip), %rdi      # 0xc543
jmp 0x8928
movb $0x20, %bl
movzbl %bl, %edx
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x32ce
movq %rax, %r14
movq %r14, %rdi
callq 0x2675
cmpb $0x0, (%rax)
je 0x8be3
movq %rax, %r14
movq %rax, %rdi
callq 0x8473
testl %eax, %eax
jns 0x89fc
movzbl (%r14), %eax
cmpl $0x3b, %eax
je 0x8be3
testl %eax, %eax
jne 0x8a07
callq 0x2c67
cmpl $0x0, 0x85c9(%rip)      # 0x111b8
je 0x877a
cmpl $0x0, 0x1be1c(%rip)     # 0x24a18
jne 0x877a
movq 0x1bdff(%rip), %rdi     # 0x24a08
movzwl 0xc(%rsp), %edx
leaq 0x2681(%rip), %rsi      # 0xb296
jmp 0x87d9