// File: /workspace/github_c_makefile_star2_O3/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 $0x58, %rsp
movq %rdx, %rcx
movq %rsi, %rax
movq %rdi, %r14
xorl %edi, %edi
leaq 0x6(%rsp), %rsi
movb %dil, (%rsi)
leaq 0x7(%rsp), %rdx
movb %dil, (%rdx)
movq %rax, %rdi
callq 0x7f572
movl %eax, %ebx
incl %eax
cmpl $0x2, %eax
jae 0x7ff10
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incq 0x20(%r14)
movdqu 0x350(%r14), %xmm0
pcmpeqd %xmm1, %xmm1
psubq %xmm1, %xmm0
movdqu %xmm0, 0x350(%r14)
movb 0x6(%rsp), %al
movq (%r14), %rdx
movq 0x18(%r14), %rcx
movq %rcx, %rsi
shlq $0x5, %rsi
movb %al, (%rdx,%rsi)
movzbl 0x7(%rsp), %eax
movb %al, 0x1(%rdx,%rsi)
incq %rcx
pxor %xmm1, %xmm1
movdqu %xmm1, 0x8(%rdx,%rsi)
movl $0x0, 0x18(%rdx,%rsi)
movq %rcx, 0x18(%r14)
movq %rcx, %rdx
subq 0x28(%r14), %rdx
jb 0x7ff75
movq %rdx, 0x18(%r14)
movq %rdx, %rcx
movl $0x1, %ebx
cmpb $0x0, 0x389(%r14)
jne 0x7feff
cmpb $-0x1, 0x6(%rsp)
je 0x7ffe1
xorl %esi, %esi
addl $-0x43, %eax
cmpl $0x31, %eax
ja 0x800b2
movabsq $0x100000001, %rcx      # imm = 0x100000001
btq %rax, %rcx
jb 0x800af
movabsq $0x1000000010, %rcx     # imm = 0x1000000010
btq %rax, %rcx
jb 0x800aa
movabsq $0x2000000020000, %rcx  # imm = 0x2000000020000
btq %rax, %rcx
jae 0x800b2
movb $0x3, %sil
jmp 0x800b2
movq %rcx, 0x370(%r14)
movw $0x0, 0x30(%r14)
leaq 0x34(%r14), %rdi
xorl %eax, %eax
movq %rax, 0x340(%r14)
movq %rax, 0x358(%r14)
movl $0x208, %edx            # imm = 0x208
xorl %esi, %esi
callq 0xb2f0
movq 0x348(%r14), %r15
testq %r15, %r15
je 0x80042
movq (%r15), %rdi
leaq 0x730e0(%rip), %r12     # 0xf3105
movq %r12, %rsi
movl $0x44, %edx
callq 0x35c27
movq %r15, %rdi
movq %r12, %rsi
movl $0x45, %edx
callq 0x35c27
movq 0x3c0(%r14), %r15
leaq 0x730b5(%rip), %rsi     # 0xf3105
movl $0x28, %edi
movl $0x33, %edx
callq 0x35862
testq %r15, %r15
je 0x805d3
movq %rax, %r12
leaq 0x73093(%rip), %rsi     # 0xf3105
movq %r15, %rdi
movl $0x35, %edx
callq 0x35862
movq %rax, (%r12)
movq $0x0, 0x20(%r12)
movq %r15, 0x18(%r12)
decq %r15
movq %r15, 0x8(%r12)
movq %r15, 0x10(%r12)
movq %r12, 0x348(%r14)
jmp 0x7feff
movb $0x2, %sil
jmp 0x800b2
movb $0x1, %sil
movb 0x30(%r14), %dil
movb 0x31(%r14), %bpl
movb %bpl, 0x30(%r14)
movb %sil, 0x31(%r14)
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %rax
cmpq $0x3, %rax
jb 0x7feff
movq 0x348(%r14), %r13
movq 0x3c0(%r14), %rax
movq 0x20(%r13), %r15
addq $-0x2, %rax
cmpq %rax, %r15
jae 0x800f7
movq (%r13), %rax
jmp 0x8015f
testq %r15, %r15
je 0x805d8
decq %r15
movq %r15, 0x20(%r13)
movq (%r13), %rax
movq 0x10(%r13), %rdx
movzbl (%rax,%rdx), %ecx
testq %rdx, %rdx
jne 0x8011c
movq 0x18(%r13), %rdx
decq %rdx
movq %rdx, 0x10(%r13)
movl 0x13c(%r14,%rcx,4), %edx
decl %edx
movl %edx, 0x13c(%r14,%rcx,4)
subl %edx, 0x38(%r14)
movq 0x340(%r14), %rdx
cmpq %r15, %rdx
jbe 0x8015f
decq %rdx
movq %rdx, 0x340(%r14)
movl 0x3c(%r14,%rcx,4), %edx
decl %edx
movl %edx, 0x3c(%r14,%rcx,4)
subl %edx, 0x34(%r14)
cmpq 0x18(%r13), %r15
jne 0x801fc
movb %dil, 0x10(%rsp)
movl %esi, %ebx
movl $0x400, %r12d           # imm = 0x400
cmpq %r12, %r15
cmovbq %r15, %r12
leaq (%r12,%r15), %rsi
leaq 0x72f7d(%rip), %rdx     # 0xf3105
movq %rax, %rdi
movq %rsi, 0x8(%rsp)
movl $0x65, %ecx
callq 0x35a9d
movq %rax, (%r13)
movq 0x8(%r13), %rcx
cmpq 0x10(%r13), %rcx
jne 0x805dd
testq %r15, %r15
je 0x805e2
movq 0x18(%r13), %rdx
decq %rdx
cmpq %rcx, %rdx
movl %ebx, %esi
movb 0x10(%rsp), %dil
jbe 0x801e6
movq (%r13), %rax
movb (%rax,%rdx), %cl
addq %rdx, %rax
movb %cl, (%r12,%rax)
decq %rdx
movq 0x8(%r13), %rcx
cmpq %rcx, %rdx
ja 0x801c8
movq (%r13), %rax
addq %r12, %rcx
movq %rcx, 0x8(%r13)
movq 0x8(%rsp), %rdx
movq %rdx, 0x18(%r13)
movq 0x20(%r13), %r15
jmp 0x80200
movq 0x8(%r13), %rcx
shlb $0x4, %dil
shlb $0x2, %bpl
addb %dil, %bpl
orb %sil, %bpl
incq %r15
movq %r15, 0x20(%r13)
movb %bpl, (%rax,%rcx)
movq 0x8(%r13), %rax
testq %rax, %rax
jne 0x80226
movq 0x18(%r13), %rax
decq %rax
movq %rax, 0x8(%r13)
movq 0x340(%r14), %rcx
leaq 0x1(%rcx), %r13
movq %r13, 0x340(%r14)
movzbl %bpl, %edx
shll $0x2, %edx
movl 0x13c(%r14,%rdx), %esi
movl 0x38(%r14), %eax
addl %esi, %eax
movl %eax, 0x38(%r14)
incl %esi
movl %esi, 0x13c(%r14,%rdx)
movl 0x3c(%r14,%rdx), %esi
movl 0x34(%r14), %r12d
addl %esi, %r12d
movl %r12d, 0x34(%r14)
incl %esi
movl %esi, 0x3c(%r14,%rdx)
xorps %xmm0, %xmm0
cvtsi2sd %rsi, %xmm0
movsd 0x3d0(%r14), %xmm2
movapd %xmm2, %xmm1
addsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x80307
movq 0x348(%r14), %rdx
movq 0x20(%rdx), %rsi
movq %rsi, %rdi
negq %rdi
movq %rcx, %r8
notq %r8
addq %rsi, %r8
movl $0x1, %ebx
cmpq %r8, %rsi
jbe 0x805ce
movq 0x10(%rdx), %r9
cmpq %r8, %r9
jae 0x802cd
addq 0x18(%rdx), %r9
addq (%rdx), %r9
addq %rdi, %r9
movzbl 0x1(%rcx,%r9), %r9d
movl 0x3c(%r14,%r9,4), %r10d
decl %r10d
movl %r10d, 0x3c(%r14,%r9,4)
subl %r10d, %r12d
movl %r12d, 0x34(%r14)
movq %rcx, 0x340(%r14)
decq %rcx
incq %r8
cmpb %bpl, %r9b
jne 0x802b7
incq %rcx
movq %rcx, %r13
jmp 0x8030c
movl $0x1, %ebx
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
testq %r13, %r13
js 0x80325
xorps %xmm1, %xmm1
cvtsi2ss %r13, %xmm1
jmp 0x80340
movq %r13, %rax
shrq %rax
movl %r13d, %ecx
andl $0x1, %ecx
orq %rax, %rcx
xorps %xmm1, %xmm1
cvtsi2ss %rcx, %xmm1
addss %xmm1, %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x7feff
movsd %xmm2, 0x40(%rsp)
leaq 0x3c(%r14), %rsi
leaq 0x23c(%r14), %r15
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
callq 0xb520
movq 0x358(%r14), %rdx
movq %rdx, %r8
subq 0x3c0(%r14), %r8
jbe 0x80393
movq 0x3c8(%r14), %rax
cmpq %r8, %rax
cmovbq %rax, %r8
jmp 0x80396
xorl %r8d, %r8d
movq (%r14), %rdi
movq 0x28(%r14), %rsi
leaq 0x10(%r14), %rax
leaq 0x370(%r14), %rcx
movq %rdx, 0x20(%rsp)
cmpq %rsi, %rdx
cmovbq %rcx, %rax
movq (%rax), %rdx
movq 0x348(%r14), %r10
movq 0x20(%r10), %rax
movq %r13, %rcx
notq %r13
addq %rax, %r13
movq %rcx, %r9
subq %rax, %r9
movq %r9, 0x50(%rsp)
movq %rax, 0x10(%rsp)
addq %r8, %rax
addq %rdx, %rax
movq %r8, 0x18(%rsp)
addq %r8, %rdx
movq %rdx, 0x8(%rsp)
shlq $0x5, %rax
movq %rdi, 0x30(%rsp)
leaq (%rax,%rdi), %rdx
addq $-0x8, %rdx
xorpd %xmm0, %xmm0
xorl %edi, %edi
xorl %r8d, %r8d
xorpd %xmm1, %xmm1
movsd 0x40(%rsp), %xmm4
movq %rdx, 0x38(%rsp)
movq %rdi, 0x48(%rsp)
leaq 0x1(%r8), %rax
movq %r13, %r11
subq %r8, %r11
movq %rcx, %rbp
addq %rcx, %r8
shlq $0x5, %r8
subq %r8, %rdx
movq %rax, %r8
movq 0x8(%rsp), %rax
leaq (%rax,%r11), %r9
cmpq %rsi, %r9
movl $0x0, %edi
cmovaeq %rsi, %rdi
cmpq %r11, 0x10(%rsp)
jbe 0x805c9
movq 0x10(%r10), %rbx
cmpq %r11, %rbx
jae 0x80463
addq 0x18(%r10), %rbx
shlq $0x5, %rdi
movq %rdx, %rax
subq %rdi, %rax
maxss (%rax), %xmm1
addq (%r10), %rbx
addq 0x50(%rsp), %rbx
movzbl (%r8,%rbx), %edi
movl (%r15,%rdi,4), %ebx
leal 0x1(%rbx), %ecx
movl %ecx, (%r15,%rdi,4)
leaq (%r8,%rbp), %rdi
decq %rdi
testq %rdi, %rdi
js 0x8049f
xorps %xmm3, %xmm3
cvtsi2ss %rdi, %xmm3
jmp 0x804b7
movq %rdi, %rcx
shrq %rcx
andl $0x1, %edi
orq %rcx, %rdi
xorps %xmm3, %xmm3
cvtsi2ss %rdi, %xmm3
addss %xmm3, %xmm3
addl %ebx, %r12d
xorps %xmm2, %xmm2
cvtsi2ss %r12, %xmm2
divss %xmm3, %xmm2
ucomiss %xmm0, %xmm2
jb 0x804dd
xorps %xmm3, %xmm3
cvtss2sd %xmm2, %xmm3
ucomisd %xmm4, %xmm3
jbe 0x804dd
ucomiss %xmm1, %xmm2
jae 0x804f6
leaq 0x1(%r8), %rax
decq %r11
addq $-0x20, %rdx
cmpq %r13, %r8
movq %rax, %r8
jbe 0x80436
jmp 0x80518
movss %xmm2, (%rax)
movb $0x1, %dil
movaps %xmm2, %xmm0
movq %r11, 0x28(%rsp)
cmpq %r13, %r8
movq %rbp, %rcx
movq 0x38(%rsp), %rdx
jbe 0x80417
jmp 0x80530
testb $0x1, 0x48(%rsp)
je 0x805bf
movq 0x28(%rsp), %r11
movq 0x8(%rsp), %r9
addq %r11, %r9
movl $0x1, %ebx
xorl %eax, %eax
cmpq %rsi, %r9
cmovaeq %rsi, %rax
movq %r9, %rcx
subq %rax, %rcx
movq 0x10(%rsp), %rdi
subq %r11, %rdi
addq $0x2, %rdi
shlq $0x5, %rcx
movq 0x30(%rsp), %rdx
movq 0x8(%rdx,%rcx), %rax
cmpq %rax, %rdi
cmovbeq %rax, %rdi
movq %rdi, 0x8(%rdx,%rcx)
movq 0x3c8(%r14), %rax
cmpq $0x2, %rax
jb 0x7feff
addq 0x18(%rsp), %r11
cmpq %rax, %r11
cmovaeq %rax, %r11
movq 0x20(%rsp), %rcx
decq %rcx
cmpq %rcx, %r11
cmovbq %r11, %rcx
subq %rcx, %r9
xorl %eax, %eax
cmpq %rsi, %r9
cmovaeq %rsi, %rax
subq %rax, %r9
shlq $0x5, %r9
movq 0x10(%rdx,%r9), %rax
cmpq %rcx, %rax
cmovaq %rax, %rcx
movq %rcx, 0x10(%rdx,%r9)
jmp 0x7feff
movl $0x1, %ebx
jmp 0x7feff
callq 0x1de5a
callq 0x1de21
callq 0x1deca
callq 0x1ddb1
callq 0x1ddea
callq 0x1de93
nop