// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/randomcodes-hpcorrect.c
// Function: gt_randomcodes_hpcorrect_firstpass_correct
static void gt_randomcodes_hpcorrect_firstpass_correct(
    const GtSeqnumrelpos *snrp, const GtUword *suffixes,
    GtUword nofsuffixes, GtRandomcodesHpcorrectData *sdata,
    GtUword u, GtUword t)
{
  char t_char;
  uint8_t t_hlen, t_hlen_b, t_hlen_a, t_hlen_sum, u_hlen_b;
  GtUword u_sfx, u_relpos, u_seqnum, u_startpos, u_kmerpos, u_kplus1pos,
                t_sfx, t_relpos, t_seqnum, t_startpos, t_kmerpos;
  bool rc;
#ifdef GT_RANDOMCODES_HPCORRECT_DEBUG
  gt_file_xprintf(sdata->outfile,
      "# firstpass_correct, u: "GT_WU", t: "GT_WU"\n", u, t);
#endif
  for (t_sfx = 0; t_sfx < nofsuffixes && sdata->rextset[t_sfx] != t; t_sfx++)
    { /* nothing */ }
  gt_assert(t_sfx < nofsuffixes);
  t_relpos = gt_seqnumrelpos_decode_relpos(snrp, suffixes[t_sfx]);
  t_seqnum = gt_seqnumrelpos_decode_seqnum(snrp, suffixes[t_sfx]);
  t_startpos = gt_encseq_seqstartpos(sdata->encseq, t_seqnum);
  t_kmerpos = t_startpos + t_relpos;
  t_char = gt_encseq_get_decoded_char(sdata->encseq, t_kmerpos + sdata->k,
        GT_READMODE_FORWARD);
  t_hlen_b = GT_RANDOMCODES_HPCORRECT_HMER(sdata, t_sfx)[sdata->k - 1] + 1;
  t_hlen = GT_RANDOMCODES_HPCORRECT_HMER(sdata, t_sfx)[sdata->k] + 1;
  t_hlen_a = GT_RANDOMCODES_HPCORRECT_HMER(sdata, t_sfx)[sdata->k + 1] + 1;
  t_hlen_sum = t_hlen_b + t_hlen + t_hlen_a;
  for (u_sfx = 0; u_sfx < nofsuffixes; u_sfx++)
  {
    if (sdata->rextset[u_sfx] != u)
      continue;
    u_relpos = gt_seqnumrelpos_decode_relpos(snrp, suffixes[u_sfx]);
    u_seqnum = gt_seqnumrelpos_decode_seqnum(snrp, suffixes[u_sfx]);
    u_startpos = gt_encseq_seqstartpos(sdata->encseq, u_seqnum);
    u_kmerpos = u_startpos + u_relpos;
    u_kplus1pos = u_relpos + sdata->k;
    u_hlen_b = GT_RANDOMCODES_HPCORRECT_HMER(sdata, u_sfx)[sdata->k - 1] + 1;
    rc = (u_seqnum >= sdata->nofreads);
    if (rc)
    {
      if (sdata->skip_rc)
        continue;
      u_seqnum = sdata->mirror_nofseqs - 1UL - u_seqnum;
      u_kplus1pos = gt_encseq_seqlength(sdata->encseq, u_seqnum) - 1UL -
        u_kplus1pos;
    }
    if (gt_randomcodes_hpcorrect_similar_rext(sdata, u_sfx, u_kmerpos, 0,
          t_sfx, t_kmerpos, 1, sdata->rext_I_minscore))
    {
      /* deletion found in u */
      sdata->rextset_size[u]--;
      sdata->rextset[u_sfx] = GT_UNDEF_UWORD;
      if (rc)
        gt_file_xprintf(sdata->outfile,""GT_WU"\t"GT_WU"\tI\t%c\t%u\t%u\t%u\n",
            u_seqnum, u_kplus1pos, gt_randomcodes_complement(t_char),
            t_hlen_a, t_hlen, t_hlen_b);
      else
        gt_file_xprintf(sdata->outfile,""GT_WU"\t"GT_WU"\tI\t%c\t%u\t%u\t%u\n",
            u_seqnum, u_kplus1pos - 1UL, t_char,
            t_hlen_b, t_hlen, t_hlen_a);
    }
    else if (gt_randomcodes_hpcorrect_similar_rext(sdata, u_sfx, u_kmerpos, 1,
          t_sfx, t_kmerpos, 1, sdata->rext_R_minscore))
    {
      /* substitution found */
      sdata->rextset_size[u]--;
      sdata->rextset[u_sfx] = GT_UNDEF_UWORD;
      if (rc)
        gt_file_xprintf(sdata->outfile,""GT_WU"\t"GT_WU"\tR\t%c\t0\t%u\t%u\n",
            u_seqnum, u_kplus1pos, gt_randomcodes_complement(t_char),
            t_hlen, t_hlen_b);
      else
        gt_file_xprintf(sdata->outfile,""GT_WU"\t"GT_WU"\tR\t%c\t0\t%u\t%u\n",
            u_seqnum, u_kplus1pos, t_char, t_hlen, t_hlen_a);
    }
    else if (((t_hlen_sum >= u_hlen_b &&
               t_hlen_sum - u_hlen_b <= (uint8_t)1U) ||
              (t_hlen_sum < u_hlen_b &&
               u_hlen_b - t_hlen_sum == (uint8_t)1U)) &&
        gt_randomcodes_hpcorrect_detect_double_insertion(sdata, u_sfx,
          u_kmerpos, t_sfx, t_kmerpos, sdata->rext_J_minscore,
          sdata->rext_J_lwidth, sdata->rext_J_lminscore))
    {
      /* double deletion found in u */
      sdata->rextset_size[u]--;
      sdata->rextset[u_sfx] = GT_UNDEF_UWORD;
      if (rc)
        gt_file_xprintf(sdata->outfile,""GT_WU"\t"GT_WU"\tJ\t%c\t%u\t%u\t%u\n",
            u_seqnum, u_kplus1pos + 1UL, gt_randomcodes_complement(t_char),
            t_hlen_a, t_hlen, t_hlen_b);
      else
        gt_file_xprintf(sdata->outfile,""GT_WU"\t"GT_WU"\tJ\t%c\t%u\t%u\t%u\n",
            u_seqnum, u_kplus1pos - 1UL, t_char,
            t_hlen_b, t_hlen, t_hlen_a);
    }
    else if (gt_randomcodes_hpcorrect_similar_rext(sdata, u_sfx, u_kmerpos, 1,
          t_sfx, t_kmerpos, 0, sdata->rext_D_minscore))
    {
      /* insertion found in u */
      sdata->rextset_size[u]--;
      sdata->rextset[u_sfx] = GT_UNDEF_UWORD;
      gt_file_xprintf(sdata->outfile,""GT_WU"\t"GT_WU"\tD\t-\t0\t0\t%u\n",
                      u_seqnum, u_kplus1pos, t_hlen_a);
    }
  }
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
movq %rdx, 0xe0(%rsp)
movq %rcx, 0xd8(%rsp)
movq %r8, 0xd0(%rsp)
movq %r9, 0xc8(%rsp)
movq $0x0, 0x88(%rsp)
movq 0x88(%rsp), %rcx
xorl %eax, %eax
cmpq 0xe0(%rsp), %rcx
movb %al, 0x66(%rsp)
jae 0x344685
movq 0xd8(%rsp), %rax
movq 0xd0(%rax), %rax
movq 0x88(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpq 0xc8(%rsp), %rax
setne %al
movb %al, 0x66(%rsp)
movb 0x66(%rsp), %al
testb $0x1, %al
jne 0x34468f
jmp 0x3446a7
jmp 0x344691
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0x344643
jmp 0x3446a9
movq 0x88(%rsp), %rax
cmpq 0xe0(%rsp), %rax
jb 0x3446f3
movq 0x2b7906(%rip), %rax    # 0x5fbfc8
movq (%rax), %rdi
leaq 0x1b6ed1(%rip), %rsi    # 0x4fb59d
leaq 0x213050(%rip), %rdx    # 0x557723
leaq 0x21305d(%rip), %rcx    # 0x557737
leaq 0x212cfb(%rip), %r8     # 0x5573dc
movl $0x244, %r9d            # imm = 0x244
movb $0x0, %al
callq 0x33960
callq 0x2f830
jmp 0x3446f5
movq 0xf0(%rsp), %rdi
movq 0xe8(%rsp), %rax
movq 0x88(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x398350
movq %rax, 0x80(%rsp)
movq 0xf0(%rsp), %rdi
movq 0xe8(%rsp), %rax
movq 0x88(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x398330
movq %rax, 0x78(%rsp)
movq 0xd8(%rsp), %rax
movq (%rax), %rdi
movq 0x78(%rsp), %rsi
callq 0x31a00
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq 0x80(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0xd8(%rsp), %rax
movq (%rax), %rdi
movq 0x68(%rsp), %rsi
movq 0xd8(%rsp), %rax
addq 0x20(%rax), %rsi
xorl %edx, %edx
callq 0x336a0
movb %al, 0xc7(%rsp)
movq 0xd8(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x88(%rsp), %rcx
movq 0xd8(%rsp), %rdx
imulq 0x48(%rdx), %rcx
addq %rcx, %rax
movq 0xd8(%rsp), %rcx
movq 0x20(%rcx), %rcx
subq $0x1, %rcx
movzbl (%rax,%rcx), %eax
addl $0x1, %eax
movb %al, 0xc5(%rsp)
movq 0xd8(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x88(%rsp), %rcx
movq 0xd8(%rsp), %rdx
imulq 0x48(%rdx), %rcx
addq %rcx, %rax
movq 0xd8(%rsp), %rcx
movq 0x20(%rcx), %rcx
movzbl (%rax,%rcx), %eax
addl $0x1, %eax
movb %al, 0xc6(%rsp)
movq 0xd8(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x88(%rsp), %rcx
movq 0xd8(%rsp), %rdx
imulq 0x48(%rdx), %rcx
addq %rcx, %rax
movq 0xd8(%rsp), %rcx
movq 0x20(%rcx), %rcx
movzbl 0x1(%rax,%rcx), %eax
addl $0x1, %eax
movb %al, 0xc4(%rsp)
movzbl 0xc5(%rsp), %eax
movzbl 0xc6(%rsp), %ecx
addl %ecx, %eax
movzbl 0xc4(%rsp), %ecx
addl %ecx, %eax
movb %al, 0xc3(%rsp)
movq $0x0, 0xb8(%rsp)
movq 0xb8(%rsp), %rax
cmpq 0xe0(%rsp), %rax
jae 0x344fe7
movq 0xd8(%rsp), %rax
movq 0xd0(%rax), %rax
movq 0xb8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpq 0xd0(%rsp), %rax
je 0x3448c8
jmp 0x344fce
movq 0xf0(%rsp), %rdi
movq 0xe8(%rsp), %rax
movq 0xb8(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x398350
movq %rax, 0xb0(%rsp)
movq 0xf0(%rsp), %rdi
movq 0xe8(%rsp), %rax
movq 0xb8(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x398330
movq %rax, 0xa8(%rsp)
movq 0xd8(%rsp), %rax
movq (%rax), %rdi
movq 0xa8(%rsp), %rsi
callq 0x31a00
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
addq 0xb0(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0xb0(%rsp), %rax
movq 0xd8(%rsp), %rcx
addq 0x20(%rcx), %rax
movq %rax, 0x90(%rsp)
movq 0xd8(%rsp), %rax
movq 0x30(%rax), %rax
movq 0xb8(%rsp), %rcx
movq 0xd8(%rsp), %rdx
imulq 0x48(%rdx), %rcx
addq %rcx, %rax
movq 0xd8(%rsp), %rcx
movq 0x20(%rcx), %rcx
subq $0x1, %rcx
movzbl (%rax,%rcx), %eax
addl $0x1, %eax
movb %al, 0xc2(%rsp)
movq 0xa8(%rsp), %rax
movq 0xd8(%rsp), %rcx
cmpq 0x10(%rcx), %rax
setae %al
andb $0x1, %al
movb %al, 0x67(%rsp)
testb $0x1, 0x67(%rsp)
je 0x344a33
movq 0xd8(%rsp), %rax
testb $0x1, 0x78(%rax)
je 0x3449e7
jmp 0x344fce
movq 0xd8(%rsp), %rax
movq 0x18(%rax), %rax
subq $0x1, %rax
subq 0xa8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0xd8(%rsp), %rax
movq (%rax), %rdi
movq 0xa8(%rsp), %rsi
callq 0x32020
subq $0x1, %rax
subq 0x90(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0xd8(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq 0x88(%rsp), %r8
movq 0x68(%rsp), %r9
movq 0xd8(%rsp), %rax
movq 0xe8(%rax), %rax
xorl %ecx, %ecx
movl $0x1, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x344ff0
testb $0x1, %al
jne 0x344a83
jmp 0x344bae
movq 0xd8(%rsp), %rax
movq 0xd8(%rax), %rax
movq 0xd0(%rsp), %rcx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
movq 0xd8(%rsp), %rax
movq 0xd0(%rax), %rax
movq 0xb8(%rsp), %rcx
movq $-0x1, (%rax,%rcx,8)
testb $0x1, 0x67(%rsp)
je 0x344b4d
movq 0xd8(%rsp), %rax
movq 0xa0(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x58(%rsp)
movsbl 0xc7(%rsp), %edi
callq 0x3452a0
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rdx
movq 0x58(%rsp), %rcx
movsbl %al, %r8d
movzbl 0xc4(%rsp), %r9d
movzbl 0xc6(%rsp), %r10d
movzbl 0xc5(%rsp), %eax
leaq 0x212c26(%rip), %rsi    # 0x557762
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x30490
jmp 0x344ba9
movq 0xd8(%rsp), %rax
movq 0xa0(%rax), %rdi
movq 0xa8(%rsp), %rdx
movq 0x90(%rsp), %rcx
subq $0x1, %rcx
movsbl 0xc7(%rsp), %r8d
movzbl 0xc5(%rsp), %r9d
movzbl 0xc6(%rsp), %r10d
movzbl 0xc4(%rsp), %eax
leaq 0x212bc8(%rip), %rsi    # 0x557762
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x30490
jmp 0x344fcc
movq 0xd8(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq 0x88(%rsp), %r8
movq 0x68(%rsp), %r9
movq 0xd8(%rsp), %rax
movq 0xf8(%rax), %rax
movl $0x1, %ecx
movl $0x1, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x344ff0
testb $0x1, %al
jne 0x344c01
jmp 0x344d08
movq 0xd8(%rsp), %rax
movq 0xd8(%rax), %rax
movq 0xd0(%rsp), %rcx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
movq 0xd8(%rsp), %rax
movq 0xd0(%rax), %rax
movq 0xb8(%rsp), %rcx
movq $-0x1, (%rax,%rcx,8)
testb $0x1, 0x67(%rsp)
je 0x344cb9
movq 0xd8(%rsp), %rax
movq 0xa0(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x40(%rsp)
movsbl 0xc7(%rsp), %edi
callq 0x3452a0
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rcx
movsbl %al, %r8d
movzbl 0xc6(%rsp), %r9d
movzbl 0xc5(%rsp), %eax
leaq 0x212acc(%rip), %rsi    # 0x557779
movl %eax, (%rsp)
movb $0x0, %al
callq 0x30490
jmp 0x344d03
movq 0xd8(%rsp), %rax
movq 0xa0(%rax), %rdi
movq 0xa8(%rsp), %rdx
movq 0x90(%rsp), %rcx
movsbl 0xc7(%rsp), %r8d
movzbl 0xc6(%rsp), %r9d
movzbl 0xc4(%rsp), %eax
leaq 0x212a80(%rip), %rsi    # 0x557779
movl %eax, (%rsp)
movb $0x0, %al
callq 0x30490
jmp 0x344fca
movzbl 0xc3(%rsp), %eax
movzbl 0xc2(%rsp), %ecx
cmpl %ecx, %eax
jl 0x344d33
movzbl 0xc3(%rsp), %eax
movzbl 0xc2(%rsp), %ecx
subl %ecx, %eax
cmpl $0x1, %eax
jle 0x344d66
movzbl 0xc3(%rsp), %eax
movzbl 0xc2(%rsp), %ecx
cmpl %ecx, %eax
jge 0x344efe
movzbl 0xc2(%rsp), %eax
movzbl 0xc3(%rsp), %ecx
subl %ecx, %eax
cmpl $0x1, %eax
jne 0x344efe
movq 0xd8(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq 0x88(%rsp), %rcx
movq 0x68(%rsp), %r8
movq 0xd8(%rsp), %rax
movq 0xf0(%rax), %r9
movq 0xd8(%rsp), %rax
movq 0x110(%rax), %r10
movq 0xd8(%rsp), %rax
movq 0x108(%rax), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x345300
testb $0x1, %al
jne 0x344dcf
jmp 0x344efe
movq 0xd8(%rsp), %rax
movq 0xd8(%rax), %rax
movq 0xd0(%rsp), %rcx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
movq 0xd8(%rsp), %rax
movq 0xd0(%rax), %rax
movq 0xb8(%rsp), %rcx
movq $-0x1, (%rax,%rcx,8)
testb $0x1, 0x67(%rsp)
je 0x344e9d
movq 0xd8(%rsp), %rax
movq 0xa0(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x90(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movsbl 0xc7(%rsp), %edi
callq 0x3452a0
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rcx
movsbl %al, %r8d
movzbl 0xc4(%rsp), %r9d
movzbl 0xc6(%rsp), %r10d
movzbl 0xc5(%rsp), %eax
leaq 0x212903(%rip), %rsi    # 0x55778f
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x30490
jmp 0x344ef9
movq 0xd8(%rsp), %rax
movq 0xa0(%rax), %rdi
movq 0xa8(%rsp), %rdx
movq 0x90(%rsp), %rcx
subq $0x1, %rcx
movsbl 0xc7(%rsp), %r8d
movzbl 0xc5(%rsp), %r9d
movzbl 0xc6(%rsp), %r10d
movzbl 0xc4(%rsp), %eax
leaq 0x2128a5(%rip), %rsi    # 0x55778f
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x30490
jmp 0x344fc8
movq 0xd8(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq 0x88(%rsp), %r8
movq 0x68(%rsp), %r9
movq 0xd8(%rsp), %rax
movq 0x100(%rax), %rax
movl $0x1, %ecx
xorl %r10d, %r10d
movl $0x0, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x344ff0
testb $0x1, %al
jne 0x344f51
jmp 0x344fc6
movq 0xd8(%rsp), %rax
movq 0xd8(%rax), %rax
movq 0xd0(%rsp), %rcx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
movq 0xd8(%rsp), %rax
movq 0xd0(%rax), %rax
movq 0xb8(%rsp), %rcx
movq $-0x1, (%rax,%rcx,8)
movq 0xd8(%rsp), %rax
movq 0xa0(%rax), %rdi
movq 0xa8(%rsp), %rdx
movq 0x90(%rsp), %rcx
movzbl 0xc4(%rsp), %r8d
leaq 0x2127e7(%rip), %rsi    # 0x5577a6
movb $0x0, %al
callq 0x30490
jmp 0x344fc8
jmp 0x344fca
jmp 0x344fcc
jmp 0x344fce
movq 0xb8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xb8(%rsp)
jmp 0x344888
addq $0xf8, %rsp
retq
nop