// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/condenseq.c
// Function: gt_condenseq_extract_encoded_range
const GtUchar *gt_condenseq_extract_encoded_range(GtCondenseq *condenseq,
                                                  GtRange range)
{
  GtUchar *buf;
  GtUword nextsep,
          linkid = 0,
          uniqueid,
          buffoffset = 0,
          length;
  GtCondenseqLink *link = NULL;
  GtCondenseqUnique *unique = NULL;

  gt_assert(condenseq && condenseq->uds_nelems != 0);
  gt_assert(condenseq->uniques[0].orig_startpos == 0);
  gt_assert(range.start <= range.end);
  gt_assert(range.end < condenseq->orig_len);

  nextsep = condenseq_next_sep(condenseq, range.start);
  uniqueid = gt_condenseq_uniques_position_binsearch(condenseq,
                                                     range.start);

  length = range.end - range.start + 1;

  /* TODO DW check if there is another way than using this buffer, so we could
     use const for condenseq here. */
  if (condenseq->ubuffer == NULL || condenseq->ubuffsize < length) {
    condenseq->ubuffer = gt_realloc(condenseq->ubuffer,
                                    sizeof (*condenseq->ubuffer) * length);
    condenseq->ubuffsize = length;
  }

  buf = condenseq->ubuffer;

  unique = &condenseq->uniques[uniqueid];

  if (unique->orig_startpos + unique->len <= range.start) {
    uniqueid++;
    if (uniqueid == condenseq->uds_nelems)
      unique = NULL;
    else {
      unique = &condenseq->uniques[uniqueid];
      gt_assert(unique->orig_startpos + unique->len > range.start);
    }
  }

  if (condenseq->lds_nelems != 0) {
      linkid = condenseq_links_position_binsearch(condenseq, range.start);
    if (linkid == condenseq->lds_nelems)
      linkid = 0;
    link = &condenseq->links[linkid];
  }
  if (link != NULL &&
      link->orig_startpos + link->len <= range.start) {
    linkid++;
    if (linkid == condenseq->lds_nelems)
      link = NULL;
    else {
      link = &condenseq->links[linkid];
      gt_assert(link->orig_startpos + link->len > range.start);
    }
  }

  while (buffoffset < length) {
    gt_assert(nextsep == range.start + buffoffset ||
              unique != NULL ||
              link != NULL);
    if (nextsep != 0 && nextsep == range.start + buffoffset) {
      buf[buffoffset++] = GT_SEPARATOR;
      nextsep = condenseq_next_sep(condenseq, range.start + buffoffset);
    }
    else if (unique != NULL &&
             (link == NULL || unique->orig_startpos < link->orig_startpos)) {
      buffoffset += condenseq_unique_extract_encoded(condenseq, uniqueid,
                                                     buf + buffoffset,
                                                     range.start + buffoffset,
                                                     range.end);
      if (++uniqueid == condenseq->uds_nelems)
        unique = NULL;
      else {
        unique = &condenseq->uniques[uniqueid];
        gt_assert(unique->orig_startpos + unique->len > range.start);
      }
    }
    else {
      gt_assert(link != NULL);
      buffoffset += condenseq_link_extract_encoded(condenseq, linkid,
                                                   buf + buffoffset,
                                                   range.start + buffoffset,
                                                   range.end);
      if (++linkid == condenseq->lds_nelems)
        link = NULL;
      else {
        link = &condenseq->links[linkid];
        gt_assert(link->orig_startpos + link->len > range.start);
      }
    }
  }
  gt_assert(buffoffset == length);
  return buf;
}

// Assembly:
subq $0x58, %rsp
movq %rsi, 0x48(%rsp)
movq %rdx, 0x50(%rsp)
movq %rdi, 0x40(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, (%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x14060d
movq 0x40(%rsp), %rax
cmpq $0x0, 0x98(%rax)
jne 0x140645
movq 0x4fb98c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d59f5(%rip), %rsi    # 0x516013
leaq 0x40ade0(%rip), %rdx    # 0x54b405
leaq 0x40ae01(%rip), %rcx    # 0x54b42d
leaq 0x40a911(%rip), %r8     # 0x54af44
movl $0x2e5, %r9d            # imm = 0x2E5
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x140647
jmp 0x140649
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x140691
movq 0x4fb940(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d59a9(%rip), %rsi    # 0x516013
leaq 0x40addf(%rip), %rdx    # 0x54b450
leaq 0x40adb5(%rip), %rcx    # 0x54b42d
leaq 0x40a8c5(%rip), %r8     # 0x54af44
movl $0x2e6, %r9d            # imm = 0x2E6
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x140693
jmp 0x140695
movq 0x48(%rsp), %rax
cmpq 0x50(%rsp), %rax
jbe 0x1406d9
movq 0x4fb8f8(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d5961(%rip), %rsi    # 0x516013
leaq 0x4068ab(%rip), %rdx    # 0x546f64
leaq 0x40ad6d(%rip), %rcx    # 0x54b42d
leaq 0x40a87d(%rip), %r8     # 0x54af44
movl $0x2e7, %r9d            # imm = 0x2E7
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1406db
jmp 0x1406dd
movq 0x50(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq 0x78(%rcx), %rax
jb 0x140725
movq 0x4fb8ac(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d5915(%rip), %rsi    # 0x516013
leaq 0x40ad74(%rip), %rdx    # 0x54b479
leaq 0x40ad21(%rip), %rcx    # 0x54b42d
leaq 0x40a831(%rip), %r8     # 0x54af44
movl $0x2e8, %r9d            # imm = 0x2E8
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x140727
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x140ce0
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x140400
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rax
subq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x140781
movq 0x40(%rsp), %rax
movq 0x88(%rax), %rax
cmpq 0x10(%rsp), %rax
jae 0x1407c1
movq 0x40(%rsp), %rax
movq 0x30(%rax), %rdi
movq 0x10(%rsp), %rsi
shlq $0x0, %rsi
leaq 0x40a7aa(%rip), %rdx    # 0x54af44
movl $0x2f4, %ecx            # imm = 0x2F4
callq 0xe8540
movq %rax, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x10(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x88(%rax)
movq 0x40(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
imulq $0x28, 0x20(%rsp), %rcx
addq %rcx, %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq (%rsp), %rcx
movl 0x20(%rcx), %ecx
addq %rcx, %rax
cmpq 0x48(%rsp), %rax
ja 0x14089a
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq 0x98(%rcx), %rax
jne 0x14082d
movq $0x0, (%rsp)
jmp 0x140898
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
imulq $0x28, 0x20(%rsp), %rcx
addq %rcx, %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq (%rsp), %rcx
movl 0x20(%rcx), %ecx
addq %rcx, %rax
cmpq 0x48(%rsp), %rax
ja 0x140894
movq 0x4fb73d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d57a6(%rip), %rsi    # 0x516013
leaq 0x40ac25(%rip), %rdx    # 0x54b499
leaq 0x40abb2(%rip), %rcx    # 0x54b42d
leaq 0x40a6c2(%rip), %r8     # 0x54af44
movl $0x302, %r9d            # imm = 0x302
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x140896
jmp 0x140898
jmp 0x14089a
movq 0x40(%rsp), %rax
cmpq $0x0, 0x70(%rax)
je 0x1408ed
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x140d50
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq 0x70(%rcx), %rax
jne 0x1408d3
movq $0x0, 0x28(%rsp)
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x28(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x1409b4
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rsp), %rcx
movl 0x10(%rcx), %ecx
addq %rcx, %rax
cmpq 0x48(%rsp), %rax
ja 0x1409b4
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq 0x70(%rcx), %rax
jne 0x140941
movq $0x0, 0x8(%rsp)
jmp 0x1409b2
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x28(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rsp), %rcx
movl 0x10(%rcx), %ecx
addq %rcx, %rax
cmpq 0x48(%rsp), %rax
ja 0x1409ae
movq 0x4fb623(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d568c(%rip), %rsi    # 0x516013
leaq 0x40ab3d(%rip), %rdx    # 0x54b4cb
leaq 0x40aa98(%rip), %rcx    # 0x54b42d
leaq 0x40a5a8(%rip), %r8     # 0x54af44
movl $0x313, %r9d            # imm = 0x313
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1409b0
jmp 0x1409b2
jmp 0x1409b4
jmp 0x1409b6
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
jae 0x140c7f
jmp 0x1409c8
movq 0x30(%rsp), %rax
movq 0x48(%rsp), %rcx
addq 0x18(%rsp), %rcx
cmpq %rcx, %rax
je 0x140a23
cmpq $0x0, (%rsp)
jne 0x140a23
cmpq $0x0, 0x8(%rsp)
jne 0x140a23
movq 0x4fb5ae(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d5617(%rip), %rsi    # 0x516013
leaq 0x40aaf6(%rip), %rdx    # 0x54b4f9
leaq 0x40aa23(%rip), %rcx    # 0x54b42d
leaq 0x40a533(%rip), %r8     # 0x54af44
movl $0x31a, %r9d            # imm = 0x31A
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x140a25
cmpq $0x0, 0x30(%rsp)
je 0x140a79
movq 0x30(%rsp), %rax
movq 0x48(%rsp), %rcx
addq 0x18(%rsp), %rcx
cmpq %rcx, %rax
jne 0x140a79
movq 0x38(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rsp)
movb $-0x1, (%rax,%rcx)
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
addq 0x18(%rsp), %rsi
callq 0x140ce0
movq %rax, 0x30(%rsp)
jmp 0x140c7a
cmpq $0x0, (%rsp)
je 0x140b6b
cmpq $0x0, 0x8(%rsp)
je 0x140aa3
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x140b6b
movq 0x40(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq 0x18(%rsp), %rdx
movq 0x48(%rsp), %rcx
addq 0x18(%rsp), %rcx
movq 0x50(%rsp), %r8
callq 0x140f10
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rcx
cmpq 0x98(%rcx), %rax
jne 0x140afb
movq $0x0, (%rsp)
jmp 0x140b66
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
imulq $0x28, 0x20(%rsp), %rcx
addq %rcx, %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq (%rsp), %rcx
movl 0x20(%rcx), %ecx
addq %rcx, %rax
cmpq 0x48(%rsp), %rax
ja 0x140b62
movq 0x4fb46f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d54d8(%rip), %rsi    # 0x516013
leaq 0x40a957(%rip), %rdx    # 0x54b499
leaq 0x40a8e4(%rip), %rcx    # 0x54b42d
leaq 0x40a3f4(%rip), %r8     # 0x54af44
movl $0x329, %r9d            # imm = 0x329
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x140b64
jmp 0x140b66
jmp 0x140c78
jmp 0x140b6d
cmpq $0x0, 0x8(%rsp)
jne 0x140bad
movq 0x4fb424(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d548d(%rip), %rsi    # 0x516013
leaq 0x40a9a5(%rip), %rdx    # 0x54b532
leaq 0x40a899(%rip), %rcx    # 0x54b42d
leaq 0x40a3a9(%rip), %r8     # 0x54af44
movl $0x32d, %r9d            # imm = 0x32D
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x140baf
movq 0x40(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq 0x18(%rsp), %rdx
movq 0x48(%rsp), %rcx
addq 0x18(%rsp), %rcx
movq 0x50(%rsp), %r8
callq 0x141090
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x40(%rsp), %rcx
cmpq 0x70(%rcx), %rax
jne 0x140c05
movq $0x0, 0x8(%rsp)
jmp 0x140c76
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x28(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rsp), %rcx
movl 0x10(%rcx), %ecx
addq %rcx, %rax
cmpq 0x48(%rsp), %rax
ja 0x140c72
movq 0x4fb35f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d53c8(%rip), %rsi    # 0x516013
leaq 0x40a879(%rip), %rdx    # 0x54b4cb
leaq 0x40a7d4(%rip), %rcx    # 0x54b42d
leaq 0x40a2e4(%rip), %r8     # 0x54af44
movl $0x336, %r9d            # imm = 0x336
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x140c74
jmp 0x140c76
jmp 0x140c78
jmp 0x140c7a
jmp 0x1409b6
jmp 0x140c81
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x140cc5
movq 0x4fb30c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d5375(%rip), %rsi    # 0x516013
leaq 0x40a89a(%rip), %rdx    # 0x54b53f
leaq 0x40a781(%rip), %rcx    # 0x54b42d
leaq 0x40a291(%rip), %r8     # 0x54af44
movl $0x33a, %r9d            # imm = 0x33A
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x140cc7
movq 0x38(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)