// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/condenseq.c
// Function: condenseq_link_extract_encoded
static GtUword condenseq_link_extract_encoded(const GtCondenseq *cs,
                                              GtUword id,
                                              GtUchar *buffer,
                                              GtUword frompos,
                                              GtUword topos)
{
  GtCondenseqLink link = cs->links[id];
  GtEditscript *editscript = link.editscript;
  GtUword unique_startpos,
          targetlength,
          startoffset,
          endpos,
          linklength,
          written;
  gt_assert(link.orig_startpos <= frompos);
  unique_startpos = gt_encseq_seqstartpos(cs->unique_es, link.unique_id);
  startoffset = frompos - link.orig_startpos;
  gt_assert(startoffset < link.len);
  linklength = link.len - startoffset;
  targetlength = topos - frompos + 1;
  if (linklength < targetlength)
    endpos = link.len - 1;
  else
    endpos = startoffset + targetlength - 1;
  written =
    gt_editscript_get_sub_sequence_v(editscript, cs->unique_es,
                                     unique_startpos + link.unique_offset,
                                     GT_READMODE_FORWARD, startoffset,
                                     endpos, buffer);
  gt_assert(written == endpos - startoffset + 1);
  return written;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movq %r8, 0x60(%rsp)
movq 0x80(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x78(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, 0x40(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x48(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x50(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x68(%rsp), %rax
jbe 0x14113c
movq 0x4fae95(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d4efe(%rip), %rsi    # 0x516013
leaq 0x40a85a(%rip), %rdx    # 0x54b976
leaq 0x40a871(%rip), %rcx    # 0x54b994
leaq 0x409e1a(%rip), %r8     # 0x54af44
movl $0x2c6, %r9d            # imm = 0x2C6
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x14113e
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rdi
movl 0x54(%rsp), %eax
movl %eax, %esi
callq 0xb0530
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rax
subq 0x48(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movl 0x50(%rsp), %ecx
cmpq %rcx, %rax
jb 0x1411af
movq 0x4fae22(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d4e8b(%rip), %rsi    # 0x516013
leaq 0x40a824(%rip), %rdx    # 0x54b9b3
leaq 0x40a7fe(%rip), %rcx    # 0x54b994
leaq 0x409da7(%rip), %r8     # 0x54af44
movl $0x2c9, %r9d            # imm = 0x2C9
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1411b1
movl 0x50(%rsp), %eax
subq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rax
subq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x28(%rsp), %rax
jae 0x1411ee
movl 0x50(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movq %rax, 0x18(%rsp)
jmp 0x141201
movq 0x20(%rsp), %rax
addq 0x28(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rdi
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rsi
movq 0x30(%rsp), %rdx
movl 0x58(%rsp), %eax
addq %rax, %rdx
movq 0x20(%rsp), %r8
movq 0x18(%rsp), %r9
movq 0x70(%rsp), %rax
xorl %ecx, %ecx
movq %rax, (%rsp)
callq 0x15bd80
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
subq 0x20(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
je 0x14128d
movq 0x4fad44(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d4dad(%rip), %rsi    # 0x516013
leaq 0x40a75d(%rip), %rdx    # 0x54b9ca
leaq 0x40a720(%rip), %rcx    # 0x54b994
leaq 0x409cc9(%rip), %r8     # 0x54af44
movl $0x2d5, %r9d            # imm = 0x2D5
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x14128f
movq 0x8(%rsp), %rax
addq $0x88, %rsp
retq
nopl (%rax)