// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/feature_node.c
// Function: gt_feature_node_traverse_children
int gt_feature_node_traverse_children(GtFeatureNode *feature_node, void *data,
                                      GtFeatureNodeTraverseFunc traverse,
                                      bool traverse_only_once, GtError *err)
{
  GtArray *node_stack = NULL, *list_of_children;
  GtFeatureNode *fn, *fn_ref, *child_feature;
  GtDlistelem *dlistelem;
  GtUword i;
  GtHashtable *traversed_nodes = NULL;
  bool has_node_with_multiple_parents = false;
  int had_err = 0;

  if (!feature_node)
    return 0;

  /* create additional reference to <feature_node> (necessary if feature_node is
     freed by <traverse>) */
  fn_ref = (GtFeatureNode*) gt_genome_node_ref((GtGenomeNode*) feature_node);

  node_stack = gt_array_new(sizeof (GtFeatureNode*));
  if (gt_feature_node_is_pseudo(feature_node)) {
    /* add the children backwards to traverse in order */
    for (dlistelem = gt_dlist_last(feature_node->children);
         dlistelem != NULL;
         dlistelem = gt_dlistelem_previous(dlistelem)) {
      child_feature = (GtFeatureNode*) gt_dlistelem_get_data(dlistelem);
      gt_array_add(node_stack, child_feature);
    }
  }
  else
    gt_array_add(node_stack, feature_node);
  gt_assert(gt_array_size(node_stack));
  list_of_children = gt_array_new(sizeof (GtFeatureNode*));

  if (traverse_only_once) {
    static const HashElemInfo node_hashtype
      = { gt_ht_ptr_elem_hash, { NULL }, sizeof (GtFeatureNode *),
          gt_ht_ptr_elem_cmp, NULL, NULL };
    traversed_nodes = gt_hashtable_new(node_hashtype);
  }

  while (gt_array_size(node_stack)) {
    fn = *(GtFeatureNode**) gt_array_pop(node_stack);
    gt_array_reset(list_of_children);
    if (fn->children) {
      /* a backup of the children array is necessary if traverse() frees the
         node */
      for (dlistelem = gt_dlist_first(fn->children); dlistelem != NULL;
           dlistelem = gt_dlistelem_next(dlistelem)) {
        child_feature = (GtFeatureNode*) gt_dlistelem_get_data(dlistelem);
        gt_array_add(list_of_children, child_feature);
      }
    }
    /* store the implications of <fn> to the tree status of <feature_node> */
    if (multiple_parents(fn->bit_field))
      has_node_with_multiple_parents = true;
    /* call traverse function */
    if (traverse) {
      if ((had_err = traverse(fn, data, err)))
        break;
    }
    for (i = 0; i < gt_array_size(list_of_children); i++) {
      /* we go backwards to traverse in order */
      child_feature = *(GtFeatureNode**) gt_array_get(list_of_children,
                                       gt_array_size(list_of_children) - i - 1);
      if (!traverse_only_once ||
          !gt_hashtable_get(traversed_nodes, &child_feature)) {
        /* feature has not been traversed or has to be traversed multiple
           times */
        gt_array_add(node_stack, child_feature);
        if (traverse_only_once)
          gt_hashtable_add(traversed_nodes, &child_feature);
      }
    }
  }

  /* save the tree status of the genome node */
  if (!had_err) {
    if (has_node_with_multiple_parents) {
      set_tree_status(&fn_ref->bit_field, IS_NOT_A_TREE);
      gt_assert(get_tree_status(fn_ref->bit_field) == IS_NOT_A_TREE);
    }
    else {
      set_tree_status(&fn_ref->bit_field, IS_TREE);
      gt_assert(get_tree_status(fn_ref->bit_field) ==IS_TREE);
    }
  }

  /* free */
  gt_genome_node_delete((GtGenomeNode*) fn_ref);
  if (traverse_only_once)
    gt_hashtable_delete(traversed_nodes);
  gt_array_delete(list_of_children);
  gt_array_delete(node_stack);

  return had_err;
}

// Assembly:
subq $0xb8, %rsp
movb %cl, %al
movq %rdi, 0xa8(%rsp)
movq %rsi, 0xa0(%rsp)
movq %rdx, 0x98(%rsp)
andb $0x1, %al
movb %al, 0x97(%rsp)
movq %r8, 0x88(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0x48(%rsp)
movb $0x0, 0x47(%rsp)
movl $0x0, 0x40(%rsp)
cmpq $0x0, 0xa8(%rsp)
jne 0x220ff
movl $0x0, 0xb4(%rsp)
jmp 0x22504
movq 0xa8(%rsp), %rdi
callq 0x25140
movq %rax, 0x68(%rsp)
movl $0x8, %edi
callq 0x75ab0
movq %rax, 0x80(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x21880
testb $0x1, %al
jne 0x22136
jmp 0x2218d
movq 0xa8(%rsp), %rax
movq 0x70(%rax), %rdi
callq 0x7d8a0
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
je 0x2218b
movq 0x58(%rsp), %rdi
callq 0x7d9e0
movq %rax, 0x60(%rsp)
movq 0x80(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movl $0x8, %edx
callq 0x76220
movq 0x58(%rsp), %rdi
callq 0x7f260
movq %rax, 0x58(%rsp)
jmp 0x2214c
jmp 0x221a7
movq 0x80(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
movl $0x8, %edx
callq 0x76220
jmp 0x221a9
movq 0x80(%rsp), %rdi
callq 0x76490
cmpq $0x0, %rax
jne 0x221f4
movq 0x191e15(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x13be99(%rip), %rsi    # 0x15e066
leaq 0x140173(%rip), %rdx    # 0x162347
leaq 0x140186(%rip), %rcx    # 0x162361
leaq 0x13f9c2(%rip), %r8     # 0x161ba4
movl $0x385, %r9d            # imm = 0x385
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x221f6
movl $0x8, %edi
callq 0x75ab0
movq %rax, 0x78(%rsp)
testb $0x1, 0x97(%rsp)
je 0x2223c
movups 0x18faea(%rip), %xmm0   # 0x1b1d00
movq %rsp, %rax
movups %xmm0, 0x20(%rax)
movups 0x18facc(%rip), %xmm0   # 0x1b1cf0
movups %xmm0, 0x10(%rax)
movups 0x18fab1(%rip), %xmm0   # 0x1b1ce0
movups %xmm0, (%rax)
callq 0x87020
movq %rax, 0x48(%rsp)
jmp 0x2223e
movq 0x80(%rsp), %rdi
callq 0x76490
cmpq $0x0, %rax
je 0x223ee
movq 0x80(%rsp), %rdi
callq 0x75d90
movq (%rax), %rax
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rdi
callq 0x765c0
movq 0x70(%rsp), %rax
cmpq $0x0, 0x70(%rax)
je 0x222d1
movq 0x70(%rsp), %rax
movq 0x70(%rax), %rdi
callq 0x7d850
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
je 0x222cf
movq 0x58(%rsp), %rdi
callq 0x7d9e0
movq %rax, 0x60(%rsp)
movq 0x78(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movl $0x8, %edx
callq 0x76220
movq 0x58(%rsp), %rdi
callq 0x7da30
movq %rax, 0x58(%rsp)
jmp 0x22293
jmp 0x222d1
movq 0x70(%rsp), %rax
movl 0x68(%rax), %edi
callq 0x23450
testb $0x1, %al
jne 0x222e4
jmp 0x222e9
movb $0x1, 0x47(%rsp)
cmpq $0x0, 0x98(%rsp)
je 0x22323
movq 0x98(%rsp), %rax
movq 0x70(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0x88(%rsp), %rdx
callq *%rax
movl %eax, 0x40(%rsp)
cmpl $0x0, %eax
je 0x22321
jmp 0x223ee
jmp 0x22323
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x78(%rsp), %rdi
callq 0x76490
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0x223e9
movq 0x78(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x78(%rsp), %rdi
callq 0x76490
movq 0x30(%rsp), %rdi
movq %rax, %rsi
subq 0x50(%rsp), %rsi
subq $0x1, %rsi
callq 0x75c80
movq (%rax), %rax
movq %rax, 0x60(%rsp)
testb $0x1, 0x97(%rsp)
je 0x223a2
movq 0x48(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x87110
cmpq $0x0, %rax
jne 0x223d4
movq 0x80(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movl $0x8, %edx
callq 0x76220
testb $0x1, 0x97(%rsp)
je 0x223d2
movq 0x48(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x872d0
jmp 0x223d4
jmp 0x223d6
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x2232c
jmp 0x2223e
cmpl $0x0, 0x40(%rsp)
jne 0x224c4
testb $0x1, 0x47(%rsp)
je 0x22461
movq 0x68(%rsp), %rdi
addq $0x68, %rdi
movl $0x2, %esi
callq 0x207f0
movq 0x68(%rsp), %rax
movl 0x68(%rax), %edi
callq 0x23480
cmpl $0x2, %eax
je 0x2245d
movq 0x191bac(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x13bc30(%rip), %rsi    # 0x15e066
leaq 0x13ff46(%rip), %rdx    # 0x162383
leaq 0x13ff1d(%rip), %rcx    # 0x162361
leaq 0x13f759(%rip), %r8     # 0x161ba4
movl $0x3b6, %r9d            # imm = 0x3B6
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x2245f
jmp 0x224c2
movq 0x68(%rsp), %rdi
addq $0x68, %rdi
movl $0x1, %esi
callq 0x207f0
movq 0x68(%rsp), %rax
movl 0x68(%rax), %edi
callq 0x23480
cmpl $0x1, %eax
je 0x224be
movq 0x191b4b(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x13bbcf(%rip), %rsi    # 0x15e066
leaq 0x13ff19(%rip), %rdx    # 0x1623b7
leaq 0x13febc(%rip), %rcx    # 0x162361
leaq 0x13f6f8(%rip), %r8     # 0x161ba4
movl $0x3ba, %r9d            # imm = 0x3BA
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x224c0
jmp 0x224c2
jmp 0x224c4
movq 0x68(%rsp), %rdi
callq 0x26eb0
testb $0x1, 0x97(%rsp)
je 0x224e2
movq 0x48(%rsp), %rdi
callq 0x888b0
movq 0x78(%rsp), %rdi
callq 0x770a0
movq 0x80(%rsp), %rdi
callq 0x770a0
movl 0x40(%rsp), %eax
movl %eax, 0xb4(%rsp)
movl 0xb4(%rsp), %eax
addq $0xb8, %rsp
retq
nopw %cs:(%rax,%rax)