// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/region_mapping.c
// Function: gt_region_mapping_get_description
int gt_region_mapping_get_description(GtRegionMapping *rm, GtStr *desc,
                                      GtStr *seqid, GtError *err)
{
  int had_err = 0;
  gt_error_check(err);
  gt_assert(rm && desc && seqid);
  if (rm->userawseq) {
    gt_str_append_cstr(desc, "<rawseq>");
    return 0;
  }
  had_err = update_seq_col_if_necessary(rm, seqid, err);
  if (!had_err) {
    if (gt_md5_seqid_has_prefix(gt_str_get(seqid))) {
      had_err = gt_seq_col_md5_to_description(rm->seq_col, desc, seqid,
                                              err);
    } else if (rm->usedesc) {
      GtUword filenum, seqnum;
      gt_assert(rm->seqid2seqnum_mapping);
      had_err = gt_seqid2seqnum_mapping_map(rm->seqid2seqnum_mapping,
                                            gt_str_get(seqid), NULL, &seqnum,
                                            &filenum, NULL, err);
      if (!had_err) {
        char *cdesc;
        cdesc = gt_seq_col_get_description(rm->seq_col, filenum, seqnum);
        gt_assert(cdesc);
        gt_str_append_cstr(desc, cdesc);
        gt_free(cdesc);
      }
    } else if (rm->useseqno) {
      GtUword seqno = GT_UNDEF_UWORD;
      gt_assert(rm->encseq);
      if (1 != sscanf(gt_str_get(seqid), "seq"GT_WU"", &seqno)) {
        gt_error_set(err, "seqid '%s' does not have the form 'seqX' "
                          "where X is a sequence number in the encoded "
                          "sequence", gt_str_get(seqid));
        had_err = -1;
      }
      gt_assert(had_err || seqno != GT_UNDEF_UWORD);
      if (!had_err && seqno >= gt_encseq_num_of_sequences(rm->encseq)) {
          gt_error_set(err, "trying to access sequence "GT_WU", but encoded"
                            "sequence contains only "GT_WU" sequences",
                            seqno, gt_encseq_num_of_sequences(rm->encseq));
          had_err = -1;
      }
      if (!had_err) {
        GtUword desclen;
        const char *edesc;
        edesc = gt_encseq_description(rm->encseq, &desclen, seqno);
        gt_str_append_cstr_nt(desc, edesc, desclen);
      }
    } else if (rm->matchdesc) {
      had_err = gt_seq_col_grep_desc_description(rm->seq_col, desc,
                                                 seqid, err);
    } else if (rm->mapping) {
      char *cdesc;
      cdesc = gt_seq_col_get_description(rm->seq_col, 0, 0);
      gt_assert(cdesc);
      gt_str_append_cstr(desc, cdesc);
      gt_free(cdesc);
    } else {
      gt_assert(!rm->usedesc && !rm->matchdesc);
      if (!had_err) {
        gt_error_set(err, "no mapping rule given and no MD5 tags "
                          "present in the query seqid \"%s\" -- no mapping can "
                          "be defined", gt_str_get(seqid));
        had_err = -1;
      }
    }
  }
  return had_err;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r12
testq %rcx, %rcx
je 0xa895d
movq %r15, %rdi
callq 0x34fea
testb %al, %al
jne 0xa8bd9
testq %r12, %r12
je 0xa8bd4
testq %r14, %r14
je 0xa8bd4
testq %r13, %r13
je 0xa8bd4
cmpb $0x1, 0x1b(%r12)
jne 0xa8993
leaq 0x533c5(%rip), %rsi     # 0xfbd4c
movq %r14, %rdi
callq 0x3b7af
xorl %ebx, %ebx
jmp 0xa89aa
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0xa8547
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0xa89ba
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r13, %rdi
callq 0x3bb5d
movq %rax, %rdi
callq 0x7aa64
testb %al, %al
je 0xa89ee
movq 0x38(%r12), %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r15, %rcx
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xd8287
cmpb $0x1, 0x19(%r12)
jne 0xa8a73
movq 0x40(%r12), %rbx
testq %rbx, %rbx
je 0xa8bde
movq %r13, %rdi
callq 0x3bb5d
movq %r15, (%rsp)
leaq 0x18(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %r9d, %r9d
callq 0xa944a
movl %eax, %ebx
testl %eax, %eax
jne 0xa89aa
movq 0x38(%r12), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0xd8343
testq %rax, %rax
je 0xa8be8
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x3b7af
leaq 0x52e38(%rip), %rsi     # 0xfb89e
movq %r15, %rdi
movl $0x1b9, %edx            # imm = 0x1B9
jmp 0xa8b6d
cmpb $0x1, 0x1c(%r12)
jne 0xa8b07
movq $-0x1, 0x10(%rsp)
cmpq $0x0, 0x30(%r12)
je 0xa8be3
movq %r13, %rdi
callq 0x3bb5d
leaq 0x5304a(%rip), %rsi     # 0xfbaed
leaq 0x10(%rsp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0xb680
cmpl $0x1, %eax
jne 0xa8b77
movq 0x10(%rsp), %r13
cmpq $-0x1, %r13
je 0xa8bed
movq 0x30(%r12), %rdi
callq 0xbff74
cmpq %rax, %r13
jae 0xa8b88
movq 0x30(%r12), %rdi
movq 0x10(%rsp), %rdx
leaq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0xc4566
movq (%rbx), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x3b8d7
jmp 0xa898f
cmpb $0x1, 0x18(%r12)
jne 0xa8b2f
movq 0x38(%r12), %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r15, %rcx
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xd8215
cmpq $0x0, 0x20(%r12)
je 0xa8bb3
movq 0x38(%r12), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
xorl %edx, %edx
callq 0xd8343
testq %rax, %rax
je 0xa8bf2
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x3b7af
leaq 0x52d39(%rip), %rsi     # 0xfb89e
movq %r15, %rdi
movl $0x1d9, %edx            # imm = 0x1D9
callq 0x35c27
jmp 0xa89aa
movq %r13, %rdi
callq 0x3bb5d
leaq 0x52f6e(%rip), %rsi     # 0xfbaf4
jmp 0xa8bc2
movq 0x10(%rsp), %r14
movq 0x30(%r12), %rdi
callq 0xbff74
leaq 0x531bd(%rip), %rsi     # 0xfbd5b
movq %r15, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x34f1f
jmp 0xa89aa
movq %r13, %rdi
callq 0x3bb5d
leaq 0x530bf(%rip), %rsi     # 0xfbc81
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x34f1f
jmp 0xa89aa
callq 0x24082
callq 0x24049
callq 0x2419f
callq 0x2412d
callq 0x24166
callq 0x240f4
callq 0x240bb