// File: /workspace/github_c_makefile_star2_O3/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 0x155ee3
movq %rbx, %rdi
callq 0xfcc32
testb %al, %al
jne 0x156009
testq %r14, %r14
je 0x156004
testq %r15, %r15
je 0x156004
movq %r14, %rdi
callq 0x144635
movq %rax, %r13
movq %rax, %rdi
callq 0x11b0a1
movq %rax, %rdi
callq 0x106990
xorl %ebp, %ebp
testb %al, %al
jne 0x155ff3
movq %r14, %rdi
callq 0x144679
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 0x16e397
testq %rax, %rax
je 0x155fd7
movq %rax, %rbp
movl %r12d, 0xc(%rsp)
leaq 0x21629d(%rip), %rdi    # 0x36c1f9
callq 0x11acc9
movq %rax, %r12
movq %rax, %rdi
movq %rbp, %rsi
callq 0x11acf3
movq %r12, %rdi
movl $0x3a, %esi
callq 0x11af23
movq %r12, %rdi
movq %r13, %rsi
callq 0x11adc1
movq %r14, %rdi
callq 0x143cab
testq %rax, %rax
je 0x155fde
movq %r12, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movl 0xc(%rsp), %eax
movb %al, 0x28(%rsp)
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x15600e
decq %rax
leaq 0x18(%rsp), %rsi
movq %rax, 0x18(%rsi)
leaq 0x50(%rip), %rdx        # 0x156013
movq %r14, %rdi
movl $0x1, %ecx
movq %rbx, %r8
callq 0x142d9d
movl %eax, %ebp
jmp 0x155feb
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x155ff3
movq %r14, %rdi
movq %r12, %rsi
callq 0x144709
xorl %ebp, %ebp
movq %r12, %rdi
callq 0x11bdbf
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x49539
callq 0x49500
callq 0x49572