// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/spec_visitor.c
// Function: spec_init_lua_env
static int spec_init_lua_env(GtSpecVisitor *sv, const char *progname,
                             GtError *err)
{
  int had_err = 0;
  GtStr *prog, *speclib;
  gt_assert(sv);

  /* setup DSL: add some more convenience methods not in the public API */
  luaL_getmetatable(sv->L, GENOME_NODE_METATABLE);
  lua_pushstring(sv->L, "appears_as_child_of_type");
  lua_pushcfunction(sv->L, spec_feature_node_lua_appears_as_child_of_type);
  lua_rawset(sv->L, -3);
  lua_pushstring(sv->L, "appears_as_child_of_supertype");
  lua_pushcfunction(sv->L, spec_feature_node_lua_appears_as_child_of_supertype);
  lua_rawset(sv->L, -3);
  lua_pushstring(sv->L, "appears_as_root_node");
  lua_pushcfunction(sv->L, spec_feature_node_lua_appears_as_root_node);
  lua_rawset(sv->L, -3);
  lua_pushstring(sv->L, "has_child_of_supertype");
  lua_pushcfunction(sv->L, spec_feature_node_lua_has_child_of_supertype);
  lua_rawset(sv->L, -3);
  lua_pushstring(sv->L, "get_path");
  lua_pushcfunction(sv->L, spec_feature_node_get_path);
  lua_rawset(sv->L, -3);
  lua_getglobal(sv->L, "string");
  lua_pushstring(sv->L, "is_a");
  lua_pushcfunction(sv->L, spec_is_a);
  lua_rawset(sv->L, -3);
  lua_pushstring(sv->L, "part_of");
  lua_pushcfunction(sv->L, spec_part_of);
  lua_rawset(sv->L, -3);

  /* setup DSL: node-type-specific 'describe' environment */
  lua_newtable(sv->L);
  lua_pushstring(sv->L, "feature");
  lua_pushcfunction(sv->L, spec_register_feature_callback);
  lua_rawset(sv->L, -3);
  lua_pushstring(sv->L, "region");
  lua_pushcfunction(sv->L, spec_register_region_callback);
  lua_rawset(sv->L, -3);
  lua_pushstring(sv->L, "meta");
  lua_pushcfunction(sv->L, spec_register_meta_callback);
  lua_rawset(sv->L, -3);
  lua_pushstring(sv->L, "comment");
  lua_pushcfunction(sv->L, spec_register_comment_callback);
  lua_rawset(sv->L, -3);
  lua_pushstring(sv->L, "sequence");
  lua_pushcfunction(sv->L, spec_register_sequence_callback);
  lua_rawset(sv->L, -3);
  lua_setglobal(sv->L, "describe");

  /* setup DSL: aspect definition 'it' */
  lua_pushcfunction(sv->L, spec_it);
  lua_setglobal(sv->L, "it");

  /* setup DSL: 'expect'ations */
  lua_pushcfunction(sv->L, spec_expect);
  lua_setglobal(sv->L, "expect");

  /* setup DSL: dispatcher metatable for Lua-based expectation matchers */
  luaL_newmetatable(sv->L, "GenomeTools.specexpect");
  lua_pushstring(sv->L, "__index");
  lua_pushcfunction(sv->L, spec_expect_index);
  lua_settable(sv->L, -3);
  lua_pushstring(sv->L, "__mode");
  lua_pushstring(sv->L, "k");
  lua_settable(sv->L, -3);

  /* load matcher funcs written in Lua (for extensibility) */
  prog = gt_str_new();
  gt_str_append_cstr_nt(prog, progname,
                        gt_cstr_length_up_to_char(progname, ' '));
  speclib = gt_get_gtdata_path(gt_str_get(prog), NULL);
  gt_str_delete(prog);
  gt_str_append_cstr(speclib, "/spec/speclib.lua");
  had_err = (luaL_loadfile(sv->L, gt_str_get(speclib))
               || lua_pcall(sv->L, 0, 0, 0));
  if (had_err) {
    const char *error = lua_tostring(sv->L, -1);
    gt_error_set(err, "%s", error);
    had_err = -1;
  }
  gt_str_delete(speclib);

  /* store this visitor for later use */
  lua_pushlightuserdata(sv->L, (void*) &spec_defuserdata);
  lua_pushlightuserdata(sv->L, (void*) sv);
  lua_settable(sv->L, LUA_REGISTRYINDEX);

  /* no meta and region specs at the beginning */
  sv->meta_ref = sv->region_ref =
    sv->sequence_ref = sv->comment_ref = GT_UNDEF_INT;

  return had_err;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movl $0x0, 0x3c(%rsp)
cmpq $0x0, 0x50(%rsp)
jne 0x1dd1db
movq 0x45edf6(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x338e5f(%rip), %rsi    # 0x516013
leaq 0x38a366(%rip), %rdx    # 0x567521
leaq 0x389191(%rip), %rcx    # 0x566353
leaq 0x389008(%rip), %r8     # 0x5661d1
movl $0x32f, %r9d            # imm = 0x32F
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1dd1dd
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
leaq 0x389173(%rip), %rdx    # 0x566365
callq 0x336410
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x389176(%rip), %rsi    # 0x56637d
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x7b4(%rip), %rsi       # 0x1dd9d0
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336e40
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x389150(%rip), %rsi    # 0x566396
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x795(%rip), %rsi       # 0x1dd9f0
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336e40
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x38924a(%rip), %rsi    # 0x5664cf
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x776(%rip), %rsi       # 0x1dda10
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336e40
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x389287(%rip), %rsi    # 0x56654b
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x867(%rip), %rsi       # 0x1ddb40
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336e40
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x389271(%rip), %rsi    # 0x566574
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0xac8(%rip), %rsi       # 0x1ddde0
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336e40
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x366493(%rip), %rdx    # 0x5437da
callq 0x336410
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x38c9ca(%rip), %rsi    # 0x569d26
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0xc3f(%rip), %rsi       # 0x1ddfb0
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336e40
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x389226(%rip), %rsi    # 0x5665c1
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0xe10(%rip), %rsi       # 0x1de1c0
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336e40
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x336790
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x3759d4(%rip), %rsi    # 0x552dc0
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0xf9f(%rip), %rsi       # 0x1de3a0
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336e40
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x363f86(%rip), %rsi    # 0x5413b1
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x10c0(%rip), %rsi      # 0x1de500
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336e40
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x3931a3(%rip), %rsi    # 0x57060d
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x11a1(%rip), %rsi      # 0x1de620
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336e40
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x3be0e7(%rip), %rsi    # 0x59b590
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x1282(%rip), %rsi      # 0x1de740
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336e40
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x3881cb(%rip), %rsi    # 0x5656b3
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x1363(%rip), %rsi      # 0x1de860
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336e40
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x388e88(%rip), %rdx    # 0x5663b4
callq 0x336d90
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x143f(%rip), %rsi      # 0x1de980
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x3620a1(%rip), %rdx    # 0x53f5fe
callq 0x336d90
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x151e(%rip), %rsi      # 0x1dea90
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x35f5c5(%rip), %rdx    # 0x53cb53
callq 0x336d90
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x388e1a(%rip), %rsi    # 0x5663bd
callq 0x33a700
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x388e1c(%rip), %rsi    # 0x5663d4
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x1603(%rip), %rsi      # 0x1debd0
xorl %edx, %edx
callq 0x335ef0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336ae0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x388de5(%rip), %rsi    # 0x5663dc
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x33e46d(%rip), %rsi    # 0x51ba79
callq 0x335740
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x336ae0
callq 0x11d4a0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x48(%rsp), %rdi
movl $0x20, %esi
callq 0xa3030
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rax, %rdx
callq 0x11d830
movq 0x30(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xe0950
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rdi
callq 0x11f560
movq 0x28(%rsp), %rdi
leaq 0x388d51(%rip), %rsi    # 0x5663e3
callq 0x11d550
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
callq 0x11dee0
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x33b630
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, 0x1f(%rsp)
jne 0x1dd6e7
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq 0x3375c0
cmpl $0x0, %eax
setne %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x3c(%rsp)
je 0x1dd737
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x334f50
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rdi
movq 0x20(%rsp), %rdx
leaq 0x3be8f9(%rip), %rsi    # 0x59c021
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x3c(%rsp) # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rdi
callq 0x11f560
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x46036f(%rip), %rsi    # 0x63dac0
callq 0x336160
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x50(%rsp), %rsi
callq 0x336160
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x336ae0
movq 0x50(%rsp), %rax
movl $0x80000000, 0x38(%rax) # imm = 0x80000000
movq 0x50(%rsp), %rax
movl $0x80000000, 0x3c(%rax) # imm = 0x80000000
movq 0x50(%rsp), %rax
movl $0x80000000, 0x34(%rax) # imm = 0x80000000
movq 0x50(%rsp), %rax
movl $0x80000000, 0x30(%rax) # imm = 0x80000000
movl 0x3c(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)