// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/md5_to_id_visitor.c
// Function: md5_to_seqid
static int md5_to_seqid(GtGenomeNode *gn, GtRegionMapping *region_mapping,
                        GtError *err)
{
  GtStr *seqid;
  int had_err = 0;
  gt_error_check(err);
  gt_assert(gn);
  seqid = gt_genome_node_get_seqid(gn);
  if (gt_md5_seqid_has_prefix(gt_str_get(seqid))) {
    GtStr *new_seqid = gt_str_new();
    /* seqid is a MD5 seqid -> change id */
    if (gt_str_length(seqid) > GT_MD5_SEQID_TOTAL_LEN)
      gt_str_append_cstr(new_seqid, gt_str_get(seqid) + GT_MD5_SEQID_TOTAL_LEN);
    else {
      /* for backward compatibility */
      GtStr *desc = gt_str_new();
      if (!region_mapping) {
        gt_error_set(err, "no region mapping defined");
        had_err = -1;
      }
      if (!had_err) {
        had_err = gt_region_mapping_get_description(region_mapping, desc, seqid,
                                                    err);
      }
      if (!had_err)
        gt_regular_seqid_save(new_seqid, desc);
      gt_str_delete(desc);
    }
    if (!had_err) {
      if (gt_feature_node_try_cast(gn)) {
        M2IChangeSeqidInfo info;
        info.new_seqid = new_seqid;
        info.region_mapping = region_mapping;
        had_err = gt_feature_node_traverse_children((GtFeatureNode*) gn, &info,
                                                    m2i_change_seqid, true,
                                                    err);
      }
      else
        gt_genome_node_change_seqid(gn, new_seqid);
    }
    gt_str_delete(new_seqid);
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %rbp
movq %rdi, %r14
testq %rdx, %rdx
je 0xffb94
movq %rbx, %rdi
callq 0x89eb7
testb %al, %al
jne 0xffcd7
testq %r14, %r14
je 0xffca9
movq %r14, %rdi
callq 0xdd14a
movq %rax, %r13
movq %rax, %rdi
callq 0xad1fa
movq %rax, %rdi
callq 0x969d4
xorl %r15d, %r15d
testb %al, %al
je 0xffc97
callq 0xacb84
movq %rax, %r12
movq %r13, %rdi
callq 0xad289
cmpq $0x26, %rax
jb 0xffbef
movq %r13, %rdi
callq 0xad1fa
leaq 0x25(%rax), %rsi
movq %r12, %rdi
callq 0xacbfb
jmp 0xffc4e
callq 0xacb84
movq %rbp, %rdi
movq %rax, %rbp
testq %rdi, %rdi
movq %rdi, (%rsp)
je 0xffc28
movq %rbp, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x11068b
movl %eax, %r15d
testl %eax, %eax
jne 0xffc3d
movq %r12, %rdi
movq %rbp, %rsi
callq 0x111988
xorl %r15d, %r15d
jmp 0xffc3d
leaq 0x2281ae(%rip), %rsi    # 0x327ddd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r15
movq %rbp, %rdi
callq 0xae103
testl %r15d, %r15d
movq (%rsp), %rbp
jne 0xffc8f
movq %r14, %rdi
callq 0xdc2f0
testq %rax, %rax
je 0xffc81
leaq 0x8(%rsp), %rsi
movq %r12, (%rsi)
movq %rbp, 0x8(%rsi)
leaq 0x9f(%rip), %rdx        # 0xffd0d
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %r8
callq 0xdac92
movl %eax, %r15d
jmp 0xffc8f
movq %r14, %rdi
movq %r12, %rsi
callq 0xdd346
xorl %r15d, %r15d
movq %r12, %rdi
callq 0xae103
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3382b8(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1e5359(%rip), %rsi    # 0x2e5013
leaq 0x23dd5a(%rip), %rdx    # 0x33da1b
leaq 0x228108(%rip), %rcx    # 0x327dd0
leaq 0x2280c1(%rip), %r8     # 0x327d90
movl $0x80, %r9d
jmp 0xffd01
movq 0x33828a(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1e532b(%rip), %rsi    # 0x2e5013
leaq 0x1e54d0(%rip), %rdx    # 0x2e51bf
leaq 0x2280da(%rip), %rcx    # 0x327dd0
leaq 0x228093(%rip), %r8     # 0x327d90
pushq $0x7f
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390