// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/diagbandseed.c
// Function: gt_diagbandseed_longest_code_run
static GtUword gt_diagbandseed_longest_code_run(const GtKmerPosList
                                                   *kmerpos_list)
{
  GtUword idx;
  GtLongestCodeRunType longest_code_run = 1, current_code_run = 1;
  GtCodetype previouscode;

  gt_assert(kmerpos_list != NULL);
  if (kmerpos_list->encode_info != NULL)
  {
    gt_assert(kmerpos_list->spaceGtUword != NULL);
    previouscode = gt_kmerpos_entry_code(kmerpos_list->encode_info,
                                         kmerpos_list->spaceGtUword[0]);
    for (idx = 1; idx < kmerpos_list->nextfree; idx++)
    {
      const GtCodetype currentcode
        = gt_kmerpos_entry_code(kmerpos_list->encode_info,
                                kmerpos_list->spaceGtUword[idx]);

      if (previouscode == currentcode)
      {
        current_code_run++;
      } else
      {
        if (current_code_run > longest_code_run)
        {
          longest_code_run = current_code_run;
        }
        current_code_run = 1;
        previouscode = currentcode;
      }
    }
  } else
  {
    gt_assert(kmerpos_list->spaceGtDiagbandseedKmerPos != NULL);
    previouscode = kmerpos_list->spaceGtDiagbandseedKmerPos[0].code;
    for (idx = 1; idx < kmerpos_list->nextfree; idx++)
    {
      const GtCodetype currentcode
        = kmerpos_list->spaceGtDiagbandseedKmerPos[idx].code;

      if (previouscode == currentcode)
      {
        current_code_run++;
      } else
      {
        if (current_code_run > longest_code_run)
        {
          longest_code_run = current_code_run;
        }
        current_code_run = 1;
        previouscode = currentcode;
      }
    }
  }
  if (current_code_run > longest_code_run)
  {
    longest_code_run = current_code_run;
  }
  return longest_code_run;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x13e076
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x13e01d
movq 0x8(%rdi), %rsi
testq %rsi, %rsi
je 0x13e0a4
movq (%rsi), %r9
movl 0x20(%rax), %ecx
shrq %cl, %r9
movq 0x18(%rdi), %rdi
pushq $0x1
popq %r8
movq %r8, %rdx
movq %r8, %rax
movq %r8, %r10
cmpq %rdi, %r10
jae 0x13e06d
movq (%rsi,%r10,8), %r11
shrq %cl, %r11
leaq 0x1(%rdx), %rbx
cmpq %rax, %rdx
cmovbeq %rax, %rdx
cmpq %r11, %r9
cmovneq %r8, %rbx
cmovneq %rdx, %rax
incq %r10
movq %rbx, %rdx
movq %r11, %r9
jmp 0x13dff0
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x13e0d2
movq (%rcx), %r9
movq 0x18(%rdi), %rsi
addq $0x10, %rcx
pushq $0x1
popq %rdi
movq %rdi, %rdx
movq %rdi, %rax
movq %rdi, %r8
cmpq %rsi, %r8
jae 0x13e06d
movq (%rcx), %r10
leaq 0x1(%rdx), %r11
cmpq %rax, %rdx
cmovbeq %rax, %rdx
cmpq %r10, %r9
cmovneq %rdi, %r11
cmovneq %rdx, %rax
incq %r8
addq $0x10, %rcx
movq %r11, %rdx
movq %r10, %r9
jmp 0x13e040
cmpq %rax, %rdx
cmovaq %rdx, %rax
popq %rbx
retq
movq 0x2f9eeb(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1a6f8c(%rip), %rsi    # 0x2e5013
leaq 0x202345(%rip), %rdx    # 0x3403d3
leaq 0x20246b(%rip), %rcx    # 0x340500
leaq 0x201e20(%rip), %r8     # 0x33febc
movl $0x2f8, %r9d            # imm = 0x2F8
jmp 0x13e0fe
movq 0x2f9ebd(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1a6f5e(%rip), %rsi    # 0x2e5013
leaq 0x202465(%rip), %rdx    # 0x340521
leaq 0x20243d(%rip), %rcx    # 0x340500
leaq 0x201df2(%rip), %r8     # 0x33febc
movl $0x2fb, %r9d            # imm = 0x2FB
jmp 0x13e0fe
movq 0x2f9e8f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1a6f30(%rip), %rsi    # 0x2e5013
leaq 0x20245a(%rip), %rdx    # 0x340544
leaq 0x20240f(%rip), %rcx    # 0x340500
leaq 0x201dc4(%rip), %r8     # 0x33febc
movl $0x313, %r9d            # imm = 0x313
xorl %eax, %eax
callq 0x17a50
callq 0x17390