// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x0, 0x1f(%rsp)
movq 0x48(%rsp), %rdi
movl $0x1, %esi
leaq 0x3887fd(%rip), %rdx    # 0x566365
callq 0x33a790
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rdi
callq 0x170450
movq %rax, 0x38(%rsp)
movb $0x1, %al
cmpq $0x0, 0x38(%rsp)
movb %al, 0x7(%rsp)
jne 0x1ddbb2
movq 0x48(%rsp), %rdi
movl $0x1, %esi
leaq 0x388852(%rip), %rdx    # 0x5663f5
callq 0x33a1f0
cmpl $0x0, %eax
setne %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
movq 0x48(%rsp), %rdi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x33a6b0
movq %rax, %rdi
callq 0x120930
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rdi
leaq 0x45fede(%rip), %rsi    # 0x63dac0
callq 0x336160
movq 0x48(%rsp), %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x336210
movq 0x48(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x335300
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x1ddc58
movq 0x48(%rsp), %rdi
movl $0x1, %esi
callq 0x33a490
movq 0x48(%rsp), %rdi
leaq 0x3888b3(%rip), %rsi    # 0x5664e4
callq 0x335740
movq 0x48(%rsp), %rdi
movl $0x2, %esi
callq 0x338280
movq 0x48(%rsp), %rdi
callq 0x337ea0
movl %eax, 0x54(%rsp)
jmp 0x1dddcc
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x10(%rsp), %rsi
callq 0x1f41b0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, 0x6(%rsp)
jne 0x1ddc98
movq 0x48(%rsp), %rdi
movl $0x2, %esi
leaq 0x3887d3(%rip), %rdx    # 0x56645c
callq 0x33a1f0
cmpl $0x0, %eax
setne %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
movq 0x38(%rsp), %rdi
callq 0x170b00
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
callq 0x170e30
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x1ddcfa
movq 0x45e2d7(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x338340(%rip), %rsi    # 0x516013
leaq 0x388857(%rip), %rdx    # 0x566531
leaq 0x388854(%rip), %rcx    # 0x566535
leaq 0x3884e9(%rip), %r8     # 0x5661d1
movl $0x2d8, %r9d            # imm = 0x2D8
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1ddcfc
jmp 0x1ddcfe
xorl %eax, %eax
testb $0x1, 0x1f(%rsp)
movb %al, 0x5(%rsp)
jne 0x1ddd25
movq 0x28(%rsp), %rdi
callq 0x170e30
movq %rax, 0x30(%rsp)
cmpq $0x0, %rax
setne %al
movb %al, 0x5(%rsp)
movb 0x5(%rsp), %al
testb $0x1, %al
jne 0x1ddd2f
jmp 0x1ddda7
movq 0x20(%rsp), %rax
cmpq $0x0, 0x28(%rax)
je 0x1ddd8a
movq 0x30(%rsp), %rdi
callq 0x16d430
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x8(%rsp), %rsi
callq 0x1f41b0
testb $0x1, %al
jne 0x1ddd63
jmp 0x1ddd83
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x1f4380
andb $0x1, %al
movb %al, 0x1f(%rsp)
jmp 0x1ddd88
movb $0x0, 0x1f(%rsp)
jmp 0x1ddda2
movq 0x30(%rsp), %rdi
callq 0x16d430
cmpq 0x10(%rsp), %rax
sete %al
andb $0x1, %al
movb %al, 0x1f(%rsp)
jmp 0x1ddcfe
movq 0x28(%rsp), %rdi
callq 0x170f50
movq 0x48(%rsp), %rdi
movb 0x1f(%rsp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x336110
movl $0x1, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)