// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/id_to_md5_visitor.c
// Function: seqid_to_md5
static int seqid_to_md5(GtGenomeNode *gn, GtRegionMapping *region_mapping,
                        bool substitute_target_ids, GtError *err)
{
  GtStr *seqid;
  int had_err = 0;
  gt_error_check(err);
  gt_assert(gn && region_mapping);
  seqid = gt_genome_node_get_seqid(gn);
  if (!gt_md5_seqid_has_prefix(gt_str_get(seqid))) {
    /* seqid is not already a MD5 seqid -> change id */
    GtUword offset;
    const char *md5;
    GtRange range = gt_genome_node_get_range(gn);
    if (!(md5 = gt_region_mapping_get_md5_fingerprint(region_mapping, seqid,
                                                      &range, &offset, err))) {
      had_err = -1;
    }
    if (!had_err) {
      GtStr *new_seqid = gt_str_new_cstr(GT_MD5_SEQID_PREFIX);
      gt_str_append_cstr(new_seqid, md5);
      gt_str_append_char(new_seqid, GT_MD5_SEQID_SEPARATOR);
      gt_str_append_str(new_seqid, seqid);
      if (gt_feature_node_try_cast(gn)) {
        I2MChangeSeqidInfo info;
        info.new_seqid = new_seqid;
        info.region_mapping = region_mapping;
        info.substitute_target_ids = substitute_target_ids;
        gt_assert(offset);
        info.offset = offset - 1;
        had_err = gt_feature_node_traverse_children((GtFeatureNode*) gn, &info,
                                                    i2m_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 $0x48, %rsp
movq %rcx, %rbx
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %r14
testq %rcx, %rcx
je 0xf2a71
movq %rbx, %rdi
callq 0x89eb7
testb %al, %al
jne 0xf2bbe
testq %r14, %r14
je 0xf2b90
testq %r15, %r15
je 0xf2b90
movq %r14, %rdi
callq 0xdd14a
movq %rax, %r13
movq %rax, %rdi
callq 0xad1fa
movq %rax, %rdi
callq 0x969d4
xorl %ebp, %ebp
testb %al, %al
jne 0xf2b7f
movq %r14, %rdi
callq 0xdd1f4
leaq 0x38(%rsp), %r8
movq %rax, (%r8)
movq %rdx, 0x8(%r8)
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %r13, %rsi
movq %r8, %rdx
movq %rbx, %r8
callq 0x110a80
testq %rax, %rax
je 0xf2b65
movq %rax, %rbp
movl %r12d, 0xc(%rsp)
leaq 0x2199ef(%rip), %rdi    # 0x30c4d9
callq 0xacbd1
movq %rax, %r12
movq %rax, %rdi
movq %rbp, %rsi
callq 0xacbfb
pushq $0x3a
popq %rsi
movq %r12, %rdi
callq 0xaced9
movq %r12, %rdi
movq %r13, %rsi
callq 0xacd13
movq %r14, %rdi
callq 0xdc2f0
testq %rax, %rax
je 0xf2b6a
movq %r12, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movl 0xc(%rsp), %eax
movb %al, 0x28(%rsp)
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xf2bec
decq %rax
leaq 0x18(%rsp), %rsi
movq %rax, 0x18(%rsi)
leaq 0xd1(%rip), %rdx        # 0xf2c24
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %r8
callq 0xdac92
movl %eax, %ebp
jmp 0xf2b77
pushq $-0x1
popq %rbp
jmp 0xf2b7f
movq %r14, %rdi
movq %r12, %rsi
callq 0xdd346
xorl %ebp, %ebp
movq %r12, %rdi
callq 0xae103
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3453d1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1f2472(%rip), %rsi    # 0x2e5013
leaq 0x23222a(%rip), %rdx    # 0x324dd2
leaq 0x232216(%rip), %rcx    # 0x324dc5
leaq 0x2321cf(%rip), %r8     # 0x324d85
movl $0x89, %r9d
jmp 0xf2c18
movq 0x3453a3(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1f2444(%rip), %rsi    # 0x2e5013
leaq 0x1f25e9(%rip), %rdx    # 0x2e51bf
leaq 0x2321e8(%rip), %rcx    # 0x324dc5
leaq 0x2321a1(%rip), %r8     # 0x324d85
movl $0x88, %r9d
jmp 0xf2c18
movq 0x345375(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1f2416(%rip), %rsi    # 0x2e5013
leaq 0x215542(%rip), %rdx    # 0x308146
leaq 0x2321ba(%rip), %rcx    # 0x324dc5
leaq 0x232173(%rip), %r8     # 0x324d85
movl $0x9e, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390