// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/bioseq_col.c
// Function: md5_to_index
static int md5_to_index(GtBioseq **bioseq, GtUword *seqnum,
                        GtBioseqCol *bsc, GtStr *md5_seqid, GtError *err)
{
  bool seqid_changed = false;
  char *seqid = NULL;
  GtUword i;
  int had_err = 0;
  gt_error_check(err);
  gt_assert(seqnum && bsc && md5_seqid);
  /* performance hack to avoid string duplication */
  if (gt_str_length(md5_seqid) >= GT_MD5_SEQID_TOTAL_LEN) {
    seqid = gt_str_get(md5_seqid);
    if (seqid[GT_MD5_SEQID_TOTAL_LEN-1] != GT_MD5_SEQID_SEPARATOR) {
      gt_error_set(err, "MD5 sequence id %s not terminated with '%c'",
                   gt_str_get(md5_seqid), GT_MD5_SEQID_SEPARATOR);
      had_err = -1;
    }
    if (!had_err) {
      seqid[GT_MD5_SEQID_TOTAL_LEN-1] = '\0';
      seqid_changed = true;
    }
  }
  for (i = 0; !had_err && i < bsc->num_of_seqfiles; i++) {
    *bioseq = bsc->bioseqs[i];
    *seqnum = gt_bioseq_md5_to_index(*bioseq, gt_str_get(md5_seqid) +
                                     GT_MD5_SEQID_PREFIX_LEN);
    if (*seqnum != GT_UNDEF_UWORD)
      break;
  }
  if (seqid_changed) /* reset seqid no matter what */
    seqid[GT_MD5_SEQID_TOTAL_LEN-1] = GT_MD5_SEQID_SEPARATOR;
  if (!had_err && *seqnum == GT_UNDEF_UWORD) {
    gt_error_set(err, "sequence %s not found", gt_str_get(md5_seqid));
    had_err = -1;
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r13
movq %r8, %rdi
callq 0xc103
testb %al, %al
jne 0x9e658
testq %r15, %r15
je 0x9e686
movq %r14, %rdi
callq 0x14461
movq %rax, %rbp
cmpq $0x25, %rax
jb 0x9e5a4
movq %r14, %rdi
callq 0x143d2
cmpb $0x3a, 0x24(%rax)
jne 0x9e627
movq %rbp, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %rax, (%rsp)
movb $0x0, 0x24(%rax)
jmp 0x9e5b6
movq %rbp, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq $0x0, (%rsp)
xorl %ebp, %ebp
cmpq 0x10(%r12), %rbp
jae 0x9e5ec
movq 0x8(%r12), %rax
movq (%rax,%rbp,8), %rbx
movq %rbx, (%r13)
movq %r14, %rdi
callq 0x143d2
leaq 0x4(%rax), %rsi
movq %rbx, %rdi
callq 0x9dcb1
movq %rax, (%r15)
incq %rbp
cmpq $-0x1, %rax
je 0x9e5b8
cmpq $0x25, 0x8(%rsp)
jb 0x9e5fc
movq (%rsp), %rax
movb $0x3a, 0x24(%rax)
xorl %eax, %eax
cmpq $-0x1, (%r15)
movq 0x10(%rsp), %rbx
jne 0x9e649
movq %r14, %rdi
callq 0x143d2
leaq 0x4c7f2(%rip), %rsi     # 0xeae0a
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xc007
jmp 0x9e646
movq %r14, %rdi
callq 0x143d2
leaq 0x4c7a8(%rip), %rsi     # 0xeadde
pushq $0x3a
popq %rcx
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xc007
pushq $-0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8f959(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x2b9fd(%rip), %rsi     # 0xca066
leaq 0x2bfe9(%rip), %rdx     # 0xca659
leaq 0x4c3fa(%rip), %rcx     # 0xeaa71
leaq 0x4c685(%rip), %r8      # 0xead03
movl $0xf2, %r9d
jmp 0x9e6b2
movq 0x8f92b(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x2b9cf(%rip), %rsi     # 0xca066
leaq 0x4c725(%rip), %rdx     # 0xeadc3
leaq 0x4c3cc(%rip), %rcx     # 0xeaa71
leaq 0x4c657(%rip), %r8      # 0xead03
movl $0xf3, %r9d
xorl %eax, %eax
callq 0xb8c0
callq 0xb300