// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x20(%rsp)
testq %r8, %r8
je 0x8a0bc
movq %r14, %rdi
callq 0xc103
testb %al, %al
jne 0x8a392
testq %r15, %r15
je 0x8a2ff
testq %r12, %r12
je 0x8a2ff
cmpb $0x1, 0x1b(%r15)
je 0x8a330
movq %r12, %rdi
callq 0x143d2
movq %rax, %rdi
callq 0x59a50
testb %al, %al
jne 0x8a361
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x89778
testl %eax, %eax
je 0x8a118
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 0x8a16f
movq 0x40(%r15), %rbp
testq %rbp, %rbp
je 0x8a3c3
movq %r12, %rdi
callq 0x143d2
movq %r14, (%rsp)
leaq 0x18(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %rbp, %rdi
movq %rax, %rsi
movq %r13, %rdx
movq %rbx, %r9
callq 0x8abc8
testl %eax, %eax
jne 0x8a103
movq 0x38(%r15), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0xbfe84
movq %rax, %r15
jmp 0x8a106
cmpb $0x1, 0x18(%r15)
jne 0x8a19d
movq 0x38(%r15), %rdi
testq %rdi, %rdi
jne 0x8a2a7
movq 0x30(%r15), %rdi
testq %rdi, %rdi
je 0x8a290
movq %r14, %rsi
callq 0xbab07
jmp 0x8a29b
cmpb $0x1, 0x1c(%r15)
jne 0x8a22b
orq $-0x1, 0x10(%rsp)
cmpq $0x0, 0x30(%r15)
je 0x8a3f1
movq %r12, %rdi
callq 0x143d2
leaq 0x5ac35(%rip), %rsi     # 0xe4dfd
leaq 0x10(%rsp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0xb680
cmpl $0x1, %eax
jne 0x8a24b
movq 0x10(%rsp), %r12
cmpq $-0x1, %r12
je 0x8a41f
movq 0x30(%r15), %rdi
callq 0xa1f8d
cmpq %rax, %r12
jae 0x8a2ce
movq 0x30(%r15), %rdi
movq %r14, %rsi
callq 0xa7fb4
movq $0x1, (%rbx)
testq %rax, %rax
je 0x8a103
movq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xbf392
jmp 0x8a16a
cmpq $0x0, 0x20(%r15)
je 0x8a26c
movq 0x38(%r15), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xbfe84
movq $0x1, (%rbx)
jmp 0x8a109
movq %r12, %rdi
callq 0x143d2
leaq 0x5abaa(%rip), %rsi     # 0xe4e04
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xc007
jmp 0x8a2f3
movq %r12, %rdi
callq 0x143d2
leaq 0x5ad16(%rip), %rsi     # 0xe4f91
xorl %r15d, %r15d
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xc007
jmp 0x8a106
movq (%r15), %rdi
movq %r14, %rsi
callq 0x9f2e7
movq %rax, 0x38(%r15)
testq %rax, %rax
je 0x8a2c9
movq %rax, %rdi
leaq 0x20(%rsp), %r15
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0xbfbd6
movq (%r15), %r15
movq $0x1, (%rbx)
jmp 0x8a106
xorl %r15d, %r15d
jmp 0x8a2bd
movq 0x10(%rsp), %r12
movq 0x30(%r15), %rdi
callq 0xa1f8d
leaq 0x5ad88(%rip), %rsi     # 0xe506b
movq %r14, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xc007
movq $0x1, (%rbx)
jmp 0x8a103
movq 0xa3cb2(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x3fd56(%rip), %rsi     # 0xca066
leaq 0x5ad03(%rip), %rdx     # 0xe501a
leaq 0x5ad9c(%rip), %rcx     # 0xe50ba
leaq 0x5a889(%rip), %r8      # 0xe4bae
movl $0x1f1, %r9d            # imm = 0x1F1
jmp 0x8a44b
movq 0xa3c81(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x3fd25(%rip), %rsi     # 0xca066
leaq 0x5ad98(%rip), %rdx     # 0xe50e0
leaq 0x5ad6b(%rip), %rcx     # 0xe50ba
leaq 0x5a858(%rip), %r8      # 0xe4bae
movl $0x1f2, %r9d            # imm = 0x1F2
jmp 0x8a44b
movq 0xa3c50(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x3fcf4(%rip), %rsi     # 0xca066
leaq 0x5ad76(%rip), %rdx     # 0xe50ef
leaq 0x5ad3a(%rip), %rcx     # 0xe50ba
leaq 0x5a827(%rip), %r8      # 0xe4bae
movl $0x1f3, %r9d            # imm = 0x1F3
jmp 0x8a44b
movq 0xa3c1f(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x3fcc3(%rip), %rsi     # 0xca066
leaq 0x402af(%rip), %rdx     # 0xca659
leaq 0x5ad09(%rip), %rcx     # 0xe50ba
leaq 0x5a7f6(%rip), %r8      # 0xe4bae
movl $0x1f0, %r9d            # imm = 0x1F0
jmp 0x8a44b
movq 0xa3bee(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x3fc92(%rip), %rsi     # 0xca066
leaq 0x5a92b(%rip), %rdx     # 0xe4d06
leaq 0x5acd8(%rip), %rcx     # 0xe50ba
leaq 0x5a7c5(%rip), %r8      # 0xe4bae
movl $0x1f7, %r9d            # imm = 0x1F7
jmp 0x8a44b
movq 0xa3bc0(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x3fc64(%rip), %rsi     # 0xca066
leaq 0x5a9e9(%rip), %rdx     # 0xe4df2
leaq 0x5acaa(%rip), %rcx     # 0xe50ba
leaq 0x5a797(%rip), %r8      # 0xe4bae
movl $0x20f, %r9d            # imm = 0x20F
jmp 0x8a44b
movq 0xa3b92(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x3fc36(%rip), %rsi     # 0xca066
leaq 0x5aa2b(%rip), %rdx     # 0xe4e62
leaq 0x5ac7c(%rip), %rcx     # 0xe50ba
leaq 0x5a769(%rip), %r8      # 0xe4bae
movl $0x216, %r9d            # imm = 0x216
xorl %eax, %eax
callq 0xb8c0
callq 0xb300