// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/spec_visitor.c
// Function: spec_feature_node_lua_has_child_of_supertype
static int spec_feature_node_lua_has_child_of_supertype(lua_State *L)
{
  GtGenomeNode **gn;
  GtFeatureNode *fn, GT_UNUSED *fn2 = NULL;
  GtFeatureNodeIterator *it;
  GtSpecVisitor *sv;
  bool found = false;
  const char *type;

  gn = check_genome_node(L, 1);
  /* make sure we get a feature node */
  fn = gt_feature_node_try_cast(*gn);
  luaL_argcheck(L, fn, 1, "not a feature node");
  type = gt_symbol(luaL_checkstring(L, 2));

  lua_pushlightuserdata(L, (void *) &spec_defuserdata);
  lua_gettable(L, LUA_REGISTRYINDEX);
  sv = lua_touserdata(L, -1);

  if (!sv->type_checker) {
    luaL_where(L, 1);
    lua_pushstring(L, "'feature_node.has_child_of_supertype()' requires a type "
                      "checker (-typecheck)");
    lua_concat(L, 2);
    return lua_error(L);
  }

  luaL_argcheck(L, gt_type_checker_is_valid(sv->type_checker, type),
                2, "not a valid SO type");

  it = gt_feature_node_iterator_new(fn);
  /* skip parent node itself */
  fn2 = gt_feature_node_iterator_next(it);
  gt_assert(fn2);
  while (!found && (fn2 = gt_feature_node_iterator_next(it))) {
    if (sv->type_checker) {
        const char *fn2t = gt_feature_node_get_type(fn2);
        if (gt_type_checker_is_valid(sv->type_checker, fn2t))
          found = gt_type_checker_is_a(sv->type_checker, type, fn2t);
        else
          found = false;
      } else
        found = (gt_feature_node_get_type(fn2) == type);
  }
  gt_feature_node_iterator_delete(it);
  lua_pushboolean(L, found);
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x21cd7c(%rip), %rdx    # 0x39ce87
movl $0x1, %esi
callq 0x230dae
movq (%rax), %rdi
callq 0x14aefc
movq %rax, %r12
testq %rax, %rax
jne 0x180139
leaq 0x21cdeb(%rip), %rdx    # 0x39cf17
movq %rbx, %rdi
movl $0x1, %esi
callq 0x230a08
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x230d0f
movq %rax, %rdi
callq 0x12234f
movq %rax, %r14
leaq 0x34509e(%rip), %rsi    # 0x4c51f8
movq %rbx, %rdi
callq 0x22e58a
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x22e5c2
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x22de0e
movq 0x28(%rax), %rdi
testq %rdi, %rdi
je 0x180233
movq %rax, %r15
movq %r14, %rsi
callq 0x18b801
testb %al, %al
jne 0x1801ac
leaq 0x21cddf(%rip), %rdx    # 0x39cf7e
movq %rbx, %rdi
movl $0x2, %esi
callq 0x230a08
movq %r12, %rdi
callq 0x14b1a8
movq %rax, %r12
movq %rax, %rdi
callq 0x14b33e
testq %rax, %rax
je 0x18029a
movq %r12, %rdi
callq 0x14b33e
testq %rax, %rax
je 0x180272
movq 0x28(%r15), %rbp
movq %rax, %rdi
callq 0x149bb2
movq %rax, %r13
testq %rbp, %rbp
je 0x180210
movq 0x28(%r15), %rdi
movq %r13, %rsi
callq 0x18b801
testb %al, %al
je 0x180219
movq 0x28(%r15), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x18b865
movl %eax, %ebp
jmp 0x18021b
cmpq %r14, %r13
sete %bpl
jmp 0x18021b
xorl %ebp, %ebp
testb %bpl, %bpl
jne 0x18022d
movq %r12, %rdi
callq 0x14b33e
testq %rax, %rax
jne 0x1801d9
movzbl %bpl, %ebp
jmp 0x180274
movq %rbx, %rdi
movl $0x1, %esi
callq 0x230bcc
leaq 0x21cdbf(%rip), %rsi    # 0x39d006
movq %rbx, %rdi
callq 0x22e0c4
movq %rbx, %rdi
movl $0x2, %esi
callq 0x22f73e
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22f4f8
xorl %ebp, %ebp
movq %r12, %rdi
callq 0x14b3d0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x22e570
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5665a