// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/alphabet.c
// Function: read_symbolmap_from_lines
static int read_symbolmap_from_lines(GtAlphabet *alpha,
                                     const char *mapfile,
                                     const GtStrArray *lines,
                                     GtError *err)
{
  char cc;
  unsigned int cnum, allocateddomainsize = 0;
  GtUword linecount, column;
  bool blankfound, ignore, preamble = true, haserr = false;
  const char *currentline;
  GtUchar chartoshow;

  gt_error_check(err);
  alpha->alphadef = gt_str_new();
  alpha->domainsize = alpha->mapsize = alpha->mappedwildcards = 0;
  for (cnum=0; cnum<=(unsigned int) GT_MAXALPHABETCHARACTER; cnum++)
  {
    alpha->symbolmap[cnum] = (GtUchar) GT_UNDEFCHAR;
  }
  alpha->mapdomain = NULL;
  alpha->characters = gt_malloc(sizeof (GtUchar) *
                                (gt_str_array_size(lines)-1));
  for (linecount = 0; linecount < gt_str_array_size(lines); linecount++)
  {
    currentline = gt_str_array_get(lines,linecount);
    gt_str_append_cstr(alpha->alphadef, currentline);
    gt_str_append_char(alpha->alphadef, '\n');
    ignore = false;
    if (currentline != NULL && currentline[0] != '\0')
    {
      if (preamble)
      {
        if (LINE(0) == (GtUchar) '#')
        {
          ignore = true;
        } else
        {
          preamble = false;
        }
      }
      if (!ignore)
      {
        blankfound = false;
        for (column=0; LINE(column) != '\0'; column++)
        { /* for all chars in line */
          cc = LINE(column);
          if (ispunct((int) cc) || isalnum((int) cc))
          {
            if (alpha->symbolmap[(unsigned int) cc] != (GtUchar) GT_UNDEFCHAR)
            {
              gt_error_set(err,"cannot map symbol '%c' to %u: "
                            "it is already mapped to %u",
                             cc,
                             alpha->mapsize,
                             (unsigned int) alpha->
                                            symbolmap[(unsigned int) cc]);
              haserr = true;
              break;
            }
            /* get same value */
            alpha->symbolmap[(unsigned int) cc] = (GtUchar) alpha->mapsize;
            if (alpha->domainsize >= allocateddomainsize)
            {
              allocateddomainsize += 8;
              alpha->mapdomain = gt_realloc(alpha->mapdomain,
                                        sizeof (GtUchar) * allocateddomainsize);
            }
            gt_assert(alpha->mapdomain != NULL);
            alpha->mapdomain[alpha->domainsize++] = (GtUchar) cc;
          } else
          {
            if (cc == (GtUchar) ' ')    /* first blank in line found */
            {
              blankfound = true;
              /*@innerbreak@*/ break;
            }
            if (mapfile != NULL) {
              gt_error_set(err,
                           "illegal character '%c' in line " GT_WU
                           " of mapfile %s",
                           cc, linecount,mapfile);
            } else {
              gt_error_set(err,
                           "illegal character '%c' in line " GT_WU
                           " of alphabet definition",
                           cc, linecount);
            }
            haserr = true;
            break;
          }
        }
        if (haserr)
        {
          break;
        }
        if (blankfound)
        {
          if (isspace((int) LINE(column+1)))
          {
            if (mapfile != NULL) {
              gt_error_set(err,"illegal character '%c' at the end of "
                           "line "GT_WU" in mapfile %s",
                           LINE(column+1),linecount,mapfile);
            } else {
              gt_error_set(err,"illegal character '%c' at the end of "
                           "line "GT_WU" of alphabet definition",
                           LINE(column+1),linecount);
            }
            haserr  = true;
            break;
          }
          /* use next character to display character */
          chartoshow = (GtUchar) LINE(column+1);
        } else
        {
          /* use first character of line to display character */
          chartoshow = (GtUchar) LINE(0);
        }
        if (linecount == gt_str_array_size(lines)-1)
        {
          alpha->wildcardshow = chartoshow;
        } else
        {
          alpha->characters[alpha->mapsize] = chartoshow;
        }
        alpha->mapsize++;
      }
    }
  }
  if (!haserr)
  {
    for (cnum=0;cnum<=(unsigned int) GT_MAXALPHABETCHARACTER; cnum++)
    {
      if (alpha->symbolmap[cnum] == (GtUchar) (alpha->mapsize - 1))
      {
        alpha->symbolmap[cnum] = (GtUchar) GT_WILDCARD;
        alpha->mappedwildcards++;
      }
    }
  }
  /* there are mapsize-1 characters plus wildcard plus separator.
     hence there are mapsize+1 symbols in the range 0..mapsize.
     that is, mapsize is the largest symbol and we obtain */
  alpha->bitspersymbol
    = gt_determinebitspervalue((GtUword) alpha->mapsize);
  return haserr ? -1 : 0;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movl $0x0, 0x3c(%rsp)
movb $0x1, 0x25(%rsp)
movb $0x0, 0x24(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x10b3ca
movq 0x48(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x10b392
jmp 0x10b3ca
movq 0xa8c3f(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x52cc3(%rip), %rsi     # 0x15e066
leaq 0x5329e(%rip), %rdx     # 0x15e648
leaq 0x78c1e(%rip), %rcx     # 0x183fcf
leaq 0x7866a(%rip), %r8      # 0x183a22
movl $0xad, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x10b3cc
callq 0x18f00
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x130(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x8(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x4(%rax)
movq 0x60(%rsp), %rax
movl $0x0, (%rax)
movl $0x0, 0x40(%rsp)
cmpl $0xff, 0x40(%rsp)
ja 0x10b430
movq 0x60(%rsp), %rax
movl 0x40(%rsp), %ecx
movb $-0x3, 0x15(%rax,%rcx)
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x40(%rsp)
jmp 0x10b40b
movq 0x60(%rsp), %rax
movq $0x0, 0x118(%rax)
movq 0x50(%rsp), %rdi
callq 0x1b720
movq %rax, %rdi
subq $0x1, %rdi
shlq $0x0, %rdi
leaq 0x785c6(%rip), %rsi     # 0x183a22
movl $0xb6, %edx
callq 0xd2e0
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x120(%rax)
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rdi
callq 0x1b720
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x10b87c
movq 0x50(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x1b320
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rax
movq 0x130(%rax), %rdi
movq 0x18(%rsp), %rsi
callq 0x18fb0
movq 0x60(%rsp), %rax
movq 0x130(%rax), %rdi
movl $0xa, %esi
callq 0x194d0
movb $0x0, 0x26(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x10b867
movq 0x18(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x10b867
testb $0x1, 0x25(%rsp)
je 0x10b527
movq 0x18(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x10b520
movb $0x1, 0x26(%rsp)
jmp 0x10b525
movb $0x0, 0x25(%rsp)
jmp 0x10b527
testb $0x1, 0x26(%rsp)
jne 0x10b865
movb $0x0, 0x27(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x18(%rsp), %rax
movq 0x28(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x10b746
movq 0x18(%rsp), %rax
movq 0x28(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0x47(%rsp)
callq 0xb6b0
movq (%rax), %rax
movsbl 0x47(%rsp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x10b5a4
callq 0xb6b0
movq (%rax), %rax
movsbl 0x47(%rsp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x10b6d0
movq 0x60(%rsp), %rax
movsbl 0x47(%rsp), %ecx
movl %ecx, %ecx
movzbl 0x15(%rax,%rcx), %eax
cmpl $0xfd, %eax
je 0x10b5f8
movq 0x48(%rsp), %rdi
movsbl 0x47(%rsp), %edx
movq 0x60(%rsp), %rax
movl 0x4(%rax), %ecx
movq 0x60(%rsp), %rax
movsbl 0x47(%rsp), %esi
movl %esi, %esi
movzbl 0x15(%rax,%rsi), %r8d
leaq 0x78a02(%rip), %rsi     # 0x183fe9
movb $0x0, %al
callq 0xc0d0
movb $0x1, 0x24(%rsp)
jmp 0x10b746
movq 0x60(%rsp), %rax
movl 0x4(%rax), %eax
movb %al, %dl
movq 0x60(%rsp), %rax
movsbl 0x47(%rsp), %ecx
movl %ecx, %ecx
movb %dl, 0x15(%rax,%rcx)
movq 0x60(%rsp), %rax
movl (%rax), %eax
cmpl 0x3c(%rsp), %eax
jb 0x10b660
movl 0x3c(%rsp), %eax
addl $0x8, %eax
movl %eax, 0x3c(%rsp)
movq 0x60(%rsp), %rax
movq 0x118(%rax), %rdi
movl 0x3c(%rsp), %eax
movl %eax, %esi
shlq $0x0, %rsi
leaq 0x783db(%rip), %rdx     # 0x183a22
movl $0xe2, %ecx
callq 0xd730
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x118(%rax)
jmp 0x10b662
movq 0x60(%rsp), %rax
cmpq $0x0, 0x118(%rax)
jne 0x10b6a9
movq 0xa8960(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x529e4(%rip), %rsi     # 0x15e066
leaq 0x78999(%rip), %rdx     # 0x184022
leaq 0x7893f(%rip), %rcx     # 0x183fcf
leaq 0x7838b(%rip), %r8      # 0x183a22
movl $0xe4, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x10b6ab
movb 0x47(%rsp), %dl
movq 0x60(%rsp), %rax
movq 0x118(%rax), %rax
movq 0x60(%rsp), %rsi
movl (%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, (%rsi)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
jmp 0x10b731
movsbl 0x47(%rsp), %eax
cmpl $0x20, %eax
jne 0x10b6e1
movb $0x1, 0x27(%rsp)
jmp 0x10b746
cmpq $0x0, 0x58(%rsp)
je 0x10b70d
movq 0x48(%rsp), %rdi
movsbl 0x47(%rsp), %edx
movq 0x30(%rsp), %rcx
movq 0x58(%rsp), %r8
leaq 0x78937(%rip), %rsi     # 0x18403b
movb $0x0, %al
callq 0xc0d0
jmp 0x10b72a
movq 0x48(%rsp), %rdi
movsbl 0x47(%rsp), %edx
movq 0x30(%rsp), %rcx
leaq 0x78949(%rip), %rsi     # 0x18406c
movb $0x0, %al
callq 0xc0d0
movb $0x1, 0x24(%rsp)
jmp 0x10b746
jmp 0x10b733
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x10b540
testb $0x1, 0x24(%rsp)
je 0x10b752
jmp 0x10b87c
testb $0x1, 0x27(%rsp)
je 0x10b800
callq 0xb6b0
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %rdx
movsbl 0x1(%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x10b7ec
cmpq $0x0, 0x58(%rsp)
je 0x10b7bb
movq 0x48(%rsp), %rdi
movq 0x18(%rsp), %rax
movq 0x28(%rsp), %rcx
movsbl 0x1(%rax,%rcx), %edx
movq 0x30(%rsp), %rcx
movq 0x58(%rsp), %r8
leaq 0x788f4(%rip), %rsi     # 0x1840a6
movb $0x0, %al
callq 0xc0d0
jmp 0x10b7e2
movq 0x48(%rsp), %rdi
movq 0x18(%rsp), %rax
movq 0x28(%rsp), %rcx
movsbl 0x1(%rax,%rcx), %edx
movq 0x30(%rsp), %rcx
leaq 0x78907(%rip), %rsi     # 0x1840e2
movb $0x0, %al
callq 0xc0d0
movb $0x1, 0x24(%rsp)
jmp 0x10b87c
movq 0x18(%rsp), %rax
movq 0x28(%rsp), %rcx
movb 0x1(%rax,%rcx), %al
movb %al, 0x17(%rsp)
jmp 0x10b80b
movq 0x18(%rsp), %rax
movb (%rax), %al
movb %al, 0x17(%rsp)
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq 0x50(%rsp), %rdi
callq 0x1b720
movq %rax, %rcx
movq (%rsp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jne 0x10b83c
movb 0x17(%rsp), %cl
movq 0x60(%rsp), %rax
movb %cl, 0x14(%rax)
jmp 0x10b857
movb 0x17(%rsp), %dl
movq 0x60(%rsp), %rax
movq 0x120(%rax), %rax
movq 0x60(%rsp), %rcx
movl 0x4(%rcx), %ecx
movb %dl, (%rax,%rcx)
movq 0x60(%rsp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x10b867
jmp 0x10b869
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x10b47e
testb $0x1, 0x24(%rsp)
jne 0x10b8e2
movl $0x0, 0x40(%rsp)
cmpl $0xff, 0x40(%rsp)
ja 0x10b8e0
movq 0x60(%rsp), %rax
movl 0x40(%rsp), %ecx
movzbl 0x15(%rax,%rcx), %eax
movq 0x60(%rsp), %rcx
movl 0x4(%rcx), %ecx
subl $0x1, %ecx
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x10b8d1
movq 0x60(%rsp), %rax
movl 0x40(%rsp), %ecx
movb $-0x2, 0x15(%rax,%rcx)
movq 0x60(%rsp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x10b8d3
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x40(%rsp)
jmp 0x10b88b
jmp 0x10b8e2
movq 0x60(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %edi
callq 0x8c6d0
movl %eax, %ecx
movq 0x60(%rsp), %rax
movl %ecx, 0xc(%rax)
movb 0x24(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)