// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/diagbandseed.c
// Function: gt_diagbandseed_kmer_iter_next
static const GtKmerPosList *gt_diagbandseed_kmer_iter_next(
                                              GtDiagbandseedKmerIterator *ki)
{
  GtCodetype code;

  if (ki->at_list_end)
  {
    return NULL;
  }
  /* reset section list */
  if (ki->original != NULL)
  { /* list based */
    if (ki->section.encode_info != NULL)
    {
      code = gt_kmerpos_entry_code(ki->section.encode_info,*ki->listptr_uword);
      ki->listptr_struct = ki->section.spaceGtDiagbandseedKmerPos;
      do
      {
        gt_assert(ki->listptr_struct < ki->listend_struct);
        gt_kmerpos_entry_decode(ki->listptr_struct++,
                                ki->section.encode_info,*ki->listptr_uword);
        ki->listptr_uword++;
      } while (ki->listptr_uword < ki->listend_uword &&
               code == gt_kmerpos_entry_code(ki->section.encode_info,
                                             *ki->listptr_uword));
      if (ki->listptr_uword >= ki->listend_uword)
      {
        ki->at_list_end = true;
      }
    } else
    {
      code = ki->listptr_struct->code;
      ki->section.spaceGtDiagbandseedKmerPos = ki->listptr_struct;
      /* add element to section until code differs */
      do
      {
        ki->listptr_struct++;
      } while (ki->listptr_struct < ki->listend_struct &&
               code == ki->listptr_struct->code);
      if (ki->listptr_struct >= ki->listend_struct)
      {
        ki->at_list_end = true;
      }
    }
  } else
  { /* file based */
    int rval;

    if (ki->section.encode_info != NULL)
    {
      ki->listptr_struct = ki->section.spaceGtDiagbandseedKmerPos;
      code = gt_kmerpos_entry_code(ki->section.encode_info,ki->buffer_uword);
      do
      {
        gt_assert(ki->listptr_struct < ki->listend_struct);
        gt_kmerpos_entry_decode(ki->listptr_struct++,
                                ki->section.encode_info,ki->buffer_uword);
        rval = gt_readnextfromstream_GtUword(&ki->buffer_uword,
                                             &ki->kmerstream_uword);
      } while (rval == 1 &&
               code == gt_kmerpos_entry_code(ki->section.encode_info,
                                             ki->buffer_uword));
    } else
    {
      if (ki->section.spaceGtDiagbandseedKmerPos < ki->listptr_struct)
      {
        ki->section.spaceGtDiagbandseedKmerPos[0] = *ki->listptr_struct;
        ki->listptr_struct = ki->section.spaceGtDiagbandseedKmerPos;
      }
      code = ki->listptr_struct->code;
      do
      {
        ki->listptr_struct++;
        gt_assert(ki->listptr_struct < ki->listend_struct);
        rval = gt_readnextfromstream_GtDiagbandseedKmerPos(ki->listptr_struct,
                                                           &ki->
                                                             kmerstream_struct);
      } while (rval == 1 && code == ki->listptr_struct->code);
    }
    if (rval != 1)
    {
      ki->at_list_end = true;
    }
  }
  ki->section.nextfree = (GtUword) (ki->listptr_struct -
                                    ki->section.spaceGtDiagbandseedKmerPos);
  return &ki->section;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x0, 0x30(%rdi)
je 0x197727
xorl %ebx, %ebx
jmp 0x197896
movq %rdi, %rbx
cmpq $0x0, 0x38(%rdi)
movq 0x28(%rdi), %rsi
je 0x1977a0
testq %rsi, %rsi
je 0x197814
movq (%rbx), %rax
movq 0x58(%rbx), %rcx
movq (%rcx), %rdx
movb 0x20(%rsi), %cl
movq %rdx, %r14
shrq %cl, %r14
movq %rax, 0x48(%rbx)
movq 0x48(%rbx), %rdi
cmpq 0x40(%rbx), %rdi
jae 0x1978a5
leaq 0x10(%rdi), %rax
movq %rax, 0x48(%rbx)
callq 0x19465a
movq 0x58(%rbx), %rax
addq $0x8, %rax
movq %rax, 0x58(%rbx)
cmpq 0x50(%rbx), %rax
jae 0x197883
movq 0x28(%rbx), %rsi
movq (%rax), %rdx
movb 0x20(%rsi), %cl
movq %rdx, %rax
shrq %cl, %rax
cmpq %rax, %r14
je 0x197755
jmp 0x197887
movq (%rbx), %rax
testq %rsi, %rsi
je 0x197841
movq %rax, 0x48(%rbx)
leaq 0x90(%rbx), %r14
movq 0x90(%rbx), %rdx
movb 0x20(%rsi), %cl
movq %rdx, %r12
shrq %cl, %r12
leaq 0x78(%rbx), %r15
movq 0x48(%rbx), %rdi
cmpq 0x40(%rbx), %rdi
jae 0x1978aa
leaq 0x10(%rdi), %rax
movq %rax, 0x48(%rbx)
callq 0x19465a
movq %r14, %rdi
movq %r15, %rsi
callq 0x1978b4
testl %eax, %eax
je 0x197883
movq 0x28(%rbx), %rsi
movq 0x90(%rbx), %rdx
movb 0x20(%rsi), %cl
movq %rdx, %rax
shrq %cl, %rax
cmpq %rax, %r12
je 0x1977cb
jmp 0x197887
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rcx
movq (%rcx), %rdx
movq %rcx, (%rbx)
addq $0x10, %rcx
cmpq %rax, %rcx
jae 0x19787f
leaq 0x10(%rcx), %rsi
cmpq (%rcx), %rdx
movq %rsi, %rcx
je 0x197826
addq $-0x10, %rsi
movq %rsi, 0x48(%rbx)
jmp 0x197887
movq 0x48(%rbx), %rdi
cmpq %rdi, %rax
jae 0x197853
movups (%rdi), %xmm0
movups %xmm0, (%rax)
movq (%rbx), %rdi
movq (%rdi), %r15
leaq 0x60(%rbx), %r14
addq $0x10, %rdi
movq %rdi, 0x48(%rbx)
cmpq 0x40(%rbx), %rdi
jae 0x1978af
movq %r14, %rsi
callq 0x197923
testl %eax, %eax
je 0x197883
movq 0x48(%rbx), %rdi
cmpq (%rdi), %r15
je 0x19785a
jmp 0x197887
movq %rcx, 0x48(%rbx)
movb $0x1, 0x30(%rbx)
movq 0x48(%rbx), %rax
subq (%rbx), %rax
sarq $0x4, %rax
movq %rax, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x5dcf8
callq 0x5dd31
callq 0x5dd6a