// File: /workspace/github_c_makefile_star2_O0/Edilbert[P]BS9/bs9.c
// Function: ParseASCII
char *ParseASCII(char *p, unsigned char b[], int *l)
{
   char Delimiter;

   Delimiter = *p++;
   while (*p && *p != Delimiter && *l < ML-1)
   {
      if (*p == '\\') // special character CR, LF, NULL
      {
         ++p;
              if (*p == 'r') b[*l] = 13; // return
         else if (*p == 'f') b[*l] = 12; // form feed
         else if (*p == 'n') b[*l] = 10; // new line
         else if (*p == 't') b[*l] =  9; // tab
         else if (*p == 'a') b[*l] =  7; // alert
         else if (*p == 'e') b[*l] = 27; // escape
         else if (*p == '0') b[*l] =  0; // zero
         else if (*p == 'b') b[*l] = 29; // bold colour
         else if (*p == 's') b[*l] = 28; // standard colour
         else b[*l] = *p;
         ++(*l);
         ++p;
      }
      else
      {
         b[(*l)++] = *p++;
      }
   }
   if (*p == Delimiter) ++p;
   if (*p == '^')
   {
      b[(*l)-1] |= 0x80; // Set bit 7 of last char
      ++p;
   }
   return p;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq -0x8(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rsp)
movb (%rax), %al
movb %al, -0x19(%rsp)
movq -0x8(%rsp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1a(%rsp)
je 0x7bf2
movq -0x8(%rsp), %rax
movsbl (%rax), %ecx
movsbl -0x19(%rsp), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x1a(%rsp)
je 0x7bf2
movq -0x18(%rsp), %rax
cmpl $0xff, (%rax)
setl %al
movb %al, -0x1a(%rsp)
movb -0x1a(%rsp), %al
testb $0x1, %al
jne 0x7bff
jmp 0x7dc1
movq -0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x7d90
movq -0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rsp)
movq -0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x72, %eax
jne 0x7c41
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movslq (%rcx), %rcx
movb $0xd, (%rax,%rcx)
jmp 0x7d74
movq -0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
jne 0x7c64
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movslq (%rcx), %rcx
movb $0xc, (%rax,%rcx)
jmp 0x7d72
movq -0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x6e, %eax
jne 0x7c87
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movslq (%rcx), %rcx
movb $0xa, (%rax,%rcx)
jmp 0x7d70
movq -0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
jne 0x7caa
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movslq (%rcx), %rcx
movb $0x9, (%rax,%rcx)
jmp 0x7d6e
movq -0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jne 0x7ccd
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movslq (%rcx), %rcx
movb $0x7, (%rax,%rcx)
jmp 0x7d6c
movq -0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x65, %eax
jne 0x7ced
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movslq (%rcx), %rcx
movb $0x1b, (%rax,%rcx)
jmp 0x7d6a
movq -0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x7d0d
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movslq (%rcx), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x7d68
movq -0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x62, %eax
jne 0x7d2d
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movslq (%rcx), %rcx
movb $0x1d, (%rax,%rcx)
jmp 0x7d66
movq -0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x73, %eax
jne 0x7d4d
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movslq (%rcx), %rcx
movb $0x1c, (%rax,%rcx)
jmp 0x7d64
movq -0x8(%rsp), %rax
movb (%rax), %dl
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movslq (%rcx), %rcx
movb %dl, (%rax,%rcx)
jmp 0x7d66
jmp 0x7d68
jmp 0x7d6a
jmp 0x7d6c
jmp 0x7d6e
jmp 0x7d70
jmp 0x7d72
jmp 0x7d74
movq -0x18(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rsp)
jmp 0x7dbc
movq -0x8(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rsp)
movb (%rax), %dl
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rsi
movl (%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, (%rsi)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x7bb6
movq -0x8(%rsp), %rax
movsbl (%rax), %eax
movsbl -0x19(%rsp), %ecx
cmpl %ecx, %eax
jne 0x7de0
movq -0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rsp)
movq -0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x5e, %eax
jne 0x7e1a
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
orl $0x80, %edx
movb %dl, (%rax,%rcx)
movq -0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq