LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/xiane[P]libvphevcodec/vdi.cpp
// Function: flush_memory(unsigned int, vpu_buffer_t*)
s32 flush_memory(u32 core_idx, vpu_buffer_t *vb) {
    vdi_info_t *vdi;
    s32 i, ret = -1;
    vpu_buffer_t vdb;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return -1;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return -1;

    memset(&vdb, 0x00, sizeof(vpu_buffer_t));

    for (i = 0; i < MAX_VPU_BUFFER_POOL; i++) {
        if (vdi->vpu_buffer_pool[i].vdb.phys_addr == vb->phys_addr) {
            vdb = vdi->vpu_buffer_pool[i].vdb;
            break;
        }
    }
    VLOG(DEBUG, "[VDI] flush_memory vdb.size = %d", vdb.size);
    if (vdb.size > 0)
        ret = ioctl(vdi->vpu_fd, VDI_IOCTL_FLUSH_BUFFER, (void*) &vdb);
    return ret;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %edi, %edi
je 0x82eb
retq
movl 0x27ef3(%rip), %edi     # 0x301e4
testl %edi, %edi
js 0x82ea
cmpb $0x0, 0x27eec(%rip)     # 0x301e8
je 0x82ea
subq $0x28, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq 0x8(%rsi), %rsi
movl $0x88, %ecx
leaq 0x27ec2(%rip), %rdx     # 0x301e0
cmpq %rsi, (%rcx,%rdx)
je 0x8333
addq $0x28, %rcx
cmpq $0x2888, %rcx           # imm = 0x2888
jne 0x831e
jmp 0x8346
movups -0x8(%rcx,%rdx), %xmm0
movups 0x8(%rcx,%rdx), %xmm1
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
cmpl $0x0, (%rsp)
je 0x835b
movq %rsp, %rdx
movl $0x4020560d, %esi       # imm = 0x4020560D
xorl %eax, %eax
callq 0x2230
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lua.c
// Function: main
int main (int argc, char **argv) {
  int status, result;
  lua_State *L = luaL_newstate();  /* create state */
  if (L == NULL) {
    l_message(argv[0], "cannot create state: not enough memory");
    return EXIT_FAILURE;
  }
  /* call 'pmain' in protected mode */
  lua_pushcfunction(L, &pmain);
  lua_pushinteger(L, argc);  /* 1st argument */
  lua_pushlightuserdata(L, argv); /* 2nd argument */
  status = lua_pcall(L, 2, 1, 0);
  result = lua_toboolean(L, -1);  /* get result */
  finalreport(L, status);
  lua_close(L);
  return (result && status == LUA_OK) ? EXIT_SUCCESS : EXIT_FAILURE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
callq 0xa3a3
testq %rax, %rax
je 0x6a76
movq %rax, %rbx
leaq 0xd4(%rip), %rsi        # 0x6add
movq %rax, %rdi
xorl %edx, %edx
callq 0x7f5d
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0x7d87
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7ffb
movq %rbx, %rdi
movl $0x2, %esi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x8652
movl %eax, %ebp
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x7bb6
movl %eax, %r14d
testl %ebp, %ebp
jne 0x6a8c
movq %rbx, %rdi
callq 0x1487c
testl %r14d, %r14d
sete %al
testl %ebp, %ebp
setne %cl
orb %al, %cl
movzbl %cl, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq (%r14), %rdi
leaq 0x19590(%rip), %rsi     # 0x20010
callq 0x6610
movl $0x1, %eax
jmp 0x6a71
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x7889
cmpl $0x4, %eax
jne 0x6aaf
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x7bdc
jmp 0x6ab1
xorl %eax, %eax
testq %rax, %rax
leaq 0x1978f(%rip), %rsi     # 0x2024a
cmovneq %rax, %rsi
movq 0x2684a(%rip), %rdi     # 0x2d310
callq 0x6610
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x7697
jmp 0x6a59
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lua.c
// Function: docall
static int docall (lua_State *L, int narg, int nres) {
  int status;
  int base = lua_gettop(L) - narg;  /* function index */
  lua_pushcfunction(L, traceback);  /* push traceback function */
  lua_insert(L, base);  /* put it under chunk and args */
  globalL = L;  /* to be available to 'laction' */
  signal(SIGINT, laction);
  status = lua_pcall(L, narg, nres, base);
  signal(SIGINT, SIG_DFL);
  lua_remove(L, base);  /* remove traceback function */
  return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
callq 0x7683
movl %eax, %ebp
subl %r15d, %ebp
leaq 0x98(%rip), %rsi        # 0x73b0
movq %rbx, %rdi
xorl %edx, %edx
callq 0x7f5d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x779a
movq %rbx, 0x25fed(%rip)     # 0x2d320
leaq 0xe1(%rip), %rsi        # 0x741b
movl $0x2, %edi
callq 0x62f0
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x8652
movl %eax, %r14d
movl $0x2, %edi
xorl %esi, %esi
callq 0x62f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x76e8
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lua.c
// Function: report
static int report (lua_State *L, int status) {
  if (status != LUA_OK && !lua_isnil(L, -1)) {
    const char *msg = lua_tostring(L, -1);
    if (msg == NULL) msg = "(error object is not a string)";
    l_message(progname, msg);
    lua_pop(L, 1);
    /* force a complete garbage collection in case of errors */
    lua_gc(L, LUA_GCCOLLECT, 0);
  }
  return status;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
testl %esi, %esi
je 0x739c
movq %rdi, %r14
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x7889
testl %eax, %eax
jne 0x73a6
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x6732
jmp 0x739c
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lua.c
// Function: traceback
static int traceback (lua_State *L) {
  const char *msg = lua_tostring(L, 1);
  if (msg)
    luaL_traceback(L, L, msg, 1);
  else if (!lua_isnoneornil(L, 1)) {  /* is there an error object? */
    if (!luaL_callmeta(L, 1, "__tostring"))  /* try its 'tostring' metamethod */
      lua_pushliteral(L, "(no error message)");
  }
  return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x7bdc
movq %rbx, %rdi
testq %rax, %rax
je 0x73df
movq %rbx, %rsi
movq %rax, %rdx
movl $0x1, %ecx
callq 0x8cb4
movl $0x1, %eax
popq %rbx
retq
movl $0x1, %esi
callq 0x7889
testl %eax, %eax
jle 0x73d8
leaq 0x18e2b(%rip), %rdx     # 0x2021f
movq %rbx, %rdi
movl $0x1, %esi
callq 0x9e8a
testl %eax, %eax
jne 0x73d8
leaq 0x18e1e(%rip), %rsi     # 0x2022a
movl $0x12, %edx
movq %rbx, %rdi
callq 0x7dc7
jmp 0x73d8
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lua.c
// Function: pushline
static int pushline (lua_State *L, int firstline) {
  char buffer[LUA_MAXINPUT];
  char *b = buffer;
  size_t l;
  const char *prmt = get_prompt(L, firstline);
  int readstatus = lua_readline(L, b, prmt);
  lua_pop(L, 1);  /* remove result from 'get_prompt' */
  if (readstatus == 0)
    return 0;  /* no input */
  l = strlen(b);
  if (l > 0 && b[l-1] == '\n')  /* line ends with newline? */
    b[l-1] = '\0';  /* remove it */
  if (firstline && b[0] == '=')  /* first line starts with `=' ? */
    lua_pushfstring(L, "return %s", b+1);  /* change it to `return' */
  else
    lua_pushstring(L, b);
  lua_freeline(L, b);
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movl %esi, %ebp
movq %rdi, %rbx
testl %esi, %esi
leaq 0x18e70(%rip), %rax     # 0x202ef
leaq 0x18e61(%rip), %rsi     # 0x202e7
cmoveq %rax, %rsi
leaq 0x18e67(%rip), %rax     # 0x202f8
leaq 0x18e61(%rip), %r15     # 0x202f9
cmoveq %rax, %r15
callq 0x8033
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x7bdc
testq %rax, %rax
cmovneq %rax, %r15
movq 0x25b07(%rip), %r12     # 0x2cfc8
movq (%r12), %rsi
movq %r15, %rdi
callq 0x61e0
movq (%r12), %rdi
callq 0x63c0
movq 0x25af3(%rip), %rax     # 0x2cfd0
movq (%rax), %rdx
movq %rsp, %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x62b0
movq %rax, %r15
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x7697
testq %r15, %r15
je 0x754e
movq %rsp, %rdi
callq 0x6170
testq %rax, %rax
je 0x751b
cmpb $0xa, -0x1(%rsp,%rax)
jne 0x751b
movb $0x0, -0x1(%rsp,%rax)
testl %ebp, %ebp
je 0x753d
cmpb $0x3d, (%rsp)
jne 0x753d
leaq 0x1(%rsp), %rdx
leaq 0x18dac(%rip), %rsi     # 0x202dd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x7eb0
jmp 0x7548
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x7e16
movl $0x1, %r14d
movl %r14d, %eax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_checkstack
LUA_API int lua_checkstack (lua_State *L, int size) {
  int res;
  CallInfo *ci = L->ci;
  lua_lock(L);
  if (L->stack_last - L->top > size)  /* stack large enough? */
    res = 1;  /* yes; check is OK */
  else {  /* no; need to grow stack */
    int inuse = cast_int(L->top - L->stack) + EXTRA_STACK;
    if (inuse > LUAI_MAXSTACK - size)  /* can grow without overflow? */
      res = 0;  /* no */
    else  /* try to grow stack */
      res = (luaD_rawrunprotected(L, &growstack, &size) == LUA_OK);
  }
  if (res && ci->top < L->top + size)
    ci->top = L->top + size;  /* adjust frame top */
  lua_unlock(L);
  return res;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
movq 0x10(%rdi), %rcx
movq 0x20(%rdi), %r14
movq 0x30(%rdi), %rdx
subq %rcx, %rdx
sarq $0x4, %rdx
movslq %esi, %rdi
movl $0x1, %eax
cmpq %rdi, %rdx
jg 0x75c4
subq 0x38(%rbx), %rcx
shrq $0x4, %rcx
addl $0x5, %ecx
movl $0xf4240, %edx          # imm = 0xF4240
subl %esi, %edx
xorl %eax, %eax
cmpl %edx, %ecx
jg 0x75c4
leaq 0x39(%rip), %rsi        # 0x75e7
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xb22b
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
testl %eax, %eax
je 0x75df
movslq 0x4(%rsp), %rcx
shlq $0x4, %rcx
addq 0x10(%rbx), %rcx
cmpq %rcx, 0x8(%r14)
jae 0x75df
movq %rcx, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_xmove
LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) {
  int i;
  if (from == to) return;
  lua_lock(to);
  api_checknelems(from, n);
  api_check(from, G(from) == G(to), "moving among independent states");
  api_check(from, to->ci->top - to->top >= n, "not enough elements to move");
  from->top -= n;
  for (i = 0; i < n; i++) {
    setobj2s(to, to->top++, from->top + i);
  }
  lua_unlock(to);
}

// Assembly:
cmpq %rsi, %rdi
je 0x7635
movslq %edx, %rax
movq %rax, %rcx
shlq $0x4, %rcx
subq %rcx, 0x10(%rdi)
testl %eax, %eax
jle 0x7635
movl %edx, %eax
shlq $0x4, %rax
xorl %ecx, %ecx
movq 0x10(%rdi), %rdx
movq 0x10(%rsi), %r8
leaq 0x10(%r8), %r9
movq %r9, 0x10(%rsi)
movq (%rdx,%rcx), %r9
movq %r9, (%r8)
movl 0x8(%rdx,%rcx), %edx
movl %edx, 0x8(%r8)
addq $0x10, %rcx
cmpq %rcx, %rax
jne 0x760d
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_remove
LUA_API void lua_remove (lua_State *L, int idx) {
  StkId p;
  lua_lock(L);
  p = index2addr(L, idx);
  api_checkstackindex(L, idx, p);
  while (++p < L->top) setobjs2s(L, p-1, p);
  L->top--;
  lua_unlock(L);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x7717
addq $0x10, %rax
movq 0x10(%rbx), %rcx
cmpq %rcx, %rax
jae 0x770d
movq (%rax), %rcx
movq %rcx, -0x10(%rax)
movl 0x8(%rax), %ecx
movl %ecx, -0x8(%rax)
jmp 0x76f1
addq $-0x10, %rcx
movq %rcx, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_insert
LUA_API void lua_insert (lua_State *L, int idx) {
  StkId p;
  StkId q;
  lua_lock(L);
  p = index2addr(L, idx);
  api_checkstackindex(L, idx, p);
  for (q = L->top; q > p; q--)  /* use L->top as a temporary */
    setobjs2s(L, q, q - 1);
  setobjs2s(L, p, L->top);
  lua_unlock(L);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x7717
movq 0x10(%rbx), %rcx
cmpq %rax, %rcx
jbe 0x77c5
movq -0x10(%rcx), %rdx
movq %rdx, (%rcx)
movl -0x8(%rcx), %edx
movl %edx, 0x8(%rcx)
leaq -0x10(%rcx), %rdx
movq %rdx, %rcx
cmpq %rax, %rdx
ja 0x77ac
movq 0x10(%rbx), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movl 0x8(%rcx), %ecx
movl %ecx, 0x8(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: moveto
static void moveto (lua_State *L, TValue *fr, int idx) {
  TValue *to = index2addr(L, idx);
  api_checkvalidindex(L, to);
  setobj(L, to, fr);
  if (idx < LUA_REGISTRYINDEX)  /* function upvalue? */
    luaC_barrier(L, clCvalue(L->ci->func), fr);
  /* LUA_REGISTRYINDEX does not need gc barrier
     (collector revisits it before finishing collection) */
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, %esi
callq 0x7717
movq (%r14), %rcx
movq %rcx, (%rax)
movl 0x8(%r14), %ecx
movl %ecx, 0x8(%rax)
cmpl $0xfff0b9d7, %ebp       # imm = 0xFFF0B9D7
jg 0x7839
testb $0x40, 0x8(%r14)
je 0x7839
movq (%r14), %rdx
testb $0x3, 0x9(%rdx)
je 0x7839
movq 0x20(%rbx), %rax
movq (%rax), %rax
movq (%rax), %rsi
testb $0x4, 0x9(%rsi)
jne 0x783e
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xc83c
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_arith
LUA_API void lua_arith (lua_State *L, int op) {
  StkId o1;  /* 1st operand */
  StkId o2;  /* 2nd operand */
  lua_lock(L);
  if (op != LUA_OPUNM) /* all other operations expect two operands */
    api_checknelems(L, 2);
  else {  /* for unary minus, add fake 2nd operand */
    api_checknelems(L, 1);
    setobjs2s(L, L->top, L->top - 1);
    L->top++;
  }
  o1 = L->top - 2;
  o2 = L->top - 1;
  if (ttisnumber(o1) && ttisnumber(o2)) {
    setnvalue(o1, luaO_arith(op, nvalue(o1), nvalue(o2)));
  }
  else
    luaV_arith(L, o1, o1, o2, cast(TMS, op - LUA_OPADD + TM_ADD));
  L->top--;
  lua_unlock(L);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r8d
movq %rdi, %rbx
cmpl $0x6, %esi
jne 0x79ce
movq 0x10(%rbx), %rax
movq -0x10(%rax), %rcx
movq %rcx, (%rax)
movl -0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
addq $0x10, 0x10(%rbx)
movq 0x10(%rbx), %r14
cmpl $0x3, -0x18(%r14)
jne 0x7a04
cmpl $0x3, -0x8(%r14)
jne 0x7a04
movsd -0x20(%r14), %xmm0
movsd -0x10(%r14), %xmm1
movl %r8d, %edi
callq 0x107e1
movsd %xmm0, -0x20(%r14)
movl $0x3, -0x18(%r14)
jmp 0x7a1e
leaq -0x20(%r14), %rdx
addq $-0x10, %r14
addl $0x6, %r8d
movq %rbx, %rdi
movq %rdx, %rsi
movq %r14, %rcx
callq 0x194c3
addq $-0x10, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_tonumberx
LUA_API lua_Number lua_tonumberx (lua_State *L, int idx, int *isnum) {
  TValue n;
  const TValue *o = index2addr(L, idx);
  if (tonumber(o, &n)) {
    if (isnum) *isnum = 1;
    return nvalue(o);
  }
  else {
    if (isnum) *isnum = 0;
    return 0;
  }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
callq 0x7717
cmpl $0x3, 0x8(%rax)
je 0x7af8
movq %rsp, %rsi
movq %rax, %rdi
callq 0x189ec
testq %rax, %rax
je 0x7b0d
testq %rbx, %rbx
je 0x7b03
movl $0x1, (%rbx)
movsd (%rax), %xmm0
addq $0x10, %rsp
popq %rbx
retq
xorps %xmm0, %xmm0
testq %rbx, %rbx
je 0x7b07
movl $0x0, (%rbx)
jmp 0x7b07
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_tointegerx
LUA_API lua_Integer lua_tointegerx (lua_State *L, int idx, int *isnum) {
  TValue n;
  const TValue *o = index2addr(L, idx);
  if (tonumber(o, &n)) {
    lua_Integer res;
    lua_Number num = nvalue(o);
    lua_number2integer(res, num);
    if (isnum) *isnum = 1;
    return res;
  }
  else {
    if (isnum) *isnum = 0;
    return 0;
  }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
callq 0x7717
cmpl $0x3, 0x8(%rax)
je 0x7b40
movq %rsp, %rsi
movq %rax, %rdi
callq 0x189ec
testq %rax, %rax
je 0x7b57
cvttsd2si (%rax), %rax
movl $0x1, %ecx
testq %rbx, %rbx
je 0x7b51
movl %ecx, (%rbx)
addq $0x10, %rsp
popq %rbx
retq
xorl %ecx, %ecx
movl $0x0, %eax
jmp 0x7b4a
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_tounsignedx
LUA_API lua_Unsigned lua_tounsignedx (lua_State *L, int idx, int *isnum) {
  TValue n;
  const TValue *o = index2addr(L, idx);
  if (tonumber(o, &n)) {
    lua_Unsigned res;
    lua_Number num = nvalue(o);
    lua_number2unsigned(res, num);
    if (isnum) *isnum = 1;
    return res;
  }
  else {
    if (isnum) *isnum = 0;
    return 0;
  }
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
callq 0x7717
cmpl $0x3, 0x8(%rax)
je 0x7b85
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x189ec
testq %rax, %rax
je 0x7bad
movsd (%rax), %xmm0
addsd 0x18777(%rip), %xmm0    # 0x20308
movsd %xmm0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movl $0x1, %ecx
testq %rbx, %rbx
je 0x7ba7
movl %ecx, (%rbx)
addq $0x20, %rsp
popq %rbx
retq
xorl %ecx, %ecx
movl $0x0, %eax
jmp 0x7ba0
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_tolstring
LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
  StkId o = index2addr(L, idx);
  if (!ttisstring(o)) {
    lua_lock(L);  /* `luaV_tostring' may create a new string */
    if (!luaV_tostring(L, o)) {  /* conversion failed? */
      if (len != NULL) *len = 0;
      lua_unlock(L);
      return NULL;
    }
    luaC_checkGC(L);
    o = index2addr(L, idx);  /* previous call may reallocate the stack */
    lua_unlock(L);
  }
  if (len != NULL) *len = tsvalue(o)->len;
  return svalue(o);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0x7717
movl 0x8(%rax), %ecx
andl $0xf, %ecx
cmpl $0x4, %ecx
je 0x7c24
movq %r14, %rdi
movq %rax, %rsi
callq 0x18a40
testl %eax, %eax
je 0x7c3f
movq 0x18(%r14), %rax
cmpq $0x0, 0x18(%rax)
jle 0x7c1a
movq %r14, %rdi
callq 0xd66d
movq %r14, %rdi
movl %ebp, %esi
callq 0x7717
testq %rbx, %rbx
je 0x7c33
movq (%rax), %rcx
movq 0x10(%rcx), %rcx
movq %rcx, (%rbx)
movq (%rax), %rax
addq $0x18, %rax
popq %rbx
popq %r14
popq %rbp
retq
testq %rbx, %rbx
je 0x7c4b
movq $0x0, (%rbx)
xorl %eax, %eax
jmp 0x7c3a
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_rawlen
LUA_API size_t lua_rawlen (lua_State *L, int idx) {
  StkId o = index2addr(L, idx);
  switch (ttypenv(o)) {
    case LUA_TSTRING: return tsvalue(o)->len;
    case LUA_TUSERDATA: return uvalue(o)->len;
    case LUA_TTABLE: return luaH_getn(hvalue(o));
    default: return 0;
  }
}

// Assembly:
pushq %rax
callq 0x7717
movl 0x8(%rax), %ecx
andl $0xf, %ecx
cmpl $0x7, %ecx
je 0x7c7f
cmpl $0x5, %ecx
je 0x7c73
cmpl $0x4, %ecx
jne 0x7c88
movq (%rax), %rax
movq 0x10(%rax), %rax
jmp 0x7c8a
movq (%rax), %rdi
callq 0x17613
cltq
jmp 0x7c8a
movq (%rax), %rax
movq 0x20(%rax), %rax
jmp 0x7c8a
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_touserdata
LUA_API void *lua_touserdata (lua_State *L, int idx) {
  StkId o = index2addr(L, idx);
  switch (ttypenv(o)) {
    case LUA_TUSERDATA: return (rawuvalue(o) + 1);
    case LUA_TLIGHTUSERDATA: return pvalue(o);
    default: return NULL;
  }
}

// Assembly:
pushq %rax
callq 0x7717
movl 0x8(%rax), %ecx
andl $0xf, %ecx
cmpl $0x2, %ecx
je 0x7cce
cmpl $0x7, %ecx
jne 0x7cd3
movq (%rax), %rax
addq $0x28, %rax
jmp 0x7cd5
movq (%rax), %rax
jmp 0x7cd5
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_topointer
LUA_API const void *lua_topointer (lua_State *L, int idx) {
  StkId o = index2addr(L, idx);
  switch (ttype(o)) {
    case LUA_TTABLE: return hvalue(o);
    case LUA_TLCL: return clLvalue(o);
    case LUA_TCCL: return clCvalue(o);
    case LUA_TLCF: return cast(void *, cast(size_t, fvalue(o)));
    case LUA_TTHREAD: return thvalue(o);
    case LUA_TUSERDATA:
    case LUA_TLIGHTUSERDATA:
      return lua_touserdata(L, idx);
    default: return NULL;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0x7717
movq %rax, %rcx
movl 0x8(%rax), %edx
andl $0x3f, %edx
xorl %eax, %eax
leal -0x2(%rdx), %esi
cmpl $0x6, %esi
ja 0x7d40
leaq 0x185fc(%rip), %rdx     # 0x20310
movslq (%rdx,%rsi,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
movq %r14, %rdi
movl %ebx, %esi
callq 0x7717
movl 0x8(%rax), %ecx
andl $0xf, %ecx
cmpl $0x2, %ecx
je 0x7d55
cmpl $0x7, %ecx
jne 0x7d5a
movq (%rax), %rax
addq $0x28, %rax
jmp 0x7d4d
cmpl $0x16, %edx
je 0x7d4a
cmpl $0x26, %edx
jne 0x7d4d
movq (%rcx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%rax), %rax
jmp 0x7d4d
xorl %eax, %eax
jmp 0x7d4d
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_pushunsigned
LUA_API void lua_pushunsigned (lua_State *L, lua_Unsigned u) {
  lua_Number n;
  lua_lock(L);
  n = lua_unsigned2number(u);
  setnvalue(L->top, n);
  api_incr_top(L);
  lua_unlock(L);
}

// Assembly:
testl %esi, %esi
js 0x7dab
cvtsi2sd %esi, %xmm0
jmp 0x7db2
movl %esi, %eax
cvtsi2sd %rax, %xmm0
movq 0x10(%rdi), %rax
movsd %xmm0, (%rax)
movl $0x3, 0x8(%rax)
addq $0x10, 0x10(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_pushlstring
LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) {
  TString *ts;
  lua_lock(L);
  luaC_checkGC(L);
  ts = luaS_newlstr(L, s, len);
  setsvalue2s(L, L->top, ts);
  api_incr_top(L);
  lua_unlock(L);
  return getstr(ts);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x18(%rdi), %rax
cmpq $0x0, 0x18(%rax)
jle 0x7de8
movq %rbx, %rdi
callq 0xd66d
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x14a3f
movq 0x10(%rbx), %rcx
movq %rax, (%rcx)
movzbl 0x8(%rax), %edx
orl $0x40, %edx
movl %edx, 0x8(%rcx)
addq $0x10, 0x10(%rbx)
addq $0x18, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_pushstring
LUA_API const char *lua_pushstring (lua_State *L, const char *s) {
  if (s == NULL) {
    lua_pushnil(L);
    return NULL;
  }
  else {
    TString *ts;
    lua_lock(L);
    luaC_checkGC(L);
    ts = luaS_new(L, s);
    setsvalue2s(L, L->top, ts);
    api_incr_top(L);
    lua_unlock(L);
    return getstr(ts);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x7e5f
movq %rsi, %r14
movq 0x18(%rbx), %rax
cmpq $0x0, 0x18(%rax)
jle 0x7e38
movq %rbx, %rdi
callq 0xd66d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14c07
movq 0x10(%rbx), %rcx
movq %rax, (%rcx)
movzbl 0x8(%rax), %edx
orl $0x40, %edx
movl %edx, 0x8(%rcx)
addq $0x10, 0x10(%rbx)
addq $0x18, %rax
jmp 0x7e74
movq 0x10(%rbx), %rax
movl $0x0, 0x8(%rax)
addq $0x10, %rax
movq %rax, 0x10(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_pushcclosure
LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
  lua_lock(L);
  if (n == 0) {
    setfvalue(L->top, fn);
  }
  else {
    Closure *cl;
    api_checknelems(L, n);
    api_check(L, n <= MAXUPVAL, "upvalue index too large");
    luaC_checkGC(L);
    cl = luaF_newCclosure(L, n);
    cl->c.f = fn;
    L->top -= n;
    while (n--)
      setobj2n(L, &cl->c.upvalue[n], L->top + n);
    setclCvalue(L, L->top, cl);
  }
  api_incr_top(L);
  lua_unlock(L);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
testl %edx, %edx
je 0x7fc8
movl %edx, %ebp
movq 0x18(%rbx), %rax
cmpq $0x0, 0x18(%rax)
jle 0x7f80
movq %rbx, %rdi
callq 0xd66d
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc528
movq %r14, 0x18(%rax)
movslq %ebp, %rcx
movq %rcx, %rdx
shlq $0x4, %rdx
subq %rdx, 0x10(%rbx)
addq $0x10, %rdx
movq 0x10(%rbx), %rsi
movq -0x20(%rdx,%rsi), %rdi
movq %rdi, (%rax,%rdx)
movl -0x18(%rdx,%rsi), %esi
movl %esi, 0x8(%rax,%rdx)
addq $-0x10, %rdx
decq %rcx
jne 0x7fa0
movl $0x66, %ecx
movq %rax, %r14
jmp 0x7fcd
movl $0x16, %ecx
movq 0x10(%rbx), %rax
movq %r14, (%rax)
movl %ecx, 0x8(%rax)
addq $0x10, 0x10(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_getglobal
LUA_API void lua_getglobal (lua_State *L, const char *var) {
  Table *reg = hvalue(&G(L)->l_registry);
  const TValue *gt;  /* global table */
  lua_lock(L);
  gt = luaH_getint(reg, LUA_RIDX_GLOBALS);
  setsvalue2s(L, L->top++, luaS_new(L, var));
  luaV_gettable(L, gt, L->top - 1, L->top - 1);
  lua_unlock(L);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rax
movq 0x40(%rax), %rdi
movl $0x2, %esi
callq 0x1744b
movq %rax, %r15
movq 0x10(%r14), %r12
leaq 0x10(%r12), %rax
movq %rax, 0x10(%r14)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x14c07
movq %rax, (%r12)
movzbl 0x8(%rax), %eax
orl $0x40, %eax
movl %eax, 0x8(%r12)
movq 0x10(%r14), %rcx
addq $-0x10, %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %rcx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x18a99
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_getfield
LUA_API void lua_getfield (lua_State *L, int idx, const char *k) {
  StkId t;
  lua_lock(L);
  t = index2addr(L, idx);
  setsvalue2s(L, L->top, luaS_new(L, k));
  api_incr_top(L);
  luaV_gettable(L, t, L->top - 1, L->top - 1);
  lua_unlock(L);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
callq 0x7717
movq %rax, %r15
movq 0x10(%r14), %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0x14c07
movq %rax, (%r12)
movzbl 0x8(%rax), %eax
orl $0x40, %eax
movl %eax, 0x8(%r12)
movq 0x10(%r14), %rcx
leaq 0x10(%rcx), %rax
movq %rax, 0x10(%r14)
movq %r14, %rdi
movq %r15, %rsi
movq %rcx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x18a99
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_rawgeti
LUA_API void lua_rawgeti (lua_State *L, int idx, int n) {
  StkId t;
  lua_lock(L);
  t = index2addr(L, idx);
  api_check(L, ttistable(t), "table expected");
  setobj2s(L, L->top, luaH_getint(hvalue(t), n));
  api_incr_top(L);
  lua_unlock(L);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
callq 0x7717
movq (%rax), %rdi
movl %ebx, %esi
callq 0x1744b
movq 0x10(%r14), %rcx
movq (%rax), %rdx
movq %rdx, (%rcx)
movl 0x8(%rax), %eax
movl %eax, 0x8(%rcx)
addq $0x10, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_rawgetp
LUA_API void lua_rawgetp (lua_State *L, int idx, const void *p) {
  StkId t;
  TValue k;
  lua_lock(L);
  t = index2addr(L, idx);
  api_check(L, ttistable(t), "table expected");
  setpvalue(&k, cast(void *, p));
  setobj2s(L, L->top, luaH_get(hvalue(t), &k));
  api_incr_top(L);
  lua_unlock(L);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rdi, %r14
callq 0x7717
leaq 0x8(%rsp), %rsi
movq %rbx, (%rsi)
movl $0x2, 0x8(%rsi)
movq (%rax), %rdi
callq 0x1750d
movq 0x10(%r14), %rcx
movq (%rax), %rdx
movq %rdx, (%rcx)
movl 0x8(%rax), %eax
movl %eax, 0x8(%rcx)
addq $0x10, 0x10(%r14)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_getmetatable
LUA_API int lua_getmetatable (lua_State *L, int objindex) {
  const TValue *obj;
  Table *mt = NULL;
  int res;
  lua_lock(L);
  obj = index2addr(L, objindex);
  switch (ttypenv(obj)) {
    case LUA_TTABLE:
      mt = hvalue(obj)->metatable;
      break;
    case LUA_TUSERDATA:
      mt = uvalue(obj)->metatable;
      break;
    default:
      mt = G(L)->mt[ttypenv(obj)];
      break;
  }
  if (mt == NULL)
    res = 0;
  else {
    sethvalue(L, L->top, mt);
    api_incr_top(L);
    res = 1;
  }
  lua_unlock(L);
  return res;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x7717
movl 0x8(%rax), %ecx
andl $0xf, %ecx
cmpq $0x7, %rcx
je 0x8239
cmpl $0x5, %ecx
jne 0x8242
movq (%rax), %rax
addq $0x10, %rax
jmp 0x8250
movq 0x18(%rbx), %rax
leaq (%rax,%rcx,8), %rax
addq $0x1a8, %rax            # imm = 0x1A8
movq (%rax), %rax
testq %rax, %rax
je 0x8272
movq 0x10(%rbx), %rcx
movq %rax, (%rcx)
movl $0x45, 0x8(%rcx)
addq $0x10, 0x10(%rbx)
movl $0x1, %eax
jmp 0x8274
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_getuservalue
LUA_API void lua_getuservalue (lua_State *L, int idx) {
  StkId o;
  lua_lock(L);
  o = index2addr(L, idx);
  api_check(L, ttisuserdata(o), "userdata expected");
  if (uvalue(o)->env) {
    sethvalue(L, L->top, uvalue(o)->env);
  } else
    setnilvalue(L->top);
  api_incr_top(L);
  lua_unlock(L);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x7717
movq (%rax), %rax
movq 0x18(%rax), %rcx
movq 0x10(%rbx), %rax
testq %rcx, %rcx
je 0x8299
movq %rcx, (%rax)
movl $0x45, %ecx
jmp 0x829b
xorl %ecx, %ecx
movl %ecx, 0x8(%rax)
addq $0x10, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_setglobal
LUA_API void lua_setglobal (lua_State *L, const char *var) {
  Table *reg = hvalue(&G(L)->l_registry);
  const TValue *gt;  /* global table */
  lua_lock(L);
  api_checknelems(L, 1);
  gt = luaH_getint(reg, LUA_RIDX_GLOBALS);
  setsvalue2s(L, L->top++, luaS_new(L, var));
  luaV_settable(L, gt, L->top - 1, L->top - 2);
  L->top -= 2;  /* pop value and key */
  lua_unlock(L);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movq 0x40(%rax), %rdi
movl $0x2, %esi
callq 0x1744b
movq %rax, %r15
movq 0x10(%rbx), %r12
leaq 0x10(%r12), %rax
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14c07
movq %rax, (%r12)
movzbl 0x8(%rax), %eax
orl $0x40, %eax
movl %eax, 0x8(%r12)
movq 0x10(%rbx), %rcx
leaq -0x10(%rcx), %rdx
addq $-0x20, %rcx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18c8a
addq $-0x20, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_setfield
LUA_API void lua_setfield (lua_State *L, int idx, const char *k) {
  StkId t;
  lua_lock(L);
  api_checknelems(L, 1);
  t = index2addr(L, idx);
  setsvalue2s(L, L->top++, luaS_new(L, k));
  luaV_settable(L, t, L->top - 1, L->top - 2);
  L->top -= 2;  /* pop value and key */
  lua_unlock(L);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
callq 0x7717
movq %rax, %r15
movq 0x10(%rbx), %r12
leaq 0x10(%r12), %rax
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14c07
movq %rax, (%r12)
movzbl 0x8(%rax), %eax
orl $0x40, %eax
movl %eax, 0x8(%r12)
movq 0x10(%rbx), %rcx
leaq -0x10(%rcx), %rdx
addq $-0x20, %rcx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18c8a
addq $-0x20, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_rawset
LUA_API void lua_rawset (lua_State *L, int idx) {
  StkId t;
  lua_lock(L);
  api_checknelems(L, 2);
  t = index2addr(L, idx);
  api_check(L, ttistable(t), "table expected");
  setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1);
  invalidateTMcache(hvalue(t));
  luaC_barrierback(L, gcvalue(t), L->top-1);
  L->top -= 2;
  lua_unlock(L);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x7717
movq %rax, %r14
movq 0x10(%rbx), %r15
movq (%rax), %rsi
leaq -0x20(%r15), %rdx
movq %rbx, %rdi
callq 0x16f5c
movq -0x10(%r15), %rcx
movq %rcx, (%rax)
movl -0x8(%r15), %ecx
movl %ecx, 0x8(%rax)
movq (%r14), %rax
movb $0x0, 0xa(%rax)
movq 0x10(%rbx), %rax
testb $0x40, -0x8(%rax)
je 0x8402
movq -0x10(%rax), %rax
testb $0x3, 0x9(%rax)
je 0x8402
movq (%r14), %rsi
testb $0x4, 0x9(%rsi)
je 0x8402
movq %rbx, %rdi
callq 0xc962
addq $-0x20, 0x10(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_rawseti
LUA_API void lua_rawseti (lua_State *L, int idx, int n) {
  StkId t;
  lua_lock(L);
  api_checknelems(L, 1);
  t = index2addr(L, idx);
  api_check(L, ttistable(t), "table expected");
  luaH_setint(L, hvalue(t), n, L->top - 1);
  luaC_barrierback(L, gcvalue(t), L->top-1);
  L->top--;
  lua_unlock(L);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
callq 0x7717
movq %rax, %r14
movq (%rax), %rsi
movq 0x10(%rbx), %rcx
addq $-0x10, %rcx
movq %rbx, %rdi
movl %ebp, %edx
callq 0x16efb
movq 0x10(%rbx), %rax
testb $0x40, -0x8(%rax)
je 0x8458
movq -0x10(%rax), %rax
testb $0x3, 0x9(%rax)
je 0x8458
movq (%r14), %rsi
testb $0x4, 0x9(%rsi)
je 0x8458
movq %rbx, %rdi
callq 0xc962
addq $-0x10, 0x10(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_rawsetp
LUA_API void lua_rawsetp (lua_State *L, int idx, const void *p) {
  StkId t;
  TValue k;
  lua_lock(L);
  api_checknelems(L, 1);
  t = index2addr(L, idx);
  api_check(L, ttistable(t), "table expected");
  setpvalue(&k, cast(void *, p));
  setobj2t(L, luaH_set(L, hvalue(t), &k), L->top - 1);
  luaC_barrierback(L, gcvalue(t), L->top - 1);
  L->top--;
  lua_unlock(L);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rdi, %rbx
callq 0x7717
movq %rax, %r14
movq %rsp, %rdx
movq %r15, (%rdx)
movl $0x2, 0x8(%rdx)
movq 0x10(%rbx), %r15
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x16f5c
movq -0x10(%r15), %rcx
movq %rcx, (%rax)
movl -0x8(%r15), %ecx
movl %ecx, 0x8(%rax)
movq 0x10(%rbx), %rax
testb $0x40, -0x8(%rax)
je 0x84c8
movq -0x10(%rax), %rax
testb $0x3, 0x9(%rax)
je 0x84c8
movq (%r14), %rsi
testb $0x4, 0x9(%rsi)
je 0x84c8
movq %rbx, %rdi
callq 0xc962
addq $-0x10, 0x10(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_setmetatable
LUA_API int lua_setmetatable (lua_State *L, int objindex) {
  TValue *obj;
  Table *mt;
  lua_lock(L);
  api_checknelems(L, 1);
  obj = index2addr(L, objindex);
  if (ttisnil(L->top - 1))
    mt = NULL;
  else {
    api_check(L, ttistable(L->top - 1), "table expected");
    mt = hvalue(L->top - 1);
  }
  switch (ttypenv(obj)) {
    case LUA_TTABLE: {
      hvalue(obj)->metatable = mt;
      if (mt) {
        luaC_objbarrierback(L, gcvalue(obj), mt);
        luaC_checkfinalizer(L, gcvalue(obj), mt);
      }
      break;
    }
    case LUA_TUSERDATA: {
      uvalue(obj)->metatable = mt;
      if (mt) {
        luaC_objbarrier(L, rawuvalue(obj), mt);
        luaC_checkfinalizer(L, gcvalue(obj), mt);
      }
      break;
    }
    default: {
      G(L)->mt[ttypenv(obj)] = mt;
      break;
    }
  }
  L->top--;
  lua_unlock(L);
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x7717
movq %rax, %r15
movq 0x10(%rbx), %rax
cmpl $0x0, -0x8(%rax)
je 0x84f7
movq -0x10(%rax), %r14
jmp 0x84fa
xorl %r14d, %r14d
movl 0x8(%r15), %eax
andl $0xf, %eax
cmpq $0x7, %rax
je 0x8532
cmpl $0x5, %eax
jne 0x8569
movq (%r15), %rax
movq %r14, 0x10(%rax)
testq %r14, %r14
je 0x8575
testb $0x3, 0x9(%r14)
je 0x8559
movq (%r15), %rsi
testb $0x4, 0x9(%rsi)
je 0x8559
movq %rbx, %rdi
callq 0xc962
jmp 0x8559
movq (%r15), %rax
movq %r14, 0x10(%rax)
testq %r14, %r14
je 0x8575
testb $0x3, 0x9(%r14)
je 0x8559
movq (%r15), %rsi
testb $0x4, 0x9(%rsi)
je 0x8559
movq %rbx, %rdi
movq %r14, %rdx
callq 0xc83c
movq (%r15), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0xca6b
jmp 0x8575
movq 0x18(%rbx), %rcx
movq %r14, 0x1a8(%rcx,%rax,8)
addq $-0x10, 0x10(%rbx)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_setuservalue
LUA_API void lua_setuservalue (lua_State *L, int idx) {
  StkId o;
  lua_lock(L);
  api_checknelems(L, 1);
  o = index2addr(L, idx);
  api_check(L, ttisuserdata(o), "userdata expected");
  if (ttisnil(L->top - 1))
    uvalue(o)->env = NULL;
  else {
    api_check(L, ttistable(L->top - 1), "table expected");
    uvalue(o)->env = hvalue(L->top - 1);
    luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1));
  }
  L->top--;
  lua_unlock(L);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x7717
movq 0x10(%rbx), %rcx
cmpl $0x0, -0x8(%rcx)
je 0x85c4
movq -0x10(%rcx), %rcx
movq (%rax), %rdx
movq %rcx, 0x18(%rdx)
movq 0x10(%rbx), %rcx
movq -0x10(%rcx), %rdx
testb $0x3, 0x9(%rdx)
je 0x85cf
movq (%rax), %rsi
testb $0x4, 0x9(%rsi)
je 0x85cf
movq %rbx, %rdi
callq 0xc83c
jmp 0x85cf
movq (%rax), %rax
movq $0x0, 0x18(%rax)
addq $-0x10, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_callk
LUA_API void lua_callk (lua_State *L, int nargs, int nresults, int ctx,
                        lua_CFunction k) {
  StkId func;
  lua_lock(L);
  api_check(L, k == NULL || !isLua(L->ci),
    "cannot use continuations inside hooks");
  api_checknelems(L, nargs+1);
  api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread");
  checkresults(L, nargs, nresults);
  func = L->top - (nargs+1);
  if (k != NULL && L->nny == 0) {  /* need to prepare continuation? */
    L->ci->u.c.k = k;  /* save continuation */
    L->ci->u.c.ctx = ctx;  /* save context */
    luaD_call(L, func, nresults, 1);  /* do the call */
  }
  else  /* no continuation or no yieldable */
    luaD_call(L, func, nresults, 0);  /* just do the call */
  adjustresults(L, nresults);
  lua_unlock(L);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
notl %esi
movslq %esi, %rsi
shlq $0x4, %rsi
addq 0x10(%rdi), %rsi
xorl %eax, %eax
testq %r8, %r8
je 0x8628
cmpw $0x0, 0x44(%rbx)
jne 0x8628
movq 0x20(%rbx), %rax
movq %r8, 0x38(%rax)
movq 0x20(%rbx), %rax
movl %ecx, 0x30(%rax)
movl $0x1, %eax
movq %rbx, %rdi
movl %ebp, %edx
movl %eax, %ecx
callq 0xb9c9
cmpl $-0x1, %ebp
jne 0x864b
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rcx
cmpq %rax, 0x8(%rcx)
jae 0x864b
movq %rax, 0x8(%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_pcallk
LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc,
                        int ctx, lua_CFunction k) {
  struct CallS c;
  int status;
  ptrdiff_t func;
  lua_lock(L);
  api_check(L, k == NULL || !isLua(L->ci),
    "cannot use continuations inside hooks");
  api_checknelems(L, nargs+1);
  api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread");
  checkresults(L, nargs, nresults);
  if (errfunc == 0)
    func = 0;
  else {
    StkId o = index2addr(L, errfunc);
    api_checkstackindex(L, errfunc, o);
    func = savestack(L, o);
  }
  c.func = L->top - (nargs+1);  /* function to be called */
  if (k == NULL || L->nny > 0) {  /* no continuation or no yieldable? */
    c.nresults = nresults;  /* do a 'conventional' protected call */
    status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func);
  }
  else {  /* prepare continuation (call is already protected by 'resume') */
    CallInfo *ci = L->ci;
    ci->u.c.k = k;  /* save continuation */
    ci->u.c.ctx = ctx;  /* save context */
    /* save information for error recovery */
    ci->extra = savestack(L, c.func);
    ci->u.c.old_allowhook = L->allowhook;
    ci->u.c.old_errfunc = L->errfunc;
    L->errfunc = func;
    /* mark that function may do error recovery */
    ci->callstatus |= CIST_YPCALL;
    luaD_call(L, c.func, nresults, 1);  /* do the call */
    ci->callstatus &= ~CIST_YPCALL;
    L->errfunc = ci->u.c.old_errfunc;
    status = LUA_OK;  /* if it is here, there were no errors */
  }
  adjustresults(L, nresults);
  lua_unlock(L);
  return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r9, %r15
movl %r8d, %r14d
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %rbx
testl %ecx, %ecx
je 0x8683
movq %rbx, %rdi
movl %ecx, %esi
callq 0x7717
movq %rax, %r8
subq 0x38(%rbx), %r8
jmp 0x8686
xorl %r8d, %r8d
notl %r12d
movslq %r12d, %rcx
shlq $0x4, %rcx
addq 0x10(%rbx), %rcx
movq %rcx, (%rsp)
testq %r15, %r15
je 0x86a4
cmpw $0x0, 0x44(%rbx)
je 0x86bf
movq %rsp, %rdx
movl %ebp, 0x8(%rdx)
subq 0x38(%rbx), %rcx
leaq 0x86(%rip), %rsi        # 0x873b
movq %rbx, %rdi
callq 0xbda7
jmp 0x8717
movq 0x20(%rbx), %r12
movq %r15, 0x38(%r12)
movl %r14d, 0x30(%r12)
movq %rcx, %rax
subq 0x38(%rbx), %rax
movq %rax, 0x28(%r12)
movb 0x49(%rbx), %al
movb %al, 0x48(%r12)
movq 0x78(%rbx), %rax
movq %rax, 0x40(%r12)
movq %r8, 0x78(%rbx)
orb $0x10, 0x22(%r12)
movq %rbx, %rdi
movq %rcx, %rsi
movl %ebp, %edx
movl $0x1, %ecx
callq 0xb9c9
andb $-0x11, 0x22(%r12)
movq 0x40(%r12), %rax
movq %rax, 0x78(%rbx)
xorl %eax, %eax
cmpl $-0x1, %ebp
jne 0x872e
movq 0x10(%rbx), %rcx
movq 0x20(%rbx), %rdx
cmpq %rcx, 0x8(%rdx)
jae 0x872e
movq %rcx, 0x8(%rdx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_load
LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
                      const char *chunkname, const char *mode) {
  ZIO z;
  int status;
  lua_lock(L);
  if (!chunkname) chunkname = "?";
  luaZ_init(L, &z, reader, data);
  status = luaD_protectedparser(L, &z, chunkname, mode);
  if (status == LUA_OK) {  /* no errors? */
    LClosure *f = clLvalue(L->top - 1);  /* get newly created function */
    if (f->nupvalues == 1) {  /* does it have one upvalue? */
      /* get global table from registry */
      Table *reg = hvalue(&G(L)->l_registry);
      const TValue *gt = luaH_getint(reg, LUA_RIDX_GLOBALS);
      /* set global table as 1st upvalue of 'f' (may be LUA_ENV) */
      setobj(L, f->upvals[0]->v, gt);
      luaC_barrier(L, f->upvals[0], gt);
    }
  }
  lua_unlock(L);
  return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %r8, %r14
movq %rdx, %rax
movq %rsi, %rdx
movq %rdi, %rbx
testq %rcx, %rcx
leaq 0x180ab(%rip), %r15     # 0x20818
cmovneq %rcx, %r15
leaq 0x8(%rsp), %r12
movq %r12, %rsi
movq %rax, %rcx
callq 0x1aaaf
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0xbe26
movl %eax, %ebp
testl %eax, %eax
jne 0x87ee
movq 0x10(%rbx), %rax
movq -0x10(%rax), %r14
cmpb $0x1, 0xa(%r14)
jne 0x87ee
movq 0x18(%rbx), %rax
movq 0x40(%rax), %rdi
movl $0x2, %esi
callq 0x1744b
movq 0x20(%r14), %rcx
movq 0x10(%rcx), %rcx
movq (%rax), %rdx
movq %rdx, (%rcx)
movl 0x8(%rax), %edx
movl %edx, 0x8(%rcx)
testb $0x40, 0x8(%rax)
je 0x87ee
movq (%rax), %rdx
testb $0x3, 0x9(%rdx)
je 0x87ee
movq 0x20(%r14), %rsi
testb $0x4, 0x9(%rsi)
je 0x87ee
movq %rbx, %rdi
callq 0xc83c
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_newuserdata
LUA_API void *lua_newuserdata (lua_State *L, size_t size) {
  Udata *u;
  lua_lock(L);
  luaC_checkGC(L);
  u = luaS_newudata(L, size, NULL);
  setuvalue(L, L->top, u);
  api_incr_top(L);
  lua_unlock(L);
  return u + 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rax
cmpq $0x0, 0x18(%rax)
jle 0x8a5d
movq %rbx, %rdi
callq 0xd66d
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x14c2e
movq 0x10(%rbx), %rcx
movq %rax, (%rcx)
movl $0x47, 0x8(%rcx)
addq $0x10, 0x10(%rbx)
addq $0x28, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: aux_upvalue
static const char *aux_upvalue (StkId fi, int n, TValue **val,
                                GCObject **owner) {
  switch (ttype(fi)) {
    case LUA_TCCL: {  /* C closure */
      CClosure *f = clCvalue(fi);
      if (!(1 <= n && n <= f->nupvalues)) return NULL;
      *val = &f->upvalue[n-1];
      if (owner) *owner = obj2gco(f);
      return "";
    }
    case LUA_TLCL: {  /* Lua closure */
      LClosure *f = clLvalue(fi);
      TString *name;
      Proto *p = f->p;
      if (!(1 <= n && n <= p->sizeupvalues)) return NULL;
      *val = f->upvals[n-1]->v;
      if (owner) *owner = obj2gco(f->upvals[n - 1]);
      name = p->upvalues[n-1].name;
      return (name == NULL) ? "" : getstr(name);
    }
    default: return NULL;  /* not a closure */
  }
}

// Assembly:
movl 0x8(%rdi), %eax
andl $0x3f, %eax
cmpl $0x6, %eax
je 0x8b1e
cmpl $0x26, %eax
jne 0x8b2e
testl %esi, %esi
jle 0x8b2e
movq (%rdi), %rdi
movzbl 0xa(%rdi), %eax
cmpl %esi, %eax
jl 0x8b2e
decl %esi
shlq $0x4, %rsi
leaq (%rdi,%rsi), %rax
addq $0x20, %rax
movq %rax, (%rdx)
leaq 0x18442(%rip), %rax     # 0x20f57
testq %rcx, %rcx
je 0x8b6a
movq %rdi, (%rcx)
retq
testl %esi, %esi
jle 0x8b2e
movq (%rdi), %rdi
movq 0x18(%rdi), %rax
cmpl %esi, 0x50(%rax)
jge 0x8b31
xorl %eax, %eax
retq
decl %esi
movq 0x20(%rdi,%rsi,8), %r8
movq 0x10(%r8), %r8
movq %r8, (%rdx)
testq %rcx, %rcx
je 0x8b4c
movq 0x20(%rdi,%rsi,8), %rdx
movq %rdx, (%rcx)
movq 0x38(%rax), %rax
shlq $0x4, %rsi
movq (%rax,%rsi), %rax
leaq 0x18(%rax), %rcx
testq %rax, %rax
leaq 0x183f1(%rip), %rax     # 0x20f57
cmovneq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_setupvalue
LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) {
  const char *name;
  TValue *val = NULL;  /* to avoid warnings */
  GCObject *owner = NULL;  /* to avoid warnings */
  StkId fi;
  lua_lock(L);
  fi = index2addr(L, funcindex);
  api_checknelems(L, 1);
  name = aux_upvalue(fi, n, &val, &owner);
  if (name) {
    L->top--;
    setobj(L, val, L->top);
    luaC_barrier(L, owner, L->top);
  }
  lua_unlock(L);
  return name;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x10(%rsp), %r14
movq %rax, (%r14)
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
callq 0x7717
movq %rax, %rdi
movl %ebp, %esi
movq %r14, %rdx
movq %r15, %rcx
callq 0x8ade
movq %rax, %r14
testq %rax, %rax
je 0x8bed
movq 0x10(%rbx), %rax
leaq -0x10(%rax), %rcx
movq %rcx, 0x10(%rbx)
movq 0x10(%rsp), %rcx
movq -0x10(%rax), %rdx
movq %rdx, (%rcx)
movl -0x8(%rax), %eax
movl %eax, 0x8(%rcx)
movq 0x10(%rbx), %rax
testb $0x40, 0x8(%rax)
je 0x8bed
movq (%rax), %rdx
testb $0x3, 0x9(%rdx)
je 0x8bed
movq 0x8(%rsp), %rsi
testb $0x4, 0x9(%rsi)
je 0x8bed
movq %rbx, %rdi
callq 0xc83c
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lapi.c
// Function: lua_upvaluejoin
LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1,
                                            int fidx2, int n2) {
  LClosure *f1;
  UpVal **up1 = getupvalref(L, fidx1, n1, &f1);
  UpVal **up2 = getupvalref(L, fidx2, n2, NULL);
  *up1 = *up2;
  luaC_objbarrier(L, f1, *up2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebp
movl %ecx, %r15d
movl %edx, %r12d
movq %rdi, %rbx
callq 0x7717
movq (%rax), %r14
movslq %r12d, %r12
movq %rbx, %rdi
movl %r15d, %esi
callq 0x7717
movq (%rax), %rax
movslq %ebp, %rcx
movq 0x18(%rax,%rcx,8), %rdx
movq %rdx, 0x18(%r14,%r12,8)
movq 0x18(%rax,%rcx,8), %rdx
testb $0x3, 0x9(%rdx)
je 0x8c98
testb $0x4, 0x9(%r14)
jne 0x8ca1
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xc83c