// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_encseq_bench.c
// Function: gt_sortedlengthinfo_new
static GtSortedlengthinfo *gt_sortedlengthinfo_new(const GtEncseq *encseq,
                                                   const char *indexname,
                                                   GtError *err)
{
  GtEncseqMetadata *emd;
  GtSortedlengthinfo *sortedlengthinfo = NULL;
  int had_err = 0;

  emd = gt_encseq_metadata_new(indexname, err);
  if (emd == NULL)
    had_err = -1;
  else {
    GtUword seqlen, previousseqlen = 0, seqnum,
                  countdifferentlength = 1UL, currentpos = 0;

    sortedlengthinfo = gt_malloc(sizeof *sortedlengthinfo);
    sortedlengthinfo->minlength = gt_encseq_metadata_min_seq_length(emd);
    sortedlengthinfo->maxlength = gt_encseq_metadata_max_seq_length(emd);
    gt_assert(sortedlengthinfo->minlength > 0 &&
              sortedlengthinfo->minlength <= sortedlengthinfo->maxlength);
    for (seqnum = 0; seqnum < gt_encseq_num_of_sequences(encseq); seqnum++) {
      seqlen = gt_encseq_seqlength(encseq,seqnum);

      if (seqnum > 0) {
        if (previousseqlen > seqlen) {
          gt_error_set(err,"sequence "GT_WU" of length "GT_WU" is longer than "
                           "sequence "GT_WU" of length "GT_WU"",
                           seqnum-1,previousseqlen,seqnum,seqlen);
          had_err = -1;
          break;
        }
        if (previousseqlen < seqlen)
          countdifferentlength++;
      }
      previousseqlen = seqlen;
    }
    if (!had_err) {
      sortedlengthinfo->seqlentab
        = gt_calloc((size_t) countdifferentlength,
                    sizeof (*sortedlengthinfo->seqlentab));
    }
    else
      sortedlengthinfo->seqlentab = NULL;

    if (!had_err && countdifferentlength >= 2UL) {
      sortedlengthinfo->seqlenseppos
        = gt_malloc(sizeof (*sortedlengthinfo->seqlenseppos) *
                    (countdifferentlength-1));
      sortedlengthinfo->seqlencount
        = gt_malloc(sizeof (*sortedlengthinfo->seqlencount) *
                    (countdifferentlength-1));
    }
    else {
      sortedlengthinfo->seqlenseppos = NULL;
      sortedlengthinfo->seqlencount = NULL;
    }
    sortedlengthinfo->numofdifferentseqlen = 0;
    if (!had_err) {
      gt_assert(sortedlengthinfo->seqlenseppos != NULL &&
                sortedlengthinfo->seqlencount != NULL &&
                sortedlengthinfo->seqlentab != NULL);
      for (seqnum = 0; seqnum < gt_encseq_num_of_sequences(encseq); seqnum++) {
        seqlen = gt_encseq_seqlength(encseq,seqnum);

        if (seqnum > 0) {
          if (previousseqlen < seqlen) {
            gt_assert(sortedlengthinfo->numofdifferentseqlen <
                      countdifferentlength-1);
            sortedlengthinfo->seqlencount[
              sortedlengthinfo->numofdifferentseqlen] = seqnum;
            sortedlengthinfo->seqlenseppos[
              sortedlengthinfo->numofdifferentseqlen++] = currentpos;
            sortedlengthinfo->seqlentab[
               sortedlengthinfo->numofdifferentseqlen] = seqlen;
            gt_assert(gt_encseq_get_encoded_char(encseq,currentpos,
                                                 GT_READMODE_FORWARD)
                      == (GtUchar) GT_SEPARATOR);
          }
          currentpos += 1UL + seqlen;
        }
        else {
          sortedlengthinfo->seqlentab[0] = seqlen;
          currentpos = seqlen;
        }
        previousseqlen = seqlen;
      }
      sortedlengthinfo->numofdifferentseqlen++;
    }
  }
  gt_encseq_metadata_delete(emd);
  if (!had_err)
    return sortedlengthinfo;
  gt_sortedlengthinfo_delete(sortedlengthinfo);
  return NULL;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
movq $0x0, 0x48(%rsp)
movl $0x0, 0x44(%rsp)
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0xd4e10
movq %rax, 0x50(%rsp)
cmpq $0x0, 0x50(%rsp)
jne 0x2e51d
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x2e992
movq $0x0, 0x30(%rsp)
movq $0x1, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x30, %edi
leaq 0x4ed71f(%rip), %rsi    # 0x51bc63
movl $0x88, %edx
callq 0xe80f0
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rdi
callq 0xd6820
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, (%rax)
movq 0x50(%rsp), %rdi
callq 0xd67d0
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x48(%rsp), %rax
cmpq $0x0, (%rax)
jbe 0x2e59c
movq 0x48(%rsp), %rax
movq (%rax), %rax
movq 0x48(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x2e5d4
movq 0x60d9fd(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4e7a66(%rip), %rsi    # 0x516013
leaq 0x4ed8f0(%rip), %rdx    # 0x51bea4
leaq 0x4ed947(%rip), %rcx    # 0x51bf02
leaq 0x4ed6a1(%rip), %r8     # 0x51bc63
movl $0x8c, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2e5d6
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %rdi
callq 0xa9d50
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jae 0x2e69a
movq 0x68(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xb09f0
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x28(%rsp)
jbe 0x2e67d
movq 0x30(%rsp), %rax
cmpq 0x38(%rsp), %rax
jbe 0x2e661
movq 0x58(%rsp), %rdi
movq 0x28(%rsp), %rdx
subq $0x1, %rdx
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x38(%rsp), %r9
leaq 0x4ed8ca(%rip), %rsi    # 0x51bf1a
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x2e69a
movq 0x30(%rsp), %rax
cmpq 0x38(%rsp), %rax
jae 0x2e67b
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2e67d
movq 0x38(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x2e5df
cmpl $0x0, 0x44(%rsp)
jne 0x2e6ca
movq 0x20(%rsp), %rdi
movl $0x8, %esi
leaq 0x4ed5b1(%rip), %rdx    # 0x51bc63
movl $0xa0, %ecx
callq 0xe83c0
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x28(%rax)
jmp 0x2e6d7
movq 0x48(%rsp), %rax
movq $0x0, 0x28(%rax)
cmpl $0x0, 0x44(%rsp)
jne 0x2e73c
cmpq $0x2, 0x20(%rsp)
jb 0x2e73c
movq 0x20(%rsp), %rdi
subq $0x1, %rdi
shlq $0x3, %rdi
leaq 0x4ed569(%rip), %rsi    # 0x51bc63
movl $0xa8, %edx
callq 0xe80f0
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x20(%rsp), %rdi
subq $0x1, %rdi
shlq $0x3, %rdi
leaq 0x4ed53f(%rip), %rsi    # 0x51bc63
movl $0xab, %edx
callq 0xe80f0
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x2e756
movq 0x48(%rsp), %rax
movq $0x0, 0x18(%rax)
movq 0x48(%rsp), %rax
movq $0x0, 0x20(%rax)
movq 0x48(%rsp), %rax
movq $0x0, 0x10(%rax)
cmpl $0x0, 0x44(%rsp)
jne 0x2e990
jmp 0x2e770
movq 0x48(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x2e794
movq 0x48(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x2e794
movq 0x48(%rsp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x2e7cc
movq 0x60d805(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4e786e(%rip), %rsi    # 0x516013
leaq 0x4ed7b3(%rip), %rdx    # 0x51bf5f
leaq 0x4ed74f(%rip), %rcx    # 0x51bf02
leaq 0x4ed4a9(%rip), %r8     # 0x51bc63
movl $0xb5, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2e7ce
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rdi
callq 0xa9d50
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x2e97f
movq 0x68(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xb09f0
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x28(%rsp)
jbe 0x2e947
movq 0x30(%rsp), %rax
cmpq 0x38(%rsp), %rax
jae 0x2e932
jmp 0x2e82e
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jb 0x2e87d
movq 0x60d754(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4e77bd(%rip), %rsi    # 0x516013
leaq 0x4ed779(%rip), %rdx    # 0x51bfd6
leaq 0x4ed69e(%rip), %rcx    # 0x51bf02
leaq 0x4ed3f8(%rip), %r8     # 0x51bc63
movl $0xbc, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2e87f
movq 0x28(%rsp), %rdx
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x48(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x18(%rsp), %rdx
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x48(%rsp), %rsi
movq 0x10(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x10(%rsi)
movq %rdx, (%rax,%rcx,8)
movq 0x38(%rsp), %rdx
movq 0x48(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x48(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x68(%rsp), %rdi
movq 0x18(%rsp), %rsi
xorl %edx, %edx
callq 0xa9da0
movzbl %al, %eax
cmpl $0xff, %eax
je 0x2e92e
movq 0x60d6a3(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4e770c(%rip), %rsi    # 0x516013
leaq 0x4ed708(%rip), %rdx    # 0x51c016
leaq 0x4ed5ed(%rip), %rcx    # 0x51bf02
leaq 0x4ed347(%rip), %r8     # 0x51bc63
movl $0xc5, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2e930
jmp 0x2e932
movq 0x38(%rsp), %rax
addq $0x1, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x2e962
movq 0x38(%rsp), %rcx
movq 0x48(%rsp), %rax
movq 0x28(%rax), %rax
movq %rcx, (%rax)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x2e7d7
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
jmp 0x2e992
movq 0x50(%rsp), %rdi
callq 0xd6ae0
cmpl $0x0, 0x44(%rsp)
jne 0x2e9af
movq 0x48(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x2e9c2
movq 0x48(%rsp), %rdi
callq 0x2dd40
movq $0x0, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopl (%rax)