// File: /workspace/github_c_makefile_star2_O0/Edilbert[P]BS9/bs9.c
// Function: Parsebit5Data
char *Parsebit5Data(char *p)
{
   char c;
   int i,v;

   p = SkipSpace(p);
   if (strlen(p) < 7 || p[0] != '"' || p[6] != '"')
   {
      ErrorMsg("Need 5 character string\n");
      ErrorLine(p);
      exit(1);
   }

   // pack 5 characters into 20 bit

   // '?' ->  0
   // ' ' ->  1
   // 'A' ->  2
   // 'Z' -> 27
   // '2' -> 28
   // '3' -> 29

   v = 0;
   for (i=4 ; i > 0 ; --i)
   {
      c = p[i];
      if (c == ' ') c = 0x40;
      if (c == '2') c = 'Z'+1;
      if (c == '3') c = 'Z'+2;
      if (c < '?' || c > 'Z'+2)
      {
         ErrorMsg("illegal character\n");
         ErrorLine(p);
         exit(1);
      }
      v = (v << 5) | (c - '?');
   }
        if (p[5] == 'C') v |= (1 << 20);
   else if (p[5] == 'D') v |= (2 << 20);
   else if (p[5] == 'R') v |= (3 << 20);
   else if (p[5] == 'W') v |= (4 << 20);

   if (!Pass)
   {
      if (ListOn) fprintf(lf," %6.6x       %s\n",v,Line);
      for (i=2 ; i >= 0 ; --i)
      {
         PutByte(pc+i,v);
         v >>= 8;
      }
   }
   pc += 3;
   return p+7;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x2830
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x20f0
cmpq $0x7, %rax
jb 0x8403
movq 0x10(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x8403
movq 0x10(%rsp), %rax
movsbl 0x6(%rax), %eax
cmpl $0x22, %eax
je 0x8425
leaq 0x85e8(%rip), %rdi      # 0x109f2
movb $0x0, %al
callq 0x3150
movq 0x10(%rsp), %rdi
callq 0x3040
movl $0x1, %edi
callq 0x22b0
movl $0x0, 0x4(%rsp)
movl $0x4, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
jle 0x84d9
movq 0x10(%rsp), %rax
movslq 0x8(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0xf(%rsp)
movsbl 0xf(%rsp), %eax
cmpl $0x20, %eax
jne 0x8460
movb $0x40, 0xf(%rsp)
movsbl 0xf(%rsp), %eax
cmpl $0x32, %eax
jne 0x846f
movb $0x5b, 0xf(%rsp)
movsbl 0xf(%rsp), %eax
cmpl $0x33, %eax
jne 0x847e
movb $0x5c, 0xf(%rsp)
movsbl 0xf(%rsp), %eax
cmpl $0x3f, %eax
jl 0x8492
movsbl 0xf(%rsp), %eax
cmpl $0x5c, %eax
jle 0x84b4
leaq 0x8572(%rip), %rdi      # 0x10a0b
movb $0x0, %al
callq 0x3150
movq 0x10(%rsp), %rdi
callq 0x3040
movl $0x1, %edi
callq 0x22b0
movl 0x4(%rsp), %eax
shll $0x5, %eax
movsbl 0xf(%rsp), %ecx
subl $0x3f, %ecx
orl %ecx, %eax
movl %eax, 0x4(%rsp)
movl 0x8(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x8435
movq 0x10(%rsp), %rax
movsbl 0x5(%rax), %eax
cmpl $0x43, %eax
jne 0x84f6
movl 0x4(%rsp), %eax
orl $0x100000, %eax         # imm = 0x100000
movl %eax, 0x4(%rsp)
jmp 0x8551
movq 0x10(%rsp), %rax
movsbl 0x5(%rax), %eax
cmpl $0x44, %eax
jne 0x8513
movl 0x4(%rsp), %eax
orl $0x200000, %eax         # imm = 0x200000
movl %eax, 0x4(%rsp)
jmp 0x854f
movq 0x10(%rsp), %rax
movsbl 0x5(%rax), %eax
cmpl $0x52, %eax
jne 0x8530
movl 0x4(%rsp), %eax
orl $0x300000, %eax         # imm = 0x300000
movl %eax, 0x4(%rsp)
jmp 0x854d
movq 0x10(%rsp), %rax
movsbl 0x5(%rax), %eax
cmpl $0x57, %eax
jne 0x854b
movl 0x4(%rsp), %eax
orl $0x400000, %eax         # imm = 0x400000
movl %eax, 0x4(%rsp)
jmp 0x854d
jmp 0x854f
jmp 0x8551
cmpl $0x0, 0x204a0(%rip)     # 0x289f8
jne 0x85bf
cmpl $0x0, 0xcc37(%rip)      # 0x15198
je 0x8583
movq 0x2047e(%rip), %rdi     # 0x289e8
movl 0x4(%rsp), %edx
leaq 0x84a9(%rip), %rsi      # 0x10a1e
leaq 0x1f904(%rip), %rcx     # 0x27e80
movb $0x0, %al
callq 0x21e0
movl $0x2, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
jl 0x85bd
movl 0xf17c(%rip), %edi      # 0x17714
addl 0x8(%rsp), %edi
movl 0x4(%rsp), %esi
callq 0x23f0
movl 0x4(%rsp), %eax
sarl $0x8, %eax
movl %eax, 0x4(%rsp)
movl 0x8(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x858b
jmp 0x85bf
movl 0xf14f(%rip), %eax      # 0x17714
addl $0x3, %eax
movl %eax, 0xf146(%rip)      # 0x17714
movq 0x10(%rsp), %rax
addq $0x7, %rax
addq $0x18, %rsp
retq
nopl (%rax)