// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
testq %rcx, %rcx
je 0xa93f6
movq %r15, %rdi
callq 0x3566a
testb %al, %al
jne 0xa969a
testq %r14, %r14
je 0xa9695
testq %rbx, %rbx
je 0xa9695
testq %r13, %r13
je 0xa9695
cmpb $0x1, 0x1b(%r14)
jne 0xa942c
leaq 0x529bd(%rip), %rsi     # 0xfbddc
movq %rbx, %rdi
callq 0x3c067
xorl %r12d, %r12d
jmp 0xa9444
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0xa8fbb
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testl %eax, %eax
je 0xa9456
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x3c40b
movq %rax, %rdi
callq 0x7a678
testb %al, %al
je 0xa948a
movq 0x38(%r14), %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r15, %rcx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd7b7f
cmpb $0x1, 0x19(%r14)
jne 0xa950d
movq 0x40(%r14), %r12
testq %r12, %r12
je 0xa969f
movq %r13, %rdi
callq 0x3c40b
movq %r15, (%rsp)
leaq 0x10(%rsp), %rcx
leaq 0x8(%rsp), %r8
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %r9d, %r9d
callq 0xa9f05
movl %eax, %r12d
testl %eax, %eax
jne 0xa9444
movq 0x38(%r14), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0xd7c3b
testq %rax, %rax
je 0xa96ae
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3c067
leaq 0x5242e(%rip), %rsi     # 0xfb92e
movq %r14, %rdi
movl $0x1b9, %edx            # imm = 0x1B9
jmp 0xa95fa
cmpb $0x1, 0x1c(%r14)
jne 0xa9592
movq $-0x1, 0x8(%rsp)
cmpq $0x0, 0x30(%r14)
je 0xa96a4
movq %r13, %rdi
callq 0x3c40b
leaq 0x52646(%rip), %rsi     # 0xfbb7d
leaq 0x8(%rsp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0xb680
movl %eax, %ebp
cmpl $0x1, %eax
je 0xa9569
movq %r13, %rdi
callq 0x3c40b
leaq 0x52628(%rip), %rsi     # 0xfbb84
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3559f
cmpl $0x1, %ebp
setne %al
movq 0x8(%rsp), %r13
cmpq $-0x1, %r13
setne %cl
orb %al, %cl
je 0xa96a9
xorl %r12d, %r12d
cmpl $0x1, %ebp
je 0xa9604
xorl %ebp, %ebp
jmp 0xa963c
cmpb $0x1, 0x18(%r14)
jne 0xa95b9
movq 0x38(%r14), %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r15, %rcx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd7b0d
cmpq $0x0, 0x20(%r14)
je 0xa9674
movq 0x38(%r14), %rdi
xorl %r12d, %r12d
xorl %esi, %esi
xorl %edx, %edx
callq 0xd7c3b
testq %rax, %rax
je 0xa96b3
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3c067
leaq 0x5233c(%rip), %rsi     # 0xfb92e
movq %r14, %rdi
movl $0x1d9, %edx            # imm = 0x1D9
callq 0x362a0
jmp 0xa9444
movq 0x30(%r14), %rdi
callq 0xbef6c
movb $0x1, %bpl
cmpq %rax, %r13
jb 0xa9642
movq 0x8(%rsp), %r12
movq 0x30(%r14), %rdi
callq 0xbef6c
leaq 0x527c1(%rip), %rsi     # 0xfbdeb
xorl %ebp, %ebp
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testb %bpl, %bpl
je 0xa9444
movq 0x30(%r14), %rdi
movq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0xc3523
movq (%r14), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3c185
jmp 0xa9444
movq %r13, %rdi
callq 0x3c40b
leaq 0x5268e(%rip), %rsi     # 0xfbd11
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3559f
jmp 0xa9444
callq 0x2415a
callq 0x24121
callq 0x24277
callq 0x24205
callq 0x241cc
callq 0x2423e
callq 0x24193