// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/sequence_buffer_dust.c
// Function: gt_dust_masker_shift_window
static int gt_dust_masker_shift_window(GtDustMasker* dust_masker,
                                       GtSequenceBuffer* sb,
                                       GtError* err)
{
  int retval;
  GtUchar t_val=0;
  char t_orig=0;

  unsigned char triplet_val, s, nuc_val;

  /* read next character into buffer */
  retval = gt_sequence_buffer_next_with_original_raw(sb, &t_val, &t_orig, err);
  if (retval == -1) {
    return -1;
  } else {
    if (retval == 0) {
      return 0;
    }
  }
  dust_masker->buf_remaining++;
  dust_masker->current_length++;
  dust_masker->total_length++;
  dust_masker->buf[dust_masker->buf_insertpos].val = t_val;
  dust_masker->buf[dust_masker->buf_insertpos].orig = t_orig;
  dust_masker->buf[dust_masker->buf_insertpos].max_score = 0.0;
  dust_masker->buf[dust_masker->buf_insertpos].mask_length = 0;
  dust_masker->buf[dust_masker->buf_insertpos].next_mask = 0;
  dust_masker->buf_insertpos++;
  wrap_value_once(&dust_masker->buf_insertpos, dust_masker->buf_size);

  if (!dust_masker->masking_done) {
    if (t_val != GT_SEPARATOR) {
      nuc_val = nucleotide_value(t_orig);
      triplet_val = dust_masker->nuc_val1 * 16 +
                    dust_masker->nuc_val2 * 4 + nuc_val;
      dust_masker->nuc_val1 = dust_masker->nuc_val2;
      dust_masker->nuc_val2 = nuc_val;

      if (dust_masker->current_length <= 2) {
        return 1;
      }

      /* next part according to SHIFT_WINDOW-procedure in Morgulis et al 2006 */
      if (dust_masker->w_queue->noofelements >= dust_masker->windowsize - 2) {
        s = (char) gt_inl_queue_get(dust_masker->w_queue);
        rem_triplet_info(&dust_masker->rw, dust_masker->cw, s);
        if (dust_masker->L_param > dust_masker->w_queue->noofelements) {
          dust_masker->L_param--;
          rem_triplet_info(&dust_masker->rv, dust_masker->cv, s);
        }
      }
      gt_inl_queue_add(dust_masker->w_queue, triplet_val, false);
      dust_masker->L_param++;
      add_triplet_info(&dust_masker->rw, dust_masker->cw, triplet_val);
      add_triplet_info(&dust_masker->rv, dust_masker->cv, triplet_val);
      if (dust_masker->cv[triplet_val] > (2 * dust_masker->threshold)) {
        do {
          s = gt_inl_queue_get_at_index(dust_masker->w_queue,
                                        dust_masker->w_queue->noofelements
                                          - dust_masker->L_param);
          rem_triplet_info(&dust_masker->rv, dust_masker->cv, s);
          dust_masker->L_param--;
        } while (s != triplet_val);
      }
      if (dust_masker->rw > (float) dust_masker->L_param
          * dust_masker->threshold) {
        find_perfect(dust_masker);
      }
    } else {
      /* Reset variables for next sequence in multiseq fasta file. */
      dust_masker->last_seq_start = dust_masker->buf_insertpos;
      dust_masker->nuc_val1 = 0;
      dust_masker->nuc_val2 = 0;
      dust_masker->rv = 0;
      dust_masker->rw = 0;
      dust_masker->L_param = 0;
      dust_masker->current_length = 0;
      memset(dust_masker->cv, 0,
             sizeof *(dust_masker->cv) * (GT_MAXTRIPLETVALUE + 1));
      memset(dust_masker->cw, 0,
             sizeof *(dust_masker->cw) * (GT_MAXTRIPLETVALUE + 1));
      gt_inl_queue_delete(dust_masker->w_queue);
      dust_masker->w_queue = gt_inl_queue_new(dust_masker->windowsize);
    }
  }
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rcx
movq %rsi, %rax
movq %rdi, %rbx
xorl %edi, %edi
leaq 0xa(%rsp), %rsi
movb %dil, (%rsi)
leaq 0xb(%rsp), %rdx
movb %dil, (%rdx)
movq %rax, %rdi
callq 0x5ec17
movl %eax, %ebp
incl %eax
cmpl $0x2, %eax
jae 0x5f5eb
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incq 0x20(%rbx)
movdqu 0x350(%rbx), %xmm0
pcmpeqd %xmm1, %xmm1
psubq %xmm1, %xmm0
movdqu %xmm0, 0x350(%rbx)
movb 0xa(%rsp), %al
movq (%rbx), %rdx
movq 0x18(%rbx), %rcx
movq %rcx, %rsi
shlq $0x5, %rsi
movb %al, (%rdx,%rsi)
movzbl 0xb(%rsp), %eax
movb %al, 0x1(%rdx,%rsi)
incq %rcx
pxor %xmm1, %xmm1
movdqu %xmm1, 0x8(%rdx,%rsi)
andl $0x0, 0x18(%rdx,%rsi)
movq %rcx, 0x18(%rbx)
movq %rcx, %rdx
subq 0x28(%rbx), %rdx
jb 0x5f64b
movq %rdx, 0x18(%rbx)
movq %rdx, %rcx
pushq $0x1
popq %rbp
cmpb $0x0, 0x389(%rbx)
jne 0x5f5da
cmpb $-0x1, 0xa(%rsp)
je 0x5f6a2
xorl %r15d, %r15d
addl $-0x43, %eax
cmpl $0x31, %eax
ja 0x5f6fa
movabsq $0x100000001, %rcx      # imm = 0x100000001
btq %rax, %rcx
jb 0x5f6f7
movabsq $0x1000000010, %rcx     # imm = 0x1000000010
btq %rax, %rcx
jb 0x5f6f2
movabsq $0x2000000020000, %rcx  # imm = 0x2000000020000
btq %rax, %rcx
jae 0x5f6fa
movb $0x3, %r15b
jmp 0x5f6fa
movq %rcx, 0x370(%rbx)
andw $0x0, 0x30(%rbx)
andq $0x0, 0x340(%rbx)
leaq 0x34(%rbx), %rdi
andq $0x0, 0x358(%rbx)
movl $0x208, %edx            # imm = 0x208
xorl %esi, %esi
callq 0xb2f0
movq 0x348(%rbx), %rdi
callq 0x5f197
movq 0x3c0(%rbx), %rdi
callq 0x5f094
movq %rax, 0x348(%rbx)
jmp 0x5f5da
movb $0x2, %r15b
jmp 0x5f6fa
movb $0x1, %r15b
movb 0x30(%rbx), %sil
movb 0x31(%rbx), %r12b
movb %r12b, 0x30(%rbx)
movb %r15b, 0x31(%rbx)
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %rax
cmpq $0x3, %rax
jb 0x5f5da
movq 0x348(%rbx), %r13
movq 0x3c0(%rbx), %rax
movq 0x20(%r13), %rbp
addq $-0x2, %rax
cmpq %rax, %rbp
jae 0x5f73f
movq (%r13), %rdi
jmp 0x5f7a1
testq %rbp, %rbp
je 0x5fb94
decq %rbp
movq %rbp, 0x20(%r13)
movq (%r13), %rdi
movq 0x10(%r13), %rcx
movzbl (%rdi,%rcx), %eax
testq %rcx, %rcx
jne 0x5f764
movq 0x18(%r13), %rcx
decq %rcx
movq %rcx, 0x10(%r13)
movl 0x13c(%rbx,%rax,4), %ecx
decl %ecx
movl %ecx, 0x13c(%rbx,%rax,4)
subl %ecx, 0x38(%rbx)
movq 0x340(%rbx), %rcx
cmpq %rbp, %rcx
jbe 0x5f7a1
decq %rcx
movq %rcx, 0x340(%rbx)
movl 0x3c(%rbx,%rax,4), %ecx
decl %ecx
movl %ecx, 0x3c(%rbx,%rax,4)
subl %ecx, 0x34(%rbx)
cmpq 0x18(%r13), %rbp
jne 0x5f814
movb %sil, 0xc(%rsp)
movl $0x400, %r14d           # imm = 0x400
cmpq %r14, %rbp
cmovbq %rbp, %r14
leaq (%r14,%rbp), %rsi
leaq 0x7cca1(%rip), %rdx     # 0xdc465
pushq $0x65
popq %rcx
movq %rsi, 0x10(%rsp)
callq 0xcfc2
movq %rax, (%r13)
movq 0x8(%r13), %rax
cmpq 0x10(%r13), %rax
jne 0x5fbc2
testq %rbp, %rbp
je 0x5fbec
movq 0x18(%r13), %rcx
decq %rcx
movb 0xc(%rsp), %sil
cmpq %rax, %rcx
jbe 0x5f81a
movq (%r13), %rax
movb (%rax,%rcx), %dl
addq %rcx, %rax
movb %dl, (%r14,%rax)
movq 0x8(%r13), %rax
decq %rcx
jmp 0x5f7f8
movq 0x8(%r13), %rax
jmp 0x5f832
addq %r14, %rax
movq %rax, 0x8(%r13)
movq 0x10(%rsp), %rcx
movq %rcx, 0x18(%r13)
movq (%r13), %rdi
movq 0x20(%r13), %rbp
shlb $0x4, %sil
shlb $0x2, %r12b
addb %sil, %r12b
orb %r15b, %r12b
incq %rbp
movq %rbp, 0x20(%r13)
movb %r12b, (%rdi,%rax)
movq 0x8(%r13), %rax
testq %rax, %rax
jne 0x5f858
movq 0x18(%r13), %rax
decq %rax
movq %rax, 0x8(%r13)
movq 0x340(%rbx), %r14
incq %r14
movq %r14, 0x340(%rbx)
movzbl %r12b, %ecx
shll $0x2, %ecx
movl 0x13c(%rbx,%rcx), %edx
movl 0x38(%rbx), %eax
addl %edx, %eax
movl %eax, 0x38(%rbx)
incl %edx
movl %edx, 0x13c(%rbx,%rcx)
movl 0x3c(%rbx,%rcx), %edx
movl 0x34(%rbx), %r15d
addl %edx, %r15d
movl %r15d, 0x34(%rbx)
incl %edx
movl %edx, 0x3c(%rbx,%rcx)
cvtsi2sd %rdx, %xmm1
movsd 0x3d0(%rbx), %xmm0
movapd %xmm0, %xmm2
addsd %xmm0, %xmm2
ucomisd %xmm2, %xmm1
jbe 0x5f90b
movq 0x348(%rbx), %rdi
movq 0x20(%rdi), %rsi
subq %r14, %rsi
callq 0x5fc22
movzbl %al, %eax
movl 0x3c(%rbx,%rax,4), %ecx
decl %ecx
movl %ecx, 0x3c(%rbx,%rax,4)
movl 0x34(%rbx), %r15d
subl %ecx, %r15d
movl %r15d, 0x34(%rbx)
movq 0x340(%rbx), %r14
decq %r14
movq %r14, 0x340(%rbx)
cmpb %r12b, %al
jne 0x5f8bf
movl 0x38(%rbx), %eax
movsd 0x3d0(%rbx), %xmm0
movl %eax, %eax
cvtsi2sd %rax, %xmm1
testq %r14, %r14
js 0x5f91e
cvtsi2ss %r14, %xmm2
jmp 0x5f936
movq %r14, %rax
shrq %rax
movl %r14d, %ecx
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm2
addss %xmm2, %xmm2
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x5fb8c
leaq 0x3c(%rbx), %rsi
leaq 0x23c(%rbx), %rdi
movl $0x100, %edx            # imm = 0x100
callq 0xb520
movq 0x358(%rbx), %rax
movq %rax, %rsi
subq 0x3c0(%rbx), %rsi
jbe 0x5f980
movq 0x3c8(%rbx), %rcx
cmpq %rsi, %rcx
cmovbq %rcx, %rsi
jmp 0x5f982
xorl %esi, %esi
leaq 0x10(%rbx), %rcx
leaq 0x370(%rbx), %rdx
cmpq 0x28(%rbx), %rax
cmovbq %rdx, %rcx
movq (%rcx), %r8
movq 0x348(%rbx), %rdi
movq 0x20(%rdi), %rax
movq %r14, %rcx
notq %rcx
addq %rax, %rcx
movq %r14, %rdx
subq %rax, %rdx
movq %rdx, 0x38(%rsp)
leaq (%rsi,%rax), %r9
addq %r8, %r9
movq %rsi, 0x20(%rsp)
addq %rsi, %r8
shlq $0x5, %r9
shlq $0x5, %r14
subq %r14, %r9
addq $-0x8, %r9
xorpd %xmm1, %xmm1
xorl %ebp, %ebp
movq %rcx, 0x40(%rsp)
movq %rcx, %r14
xorpd %xmm0, %xmm0
movss %xmm0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq %r8, 0x30(%rsp)
cmpq 0x40(%rsp), %rbp
ja 0x5faed
leaq (%r8,%r14), %rax
movq (%rbx), %rcx
movq 0x28(%rbx), %rdx
cmpq %rdx, %rax
movl $0x0, %r13d
cmovaeq %rdx, %r13
shlq $0x5, %r13
subq %r13, %rcx
movq %r9, %r12
maxss (%r9,%rcx), %xmm1
movss %xmm1, 0xc(%rsp)
movq %r14, %rsi
callq 0x5fc22
movzbl %al, %eax
movl 0x23c(%rbx,%rax,4), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x23c(%rbx,%rax,4)
movq 0x348(%rbx), %rdi
movq 0x20(%rdi), %rax
movq 0x38(%rsp), %rdx
addq %rbp, %rdx
addq %rax, %rdx
js 0x5fa6f
cvtsi2ss %rdx, %xmm1
jmp 0x5fa84
movq %rdx, %rsi
shrq %rsi
andl $0x1, %edx
orq %rsi, %rdx
cvtsi2ss %rdx, %xmm1
addss %xmm1, %xmm1
addl %ecx, %r15d
cvtsi2ss %r15, %xmm0
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm1
ucomisd 0x3d0(%rbx), %xmm1
movq 0x30(%rsp), %r8
movq %r12, %r9
jbe 0x5fae5
ucomiss 0x10(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
jb 0x5fad6
ucomiss %xmm1, %xmm0
jb 0x5fad6
movq (%rbx), %rcx
subq %r13, %rcx
movss %xmm0, (%r9,%rcx)
movb $0x1, %cl
movq %rcx, 0x18(%rsp)
movq %r14, 0x28(%rsp)
movss %xmm0, 0x10(%rsp)
incq %rbp
decq %r14
addq $-0x20, %r9
jmp 0x5f9fb
movss 0xc(%rsp), %xmm1
jmp 0x5fad6
testb $0x1, 0x18(%rsp)
je 0x5fb8c
movq 0x28(%rsp), %r9
addq %r9, %r8
movq (%rbx), %rcx
movq 0x28(%rbx), %rdx
xorl %esi, %esi
cmpq %rdx, %r8
cmovaeq %rdx, %rsi
movq %r8, %rdi
subq %rsi, %rdi
subq %r9, %rax
addq $0x2, %rax
shlq $0x5, %rdi
movq 0x8(%rcx,%rdi), %rsi
cmpq %rsi, %rax
cmovbeq %rsi, %rax
movq %rax, 0x8(%rcx,%rdi)
movq 0x3c8(%rbx), %rax
cmpq $0x2, %rax
pushq $0x1
popq %rbp
jb 0x5f5da
addq 0x20(%rsp), %r9
cmpq %rax, %r9
cmovaeq %rax, %r9
movq 0x358(%rbx), %rax
decq %rax
cmpq %rax, %r9
cmovbq %r9, %rax
subq %rax, %r8
xorl %esi, %esi
cmpq %rdx, %r8
cmovaeq %rdx, %rsi
subq %rsi, %r8
shlq $0x5, %r8
movq 0x10(%rcx,%r8), %rdx
cmpq %rax, %rdx
cmovaq %rdx, %rax
movq %rax, 0x10(%rcx,%r8)
jmp 0x5f5da
pushq $0x1
popq %rbp
jmp 0x5f5da
movq 0xce41d(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x6a4c1(%rip), %rsi     # 0xca066
leaq 0x7c931(%rip), %rdx     # 0xdc4dd
leaq 0x7c94b(%rip), %rcx     # 0xdc4fe
leaq 0x7c8ab(%rip), %r8      # 0xdc465
movl $0x97, %r9d
jmp 0x5fc16
movq 0xce3ef(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x6a493(%rip), %rsi     # 0xca066
leaq 0x7c945(%rip), %rdx     # 0xdc51f
leaq 0x7c92e(%rip), %rcx     # 0xdc50f
leaq 0x7c87d(%rip), %r8      # 0xdc465
pushq $0x66
jmp 0x5fc14
movq 0xce3c5(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x6a469(%rip), %rsi     # 0xca066
leaq 0x7c93e(%rip), %rdx     # 0xdc542
leaq 0x7c904(%rip), %rcx     # 0xdc50f
leaq 0x7c853(%rip), %r8      # 0xdc465
pushq $0x67
popq %r9
xorl %eax, %eax
callq 0xb8c0
callq 0xb300