// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/ltr/ltr_cluster_prepare_seq_visitor.c
// Function: extract_feature_seq
static int extract_feature_seq(GtEncseqBuilder *b, const char *header,
                               GtStr *seqid, GtEncseq *encseq, GtRange range,
                               GT_UNUSED const char *fnt, GtError *err)
{
  char *buffer;
  int had_err = 0,
      rval;
  GtUword seqnum,
                startpos;

  rval = sscanf(gt_str_get(seqid), "seq"GT_WU"", &seqnum);
  if (rval != 1) {
    gt_error_set(err, "expected sequence ID of format 'seqX' but "
                      "encountered '%s'",gt_str_get(seqid));
    had_err = -1;
  }
  if (!had_err && (seqnum >= gt_encseq_num_of_sequences(encseq))) {
    gt_error_set(err, "annotation encountered for sequence "GT_WU", but the "
                      "supplied encoded sequence only contains sequences "
                      "0-"GT_WU"", seqnum,
                    gt_encseq_num_of_sequences(encseq)-1);
    had_err = -1;
  }

  if (!had_err) {
    buffer = gt_calloc((size_t) gt_range_length(&range) + 1, sizeof (char));
    startpos = gt_encseq_seqstartpos(encseq, seqnum);
    gt_encseq_extract_decoded(encseq, buffer, startpos + range.start - 1,
                              startpos + range.end - 1);
    gt_encseq_builder_add_cstr(b, buffer, gt_range_length(&range), header);
    gt_free(buffer);
  }

  return had_err;
}

// Assembly:
subq $0x88, %rsp
movq 0x98(%rsp), %rax
movq 0x90(%rsp), %rax
movq %r8, 0x78(%rsp)
movq %r9, 0x80(%rsp)
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movl $0x0, 0x4c(%rsp)
movq 0x60(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
leaq 0x78fb4(%rip), %rsi     # 0x562778
leaq 0x40(%rsp), %rdx
movb $0x0, %al
callq 0x19770
movl %eax, 0x48(%rsp)
cmpl $0x1, 0x48(%rsp)
je 0x4e9810
movq 0x98(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x60(%rsp), %rdi
callq 0x11dee0
movq 0x30(%rsp), %rdi
movq %rax, %rdx
leaq 0xd21f1(%rip), %rsi     # 0x5bb9f2
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x4c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x4c(%rsp)
jne 0x4e9880
movq 0x40(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rdi
callq 0xa9d50
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jb 0x4e9880
movq 0x98(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x58(%rsp), %rdi
callq 0xa9d50
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rdx
movq %rax, %rcx
subq $0x1, %rcx
leaq 0xd21bc(%rip), %rsi     # 0x5bba2d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x4c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x4c(%rsp)
jne 0x4e9944
leaq 0x78(%rsp), %rdi
callq 0x107320
movq %rax, %rdi
addq $0x1, %rdi
movl $0x1, %esi
leaq 0xd1fa2(%rip), %rdx     # 0x5bb84a
movl $0x42, %ecx
callq 0xe83c0
movq %rax, 0x50(%rsp)
movq 0x58(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xb0530
movq %rax, 0x38(%rsp)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq 0x78(%rsp), %rdx
subq $0x1, %rdx
movq 0x38(%rsp), %rcx
addq 0x80(%rsp), %rcx
subq $0x1, %rcx
callq 0xac570
movq 0x70(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x107320
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
movq 0x68(%rsp), %rcx
callq 0xbc350
movq 0x50(%rsp), %rdi
leaq 0xd1f10(%rip), %rsi     # 0x5bb84a
movl $0x47, %edx
callq 0xe88c0
movl 0x4c(%rsp), %eax
addq $0x88, %rsp
retq