// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/querymatch.c
// Function: gt_querymatch_read_line
void gt_querymatch_read_line(GtQuerymatch *querymatch,
                             double *evalue_ptr,
                             double *bit_score_ptr,
                             const char *line_ptr,
                             const GtSeedExtendDisplayFlag *in_display_flag,
                             bool selfmatch,
                             const GtEncseq *dbencseq,
                             const GtEncseq *queryencseq)
{
  char separator;
  const char *ptr = line_ptr;
  GtUword column, numcolumns, dbend_relative = GT_UWORD_MAX,
          queryend_relative = GT_UWORD_MAX;
  const unsigned int *column_order
    = gt_querymatch_display_order(&numcolumns,in_display_flag);

  querymatch->db_seedpos_rel = GT_UWORD_MAX;
  querymatch->query_seedpos_rel = GT_UWORD_MAX;
  separator = gt_querymatch_blast_display(in_display_flag) ||
              gt_querymatch_tabsep_display(in_display_flag) ? '\t' : ' ';
  for (column = 0; column < numcolumns; column++)
  {
    int ret = 1;

    gt_assert(*ptr != '\0');
    while (isspace(*ptr))
    {
      ptr++;
    }
    switch (column_order[column])
    {
      case Gt_Cigar_display:
      case Gt_Cigarx_display:
        if (querymatch->ref_eoplist != NULL)
        {
          gt_eoplist_reset(querymatch->ref_eoplist);
          gt_eoplist_from_cigar(querymatch->ref_eoplist,ptr,separator);
        } else
        {
          if (column < numcolumns - 1)
          {
            ptr = strchr(ptr,separator);
            gt_assert(ptr != NULL);
          }
        }
        break;
      case Gt_Trace_display:
      case Gt_Dtrace_display:
        if (querymatch->ref_eoplist != NULL)
        {
          gt_eoplist_reset(querymatch->ref_eoplist);
          gt_eoplist_read_trace(querymatch->ref_eoplist,ptr,separator);
        } else
        {
          if (column < numcolumns - 1)
          {
            ptr = strchr(ptr,separator);
            gt_assert(ptr != NULL);
          }
        }
        break;
      case Gt_S_len_display:
        ret = sscanf(ptr,GT_WU,&querymatch->dblen);
        break;
      case Gt_S_seqnum_display:
        ret = sscanf(ptr,GT_WU,&querymatch->dbseqnum);
        break;
      case Gt_Subjectid_display:
        querymatch->db_desc = ptr;
        break;
      case Gt_S_start_display:
        ret = sscanf(ptr,GT_WU,&querymatch->dbstart_relative);
        break;
      case Gt_Strand_display:
        querymatch->query_readmode = gt_readmode_character_code_parse(*ptr);
        break;
      case Gt_Q_len_display:
        ret = sscanf(ptr,GT_WU,&querymatch->querylen);
        break;
      case Gt_Q_end_display:
        ret = sscanf(ptr,GT_WU,&queryend_relative);
        break;
      case Gt_Q_seqnum_display:
        ret = sscanf(ptr,GT_WU,&querymatch->queryseqnum);
        break;
      case Gt_Queryid_display:
        querymatch->query_desc = ptr;
        break;
      case Gt_Q_start_display:
        ret = sscanf(ptr,GT_WU,&querymatch->querystart_fwdstrand);
        break;
      case Gt_Score_display:
        ret = sscanf(ptr,GT_WD,&querymatch->score);
        break;
      case Gt_Editdist_display:
        ret = sscanf(ptr,GT_WU,&querymatch->distance);
        break;
      case Gt_Seed_len_display:
        ret = sscanf(ptr,GT_WU,&querymatch->seedlen);
        break;
      case Gt_Seed_s_display:
        ret = sscanf(ptr,GT_WU,&querymatch->db_seedpos_rel);
        break;
      case Gt_Seed_q_display:
        ret = sscanf(ptr,GT_WU,&querymatch->query_seedpos_rel);
        break;
      case Gt_S_seqlen_display:
        ret = sscanf(ptr,GT_WU,&querymatch->db_seqlen);
        break;
      case Gt_Q_seqlen_display:
        ret = sscanf(ptr,GT_WU,&querymatch->query_seqlen);
        break;
      case Gt_Evalue_display:
        ret = sscanf(ptr,"%le",evalue_ptr);
        break;
      case Gt_Bitscore_display:
        ret = sscanf(ptr,"%le",bit_score_ptr);
        break;
      case Gt_Mismatches_display:
        ret = sscanf(ptr,GT_WU,&querymatch->mismatches);
        break;
      case Gt_S_end_display:
        ret = sscanf(ptr,GT_WU,&dbend_relative);
        break;
      case Gt_Alignmentlength_display:
      case Gt_Identity_display:
      case Gt_Indels_display:
      case Gt_Gapopens_display:
        break;
      default: gt_assert(false);
    }
    if (ret != 1)
    {
      fprintf(stderr,"column[" GT_WU "]: ret = %d, expect %s for \"%s\","
                     "ptr=%s\n",column,ret,
                     gt_querymatch_flag2name(column_order[column]),
                     line_ptr,ptr);
      exit(GT_EXIT_PROGRAMMING_ERROR);
    }
    ptr = strchr(ptr,separator);
  }
  gt_assert(gt_querymatch_s_seqnum_display(in_display_flag) &&
            gt_querymatch_q_seqnum_display(in_display_flag));
  if (!gt_querymatch_s_seqlen_display(in_display_flag))
  {
    querymatch->db_seqlen = gt_encseq_seqlength(dbencseq,querymatch->dbseqnum);
  }
  if (!gt_querymatch_q_seqlen_display(in_display_flag))
  {
    querymatch->query_seqlen
      = gt_encseq_seqlength(queryencseq,querymatch->queryseqnum);
  }
  querymatch->db_seqstart
    = gt_encseq_seqstartpos(dbencseq,querymatch->dbseqnum);
  querymatch->selfmatch = selfmatch;
  querymatch->querystart
    = gt_querymatch_position_convert(querymatch->query_readmode,
                                     gt_querymatch_querylen(querymatch),
                                     querymatch->query_seqlen,
                                     querymatch->querystart_fwdstrand);
  querymatch->query_seqstart = gt_encseq_seqstartpos(queryencseq,
                                                     querymatch->queryseqnum);
  if (!gt_querymatch_s_len_display(in_display_flag))
  {
    gt_assert(gt_querymatch_s_start_display(in_display_flag) &&
              gt_querymatch_s_end_display(in_display_flag) &&
              dbend_relative > querymatch->dbstart_relative);
    querymatch->dblen = dbend_relative - querymatch->dbstart_relative + 1;
  }
  if (!gt_querymatch_q_len_display(in_display_flag))
  {
    gt_assert(gt_querymatch_q_start_display(in_display_flag) &&
              gt_querymatch_q_end_display(in_display_flag));
    if (querymatch->querystart < queryend_relative)
    {
      querymatch->querylen = queryend_relative - querymatch->querystart + 1;
    } else
    {
      querymatch->querylen = querymatch->querystart - queryend_relative + 1;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %r9d, 0xc(%rsp)
movq %r8, %r14
movq %rcx, 0x10(%rsp)
movq %rdx, 0xa8(%rsp)
movq %rsi, 0xa0(%rsp)
movq %rdi, %rbx
movq $-0x1, %rax
movq %rax, 0x28(%rsp)
movq %rax, 0x20(%rsp)
leaq 0x30(%rsp), %rdi
movq %r8, %rsi
callq 0x1ba0b6
movq %rax, 0x18(%rsp)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x58(%rbx)
movq %r14, %rdi
callq 0x1b9e87
movb $0x9, %cl
testb %al, %al
jne 0x1bb9c5
movq %r14, %rdi
callq 0x1b9e77
testb %al, %al
movl $0x9, %eax
movl $0x20, %ecx
cmovnel %eax, %ecx
movq %r14, 0xb0(%rsp)
movq 0x30(%rsp), %r14
testq %r14, %r14
je 0x1bbd33
leaq 0x58(%rbx), %rax
movq %rax, 0x98(%rsp)
leaq 0x60(%rbx), %rax
movq %rax, 0x90(%rsp)
leaq 0x78(%rbx), %rax
movq %rax, 0x88(%rsp)
leaq 0x48(%rbx), %rax
movq %rax, 0x80(%rsp)
leaq 0x18(%rbx), %rax
movq %rax, 0x78(%rsp)
leaq 0x68(%rbx), %rax
movq %rax, 0x70(%rsp)
leaq 0x70(%rbx), %rax
movq %rax, 0x68(%rsp)
leaq 0x80(%rbx), %rax
movq %rax, 0x60(%rsp)
leaq 0x38(%rbx), %rax
movq %rax, 0x58(%rsp)
leaq 0x28(%rbx), %rax
movq %rax, 0x50(%rsp)
leaq 0x40(%rbx), %rax
movq %rax, 0x48(%rsp)
leaq 0x8(%rbx), %rax
movq %rax, 0x40(%rsp)
leaq 0x10(%rbx), %rax
movq %rax, 0x38(%rsp)
movzbl %cl, %r13d
movq 0x10(%rsp), %rbp
xorl %r12d, %r12d
movsbq (%rbp), %r15
testq %r15, %r15
je 0x1bbe86
callq 0x17870
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r15,2)
je 0x1bba93
movsbq 0x1(%rbp), %r15
incq %rbp
jmp 0x1bba81
movq 0x18(%rsp), %rax
movl (%rax,%r12,4), %eax
addl $-0xa, %eax
cmpl $0x1c, %eax
ja 0x1bbedf
leaq 0x1efc15(%rip), %rcx    # 0x3ab6c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xb0(%rbx), %rdi
testq %rdi, %rdi
je 0x1bbd01
callq 0x317d80
movq 0xb0(%rbx), %rdi
movq %rbp, %rsi
movl %r13d, %edx
callq 0x318237
jmp 0x1bbcc3
movq 0xb0(%rbx), %rdi
testq %rdi, %rdi
je 0x1bbce4
callq 0x317d80
movq 0xb0(%rbx), %rdi
movq %rbp, %rsi
movl %r13d, %edx
callq 0x318a2b
jmp 0x1bbcc3
movq %rbp, %rdi
leaq 0x2004a2(%rip), %rsi    # 0x3bbfbc
movq 0x78(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, %rdi
leaq 0x20048e(%rip), %rsi    # 0x3bbfbc
movq 0x50(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, %rdi
leaq 0x20047a(%rip), %rsi    # 0x3bbfbc
movq 0x90(%rsp), %rdx
jmp 0x1bbcb0
cmpb $0x46, %r15b
je 0x1bbd29
movzbl %r15b, %eax
cmpl $0x52, %eax
je 0x1bbd22
cmpl $0x50, %eax
jne 0x1bbeee
movl $0x3, %eax
jmp 0x1bbd2b
movq %rbp, %rdi
leaq 0x200439(%rip), %rsi    # 0x3bbfbc
movq 0x58(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, %rdi
leaq 0x1c072d(%rip), %rsi    # 0x37c2c4
movq 0x60(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, %rdi
leaq 0x200411(%rip), %rsi    # 0x3bbfbc
movq 0x68(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, %rdi
leaq 0x2003fd(%rip), %rsi    # 0x3bbfbc
leaq 0x20(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, %rdi
leaq 0x2003e9(%rip), %rsi    # 0x3bbfbc
movq %rbx, %rdx
jmp 0x1bbcb0
movq %rbp, %rdi
leaq 0x2003d7(%rip), %rsi    # 0x3bbfbc
movq 0x40(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, %rdi
leaq 0x2003c3(%rip), %rsi    # 0x3bbfbc
movq 0x38(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, %rdi
leaq 0x2003af(%rip), %rsi    # 0x3bbfbc
movq 0x70(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, %rdi
leaq 0x20039b(%rip), %rsi    # 0x3bbfbc
movq 0x48(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, %rdi
leaq 0x200387(%rip), %rsi    # 0x3bbfbc
movq 0x88(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, 0xa8(%rbx)
jmp 0x1bbcc3
movq %rbp, %rdi
leaq 0x20036a(%rip), %rsi    # 0x3bbfbc
movq 0x98(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, %rdi
leaq 0x200356(%rip), %rsi    # 0x3bbfbc
leaq 0x28(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, 0xa0(%rbx)
jmp 0x1bbcc3
movq %rbp, %rdi
leaq 0x1efd7a(%rip), %rsi    # 0x3ab9fa
movq 0xa8(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, %rdi
leaq 0x200328(%rip), %rsi    # 0x3bbfbc
movq 0x80(%rsp), %rdx
jmp 0x1bbcb0
movq %rbp, %rdi
leaq 0x1efd52(%rip), %rsi    # 0x3ab9fa
movq 0xa0(%rsp), %rdx
xorl %eax, %eax
callq 0x177f0
movl %eax, %r14d
cmpl $0x1, %eax
jne 0x1bbe8b
movq %rbp, %rdi
movl %r13d, %esi
callq 0x17280
movq %rax, %rbp
incq %r12
movq 0x30(%rsp), %r14
cmpq %r14, %r12
jb 0x1bba6b
jmp 0x1bbd33
decq %r14
cmpq %r14, %r12
jae 0x1bbcc3
movq %rbp, %rdi
movl %r13d, %esi
callq 0x17280
testq %rax, %rax
jne 0x1bbd1d
jmp 0x1bbee4
decq %r14
cmpq %r14, %r12
jae 0x1bbcc3
movq %rbp, %rdi
movl %r13d, %esi
callq 0x17280
testq %rax, %rax
je 0x1bbee9
movq %rax, %rbp
jmp 0x1bbcc3
movl $0x1, %eax
jmp 0x1bbd2b
xorl %eax, %eax
movl %eax, 0x88(%rbx)
jmp 0x1bbcc3
movq 0xb0(%rsp), %r12
movq %r12, %rdi
callq 0x1b9f08
testb %al, %al
je 0x1bbed0
movq %r12, %rdi
callq 0x1b9f68
testb %al, %al
je 0x1bbed0
movq 0xf0(%rsp), %r15
movq %r12, %rdi
callq 0x1ba04a
testb %al, %al
jne 0x1bbd7e
movq (%rbx), %rsi
movq %r15, %rdi
callq 0xeb9d2
movq %rax, 0x18(%rbx)
movq 0xf8(%rsp), %r14
movq %r12, %rdi
callq 0x1ba05b
testb %al, %al
jne 0x1bbda2
movq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0xeb9d2
movq %rax, 0x48(%rbx)
movq (%rbx), %rsi
movq %r15, %rdi
callq 0xeb6ee
movq %rax, 0x20(%rbx)
movl 0xc(%rsp), %eax
movb %al, 0x8c(%rbx)
movl 0x88(%rbx), %edi
movq 0x38(%rbx), %rcx
movq 0x40(%rbx), %rsi
movq 0x48(%rbx), %rdx
callq 0x1badb9
movq %rax, 0x30(%rbx)
movq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0xeb6ee
movq %rax, 0x50(%rbx)
movq %r12, %rdi
callq 0x1b9ef7
testb %al, %al
jne 0x1bbe28
movq %r12, %rdi
callq 0x1b9f25
testb %al, %al
je 0x1bbed5
movq %r12, %rdi
callq 0x1b9f35
testb %al, %al
je 0x1bbed5
movq 0x28(%rsp), %rax
subq 0x8(%rbx), %rax
jbe 0x1bbed5
incq %rax
movq %rax, 0x10(%rbx)
movq %r12, %rdi
callq 0x1b9f57
testb %al, %al
jne 0x1bbe74
movq %r12, %rdi
callq 0x1b9f8a
testb %al, %al
je 0x1bbeda
movq %r12, %rdi
callq 0x1b9f99
testb %al, %al
je 0x1bbeda
movq 0x20(%rsp), %rax
movq 0x30(%rbx), %rcx
movq %rax, %rdx
subq %rcx, %rdx
negq %rdx
subq %rcx, %rax
cmovbeq %rdx, %rax
incq %rax
movq %rax, 0x40(%rbx)
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6800f
movq 0x2fd0ee(%rip), %rax    # 0x4b8f80
movq (%rax), %rbx
movq 0x18(%rsp), %rax
movl (%rax,%r12,4), %edi
callq 0x1ba8b3
movq %rbp, (%rsp)
leaq 0x1efb50(%rip), %rsi    # 0x3ab9fe
movq %rbx, %rdi
movq %r12, %rdx
movl %r14d, %ecx
movq %rax, %r8
movq 0x10(%rsp), %r9
xorl %eax, %eax
callq 0x17ab0
movl $0x2, %edi
callq 0x17940
callq 0x68048
callq 0x68081
callq 0x680ba
callq 0x67fd6
callq 0x67f64
callq 0x67f9d
callq 0x67f2b