// File: /workspace/github_c_makefile_star2_O1/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 0x19fbb8
xorl %ebx, %ebx
jmp 0x19fd51
movq %rdi, %rbx
cmpq $0x0, 0x38(%rdi)
movq 0x28(%rdi), %rax
je 0x19fc42
testq %rax, %rax
je 0x19fcbe
movq (%rbx), %rdx
movq 0x58(%rbx), %rcx
movq (%rcx), %r14
movb 0x20(%rax), %cl
shrq %cl, %r14
movq %rdx, 0x48(%rbx)
movq 0x48(%rbx), %rdi
cmpq 0x40(%rbx), %rdi
jae 0x19fd60
leaq 0x10(%rdi), %rax
movq %rax, 0x48(%rbx)
movq 0x28(%rbx), %rsi
movq 0x58(%rbx), %rax
movq (%rax), %rdx
callq 0x19cc5d
movq 0x50(%rbx), %rax
movq 0x58(%rbx), %rdx
addq $0x8, %rdx
movq %rdx, 0x58(%rbx)
cmpq %rax, %rdx
jae 0x19fd3e
movq 0x28(%rbx), %rcx
movq (%rdx), %rsi
movb 0x20(%rcx), %cl
shrq %cl, %rsi
cmpq %rsi, %r14
je 0x19fbe3
cmpq %rax, %rdx
jae 0x19fd3e
jmp 0x19fd42
movq (%rbx), %rcx
testq %rax, %rax
je 0x19fcf0
movq %rcx, 0x48(%rbx)
leaq 0x90(%rbx), %r14
movq 0x90(%rbx), %r12
movb 0x20(%rax), %cl
shrq %cl, %r12
leaq 0x78(%rbx), %r15
movq 0x48(%rbx), %rdi
cmpq 0x40(%rbx), %rdi
jae 0x19fd65
leaq 0x10(%rdi), %rax
movq %rax, 0x48(%rbx)
movq 0x28(%rbx), %rsi
movq 0x90(%rbx), %rdx
callq 0x19cc5d
movq %r14, %rdi
movq %r15, %rsi
callq 0x19fd6f
testl %eax, %eax
je 0x19fd3e
movq 0x28(%rbx), %rax
movq 0x90(%rbx), %rdx
movb 0x20(%rax), %cl
shrq %cl, %rdx
cmpq %rdx, %r12
je 0x19fc6a
jmp 0x19fd42
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rdx
movq (%rdx), %rsi
movq %rdx, (%rbx)
addq $0x10, %rdx
movq %rdx, %rcx
cmpq %rax, %rdx
jae 0x19fd3a
leaq 0x10(%rcx), %rdx
cmpq (%rcx), %rsi
je 0x19fcd0
addq $-0x10, %rdx
movq %rdx, 0x48(%rbx)
cmpq %rax, %rcx
jae 0x19fd3e
jmp 0x19fd42
movq 0x48(%rbx), %rax
cmpq %rax, %rcx
jae 0x19fd06
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq (%rbx), %rax
movq %rax, 0x48(%rbx)
movq 0x48(%rbx), %rax
movq (%rax), %r15
leaq 0x60(%rbx), %r14
movq 0x48(%rbx), %rdi
addq $0x10, %rdi
movq %rdi, 0x48(%rbx)
cmpq 0x40(%rbx), %rdi
jae 0x19fd6a
movq %r14, %rsi
callq 0x19fde2
testl %eax, %eax
je 0x19fd3e
movq 0x48(%rbx), %rax
cmpq (%rax), %r15
je 0x19fd11
jmp 0x19fd42
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 0x5f16c
callq 0x5f1a5
callq 0x5f1de