// File: /workspace/github_c_makefile_star2_O1/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 0x1c2d55
movq %rax, 0x18(%rsp)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x58(%rbx)
movq %r14, %rdi
callq 0x1c2b17
movb $0x9, %cl
testb %al, %al
jne 0x1c4730
movq %r14, %rdi
callq 0x1c2b07
testb %al, %al
movl $0x9, %eax
movl $0x20, %ecx
cmovnel %eax, %ecx
movq %r14, 0xb0(%rsp)
movq 0x30(%rsp), %r15
testq %r15, %r15
je 0x1c4aaf
leaq 0x58(%rbx), %rax
movq %rax, 0x68(%rsp)
leaq 0x60(%rbx), %rax
movq %rax, 0x98(%rsp)
leaq 0x78(%rbx), %rax
movq %rax, 0x60(%rsp)
leaq 0x48(%rbx), %rax
movq %rax, 0x58(%rsp)
leaq 0x18(%rbx), %rax
movq %rax, 0x90(%rsp)
leaq 0x68(%rbx), %rax
movq %rax, 0x50(%rsp)
leaq 0x70(%rbx), %rax
movq %rax, 0x88(%rsp)
leaq 0x80(%rbx), %rax
movq %rax, 0x80(%rsp)
leaq 0x38(%rbx), %rax
movq %rax, 0x78(%rsp)
leaq 0x28(%rbx), %rax
movq %rax, 0x48(%rsp)
leaq 0x40(%rbx), %rax
movq %rax, 0x70(%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
cmpb $0x0, (%rbp)
je 0x1c4c47
callq 0x17870
movq (%rax), %rcx
decq %rbp
movsbq 0x1(%rbp), %rax
incq %rbp
testb $0x20, 0x1(%rcx,%rax,2)
jne 0x1c47eb
movq 0x18(%rsp), %rcx
movl (%rcx,%r12,4), %ecx
addl $-0xa, %ecx
cmpl $0x1c, %ecx
ja 0x1c4c5b
leaq 0x1f04be(%rip), %rdx    # 0x3b4cd4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0xb0(%rbx), %rdi
testq %rdi, %rdi
je 0x1c4a4a
callq 0x322120
movq 0xb0(%rbx), %rdi
movq %rbp, %rsi
movl %r13d, %edx
callq 0x322539
jmp 0x1c4a80
movq 0xb0(%rbx), %rdi
testq %rdi, %rdi
je 0x1c4a27
callq 0x322120
movq 0xb0(%rbx), %rdi
movq %rbp, %rsi
movl %r13d, %edx
callq 0x322d11
jmp 0x1c4a80
movq %rbp, %rdi
leaq 0x200dab(%rip), %rsi    # 0x3c562c
movq 0x90(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, %rdi
leaq 0x200d94(%rip), %rsi    # 0x3c562c
movq 0x48(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, %rdi
leaq 0x200d80(%rip), %rsi    # 0x3c562c
movq 0x98(%rsp), %rdx
jmp 0x1c4a1b
movzbl %al, %eax
cmpl $0x46, %eax
je 0x1c4a78
cmpl $0x52, %eax
je 0x1c4a71
cmpl $0x50, %eax
jne 0x1c4c6a
movl $0x3, %eax
jmp 0x1c4a7a
movq %rbp, %rdi
leaq 0x200d41(%rip), %rsi    # 0x3c562c
movq 0x78(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, %rdi
leaq 0x1c0d35(%rip), %rsi    # 0x385634
movq 0x80(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, %rdi
leaq 0x200d16(%rip), %rsi    # 0x3c562c
movq 0x88(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, %rdi
leaq 0x200cff(%rip), %rsi    # 0x3c562c
leaq 0x20(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, %rdi
leaq 0x200ceb(%rip), %rsi    # 0x3c562c
movq %rbx, %rdx
jmp 0x1c4a1b
movq %rbp, %rdi
leaq 0x200cd9(%rip), %rsi    # 0x3c562c
movq 0x40(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, %rdi
leaq 0x200cc5(%rip), %rsi    # 0x3c562c
movq 0x38(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, %rdi
leaq 0x200cb1(%rip), %rsi    # 0x3c562c
movq 0x50(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, %rdi
leaq 0x200c9d(%rip), %rsi    # 0x3c562c
movq 0x70(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, %rdi
leaq 0x200c89(%rip), %rsi    # 0x3c562c
movq 0x60(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, 0xa8(%rbx)
jmp 0x1c4a80
movq %rbp, %rdi
leaq 0x200c6c(%rip), %rsi    # 0x3c562c
movq 0x68(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, %rdi
leaq 0x200c5b(%rip), %rsi    # 0x3c562c
leaq 0x28(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, 0xa0(%rbx)
jmp 0x1c4a80
movq %rbp, %rdi
leaq 0x1f061c(%rip), %rsi    # 0x3b500a
movq 0xa8(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, %rdi
leaq 0x200c2a(%rip), %rsi    # 0x3c562c
movq 0x58(%rsp), %rdx
jmp 0x1c4a1b
movq %rbp, %rdi
leaq 0x1f05f7(%rip), %rsi    # 0x3b500a
movq 0xa0(%rsp), %rdx
xorl %eax, %eax
callq 0x177f0
movl %eax, %r14d
jmp 0x1c4a86
decq %r15
movl $0x1, %r14d
cmpq %r15, %r12
jae 0x1c4a86
movq %rbp, %rdi
movl %r13d, %esi
callq 0x17280
testq %rax, %rax
jne 0x1c4a6c
jmp 0x1c4c60
decq %r15
movl $0x1, %r14d
cmpq %r15, %r12
jae 0x1c4a86
movq %rbp, %rdi
movl %r13d, %esi
callq 0x17280
testq %rax, %rax
je 0x1c4c65
movq %rax, %rbp
jmp 0x1c4a86
movl $0x1, %eax
jmp 0x1c4a7a
xorl %eax, %eax
movl %eax, 0x88(%rbx)
movl $0x1, %r14d
cmpl $0x1, %r14d
jne 0x1c4c02
movq %rbp, %rdi
movl %r13d, %esi
callq 0x17280
movq %rax, %rbp
incq %r12
movq 0x30(%rsp), %r15
cmpq %r15, %r12
jb 0x1c47d6
movq 0xb0(%rsp), %r12
movq %r12, %rdi
callq 0x1c2b98
testb %al, %al
je 0x1c4c4c
movq %r12, %rdi
callq 0x1c2bf8
testb %al, %al
je 0x1c4c4c
movq 0xf0(%rsp), %r15
movq %r12, %rdi
callq 0x1c2cda
testb %al, %al
jne 0x1c4afa
movq (%rbx), %rsi
movq %r15, %rdi
callq 0xeffd3
movq %rax, 0x18(%rbx)
movq 0xf8(%rsp), %r14
movq %r12, %rdi
callq 0x1c2ceb
testb %al, %al
jne 0x1c4b1e
movq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0xeffd3
movq %rax, 0x48(%rbx)
movq (%rbx), %rsi
movq %r15, %rdi
callq 0xefce0
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 0x1c3b18
movq %rax, 0x30(%rbx)
movq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0xefce0
movq %rax, 0x50(%rbx)
movq %r12, %rdi
callq 0x1c2b87
testb %al, %al
jne 0x1c4ba4
movq %r12, %rdi
callq 0x1c2bb5
testb %al, %al
je 0x1c4c51
movq %r12, %rdi
callq 0x1c2bc5
testb %al, %al
je 0x1c4c51
movq 0x28(%rsp), %rax
subq 0x8(%rbx), %rax
jbe 0x1c4c51
incq %rax
movq %rax, 0x10(%rbx)
movq %r12, %rdi
callq 0x1c2be7
testb %al, %al
jne 0x1c4bf0
movq %r12, %rdi
callq 0x1c2c1a
testb %al, %al
je 0x1c4c56
movq %r12, %rdi
callq 0x1c2c29
testb %al, %al
je 0x1c4c56
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
movq 0x2ff377(%rip), %rax    # 0x4c3f80
movq (%rax), %rbx
movq 0x18(%rsp), %rax
movl (%rax,%r12,4), %edi
callq 0x1c3603
movq %rbp, (%rsp)
leaq 0x1f03e9(%rip), %rsi    # 0x3b500e
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 0x69877
callq 0x698b0
callq 0x698e9
callq 0x69922
callq 0x6983e
callq 0x697cc
callq 0x69805
callq 0x69793