// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/region_mapping.c
// Function: gt_region_mapping_get_md5_fingerprint
const char* gt_region_mapping_get_md5_fingerprint(GtRegionMapping *rm,
                                                  GtStr *seqid,
                                                  const GtRange *range,
                                                  GtUword *offset,
                                                  GtError *err)
{
  const char *md5 = NULL;
  int had_err;
  GtUword filenum, seqnum;
  gt_error_check(err);
  gt_assert(rm && seqid);
  gt_assert(!rm->userawseq); /* not implemented */
  gt_assert(!gt_md5_seqid_has_prefix(gt_str_get(seqid))); /* not implemented */
  had_err = update_seq_col_if_necessary(rm, seqid, err);
  if (!had_err) {
    if (rm->usedesc) {
      gt_assert(rm->seqid2seqnum_mapping);
      had_err = gt_seqid2seqnum_mapping_map(rm->seqid2seqnum_mapping,
                                            gt_str_get(seqid), range, &seqnum,
                                            &filenum, offset, err);
      if (!had_err)
        md5 = gt_seq_col_get_md5_fingerprint(rm->seq_col, filenum, seqnum);
    }
    else if (rm->matchdesc) {
      if (!rm->seq_col) {
        if (rm->encseq) {
          if (!(rm->seq_col = gt_encseq_col_new(rm->encseq, err)))
            had_err = -1;
        } else {
          if (!(rm->seq_col = gt_bioseq_col_new(rm->sequence_filenames, err)))
            had_err = -1;
        }
      }
      if (!had_err)
        (void) gt_seq_col_grep_desc_md5(rm->seq_col, &md5, seqid, err);
      *offset = 1;
    }
    else if (rm->useseqno) {
      GtMD5Tab *tab = NULL;
      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) {
        tab = gt_encseq_get_md5_tab(rm->encseq, err);
        if (!tab)
          had_err = -1;
      }
      *offset = 1;
      if (!had_err)
        return gt_md5_tab_get(tab, seqno);
      else
        return NULL;
    } else if (rm->mapping) {
      if (!had_err)
        md5 = gt_seq_col_get_md5_fingerprint(rm->seq_col, 0, 0);
      *offset = 1;
    } else {
      if (!had_err) {
        gt_assert(!rm->usedesc && !rm->matchdesc);
        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 md5;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r14
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r15
movq $0x0, 0x20(%rsp)
testq %r8, %r8
je 0xa8c32
movq %r14, %rdi
callq 0x34fea
testb %al, %al
jne 0xa8e87
testq %r15, %r15
je 0xa8e78
testq %r12, %r12
je 0xa8e78
cmpb $0x1, 0x1b(%r15)
je 0xa8e7d
movq %r12, %rdi
callq 0x3bb5d
movq %rax, %rdi
callq 0x7aa64
testb %al, %al
jne 0xa8e82
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0xa8547
testl %eax, %eax
je 0xa8c8e
xorl %r15d, %r15d
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x1, 0x19(%r15)
jne 0xa8ce5
movq 0x40(%r15), %rbp
testq %rbp, %rbp
je 0xa8e8c
movq %r12, %rdi
callq 0x3bb5d
movq %r14, (%rsp)
leaq 0x18(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %rbp, %rdi
movq %rax, %rsi
movq %r13, %rdx
movq %rbx, %r9
callq 0xa944a
testl %eax, %eax
jne 0xa8c79
movq 0x38(%r15), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0xd830b
movq %rax, %r15
jmp 0xa8c7c
cmpb $0x1, 0x18(%r15)
jne 0xa8d13
movq 0x38(%r15), %rdi
testq %rdi, %rdi
jne 0xa8e20
movq 0x30(%r15), %rdi
testq %rdi, %rdi
je 0xa8e09
movq %r14, %rsi
callq 0xd4960
jmp 0xa8e14
cmpb $0x1, 0x1c(%r15)
jne 0xa8da4
movq $-0x1, 0x10(%rsp)
cmpq $0x0, 0x30(%r15)
je 0xa8e91
movq %r12, %rdi
callq 0x3bb5d
leaq 0x52dac(%rip), %rsi     # 0xfbaed
leaq 0x10(%rsp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0xb680
cmpl $0x1, %eax
jne 0xa8dc4
movq 0x10(%rsp), %r12
cmpq $-0x1, %r12
je 0xa8e96
movq 0x30(%r15), %rdi
callq 0xbff74
cmpq %rax, %r12
jae 0xa8e47
movq 0x30(%r15), %rdi
movq %r14, %rsi
callq 0xc4c5b
movq $0x1, (%rbx)
testq %rax, %rax
je 0xa8c79
movq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xd7d20
jmp 0xa8ce0
cmpq $0x0, 0x20(%r15)
je 0xa8de5
movq 0x38(%r15), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xd830b
movq $0x1, (%rbx)
jmp 0xa8c7f
movq %r12, %rdi
callq 0x3bb5d
leaq 0x52d21(%rip), %rsi     # 0xfbaf4
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x34f1f
jmp 0xa8e6c
movq %r12, %rdi
callq 0x3bb5d
leaq 0x52e8d(%rip), %rsi     # 0xfbc81
xorl %r15d, %r15d
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x34f1f
jmp 0xa8c7c
movq (%r15), %rdi
movq %r14, %rsi
callq 0xbd379
movq %rax, 0x38(%r15)
testq %rax, %rax
je 0xa8e42
movq %rax, %rdi
leaq 0x20(%rsp), %r15
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0xd81ef
movq (%r15), %r15
movq $0x1, (%rbx)
jmp 0xa8c7c
xorl %r15d, %r15d
jmp 0xa8e36
movq 0x10(%rsp), %r12
movq 0x30(%r15), %rdi
callq 0xbff74
leaq 0x52eff(%rip), %rsi     # 0xfbd5b
movq %r14, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x34f1f
movq $0x1, (%rbx)
jmp 0xa8c79
callq 0x24211
callq 0x2432e
callq 0x242f5
callq 0x241d8
callq 0x242bc
callq 0x24283
callq 0x2424a