// File: /workspace/github_c_makefile_star2_O0/Edilbert[P]BS9/bs9.c
// Function: ParseStoreData
char *ParseStoreData(char *p)
{
   int Start,Length,FileFormat,Entry;
   char *Filename,*EndPtr;

   if (Pass) return p + strlen(p);
   p = EvalOperand(p,&Start,0);
   if (Start < 0 || Start > 0xfffff)
   {
      ErrorMsg("Illegal start address for STORE %d\n",Start);
      exit(1);
   }
   p = NeedChar(p,',');
   if (!p)
   {
      ErrorMsg("Missing ',' after start address\n");
      exit(1);
   }
   p = EvalOperand(p+1,&Length,0);
   if (Length < 0 || Length > 0x10000)
   {
      ErrorMsg("Illegal length for STORE %d\n",Length);
      exit(1);
   }
   p = NeedChar(p,',');
   if (!p)
   {
      ErrorMsg("Missing ',' after length\n");
      exit(1);
   }
   p = NeedChar(p+1,'"');
   if (!p)
   {
      ErrorMsg("Missing quote for filename\n");
      exit(1);
   }
   EndPtr = ++p;
   while (*EndPtr != '\0' && *EndPtr != '"') ++EndPtr;
   Filename = (char *)StrNDup(p, EndPtr - p);
   FileFormat = BINARY;
   Entry = -1;
   p = NeedChar(EndPtr+1,',');
   if (p)
   {
      ++p;
           if (StrMatch(p, "BIN"))  FileFormat = BINARY;
      else if (StrMatch(p, "SREC")) FileFormat = SRECORD;
      else if (StrMatch(p, "S19"))  FileFormat = SRECORD;
      else if (StrMatch(p, "SPARROW"))  FileFormat = SPARROW;
      else
      {
         ErrorMsg("Unknown output file format\n");
         exit(1);
      }
      if (df) fprintf(df,"Filefornat = %d\n",FileFormat);
      p = NeedChar(p,',');
      if (p)
      {
         p = EvalOperand(p+1,&Entry,0);
         if (Entry < 0 || Entry > 0xffff)
         {
            ErrorMsg("Illegal execution start address for STORE %d\n",Entry);
            exit(1);
         }
      } else p = EndPtr;
   } else p = EndPtr;

   SFA[StoreCount] = Start;
   SFL[StoreCount] = Length;
   SFE[StoreCount] = Entry;
   SFF[StoreCount] = Filename;
   SFT[StoreCount] = FileFormat;
   if (df)
   {
      fprintf(df,"Storing %4.4x - %4.4x <%s>,",
           Start,Start+Length-1,Filename);
           if (FileFormat == SPARROW) fprintf(df,"SPARROW\n");
      else if (FileFormat == SRECORD) fprintf(df,"SRECORD\n");
      else                            fprintf(df,"BINARY\n");
   }
   if (StoreCount < SFMAX) ++StoreCount;
   else
   {
      ErrorMsg("number of storage files exceeds %d\n",SFMAX);
      exit(1);
   }
   PrintLine();
   p += strlen(p);
   return p;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
cmpl $0x0, 0x21af8(%rip)     # 0x289f8
je 0x6f2b
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rdi
callq 0x20f0
movq %rax, %rcx
movq 0x10(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x40(%rsp)
jmp 0x7397
movq 0x38(%rsp), %rdi
leaq 0x34(%rsp), %rsi
xorl %edx, %edx
callq 0x4740
movq %rax, 0x38(%rsp)
cmpl $0x0, 0x34(%rsp)
jl 0x6f52
cmpl $0xfffff, 0x34(%rsp)    # imm = 0xFFFFF
jle 0x6f6e
movl 0x34(%rsp), %esi
leaq 0x9753(%rip), %rdi      # 0x106b0
movb $0x0, %al
callq 0x3150
movl $0x1, %edi
callq 0x22b0
movq 0x38(%rsp), %rdi
movl $0x2c, %esi
callq 0x36a0
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x6fa2
leaq 0x9743(%rip), %rdi      # 0x106d4
movb $0x0, %al
callq 0x3150
movl $0x1, %edi
callq 0x22b0
movq 0x38(%rsp), %rdi
addq $0x1, %rdi
leaq 0x30(%rsp), %rsi
xorl %edx, %edx
callq 0x4740
movq %rax, 0x38(%rsp)
cmpl $0x0, 0x30(%rsp)
jl 0x6fcd
cmpl $0x10000, 0x30(%rsp)    # imm = 0x10000
jle 0x6fe9
movl 0x30(%rsp), %esi
leaq 0x971d(%rip), %rdi      # 0x106f5
movb $0x0, %al
callq 0x3150
movl $0x1, %edi
callq 0x22b0
movq 0x38(%rsp), %rdi
movl $0x2c, %esi
callq 0x36a0
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x701d
leaq 0x9706(%rip), %rdi      # 0x10712
movb $0x0, %al
callq 0x3150
movl $0x1, %edi
callq 0x22b0
movq 0x38(%rsp), %rdi
addq $0x1, %rdi
movl $0x22, %esi
callq 0x36a0
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x7055
leaq 0x96e8(%rip), %rdi      # 0x1072c
movb $0x0, %al
callq 0x3150
movl $0x1, %edi
callq 0x22b0
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0xf(%rsp)
je 0x708d
movq 0x18(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x7097
jmp 0x70a7
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x7068
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rcx, %rax
movl %eax, %esi
callq 0x26b0
movq %rax, 0x20(%rsp)
movl $0x0, 0x2c(%rsp)
movl $0xffffffff, 0x28(%rsp) # imm = 0xFFFFFFFF
movq 0x18(%rsp), %rdi
addq $0x1, %rdi
movl $0x2c, %esi
callq 0x36a0
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x7240
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
leaq 0x9635(%rip), %rsi      # 0x10748
callq 0x2880
cmpq $0x0, %rax
je 0x712b
movl $0x0, 0x2c(%rsp)
jmp 0x71ac
movq 0x38(%rsp), %rdi
leaq 0x9615(%rip), %rsi      # 0x1074c
callq 0x2880
cmpq $0x0, %rax
je 0x714c
movl $0x1, 0x2c(%rsp)
jmp 0x71aa
movq 0x38(%rsp), %rdi
leaq 0xa57e(%rip), %rsi      # 0x116d6
callq 0x2880
cmpq $0x0, %rax
je 0x716d
movl $0x1, 0x2c(%rsp)
jmp 0x71a8
movq 0x38(%rsp), %rdi
leaq 0x95d8(%rip), %rsi      # 0x10751
callq 0x2880
cmpq $0x0, %rax
je 0x718e
movl $0x2, 0x2c(%rsp)
jmp 0x71a6
leaq 0x95c4(%rip), %rdi      # 0x10759
movb $0x0, %al
callq 0x3150
movl $0x1, %edi
callq 0x22b0
jmp 0x71a8
jmp 0x71aa
jmp 0x71ac
cmpq $0x0, 0x2183c(%rip)     # 0x289f0
je 0x71cf
movq 0x21833(%rip), %rdi     # 0x289f0
movl 0x2c(%rsp), %edx
leaq 0x95ad(%rip), %rsi      # 0x10775
movb $0x0, %al
callq 0x21e0
movq 0x38(%rsp), %rdi
movl $0x2c, %esi
callq 0x36a0
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x7234
movq 0x38(%rsp), %rdi
addq $0x1, %rdi
leaq 0x28(%rsp), %rsi
xorl %edx, %edx
callq 0x4740
movq %rax, 0x38(%rsp)
cmpl $0x0, 0x28(%rsp)
jl 0x7216
cmpl $0xffff, 0x28(%rsp)     # imm = 0xFFFF
jle 0x7232
movl 0x28(%rsp), %esi
leaq 0x9565(%rip), %rdi      # 0x10786
movb $0x0, %al
callq 0x3150
movl $0x1, %edi
callq 0x22b0
jmp 0x723e
movq 0x18(%rsp), %rax
movq %rax, 0x38(%rsp)
jmp 0x724a
movq 0x18(%rsp), %rax
movq %rax, 0x38(%rsp)
movl 0x34(%rsp), %edx
movslq 0x20afb(%rip), %rcx     # 0x27d50
leaq 0x81004(%rip), %rax     # 0x88260
movl %edx, (%rax,%rcx,4)
movl 0x30(%rsp), %edx
movslq 0x20ae6(%rip), %rcx     # 0x27d50
leaq 0x8103f(%rip), %rax     # 0x882b0
movl %edx, (%rax,%rcx,4)
movl 0x28(%rsp), %edx
movslq 0x20ad1(%rip), %rcx     # 0x27d50
leaq 0x8107a(%rip), %rax     # 0x88300
movl %edx, (%rax,%rcx,4)
movq 0x20(%rsp), %rdx
movslq 0x20abb(%rip), %rcx     # 0x27d50
leaq 0x810b4(%rip), %rax     # 0x88350
movq %rdx, (%rax,%rcx,8)
movl 0x2c(%rsp), %edx
movslq 0x20aa5(%rip), %rcx     # 0x27d50
leaq 0x8113e(%rip), %rax     # 0x883f0
movl %edx, (%rax,%rcx,4)
cmpq $0x0, 0x21733(%rip)     # 0x289f0
je 0x733d
movq 0x2172a(%rip), %rdi     # 0x289f0
movl 0x34(%rsp), %edx
movl 0x34(%rsp), %ecx
addl 0x30(%rsp), %ecx
subl $0x1, %ecx
movq 0x20(%rsp), %r8
leaq 0x94d3(%rip), %rsi      # 0x107b4
movb $0x0, %al
callq 0x21e0
cmpl $0x2, 0x2c(%rsp)
jne 0x7306
movq 0x216fa(%rip), %rdi     # 0x289f0
leaq 0x94d3(%rip), %rsi      # 0x107d0
movb $0x0, %al
callq 0x21e0
jmp 0x733b
cmpl $0x1, 0x2c(%rsp)
jne 0x7324
movq 0x216dc(%rip), %rdi     # 0x289f0
leaq 0x94be(%rip), %rsi      # 0x107d9
movb $0x0, %al
callq 0x21e0
jmp 0x7339
movq 0x216c5(%rip), %rdi     # 0x289f0
leaq 0x94b0(%rip), %rsi      # 0x107e2
movb $0x0, %al
callq 0x21e0
jmp 0x733b
jmp 0x733d
cmpl $0x14, 0x20a0c(%rip)    # 0x27d50
jge 0x7357
movl 0x20a04(%rip), %eax     # 0x27d50
addl $0x1, %eax
movl %eax, 0x209fb(%rip)     # 0x27d50
jmp 0x7374
leaq 0x948c(%rip), %rdi      # 0x107ea
movl $0x14, %esi
movb $0x0, %al
callq 0x3150
movl $0x1, %edi
callq 0x22b0
callq 0x34c0
movq 0x38(%rsp), %rdi
callq 0x20f0
addq 0x38(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)