// File: /workspace/github_c_makefile_star2_O1/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, %r14
xorl %edi, %edi
leaq 0x7(%rsp), %rsi
movb %dil, (%rsi)
leaq 0x6(%rsp), %rdx
movb %dil, (%rdx)
movq %rax, %rdi
callq 0x7f4f4
movl %eax, %ebx
incl %eax
cmpl $0x2, %eax
jae 0x7fe74
movl %ebx, %eax
addq $0x48, %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 0x7(%rsp), %cl
movq (%r14), %rdx
movq 0x18(%r14), %rax
movq %rax, %rsi
shlq $0x5, %rsi
movb %cl, (%rdx,%rsi)
movb 0x6(%rsp), %cl
movb %cl, 0x1(%rdx,%rsi)
incq %rax
pxor %xmm1, %xmm1
movdqu %xmm1, 0x8(%rdx,%rsi)
movl $0x0, 0x18(%rdx,%rsi)
movq %rax, 0x18(%r14)
subq 0x28(%r14), %rax
jb 0x7fed2
movq %rax, 0x18(%r14)
movl $0x1, %ebx
cmpb $0x0, 0x389(%r14)
jne 0x7fe63
cmpb $-0x1, 0x7(%rsp)
je 0x7ff3f
movzbl 0x6(%rsp), %eax
xorl %esi, %esi
addl $-0x43, %eax
cmpl $0x31, %eax
ja 0x80014
movabsq $0x100000001, %rcx      # imm = 0x100000001
btq %rax, %rcx
jb 0x80011
movabsq $0x1000000010, %rcx     # imm = 0x1000000010
btq %rax, %rcx
jb 0x8000c
movabsq $0x2000000020000, %rcx  # imm = 0x2000000020000
btq %rax, %rcx
jae 0x80014
movb $0x3, %sil
jmp 0x80014
movq 0x18(%r14), %rax
movq %rax, 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 0x7ffa4
movq (%r15), %rdi
leaq 0x731ce(%rip), %r12     # 0xf3155
movq %r12, %rsi
movl $0x44, %edx
callq 0x362a0
movq %r15, %rdi
movq %r12, %rsi
movl $0x45, %edx
callq 0x362a0
movq 0x3c0(%r14), %r15
leaq 0x731a3(%rip), %rsi     # 0xf3155
movl $0x28, %edi
movl $0x33, %edx
callq 0x35ee2
testq %r15, %r15
je 0x80529
movq %rax, %r12
leaq 0x73181(%rip), %rsi     # 0xf3155
movq %r15, %rdi
movl $0x35, %edx
callq 0x35ee2
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 0x7fe63
movb $0x2, %sil
jmp 0x80014
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 0x7fe63
movq 0x348(%r14), %r13
movq 0x3c0(%r14), %rcx
movq 0x20(%r13), %rax
addq $-0x2, %rcx
cmpq %rcx, %rax
jb 0x800c4
testq %r13, %r13
je 0x80533
testq %rax, %rax
je 0x80533
decq %rax
movq %rax, 0x20(%r13)
movq (%r13), %rcx
movq 0x10(%r13), %rdx
movzbl (%rcx,%rdx), %ecx
testq %rdx, %rdx
jne 0x80081
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 %rax, %rdx
jbe 0x800c4
decq %rdx
movq %rdx, 0x340(%r14)
movl 0x3c(%r14,%rcx,4), %eax
decl %eax
movl %eax, 0x3c(%r14,%rcx,4)
subl %eax, 0x34(%r14)
testq %r13, %r13
je 0x8052e
movq 0x18(%r13), %r12
cmpq %r12, 0x20(%r13)
jne 0x80165
movb %dil, 0x10(%rsp)
movl %esi, %ebx
movl $0x400, %r15d           # imm = 0x400
cmpq %r15, %r12
cmovbq %r12, %r15
leaq (%r15,%r12), %rsi
movq (%r13), %rdi
leaq 0x73057(%rip), %rdx     # 0xf3155
movq %rsi, 0x8(%rsp)
movl $0x65, %ecx
callq 0x36116
movq %rax, (%r13)
movq 0x8(%r13), %rax
cmpq 0x10(%r13), %rax
jne 0x80538
testq %r12, %r12
je 0x8053d
movq 0x18(%r13), %rcx
decq %rcx
cmpq %rax, %rcx
movl %ebx, %esi
movb 0x10(%rsp), %dil
jbe 0x80155
movq (%r13), %rax
movb (%rax,%rcx), %dl
addq %rcx, %rax
movb %dl, (%r15,%rax)
decq %rcx
movq 0x8(%r13), %rax
cmpq %rax, %rcx
ja 0x8013b
addq %r15, %rax
movq %rax, 0x8(%r13)
movq 0x8(%rsp), %rax
movq %rax, 0x18(%r13)
shlb $0x4, %dil
shlb $0x2, %bpl
addb %dil, %bpl
orb %sil, %bpl
incq 0x20(%r13)
movq (%r13), %rax
movq 0x8(%r13), %rcx
movb %bpl, (%rax,%rcx)
movq 0x8(%r13), %rax
testq %rax, %rax
jne 0x80190
movq 0x18(%r13), %rax
decq %rax
movq %rax, 0x8(%r13)
incq 0x340(%r14)
movzbl %bpl, %ecx
shll $0x2, %ecx
movl 0x13c(%r14,%rcx), %edx
movl 0x38(%r14), %eax
addl %edx, %eax
movl %eax, 0x38(%r14)
incl %edx
movl %edx, 0x13c(%r14,%rcx)
movl 0x3c(%r14,%rcx), %edx
addl %edx, 0x34(%r14)
incl %edx
movl %edx, 0x3c(%r14,%rcx)
xorps %xmm0, %xmm0
cvtsi2sd %rdx, %xmm0
movsd 0x3d0(%r14), %xmm2
movapd %xmm2, %xmm1
addsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
movl $0x1, %ebx
jbe 0x80264
movq 0x348(%r14), %rcx
testq %rcx, %rcx
je 0x8051f
movq 0x20(%rcx), %rdx
movq 0x340(%r14), %rsi
movq %rdx, %rdi
subq %rsi, %rdi
movq %rdx, %r8
negq %r8
decq %rsi
cmpq %rdi, %rdx
jbe 0x8051f
movq 0x10(%rcx), %r9
cmpq %rdi, %r9
jae 0x80235
addq 0x18(%rcx), %r9
addq (%rcx), %r9
addq %r8, %r9
movzbl 0x1(%rsi,%r9), %r9d
movl 0x3c(%r14,%r9,4), %r10d
decl %r10d
movl %r10d, 0x3c(%r14,%r9,4)
subl %r10d, 0x34(%r14)
movq %rsi, 0x340(%r14)
incq %rdi
decq %rsi
cmpb %bpl, %r9b
jne 0x8021f
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movq 0x340(%r14), %rdx
testq %rdx, %rdx
js 0x80284
xorps %xmm1, %xmm1
cvtsi2ss %rdx, %xmm1
jmp 0x8029e
movq %rdx, %rax
shrq %rax
movl %edx, %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 0x7fe63
movq %rdx, 0x10(%rsp)
movsd %xmm2, 0x38(%rsp)
leaq 0x3c(%r14), %rsi
movl 0x34(%r14), %r13d
leaq 0x23c(%r14), %r15
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
callq 0xb520
movq 0x358(%r14), %rsi
movq %rsi, %rcx
subq 0x3c0(%r14), %rcx
jbe 0x802ff
movq 0x3c8(%r14), %rax
cmpq %rcx, %rax
cmovbq %rax, %rcx
movq %rcx, 0x18(%rsp)
jmp 0x80308
movq $0x0, 0x18(%rsp)
movq 0x28(%r14), %rcx
leaq 0x10(%r14), %rax
leaq 0x370(%r14), %rdx
movq %rsi, 0x28(%rsp)
cmpq %rcx, %rsi
cmovbq %rdx, %rax
movq 0x348(%r14), %r9
testq %r9, %r9
movsd 0x38(%rsp), %xmm4
je 0x80524
movq (%r14), %rdi
movq (%rax), %r12
movq 0x20(%r9), %r8
movq 0x10(%rsp), %rdx
movq %rdx, %r11
notq %r11
addq %r8, %r11
movq %rdx, %rbp
subq %r8, %rbp
incq %rbp
movq 0x18(%rsp), %rsi
movq %r8, 0x8(%rsp)
leaq (%rsi,%r8), %rax
addq %r12, %rax
addq %rsi, %r12
shlq $0x5, %rax
shlq $0x5, %rdx
subq %rdx, %rax
movq %rdi, 0x30(%rsp)
leaq (%rax,%rdi), %rsi
addq $-0x8, %rsi
xorpd %xmm0, %xmm0
movq $0x0, 0x20(%rsp)
movq %r11, %r10
xorl %edx, %edx
xorpd %xmm1, %xmm1
leaq (%r12,%r10), %rax
cmpq %rcx, %rax
movl $0x0, %eax
cmovaeq %rcx, %rax
cmpq %r10, 0x8(%rsp)
jbe 0x80524
movq %r12, %r8
movq 0x10(%r9), %r12
cmpq %r10, %r12
jae 0x803c7
addq 0x18(%r9), %r12
shlq $0x5, %rax
movq %rsi, %rdi
subq %rax, %rdi
maxss (%rdi), %xmm1
addq (%r9), %r12
addq %rbp, %r12
movzbl (%rdx,%r12), %edi
movl (%r15,%rdi,4), %r12d
leal 0x1(%r12), %ebx
movl %ebx, (%r15,%rdi,4)
movq 0x10(%rsp), %rdi
addq %rdx, %rdi
js 0x80401
xorps %xmm3, %xmm3
cvtsi2ss %rdi, %xmm3
jmp 0x80419
movq %rdi, %rbx
shrq %rbx
andl $0x1, %edi
orq %rbx, %rdi
xorps %xmm3, %xmm3
cvtsi2ss %rdi, %xmm3
addss %xmm3, %xmm3
addl %r12d, %r13d
xorps %xmm2, %xmm2
cvtsi2ss %r13, %xmm2
divss %xmm3, %xmm2
xorps %xmm3, %xmm3
cvtss2sd %xmm2, %xmm3
ucomisd %xmm4, %xmm3
jbe 0x8046e
ucomiss %xmm0, %xmm2
movq %r8, %r12
jb 0x80459
ucomiss %xmm1, %xmm2
jb 0x80459
negq %rax
movss %xmm2, (%rsi,%rax)
movb $0x1, %al
movq %rax, 0x20(%rsp)
movq %r10, 0x40(%rsp)
movaps %xmm2, %xmm0
incq %rdx
decq %r10
addq $-0x20, %rsi
cmpq %r11, %rdx
jbe 0x8039c
jmp 0x80473
movq %r8, %r12
jmp 0x80459
testb $0x1, 0x20(%rsp)
je 0x80515
movq 0x40(%rsp), %r8
addq %r8, %r12
xorl %eax, %eax
cmpq %rcx, %r12
cmovaeq %rcx, %rax
movq %r12, %rdx
subq %rax, %rdx
movq 0x8(%rsp), %rdi
subq %r8, %rdi
addq $0x2, %rdi
shlq $0x5, %rdx
movq 0x30(%rsp), %rsi
movq 0x8(%rsi,%rdx), %rax
cmpq %rax, %rdi
cmovbeq %rax, %rdi
movq %rdi, 0x8(%rsi,%rdx)
movq 0x3c8(%r14), %rax
cmpq $0x2, %rax
movl $0x1, %ebx
jb 0x7fe63
addq 0x18(%rsp), %r8
cmpq %rax, %r8
cmovaeq %rax, %r8
movq 0x28(%rsp), %rdx
decq %rdx
cmpq %rdx, %r8
cmovbq %r8, %rdx
subq %rdx, %r12
xorl %eax, %eax
cmpq %rcx, %r12
cmovaeq %rcx, %rax
subq %rax, %r12
shlq $0x5, %r12
movq 0x10(%rsi,%r12), %rax
cmpq %rdx, %rax
cmovaq %rax, %rdx
movq %rdx, 0x10(%rsi,%r12)
jmp 0x7fe63
movl $0x1, %ebx
jmp 0x7fe63
callq 0x1de89
callq 0x1de50
callq 0x1df30
callq 0x1def9
callq 0x1dde0
callq 0x1de19
callq 0x1dec2
nop