// File: /workspace/github_c_makefile_star2_O1/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, 0x18(%rsp)
testq %r8, %r8
je 0xa96f3
movq %r14, %rdi
callq 0x3566a
testb %al, %al
jne 0xa9947
testq %r15, %r15
je 0xa9938
testq %r12, %r12
je 0xa9938
cmpb $0x1, 0x1b(%r15)
je 0xa993d
movq %r12, %rdi
callq 0x3c40b
movq %rax, %rdi
callq 0x7a678
testb %al, %al
jne 0xa9942
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0xa8fbb
testl %eax, %eax
je 0xa974e
movq 0x18(%rsp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x1, 0x19(%r15)
jne 0xa97a7
movq 0x40(%r15), %rbp
testq %rbp, %rbp
je 0xa994c
movq %r12, %rdi
callq 0x3c40b
movq %r14, (%rsp)
leaq 0x20(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %rbp, %rdi
movq %rax, %rsi
movq %r13, %rdx
movq %rbx, %r9
callq 0xa9f05
testl %eax, %eax
jne 0xa973a
movq 0x38(%r15), %rdi
movq 0x10(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0xd7c03
movq %rax, 0x18(%rsp)
jmp 0xa973a
cmpb $0x1, 0x18(%r15)
jne 0xa97d3
cmpq $0x0, 0x38(%r15)
jne 0xa98cc
movq 0x30(%r15), %rdi
testq %rdi, %rdi
je 0xa98b8
movq %r14, %rsi
callq 0xd3b98
jmp 0xa98c3
cmpb $0x1, 0x1c(%r15)
jne 0xa9856
movq $-0x1, 0x10(%rsp)
cmpq $0x0, 0x30(%r15)
je 0xa9951
movq %r12, %rdi
callq 0x3c40b
leaq 0x52380(%rip), %rsi     # 0xfbb7d
leaq 0x10(%rsp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0xb680
movl %eax, %ebp
cmpl $0x1, %eax
je 0xa982f
movq %r12, %rdi
callq 0x3c40b
leaq 0x52362(%rip), %rsi     # 0xfbb84
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3559f
cmpl $0x1, %ebp
setne %al
movq 0x10(%rsp), %r12
cmpq $-0x1, %r12
setne %cl
orb %al, %cl
je 0xa9956
cmpl $0x1, %ebp
je 0xa9871
xorl %r15d, %r15d
jmp 0xa9914
cmpq $0x0, 0x20(%r15)
je 0xa9897
movq 0x38(%r15), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xd7c03
movq %rax, 0x18(%rsp)
jmp 0xa98e0
movq 0x30(%r15), %rdi
callq 0xbef6c
cmpq %rax, %r12
jae 0xa98ec
movq 0x30(%r15), %rdi
movq %r14, %rsi
callq 0xc3c16
movq %rax, %rdi
testq %rax, %rax
setne %r15b
jmp 0xa9916
movq %r12, %rdi
callq 0x3c40b
leaq 0x5246b(%rip), %rsi     # 0xfbd11
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3559f
jmp 0xa973a
movq (%r15), %rdi
movq %r14, %rsi
callq 0xbc2f8
movq %rax, 0x38(%r15)
testq %rax, %rax
je 0xa98e0
movq 0x38(%r15), %rdi
leaq 0x18(%rsp), %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0xd7ae7
movq $0x1, (%rbx)
jmp 0xa973a
movq 0x10(%rsp), %r12
movq 0x30(%r15), %rdi
callq 0xbef6c
leaq 0x524ea(%rip), %rsi     # 0xfbdeb
xorl %r15d, %r15d
movq %r14, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x3559f
xorl %edi, %edi
movq $0x1, (%rbx)
testb %r15b, %r15b
je 0xa9931
movq 0x10(%rsp), %rsi
callq 0xd7623
jmp 0xa973f
xorl %eax, %eax
jmp 0xa973f
callq 0x242e9
callq 0x24406
callq 0x243cd
callq 0x242b0
callq 0x24394
callq 0x2435b
callq 0x24322