// File: /workspace/github_c_makefile_star2_O2/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 $0xc8, %rsp
movl %r9d, 0x1c(%rsp)
movq %r8, %r14
movq %rcx, %r15
movq %rdx, 0xb8(%rsp)
movq %rsi, 0xb0(%rsp)
orq $-0x1, 0x50(%rsp)
movq %rdi, %rbx
orq $-0x1, 0x48(%rsp)
leaq 0xc0(%rsp), %rdi
movq %r8, %rsi
callq 0x1691c6
movq %rax, 0x40(%rsp)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x58(%rbx)
movq %r14, %rdi
callq 0x1690cd
movb $0x9, %cl
testb %al, %al
jne 0x16b075
movq %r14, %rdi
callq 0x1690c8
testb %al, %al
pushq $0x9
popq %rax
pushq $0x20
popq %rcx
cmovnel %eax, %ecx
movq %r14, 0x60(%rsp)
leaq 0x58(%rbx), %rax
movq %rax, 0xa8(%rsp)
leaq 0x60(%rbx), %rax
movq %rax, 0xa0(%rsp)
leaq 0x78(%rbx), %rax
movq %rax, 0x98(%rsp)
leaq 0x48(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x18(%rbx), %rax
movq %rax, 0x90(%rsp)
leaq 0x68(%rbx), %rax
movq %rax, 0x88(%rsp)
leaq 0x70(%rbx), %rax
movq %rax, 0x80(%rsp)
leaq 0x80(%rbx), %rax
movq %rax, 0x78(%rsp)
leaq 0x38(%rbx), %rax
movq %rax, 0x70(%rsp)
leaq 0x28(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x40(%rbx), %rax
movq %rax, 0x68(%rsp)
leaq 0x8(%rbx), %rax
movq %rax, 0x28(%rsp)
movzbl %cl, %ebp
movq %rbx, 0x10(%rsp)
leaq 0x10(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0x1e0911(%rip), %rbx    # 0x34ba24
xorl %r12d, %r12d
movq %r15, 0x58(%rsp)
movq %r15, %r14
movq 0xc0(%rsp), %r13
cmpq %r13, %r12
jae 0x16b3fc
movb (%r14), %r15b
testb %r15b, %r15b
je 0x16b561
callq 0x17820
movq (%rax), %rax
movsbq %r15b, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0x16b157
movb 0x1(%r14), %r15b
incq %r14
jmp 0x16b143
movq 0x40(%rsp), %rax
movl (%rax,%r12,4), %eax
addl $-0xa, %eax
cmpl $0x1c, %eax
ja 0x16b66c
movslq (%rbx,%rax,4), %rax
addq %rbx, %rax
jmpq *%rax
movq 0x10(%rsp), %r15
movq 0xb0(%r15), %rdi
testq %rdi, %rdi
je 0x16b3c8
callq 0x2b798d
movq 0xb0(%r15), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2b7f19
jmp 0x16b397
movq 0x10(%rsp), %r15
movq 0xb0(%r15), %rdi
testq %rdi, %rdi
je 0x16b3ac
callq 0x2b798d
movq 0xb0(%r15), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2b8955
jmp 0x16b397
movq %r14, %rdi
leaq 0x1f122f(%rip), %rsi    # 0x35c40e
movq 0x90(%rsp), %rdx
jmp 0x16b384
movq %r14, %rdi
leaq 0x1f1218(%rip), %rsi    # 0x35c40e
movq 0x30(%rsp), %rdx
jmp 0x16b384
movq %r14, %rdi
leaq 0x1f1204(%rip), %rsi    # 0x35c40e
movq 0xa0(%rsp), %rdx
jmp 0x16b384
cmpb $0x46, %r15b
je 0x16b3ed
movzbl %r15b, %eax
cmpl $0x52, %eax
je 0x16b3e8
cmpl $0x50, %eax
jne 0x16b6ff
pushq $0x3
jmp 0x16b3ea
movq %r14, %rdi
leaq 0x1f11c6(%rip), %rsi    # 0x35c40e
movq 0x70(%rsp), %rdx
jmp 0x16b384
movq %r14, %rdi
leaq 0x1b1473(%rip), %rsi    # 0x31c6cf
movq 0x78(%rsp), %rdx
jmp 0x16b384
movq %r14, %rdi
leaq 0x1f119e(%rip), %rsi    # 0x35c40e
movq 0x80(%rsp), %rdx
jmp 0x16b384
movq %r14, %rdi
leaq 0x1f1187(%rip), %rsi    # 0x35c40e
leaq 0x48(%rsp), %rdx
jmp 0x16b384
movq %r14, %rdi
leaq 0x1f1173(%rip), %rsi    # 0x35c40e
movq 0x10(%rsp), %rdx
jmp 0x16b384
movq %r14, %rdi
leaq 0x1f115f(%rip), %rsi    # 0x35c40e
movq 0x28(%rsp), %rdx
jmp 0x16b384
movq %r14, %rdi
leaq 0x1f114b(%rip), %rsi    # 0x35c40e
movq 0x20(%rsp), %rdx
jmp 0x16b384
movq %r14, %rdi
leaq 0x1f1137(%rip), %rsi    # 0x35c40e
movq 0x88(%rsp), %rdx
jmp 0x16b384
movq %r14, %rdi
leaq 0x1f1120(%rip), %rsi    # 0x35c40e
movq 0x68(%rsp), %rdx
jmp 0x16b384
movq %r14, %rdi
leaq 0x1f110c(%rip), %rsi    # 0x35c40e
movq 0x98(%rsp), %rdx
jmp 0x16b384
movq 0x10(%rsp), %rax
movq %r14, 0xa8(%rax)
jmp 0x16b397
movq %r14, %rdi
leaq 0x1f10ea(%rip), %rsi    # 0x35c40e
movq 0xa8(%rsp), %rdx
jmp 0x16b384
movq %r14, %rdi
leaq 0x1f10d6(%rip), %rsi    # 0x35c40e
leaq 0x50(%rsp), %rdx
jmp 0x16b384
movq 0x10(%rsp), %rax
movq %r14, 0xa0(%rax)
jmp 0x16b397
movq %r14, %rdi
leaq 0x1e0a03(%rip), %rsi    # 0x34bd5a
movq 0xb8(%rsp), %rdx
jmp 0x16b384
movq %r14, %rdi
leaq 0x1f10a3(%rip), %rsi    # 0x35c40e
movq 0x38(%rsp), %rdx
jmp 0x16b384
movq %r14, %rdi
leaq 0x1e09de(%rip), %rsi    # 0x34bd5a
movq 0xb0(%rsp), %rdx
xorl %eax, %eax
callq 0x177b0
movl %eax, %r13d
cmpl $0x1, %eax
jne 0x16b599
movq %r14, %rdi
movl %ebp, %esi
callq 0x17260
movq %rax, %r14
incq %r12
jmp 0x16b11e
decq %r13
cmpq %r13, %r12
jae 0x16b397
movq %r14, %rdi
movl %ebp, %esi
callq 0x17260
testq %rax, %rax
jne 0x16b3e3
jmp 0x16b69d
decq %r13
cmpq %r13, %r12
jae 0x16b397
movq %r14, %rdi
movl %ebp, %esi
callq 0x17260
testq %rax, %rax
je 0x16b6ce
movq %rax, %r14
jmp 0x16b397
pushq $0x1
popq %rax
jmp 0x16b3ef
xorl %eax, %eax
movq 0x10(%rsp), %rcx
movl %eax, 0x88(%rcx)
jmp 0x16b397
movq 0x60(%rsp), %r14
movq %r14, %rdi
callq 0x1690f5
testb %al, %al
je 0x16b5dc
movq %r14, %rdi
callq 0x169113
testb %al, %al
je 0x16b5dc
movq %r14, %rdi
callq 0x169180
testb %al, %al
movq 0x10(%rsp), %rbx
movq 0x108(%rsp), %r15
movq 0x100(%rsp), %r12
jne 0x16b451
movq (%rbx), %rsi
movq %r12, %rdi
callq 0x75173
movq %rax, 0x18(%rbx)
movq %r14, %rdi
callq 0x169188
testb %al, %al
jne 0x16b475
movq 0x30(%rsp), %rax
movq (%rax), %rsi
movq %r15, %rdi
callq 0x75173
movq 0x38(%rsp), %rcx
movq %rax, (%rcx)
movq (%rbx), %rsi
movq %r12, %rdi
callq 0x74d9c
movq %rax, 0x20(%rbx)
movl 0x1c(%rsp), %eax
movb %al, 0x8c(%rbx)
movl 0x88(%rbx), %edi
movq 0x38(%rbx), %rcx
movq 0x40(%rbx), %rsi
movq 0x48(%rbx), %rdx
callq 0x16a251
movq %rax, 0x30(%rbx)
movq 0x28(%rbx), %rsi
movq %r15, %rdi
callq 0x74d9c
movq %rax, 0x50(%rbx)
movq %r14, %rdi
callq 0x1690f0
testb %al, %al
jne 0x16b503
movq %r14, %rdi
callq 0x1690ff
testb %al, %al
je 0x16b60a
movq %r14, %rdi
callq 0x169104
testb %al, %al
je 0x16b60a
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
subq (%rcx), %rax
jbe 0x16b60a
incq %rax
movq 0x20(%rsp), %rcx
movq %rax, (%rcx)
movq %r14, %rdi
callq 0x16910e
testb %al, %al
jne 0x16b54f
movq %r14, %rdi
callq 0x169120
testb %al, %al
je 0x16b63b
movq %r14, %rdi
callq 0x169128
testb %al, %al
je 0x16b63b
movq 0x48(%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 $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2cca00(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x179aa1(%rip), %rsi    # 0x2e5013
leaq 0x1e07bc(%rip), %rdx    # 0x34bd35
leaq 0x1e07c2(%rip), %rcx    # 0x34bd42
leaq 0x1e0511(%rip), %r8     # 0x34ba98
movl $0x3ad, %r9d            # imm = 0x3AD
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2cc9c8(%rip), %rax    # 0x437f68
movq (%rax), %rbx
movq 0x40(%rsp), %rax
movl (%rax,%r12,4), %edi
callq 0x169b81
movq %r14, (%rsp)
leaq 0x1e07a2(%rip), %rsi    # 0x34bd5e
movq %rbx, %rdi
movq %r12, %rdx
movl %r13d, %ecx
movq %rax, %r8
movq 0x58(%rsp), %r9
xorl %eax, %eax
callq 0x17a50
pushq $0x2
popq %rdi
callq 0x178f0
movq 0x2cc985(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x179a26(%rip), %rsi    # 0x2e5013
leaq 0x1e079c(%rip), %rdx    # 0x34bd90
leaq 0x1e0747(%rip), %rcx    # 0x34bd42
leaq 0x1e0496(%rip), %r8     # 0x34ba98
movl $0x423, %r9d            # imm = 0x423
jmp 0x16b58d
movq 0x2cc957(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1799f8(%rip), %rsi    # 0x2e5013
leaq 0x1e07d1(%rip), %rdx    # 0x34bdf3
leaq 0x1e0719(%rip), %rcx    # 0x34bd42
leaq 0x1e0468(%rip), %r8     # 0x34ba98
movl $0x43b, %r9d            # imm = 0x43B
jmp 0x16b58d
movq 0x2cc926(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1799c7(%rip), %rsi    # 0x2e5013
leaq 0x1e0830(%rip), %rdx    # 0x34be83
leaq 0x1e06e8(%rip), %rcx    # 0x34bd42
leaq 0x1e0437(%rip), %r8     # 0x34ba98
movl $0x441, %r9d            # imm = 0x441
jmp 0x16b58d
movq 0x2cc8f5(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x179996(%rip), %rsi    # 0x2e5013
leaq 0x1bb368(%rip), %rdx    # 0x3269ec
leaq 0x1e06b7(%rip), %rcx    # 0x34bd42
leaq 0x1e0406(%rip), %r8     # 0x34ba98
movl $0x416, %r9d            # imm = 0x416
jmp 0x16b58d
movq 0x2cc8c4(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x179965(%rip), %rsi    # 0x2e5013
leaq 0x1e0d57(%rip), %rdx    # 0x34c40c
leaq 0x1e0686(%rip), %rcx    # 0x34bd42
leaq 0x1e03d5(%rip), %r8     # 0x34ba98
movl $0x3ce, %r9d            # imm = 0x3CE
jmp 0x16b58d
movq 0x2cc893(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x179934(%rip), %rsi    # 0x2e5013
leaq 0x1e0d26(%rip), %rdx    # 0x34c40c
leaq 0x1e0655(%rip), %rcx    # 0x34bd42
leaq 0x1e03a4(%rip), %r8     # 0x34ba98
movl $0x3bf, %r9d            # imm = 0x3BF
jmp 0x16b58d
movq 0x2cc862(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x179903(%rip), %rsi    # 0x2e5013
leaq 0x1e0965(%rip), %rdx    # 0x34c07c
leaq 0x1e096f(%rip), %rcx    # 0x34c08d
leaq 0x1e0373(%rip), %r8     # 0x34ba98
movl $0x391, %r9d            # imm = 0x391
jmp 0x16b58d