lua_atpanic:
  144|    361|LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) {
  145|    361|  lua_CFunction old;
  146|    361|  lua_lock(L);
  ------------------
  |  |  264|    361|#define lua_lock(L)	((void) 0)
  ------------------
  147|    361|  old = G(L)->panic;
  ------------------
  |  |  335|    361|#define G(L)	(L->l_G)
  ------------------
  148|    361|  G(L)->panic = panicf;
  ------------------
  |  |  335|    361|#define G(L)	(L->l_G)
  ------------------
  149|    361|  lua_unlock(L);
  ------------------
  |  |  265|    361|#define lua_unlock(L)	((void) 0)
  ------------------
  150|    361|  return old;
  151|    361|}
lua_gettop:
  176|    361|LUA_API int lua_gettop (lua_State *L) {
  177|    361|  return cast_int(L->top.p - (L->ci->func.p + 1));
  ------------------
  |  |  141|    361|#define cast_int(i)	cast(int, (i))
  |  |  ------------------
  |  |  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  178|    361|}
lua_settop:
  181|    361|LUA_API void lua_settop (lua_State *L, int idx) {
  182|    361|  CallInfo *ci;
  183|    361|  StkId func, newtop;
  184|    361|  ptrdiff_t diff;  /* difference for new top */
  185|    361|  lua_lock(L);
  ------------------
  |  |  264|    361|#define lua_lock(L)	((void) 0)
  ------------------
  186|    361|  ci = L->ci;
  187|    361|  func = ci->func.p;
  188|    361|  if (idx >= 0) {
  ------------------
  |  Branch (188:7): [True: 361, False: 0]
  ------------------
  189|    361|    api_check(L, idx <= ci->top.p - (func + 1), "new top too large");
  ------------------
  |  |  126|    361|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  ------------------
  |  |  |  |  727|    361|#define luai_apicheck(l,e)	assert(e)
  |  |  ------------------
  ------------------
  190|    361|    diff = ((func + 1) + idx) - L->top.p;
  191|    361|    for (; diff > 0; diff--)
  ------------------
  |  Branch (191:12): [True: 0, False: 361]
  ------------------
  192|    361|      setnilvalue(s2v(L->top.p++));  /* clear new slots */
  ------------------
  |  |  200|      0|#define setnilvalue(obj) settt_(obj, LUA_VNIL)
  |  |  ------------------
  |  |  |  |  114|    361|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  193|    361|  }
  194|      0|  else {
  195|      0|    api_check(L, -(idx+1) <= (L->top.p - (func + 1)), "invalid new top");
  ------------------
  |  |  126|      0|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  ------------------
  |  |  |  |  727|      0|#define luai_apicheck(l,e)	assert(e)
  |  |  ------------------
  ------------------
  196|      0|    diff = idx + 1;  /* will "subtract" index (as it is negative) */
  197|      0|  }
  198|    361|  api_check(L, L->tbclist.p < L->top.p, "previous pop of an unclosed slot");
  ------------------
  |  |  126|    361|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  ------------------
  |  |  |  |  727|    361|#define luai_apicheck(l,e)	assert(e)
  |  |  ------------------
  ------------------
  199|    361|  newtop = L->top.p + diff;
  200|    361|  if (diff < 0 && L->tbclist.p >= newtop) {
  ------------------
  |  Branch (200:7): [True: 252, False: 109]
  |  Branch (200:19): [True: 0, False: 252]
  ------------------
  201|      0|    lua_assert(hastocloseCfunc(ci->nresults));
  ------------------
  |  |  114|      0|#define lua_assert(c)		((void)0)
  ------------------
  202|      0|    newtop = luaF_close(L, newtop, CLOSEKTOP, 0);
  ------------------
  |  |   47|      0|#define CLOSEKTOP	(-1)
  ------------------
  203|      0|  }
  204|    361|  L->top.p = newtop;  /* correct top only after closing any upvalue */
  205|    361|  lua_unlock(L);
  ------------------
  |  |  265|    361|#define lua_unlock(L)	((void) 0)
  ------------------
  206|    361|}
lua_isnumber:
  309|    252|LUA_API int lua_isnumber (lua_State *L, int idx) {
  310|    252|  lua_Number n;
  311|    252|  const TValue *o = index2value(L, idx);
  312|    252|  return tonumber(o, &n);
  ------------------
  |  |   52|    252|	(ttisfloat(o) ? (*(n) = fltvalue(o), 1) : luaV_tonumber_(o,n))
  |  |  ------------------
  |  |  |  |  327|    252|#define ttisfloat(o)		checktag((o), LUA_VNUMFLT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|    252|#define checktag(o,t)		(rawtt(o) == (t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|    252|#define rawtt(o)	((o)->tt_)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (91:24): [True: 68, False: 184]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(ttisfloat(o) ? (*(n) = fltvalue(o), 1) : luaV_tonumber_(o,n))
  |  |  ------------------
  |  |  |  |  332|     68|#define fltvalue(o)	check_exp(ttisfloat(o), val_(o).n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|     68|#define check_exp(c,e)		(e)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  313|    252|}
lua_stringtonumber:
  371|    361|LUA_API size_t lua_stringtonumber (lua_State *L, const char *s) {
  372|    361|  size_t sz = luaO_str2num(s, s2v(L->top.p));
  ------------------
  |  |  172|    361|#define s2v(o)	(&(o)->val)
  ------------------
  373|    361|  if (sz != 0)
  ------------------
  |  Branch (373:7): [True: 252, False: 109]
  ------------------
  374|    361|    api_incr_top(L);
  ------------------
  |  |   16|    252|#define api_incr_top(L)	{L->top.p++; \
  |  |   17|    252|			 api_check(L, L->top.p <= L->ci->top.p, \
  |  |  ------------------
  |  |  |  |  126|    252|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  727|    252|#define luai_apicheck(l,e)	assert(e)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   18|    252|					"stack overflow");}
  ------------------
  375|    361|  return sz;
  376|    361|}
lua_setwarnf:
 1327|    361|void lua_setwarnf (lua_State *L, lua_WarnFunction f, void *ud) {
 1328|    361|  lua_lock(L);
  ------------------
  |  |  264|    361|#define lua_lock(L)	((void) 0)
  ------------------
 1329|    361|  G(L)->ud_warn = ud;
  ------------------
  |  |  335|    361|#define G(L)	(L->l_G)
  ------------------
 1330|    361|  G(L)->warnf = f;
  ------------------
  |  |  335|    361|#define G(L)	(L->l_G)
  ------------------
 1331|    361|  lua_unlock(L);
  ------------------
  |  |  265|    361|#define lua_unlock(L)	((void) 0)
  ------------------
 1332|    361|}
lapi.c:index2value:
   60|    252|static TValue *index2value (lua_State *L, int idx) {
   61|    252|  CallInfo *ci = L->ci;
   62|    252|  if (idx > 0) {
  ------------------
  |  Branch (62:7): [True: 0, False: 252]
  ------------------
   63|      0|    StkId o = ci->func.p + idx;
   64|      0|    api_check(L, idx <= ci->top.p - (ci->func.p + 1), "unacceptable index");
  ------------------
  |  |  126|      0|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  ------------------
  |  |  |  |  727|      0|#define luai_apicheck(l,e)	assert(e)
  |  |  ------------------
  ------------------
   65|      0|    if (o >= L->top.p) return &G(L)->nilvalue;
  ------------------
  |  |  335|      0|#define G(L)	(L->l_G)
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|    else return s2v(o);
  ------------------
  |  |  172|      0|#define s2v(o)	(&(o)->val)
  ------------------
   67|      0|  }
   68|    252|  else if (!ispseudo(idx)) {  /* negative index */
  ------------------
  |  |   50|    252|#define ispseudo(i)		((i) <= LUA_REGISTRYINDEX)
  |  |  ------------------
  |  |  |  |   43|    252|#define LUA_REGISTRYINDEX	(-LUAI_MAXSTACK - 1000)
  |  |  |  |  ------------------
  |  |  |  |  |  |  749|    252|#define LUAI_MAXSTACK		1000000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (68:12): [True: 252, False: 0]
  ------------------
   69|    252|    api_check(L, idx != 0 && -idx <= L->top.p - (ci->func.p + 1),
  ------------------
  |  |  126|    252|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  ------------------
  |  |  |  |  727|    252|#define luai_apicheck(l,e)	assert(e)
  |  |  ------------------
  ------------------
   70|    252|                 "invalid index");
   71|    252|    return s2v(L->top.p + idx);
  ------------------
  |  |  172|    252|#define s2v(o)	(&(o)->val)
  ------------------
   72|    252|  }
   73|      0|  else if (idx == LUA_REGISTRYINDEX)
  ------------------
  |  |   43|      0|#define LUA_REGISTRYINDEX	(-LUAI_MAXSTACK - 1000)
  |  |  ------------------
  |  |  |  |  749|      0|#define LUAI_MAXSTACK		1000000
  |  |  ------------------
  ------------------
  |  Branch (73:12): [True: 0, False: 0]
  ------------------
   74|      0|    return &G(L)->l_registry;
  ------------------
  |  |  335|      0|#define G(L)	(L->l_G)
  ------------------
   75|      0|  else {  /* upvalues */
   76|      0|    idx = LUA_REGISTRYINDEX - idx;
  ------------------
  |  |   43|      0|#define LUA_REGISTRYINDEX	(-LUAI_MAXSTACK - 1000)
  |  |  ------------------
  |  |  |  |  749|      0|#define LUAI_MAXSTACK		1000000
  |  |  ------------------
  ------------------
   77|      0|    api_check(L, idx <= MAXUPVAL + 1, "upvalue index too large");
  ------------------
  |  |  126|      0|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  ------------------
  |  |  |  |  727|      0|#define luai_apicheck(l,e)	assert(e)
  |  |  ------------------
  ------------------
   78|      0|    if (ttisCclosure(s2v(ci->func.p))) {  /* C closure? */
  ------------------
  |  |  595|      0|#define ttisCclosure(o)		checktag((o), ctb(LUA_VCCL))
  |  |  ------------------
  |  |  |  |   91|      0|#define checktag(o,t)		(rawtt(o) == (t))
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|#define rawtt(o)	((o)->tt_)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   79|      0|      CClosure *func = clCvalue(s2v(ci->func.p));
  ------------------
  |  |  604|      0|#define clCvalue(o)	check_exp(ttisCclosure(o), gco2ccl(val_(o).gc))
  |  |  ------------------
  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
   80|      0|      return (idx <= func->nupvalues) ? &func->upvalue[idx-1]
  ------------------
  |  Branch (80:14): [True: 0, False: 0]
  ------------------
   81|      0|                                      : &G(L)->nilvalue;
  ------------------
  |  |  335|      0|#define G(L)	(L->l_G)
  ------------------
   82|      0|    }
   83|      0|    else {  /* light C function or Lua function (through a hook)?) */
   84|      0|      api_check(L, ttislcf(s2v(ci->func.p)), "caller not a C function");
  ------------------
  |  |  126|      0|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  ------------------
  |  |  |  |  727|      0|#define luai_apicheck(l,e)	assert(e)
  |  |  ------------------
  ------------------
   85|      0|      return &G(L)->nilvalue;  /* no upvalues */
  ------------------
  |  |  335|      0|#define G(L)	(L->l_G)
  ------------------
   86|      0|    }
   87|      0|  }
   88|    252|}

luaL_newstate:
 1094|    361|LUALIB_API lua_State *luaL_newstate (void) {
 1095|    361|  lua_State *L = lua_newstate(l_alloc, NULL);
 1096|    361|  if (l_likely(L)) {
  ------------------
  |  |  696|    361|#define l_likely(x)	luai_likely(x)
  |  |  ------------------
  |  |  |  |  684|    361|#define luai_likely(x)		(__builtin_expect(((x) != 0), 1))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (684:25): [True: 361, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1097|    361|    lua_atpanic(L, &panic);
 1098|    361|    lua_setwarnf(L, warnfoff, L);  /* default is warnings off */
 1099|    361|  }
 1100|    361|  return L;
 1101|    361|}
lauxlib.c:l_alloc:
 1017|  40.0k|static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
 1018|  40.0k|  (void)ud; (void)osize;  /* not used */
 1019|  40.0k|  if (nsize == 0) {
  ------------------
  |  Branch (1019:7): [True: 20.2k, False: 19.8k]
  ------------------
 1020|  20.2k|    free(ptr);
 1021|  20.2k|    return NULL;
 1022|  20.2k|  }
 1023|  19.8k|  else
 1024|  19.8k|    return realloc(ptr, nsize);
 1025|  40.0k|}

luaD_rawrunprotected:
  138|    722|int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {
  139|    722|  l_uint32 oldnCcalls = L->nCcalls;
  140|    722|  struct lua_longjmp lj;
  141|    722|  lj.status = LUA_OK;
  ------------------
  |  |   48|    722|#define LUA_OK		0
  ------------------
  142|    722|  lj.previous = L->errorJmp;  /* chain new error handler */
  143|    722|  L->errorJmp = &lj;
  144|    722|  LUAI_TRY(L, &lj,
  ------------------
  |  |   74|    722|#define LUAI_TRY(L,c,a)		if (setjmp((c)->b) == 0) { a }
  |  |  ------------------
  |  |  |  Branch (74:30): [True: 722, False: 0]
  |  |  ------------------
  ------------------
  145|    722|    (*f)(L, ud);
  146|    722|  );
  147|    722|  L->errorJmp = lj.previous;  /* restore old error handler */
  148|    722|  L->nCcalls = oldnCcalls;
  149|    722|  return lj.status;
  150|    722|}
luaD_closeprotected:
  924|    361|int luaD_closeprotected (lua_State *L, ptrdiff_t level, int status) {
  925|    361|  CallInfo *old_ci = L->ci;
  926|    361|  lu_byte old_allowhooks = L->allowhook;
  927|    361|  for (;;) {  /* keep closing upvalues until no more errors */
  928|    361|    struct CloseP pcl;
  929|    361|    pcl.level = restorestack(L, level); pcl.status = status;
  ------------------
  |  |   37|    361|#define restorestack(L,n)	cast(StkId, cast_charp(L->stack.p) + (n))
  |  |  ------------------
  |  |  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  930|    361|    status = luaD_rawrunprotected(L, &closepaux, &pcl);
  931|    361|    if (l_likely(status == LUA_OK))  /* no more errors? */
  ------------------
  |  |  696|    361|#define l_likely(x)	luai_likely(x)
  |  |  ------------------
  |  |  |  |  684|    361|#define luai_likely(x)		(__builtin_expect(((x) != 0), 1))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (684:25): [True: 361, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  932|    361|      return pcl.status;
  933|      0|    else {  /* an error occurred; restore saved state and repeat */
  934|      0|      L->ci = old_ci;
  935|      0|      L->allowhook = old_allowhooks;
  936|      0|    }
  937|    361|  }
  938|    361|}
ldo.c:closepaux:
  914|    361|static void closepaux (lua_State *L, void *ud) {
  915|    361|  struct CloseP *pcl = cast(struct CloseP *, ud);
  ------------------
  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  ------------------
  916|    361|  luaF_close(L, pcl->level, pcl->status, 0);
  917|    361|}

luaF_closeupval:
  193|    361|void luaF_closeupval (lua_State *L, StkId level) {
  194|    361|  UpVal *uv;
  195|    361|  StkId upl;  /* stack index pointed by 'uv' */
  196|    361|  while ((uv = L->openupval) != NULL && (upl = uplevel(uv)) >= level) {
  ------------------
  |  |   35|      0|#define uplevel(up)	check_exp(upisopen(up), cast(StkId, (up)->v.p))
  |  |  ------------------
  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  |  Branch (196:10): [True: 0, False: 361]
  |  Branch (196:41): [True: 0, False: 0]
  ------------------
  197|      0|    TValue *slot = &uv->u.value;  /* new position for value */
  198|      0|    lua_assert(uplevel(uv) < L->top.p);
  ------------------
  |  |  114|      0|#define lua_assert(c)		((void)0)
  ------------------
  199|      0|    luaF_unlinkupval(uv);  /* remove upvalue from 'openupval' list */
  200|      0|    setobj(L, slot, uv->v.p);  /* move value to upvalue slot */
  ------------------
  |  |  119|      0|	{ TValue *io1=(obj1); const TValue *io2=(obj2); \
  |  |  120|      0|          io1->value_ = io2->value_; settt_(io1, io2->tt_); \
  |  |  ------------------
  |  |  |  |  114|      0|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  |  |  121|      0|	  checkliveness(L,io1); lua_assert(!isnonstrictnil(io1)); }
  |  |  ------------------
  |  |  |  |  107|      0|	((void)L, lua_longassert(!iscollectable(obj) || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|      0|#define lua_longassert(c)	((void)0)
  |  |  |  |  ------------------
  |  |  |  |  108|      0|		(righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj))))))
  |  |  ------------------
  |  |               	  checkliveness(L,io1); lua_assert(!isnonstrictnil(io1)); }
  |  |  ------------------
  |  |  |  |  114|      0|#define lua_assert(c)		((void)0)
  |  |  ------------------
  ------------------
  201|      0|    uv->v.p = slot;  /* now current value lives here */
  202|      0|    if (!iswhite(uv)) {  /* neither white nor dead? */
  ------------------
  |  |   87|      0|#define iswhite(x)      testbits((x)->marked, WHITEBITS)
  |  |  ------------------
  |  |  |  |   62|      0|#define testbits(x,m)		((x) & (m))
  |  |  ------------------
  ------------------
  |  Branch (202:9): [True: 0, False: 0]
  ------------------
  203|      0|      nw2black(uv);  /* closed upvalues cannot be gray */
  ------------------
  |  |  100|      0|	check_exp(!iswhite(x), l_setbit((x)->marked, BLACKBIT))
  |  |  ------------------
  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  204|      0|      luaC_barrier(L, uv, slot);
  ------------------
  |  |  179|      0|#define luaC_barrier(L,p,v) (  \
  |  |  180|      0|	iscollectable(v) ? luaC_objbarrier(L,p,gcvalue(v)) : cast_void(0))
  |  |  ------------------
  |  |  |  |  300|      0|#define iscollectable(o)	(rawtt(o) & BIT_ISCOLLECTABLE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|#define rawtt(o)	((o)->tt_)
  |  |  |  |  ------------------
  |  |  |  |               #define iscollectable(o)	(rawtt(o) & BIT_ISCOLLECTABLE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define BIT_ISCOLLECTABLE	(1 << 6)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (300:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	iscollectable(v) ? luaC_objbarrier(L,p,gcvalue(v)) : cast_void(0))
  |  |  ------------------
  |  |  |  |  175|      0|#define luaC_objbarrier(L,p,o) (  \
  |  |  |  |  176|      0|	(isblack(p) && iswhite(o)) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|      0|#define isblack(x)      testbit((x)->marked, BLACKBIT)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   67|      0|#define testbit(x,b)		testbits(x, bitmask(b))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   62|      0|#define testbits(x,m)		((x) & (m))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (62:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(isblack(p) && iswhite(o)) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|      0|#define iswhite(x)      testbits((x)->marked, WHITEBITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|#define testbits(x,m)		((x) & (m))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (62:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  177|      0|	luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0))
  |  |  |  |  ------------------
  |  |  |  |  |  |  390|      0|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0))
  |  |  |  |  ------------------
  |  |  |  |  |  |  390|      0|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0))
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|      0|#define cast_void(i)	cast(void, (i))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|#define cast(t, exp)	((t)(exp))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	iscollectable(v) ? luaC_objbarrier(L,p,gcvalue(v)) : cast_void(0))
  |  |  ------------------
  |  |  |  |  138|      0|#define cast_void(i)	cast(void, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|      0|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|      0|    }
  206|      0|  }
  207|    361|}
luaF_close:
  227|    361|StkId luaF_close (lua_State *L, StkId level, int status, int yy) {
  228|    361|  ptrdiff_t levelrel = savestack(L, level);
  ------------------
  |  |   36|    361|#define savestack(L,pt)		(cast_charp(pt) - cast_charp(L->stack.p))
  |  |  ------------------
  |  |  |  |  146|    361|#define cast_charp(i)	cast(char *, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define savestack(L,pt)		(cast_charp(pt) - cast_charp(L->stack.p))
  |  |  ------------------
  |  |  |  |  146|    361|#define cast_charp(i)	cast(char *, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  229|    361|  luaF_closeupval(L, level);  /* first, close the upvalues */
  230|    361|  while (L->tbclist.p >= level) {  /* traverse tbc's down to that level */
  ------------------
  |  Branch (230:10): [True: 0, False: 361]
  ------------------
  231|      0|    StkId tbc = L->tbclist.p;  /* get variable index */
  232|      0|    poptbclist(L);  /* remove it from list */
  233|      0|    prepcallclosemth(L, tbc, status, yy);  /* close variable */
  234|      0|    level = restorestack(L, levelrel);
  ------------------
  |  |   37|      0|#define restorestack(L,n)	cast(StkId, cast_charp(L->stack.p) + (n))
  |  |  ------------------
  |  |  |  |  136|      0|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  235|      0|  }
  236|    361|  return level;
  237|    361|}

luaC_fix:
  243|  17.6k|void luaC_fix (lua_State *L, GCObject *o) {
  244|  17.6k|  global_State *g = G(L);
  ------------------
  |  |  335|  17.6k|#define G(L)	(L->l_G)
  ------------------
  245|  17.6k|  lua_assert(g->allgc == o);  /* object must be 1st in 'allgc' list! */
  ------------------
  |  |  114|  17.6k|#define lua_assert(c)		((void)0)
  ------------------
  246|  17.6k|  set2gray(o);  /* they will be gray forever */
  ------------------
  |  |   75|  17.6k|#define set2gray(x)	resetbits(x->marked, maskcolors)
  |  |  ------------------
  |  |  |  |   60|  17.6k|#define resetbits(x,m)		((x) &= cast_byte(~(m)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|  17.6k|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  17.6k|#define cast(t, exp)	((t)(exp))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  247|  17.6k|  setage(o, G_OLD);  /* and old forever */
  ------------------
  |  |  117|  17.6k|#define setage(o,a)  ((o)->marked = cast_byte(((o)->marked & (~AGEBITS)) | a))
  |  |  ------------------
  |  |  |  |  143|  17.6k|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  17.6k|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  248|  17.6k|  g->allgc = o->next;  /* remove object from 'allgc' list */
  249|  17.6k|  o->next = g->fixedgc;  /* link it to 'fixedgc' list */
  250|  17.6k|  g->fixedgc = o;
  251|  17.6k|}
luaC_newobjdt:
  258|  18.4k|GCObject *luaC_newobjdt (lua_State *L, int tt, size_t sz, size_t offset) {
  259|  18.4k|  global_State *g = G(L);
  ------------------
  |  |  335|  18.4k|#define G(L)	(L->l_G)
  ------------------
  260|  18.4k|  char *p = cast_charp(luaM_newobject(L, novariant(tt), sz));
  ------------------
  |  |  146|  18.4k|#define cast_charp(i)	cast(char *, (i))
  |  |  ------------------
  |  |  |  |  136|  18.4k|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  261|  18.4k|  GCObject *o = cast(GCObject *, p + offset);
  ------------------
  |  |  136|  18.4k|#define cast(t, exp)	((t)(exp))
  ------------------
  262|  18.4k|  o->marked = luaC_white(g);
  ------------------
  |  |  102|  18.4k|#define luaC_white(g)	cast_byte((g)->currentwhite & WHITEBITS)
  |  |  ------------------
  |  |  |  |  143|  18.4k|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  18.4k|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  263|  18.4k|  o->tt = tt;
  264|  18.4k|  o->next = g->allgc;
  265|  18.4k|  g->allgc = o;
  266|  18.4k|  return o;
  267|  18.4k|}
luaC_newobj:
  270|  18.4k|GCObject *luaC_newobj (lua_State *L, int tt, size_t sz) {
  271|  18.4k|  return luaC_newobjdt(L, tt, sz, 0);
  272|  18.4k|}
luaC_changemode:
 1360|    361|void luaC_changemode (lua_State *L, int newmode) {
 1361|    361|  global_State *g = G(L);
  ------------------
  |  |  335|    361|#define G(L)	(L->l_G)
  ------------------
 1362|    361|  if (newmode != g->gckind) {
  ------------------
  |  Branch (1362:7): [True: 0, False: 361]
  ------------------
 1363|      0|    if (newmode == KGC_GEN)  /* entering generational mode? */
  ------------------
  |  |  152|      0|#define KGC_GEN		1	/* generational gc */
  ------------------
  |  Branch (1363:9): [True: 0, False: 0]
  ------------------
 1364|      0|      entergen(L, g);
 1365|      0|    else
 1366|      0|      enterinc(g);  /* entering incremental mode */
 1367|      0|  }
 1368|    361|  g->lastatomic = 0;
 1369|    361|}
luaC_freeallobjects:
 1511|    361|void luaC_freeallobjects (lua_State *L) {
 1512|    361|  global_State *g = G(L);
  ------------------
  |  |  335|    361|#define G(L)	(L->l_G)
  ------------------
 1513|    361|  g->gcstp = GCSTPCLS;  /* no extra finalizers after here */
  ------------------
  |  |  157|    361|#define GCSTPCLS	4  /* bit true when closing Lua state */
  ------------------
 1514|    361|  luaC_changemode(L, KGC_INC);
  ------------------
  |  |  151|    361|#define KGC_INC		0	/* incremental gc */
  ------------------
 1515|    361|  separatetobefnz(g, 1);  /* separate all objects with finalizers */
 1516|    361|  lua_assert(g->finobj == NULL);
  ------------------
  |  |  114|    361|#define lua_assert(c)		((void)0)
  ------------------
 1517|    361|  callallpendingfinalizers(L);
 1518|    361|  deletelist(L, g->allgc, obj2gco(g->mainthread));
  ------------------
  |  |  390|    361|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  ------------------
  |  |  |  |  115|    361|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
 1519|    361|  lua_assert(g->finobj == NULL);  /* no new finalizers */
  ------------------
  |  |  114|    361|#define lua_assert(c)		((void)0)
  ------------------
 1520|    361|  deletelist(L, g->fixedgc, NULL);  /* collect fixed objects */
 1521|    361|  lua_assert(g->strt.nuse == 0);
  ------------------
  |  |  114|    361|#define lua_assert(c)		((void)0)
  ------------------
 1522|    361|}
lgc.c:freeobj:
  772|  18.4k|static void freeobj (lua_State *L, GCObject *o) {
  773|  18.4k|  switch (o->tt) {
  774|      0|    case LUA_VPROTO:
  ------------------
  |  |  507|      0|#define LUA_VPROTO	makevariant(LUA_TPROTO, 0)
  |  |  ------------------
  |  |  |  |   42|      0|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (774:5): [True: 0, False: 18.4k]
  ------------------
  775|      0|      luaF_freeproto(L, gco2p(o));
  ------------------
  |  |  381|      0|#define gco2p(o)  check_exp((o)->tt == LUA_VPROTO, &((cast_u(o))->p))
  |  |  ------------------
  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  776|      0|      break;
  777|      0|    case LUA_VUPVAL:
  ------------------
  |  |  584|      0|#define LUA_VUPVAL	makevariant(LUA_TUPVAL, 0)
  |  |  ------------------
  |  |  |  |   42|      0|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (777:5): [True: 0, False: 18.4k]
  ------------------
  778|      0|      freeupval(L, gco2upv(o));
  ------------------
  |  |  383|      0|#define gco2upv(o)	check_exp((o)->tt == LUA_VUPVAL, &((cast_u(o))->upv))
  |  |  ------------------
  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  779|      0|      break;
  780|      0|    case LUA_VLCL: {
  ------------------
  |  |  588|      0|#define LUA_VLCL	makevariant(LUA_TFUNCTION, 0)  /* Lua closure */
  |  |  ------------------
  |  |  |  |   42|      0|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (780:5): [True: 0, False: 18.4k]
  ------------------
  781|      0|      LClosure *cl = gco2lcl(o);
  ------------------
  |  |  376|      0|#define gco2lcl(o)  check_exp((o)->tt == LUA_VLCL, &((cast_u(o))->cl.l))
  |  |  ------------------
  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  782|      0|      luaM_freemem(L, cl, sizeLclosure(cl->nupvalues));
  ------------------
  |  |   55|      0|#define luaM_freemem(L, b, s)	luaM_free_(L, (b), (s))
  ------------------
  783|      0|      break;
  784|      0|    }
  785|      0|    case LUA_VCCL: {
  ------------------
  |  |  590|      0|#define LUA_VCCL	makevariant(LUA_TFUNCTION, 2)  /* C closure */
  |  |  ------------------
  |  |  |  |   42|      0|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (785:5): [True: 0, False: 18.4k]
  ------------------
  786|      0|      CClosure *cl = gco2ccl(o);
  ------------------
  |  |  377|      0|#define gco2ccl(o)  check_exp((o)->tt == LUA_VCCL, &((cast_u(o))->cl.c))
  |  |  ------------------
  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  787|      0|      luaM_freemem(L, cl, sizeCclosure(cl->nupvalues));
  ------------------
  |  |   55|      0|#define luaM_freemem(L, b, s)	luaM_free_(L, (b), (s))
  ------------------
  788|      0|      break;
  789|      0|    }
  790|    722|    case LUA_VTABLE:
  ------------------
  |  |  678|    722|#define LUA_VTABLE	makevariant(LUA_TTABLE, 0)
  |  |  ------------------
  |  |  |  |   42|    722|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (790:5): [True: 722, False: 17.6k]
  ------------------
  791|    722|      luaH_free(L, gco2t(o));
  ------------------
  |  |  380|    722|#define gco2t(o)  check_exp((o)->tt == LUA_VTABLE, &((cast_u(o))->h))
  |  |  ------------------
  |  |  |  |  115|    722|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  792|    722|      break;
  793|      0|    case LUA_VTHREAD:
  ------------------
  |  |  262|      0|#define LUA_VTHREAD		makevariant(LUA_TTHREAD, 0)
  |  |  ------------------
  |  |  |  |   42|      0|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (793:5): [True: 0, False: 18.4k]
  ------------------
  794|      0|      luaE_freethread(L, gco2th(o));
  ------------------
  |  |  382|      0|#define gco2th(o)  check_exp((o)->tt == LUA_VTHREAD, &((cast_u(o))->th))
  |  |  ------------------
  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  795|      0|      break;
  796|      0|    case LUA_VUSERDATA: {
  ------------------
  |  |  429|      0|#define LUA_VUSERDATA		makevariant(LUA_TUSERDATA, 0)
  |  |  ------------------
  |  |  |  |   42|      0|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (796:5): [True: 0, False: 18.4k]
  ------------------
  797|      0|      Udata *u = gco2u(o);
  ------------------
  |  |  375|      0|#define gco2u(o)  check_exp((o)->tt == LUA_VUSERDATA, &((cast_u(o))->u))
  |  |  ------------------
  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  798|      0|      luaM_freemem(L, o, sizeudata(u->nuvalue, u->len));
  ------------------
  |  |   55|      0|#define luaM_freemem(L, b, s)	luaM_free_(L, (b), (s))
  |  |  ------------------
  |  |  |  Branch (55:51): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  799|      0|      break;
  800|      0|    }
  801|  17.6k|    case LUA_VSHRSTR: {
  ------------------
  |  |  360|  17.6k|#define LUA_VSHRSTR	makevariant(LUA_TSTRING, 0)  /* short strings */
  |  |  ------------------
  |  |  |  |   42|  17.6k|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (801:5): [True: 17.6k, False: 722]
  ------------------
  802|  17.6k|      TString *ts = gco2ts(o);
  ------------------
  |  |  374|  17.6k|	check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts))
  |  |  ------------------
  |  |  |  |  115|  17.6k|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  803|  17.6k|      luaS_remove(L, ts);  /* remove it from hash table */
  804|  17.6k|      luaM_freemem(L, ts, sizelstring(ts->shrlen));
  ------------------
  |  |   55|  17.6k|#define luaM_freemem(L, b, s)	luaM_free_(L, (b), (s))
  ------------------
  805|  17.6k|      break;
  806|      0|    }
  807|      0|    case LUA_VLNGSTR: {
  ------------------
  |  |  361|      0|#define LUA_VLNGSTR	makevariant(LUA_TSTRING, 1)  /* long strings */
  |  |  ------------------
  |  |  |  |   42|      0|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (807:5): [True: 0, False: 18.4k]
  ------------------
  808|      0|      TString *ts = gco2ts(o);
  ------------------
  |  |  374|      0|	check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts))
  |  |  ------------------
  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  809|      0|      luaM_freemem(L, ts, sizelstring(ts->u.lnglen));
  ------------------
  |  |   55|      0|#define luaM_freemem(L, b, s)	luaM_free_(L, (b), (s))
  ------------------
  810|      0|      break;
  811|      0|    }
  812|      0|    default: lua_assert(0);
  ------------------
  |  |  114|      0|#define lua_assert(c)		((void)0)
  ------------------
  |  Branch (812:5): [True: 0, False: 18.4k]
  ------------------
  813|  18.4k|  }
  814|  18.4k|}
lgc.c:separatetobefnz:
  974|    361|static void separatetobefnz (global_State *g, int all) {
  975|    361|  GCObject *curr;
  976|    361|  GCObject **p = &g->finobj;
  977|    361|  GCObject **lastnext = findlast(&g->tobefnz);
  978|    361|  while ((curr = *p) != g->finobjold1) {  /* traverse all finalizable objects */
  ------------------
  |  Branch (978:10): [True: 0, False: 361]
  ------------------
  979|      0|    lua_assert(tofinalize(curr));
  ------------------
  |  |  114|      0|#define lua_assert(c)		((void)0)
  ------------------
  980|      0|    if (!(iswhite(curr) || all))  /* not being collected? */
  ------------------
  |  |   87|      0|#define iswhite(x)      testbits((x)->marked, WHITEBITS)
  |  |  ------------------
  |  |  |  |   62|      0|#define testbits(x,m)		((x) & (m))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (980:28): [True: 0, False: 0]
  ------------------
  981|      0|      p = &curr->next;  /* don't bother with it */
  982|      0|    else {
  983|      0|      if (curr == g->finobjsur)  /* removing 'finobjsur'? */
  ------------------
  |  Branch (983:11): [True: 0, False: 0]
  ------------------
  984|      0|        g->finobjsur = curr->next;  /* correct it */
  985|      0|      *p = curr->next;  /* remove 'curr' from 'finobj' list */
  986|      0|      curr->next = *lastnext;  /* link at the end of 'tobefnz' list */
  987|      0|      *lastnext = curr;
  988|      0|      lastnext = &curr->next;
  989|      0|    }
  990|      0|  }
  991|    361|}
lgc.c:findlast:
  960|    361|static GCObject **findlast (GCObject **p) {
  961|    361|  while (*p != NULL)
  ------------------
  |  Branch (961:10): [True: 0, False: 361]
  ------------------
  962|      0|    p = &(*p)->next;
  963|    361|  return p;
  964|    361|}
lgc.c:callallpendingfinalizers:
  950|    361|static void callallpendingfinalizers (lua_State *L) {
  951|    361|  global_State *g = G(L);
  ------------------
  |  |  335|    361|#define G(L)	(L->l_G)
  ------------------
  952|    361|  while (g->tobefnz)
  ------------------
  |  Branch (952:10): [True: 0, False: 361]
  ------------------
  953|      0|    GCTM(L);
  954|    361|}
lgc.c:deletelist:
 1498|    722|static void deletelist (lua_State *L, GCObject *p, GCObject *limit) {
 1499|  19.1k|  while (p != limit) {
  ------------------
  |  Branch (1499:10): [True: 18.4k, False: 722]
  ------------------
 1500|  18.4k|    GCObject *next = p->next;
 1501|  18.4k|    freeobj(L, p);
 1502|  18.4k|    p = next;
 1503|  18.4k|  }
 1504|    722|}

luaX_init:
   70|    361|void luaX_init (lua_State *L) {
   71|    361|  int i;
   72|    361|  TString *e = luaS_newliteral(L, LUA_ENV);  /* create env name */
  ------------------
  |  |   28|    361|#define luaS_newliteral(L, s)	(luaS_newlstr(L, "" s, \
  |  |   29|    361|                                 (sizeof(s)/sizeof(char))-1))
  ------------------
   73|    361|  luaC_fix(L, obj2gco(e));  /* never collect this name */
  ------------------
  |  |  390|    361|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  ------------------
  |  |  |  |  115|    361|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
   74|  8.30k|  for (i=0; i<NUM_RESERVED; i++) {
  ------------------
  |  |   46|  8.30k|#define NUM_RESERVED	(cast_int(TK_WHILE-FIRST_RESERVED + 1))
  |  |  ------------------
  |  |  |  |  141|  8.30k|#define cast_int(i)	cast(int, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  8.30k|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (74:13): [True: 7.94k, False: 361]
  ------------------
   75|  7.94k|    TString *ts = luaS_new(L, luaX_tokens[i]);
   76|  7.94k|    luaC_fix(L, obj2gco(ts));  /* reserved words are never collected */
  ------------------
  |  |  390|  7.94k|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  ------------------
  |  |  |  |  115|  7.94k|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
   77|  7.94k|    ts->extra = cast_byte(i+1);  /* reserved word */
  ------------------
  |  |  143|  7.94k|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  ------------------
  |  |  |  |  136|  7.94k|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
   78|  7.94k|  }
   79|    361|}

luaM_free_:
  150|  19.8k|void luaM_free_ (lua_State *L, void *block, size_t osize) {
  151|  19.8k|  global_State *g = G(L);
  ------------------
  |  |  335|  19.8k|#define G(L)	(L->l_G)
  ------------------
  152|  19.8k|  lua_assert((osize == 0) == (block == NULL));
  ------------------
  |  |  114|  19.8k|#define lua_assert(c)		((void)0)
  ------------------
  153|  19.8k|  callfrealloc(g, block, osize, 0);
  ------------------
  |  |   47|  19.8k|#define callfrealloc(g,block,os,ns)    ((*g->frealloc)(g->ud, block, os, ns))
  ------------------
  154|  19.8k|  g->GCdebt -= osize;
  155|  19.8k|}
luaM_realloc_:
  176|    361|void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) {
  177|    361|  void *newblock;
  178|    361|  global_State *g = G(L);
  ------------------
  |  |  335|    361|#define G(L)	(L->l_G)
  ------------------
  179|    361|  lua_assert((osize == 0) == (block == NULL));
  ------------------
  |  |  114|    361|#define lua_assert(c)		((void)0)
  ------------------
  180|    361|  newblock = firsttry(g, block, osize, nsize);
  ------------------
  |  |   76|    361|#define firsttry(g,block,os,ns)    callfrealloc(g, block, os, ns)
  |  |  ------------------
  |  |  |  |   47|    361|#define callfrealloc(g,block,os,ns)    ((*g->frealloc)(g->ud, block, os, ns))
  |  |  ------------------
  ------------------
  181|    361|  if (l_unlikely(newblock == NULL && nsize > 0)) {
  ------------------
  |  |  697|    361|#define l_unlikely(x)	luai_unlikely(x)
  |  |  ------------------
  |  |  |  |  685|    361|#define luai_unlikely(x)	(__builtin_expect(((x) != 0), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (685:26): [True: 0, False: 361]
  |  |  |  |  |  Branch (685:46): [True: 0, False: 361]
  |  |  |  |  |  Branch (685:46): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|      0|    newblock = tryagain(L, block, osize, nsize);
  183|      0|    if (newblock == NULL)  /* still no memory? */
  ------------------
  |  Branch (183:9): [True: 0, False: 0]
  ------------------
  184|      0|      return NULL;  /* do not update 'GCdebt' */
  185|      0|  }
  186|    361|  lua_assert((nsize == 0) == (newblock == NULL));
  ------------------
  |  |  114|    361|#define lua_assert(c)		((void)0)
  ------------------
  187|    361|  g->GCdebt = (g->GCdebt + nsize) - osize;
  188|    361|  return newblock;
  189|    361|}
luaM_malloc_:
  201|  19.1k|void *luaM_malloc_ (lua_State *L, size_t size, int tag) {
  202|  19.1k|  if (size == 0)
  ------------------
  |  Branch (202:7): [True: 0, False: 19.1k]
  ------------------
  203|      0|    return NULL;  /* that's all */
  204|  19.1k|  else {
  205|  19.1k|    global_State *g = G(L);
  ------------------
  |  |  335|  19.1k|#define G(L)	(L->l_G)
  ------------------
  206|  19.1k|    void *newblock = firsttry(g, NULL, tag, size);
  ------------------
  |  |   76|  19.1k|#define firsttry(g,block,os,ns)    callfrealloc(g, block, os, ns)
  |  |  ------------------
  |  |  |  |   47|  19.1k|#define callfrealloc(g,block,os,ns)    ((*g->frealloc)(g->ud, block, os, ns))
  |  |  ------------------
  ------------------
  207|  19.1k|    if (l_unlikely(newblock == NULL)) {
  ------------------
  |  |  697|  19.1k|#define l_unlikely(x)	luai_unlikely(x)
  |  |  ------------------
  |  |  |  |  685|  19.1k|#define luai_unlikely(x)	(__builtin_expect(((x) != 0), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (685:26): [True: 0, False: 19.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  208|      0|      newblock = tryagain(L, NULL, tag, size);
  209|      0|      if (newblock == NULL)
  ------------------
  |  Branch (209:11): [True: 0, False: 0]
  ------------------
  210|      0|        luaM_error(L);
  ------------------
  |  |   17|      0|#define luaM_error(L)	luaD_throw(L, LUA_ERRMEM)
  |  |  ------------------
  |  |  |  |   52|      0|#define LUA_ERRMEM	4
  |  |  ------------------
  ------------------
  211|      0|    }
  212|  19.1k|    g->GCdebt += size;
  213|  19.1k|    return newblock;
  214|  19.1k|  }
  215|  19.1k|}

luaO_hexavalue:
  135|  1.30M|int luaO_hexavalue (int c) {
  136|  1.30M|  if (lisdigit(c)) return c - '0';
  ------------------
  |  |   59|  1.30M|#define lisdigit(c)	testprop(c, MASK(DIGITBIT))
  |  |  ------------------
  |  |  |  |   52|  1.30M|#define testprop(c,p)	(luai_ctype_[(c)+1] & (p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:23): [True: 1.30M, False: 2.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  137|  2.35k|  else return (ltolower(c) - 'a') + 10;
  ------------------
  |  |   72|  2.35k|  check_exp(('A' <= (c) && (c) <= 'Z') || (c) == ((c) | ('A' ^ 'a')),  \
  |  |  ------------------
  |  |  |  |  115|  2.35k|#define check_exp(c,e)		(e)
  |  |  ------------------
  |  |   73|  2.35k|            (c) | ('A' ^ 'a'))
  ------------------
  138|  1.30M|}
luaO_str2num:
  308|    361|size_t luaO_str2num (const char *s, TValue *o) {
  309|    361|  lua_Integer i; lua_Number n;
  310|    361|  const char *e;
  311|    361|  if ((e = l_str2int(s, &i)) != NULL) {  /* try as an integer */
  ------------------
  |  Branch (311:7): [True: 184, False: 177]
  ------------------
  312|    184|    setivalue(o, i);
  ------------------
  |  |  345|    184|  { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_VNUMINT); }
  |  |  ------------------
  |  |  |  |   72|    184|#define val_(o)		((o)->value_)
  |  |  ------------------
  |  |                 { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_VNUMINT); }
  |  |  ------------------
  |  |  |  |  114|    184|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  313|    184|  }
  314|    177|  else if ((e = l_str2d(s, &n)) != NULL) {  /* else try as a float */
  ------------------
  |  Branch (314:12): [True: 68, False: 109]
  ------------------
  315|     68|    setfltvalue(o, n);
  ------------------
  |  |  339|     68|  { TValue *io=(obj); val_(io).n=(x); settt_(io, LUA_VNUMFLT); }
  |  |  ------------------
  |  |  |  |   72|     68|#define val_(o)		((o)->value_)
  |  |  ------------------
  |  |                 { TValue *io=(obj); val_(io).n=(x); settt_(io, LUA_VNUMFLT); }
  |  |  ------------------
  |  |  |  |  114|     68|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  316|     68|  }
  317|    109|  else
  318|    109|    return 0;  /* conversion failed */
  319|    252|  return (e - s) + 1;  /* success; return string size */
  320|    361|}
lobject.c:l_str2int:
  276|    361|static const char *l_str2int (const char *s, lua_Integer *result) {
  277|    361|  lua_Unsigned a = 0;
  278|    361|  int empty = 1;
  279|    361|  int neg;
  280|    361|  while (lisspace(cast_uchar(*s))) s++;  /* skip initial spaces */
  281|    361|  neg = isneg(&s);
  282|    361|  if (s[0] == '0' &&
  ------------------
  |  Branch (282:7): [True: 84, False: 277]
  ------------------
  283|    361|      (s[1] == 'x' || s[1] == 'X')) {  /* hex? */
  ------------------
  |  Branch (283:8): [True: 7, False: 77]
  |  Branch (283:23): [True: 40, False: 37]
  ------------------
  284|     47|    s += 2;  /* skip '0x' */
  285|  1.30M|    for (; lisxdigit(cast_uchar(*s)); s++) {
  286|  1.30M|      a = a * 16 + luaO_hexavalue(*s);
  287|  1.30M|      empty = 0;
  288|  1.30M|    }
  289|     47|  }
  290|    314|  else {  /* decimal */
  291|  9.38k|    for (; lisdigit(cast_uchar(*s)); s++) {
  292|  9.38k|      int d = *s - '0';
  293|  9.38k|      if (a >= MAXBY10 && (a > MAXBY10 || d > MAXLASTD + neg))  /* overflow? */
  ------------------
  |  |  273|  9.38k|#define MAXBY10		cast(lua_Unsigned, LUA_MAXINTEGER / 10)
  |  |  ------------------
  |  |  |  |  136|  18.7k|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
                    if (a >= MAXBY10 && (a > MAXBY10 || d > MAXLASTD + neg))  /* overflow? */
  ------------------
  |  |  273|     70|#define MAXBY10		cast(lua_Unsigned, LUA_MAXINTEGER / 10)
  |  |  ------------------
  |  |  |  |  136|    140|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
                    if (a >= MAXBY10 && (a > MAXBY10 || d > MAXLASTD + neg))  /* overflow? */
  ------------------
  |  |  274|      5|#define MAXLASTD	cast_int(LUA_MAXINTEGER % 10)
  |  |  ------------------
  |  |  |  |  141|      5|#define cast_int(i)	cast(int, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|      5|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (293:11): [True: 70, False: 9.31k]
  |  Branch (293:28): [True: 65, False: 5]
  |  Branch (293:43): [True: 2, False: 3]
  ------------------
  294|     67|        return NULL;  /* do not accept it (as integer) */
  295|  9.32k|      a = a * 10 + d;
  296|  9.32k|      empty = 0;
  297|  9.32k|    }
  298|    314|  }
  299|    391|  while (lisspace(cast_uchar(*s))) s++;  /* skip trailing spaces */
  300|    294|  if (empty || *s != '\0') return NULL;  /* something wrong in the numeral */
  ------------------
  |  Branch (300:7): [True: 54, False: 240]
  |  Branch (300:16): [True: 56, False: 184]
  ------------------
  301|    184|  else {
  302|    184|    *result = l_castU2S((neg) ? 0u - a : a);
  ------------------
  |  |  161|    368|#define l_castU2S(i)	((lua_Integer)(i))
  |  |  ------------------
  |  |  |  Branch (161:37): [True: 1, False: 183]
  |  |  ------------------
  ------------------
  303|    184|    return s;
  304|    184|  }
  305|    294|}
lobject.c:isneg:
  141|    361|static int isneg (const char **s) {
  142|    361|  if (**s == '-') { (*s)++; return 1; }
  ------------------
  |  Branch (142:7): [True: 3, False: 358]
  ------------------
  143|    358|  else if (**s == '+') (*s)++;
  ------------------
  |  Branch (143:12): [True: 1, False: 357]
  ------------------
  144|    358|  return 0;
  145|    361|}
lobject.c:l_str2d:
  251|    177|static const char *l_str2d (const char *s, lua_Number *result) {
  252|    177|  const char *endptr;
  253|    177|  const char *pmode = strpbrk(s, ".xXnN");  /* look for special chars */
  254|    177|  int mode = pmode ? ltolower(cast_uchar(*pmode)) : 0;
  ------------------
  |  |   72|     47|  check_exp(('A' <= (c) && (c) <= 'Z') || (c) == ((c) | ('A' ^ 'a')),  \
  |  |  ------------------
  |  |  |  |  115|     47|#define check_exp(c,e)		(e)
  |  |  ------------------
  |  |   73|    177|            (c) | ('A' ^ 'a'))
  ------------------
  |  Branch (254:14): [True: 47, False: 130]
  ------------------
  255|    177|  if (mode == 'n')  /* reject 'inf' and 'nan' */
  ------------------
  |  Branch (255:7): [True: 1, False: 176]
  ------------------
  256|      1|    return NULL;
  257|    176|  endptr = l_str2dloc(s, result, mode);  /* try to convert */
  258|    176|  if (endptr == NULL) {  /* failed? may be a different locale */
  ------------------
  |  Branch (258:7): [True: 108, False: 68]
  ------------------
  259|    108|    char buff[L_MAXLENNUM + 1];
  260|    108|    const char *pdot = strchr(s, '.');
  261|    108|    if (pdot == NULL || strlen(s) > L_MAXLENNUM)
  ------------------
  |  |  220|     41|#define L_MAXLENNUM	200
  ------------------
  |  Branch (261:9): [True: 67, False: 41]
  |  Branch (261:25): [True: 12, False: 29]
  ------------------
  262|     79|      return NULL;  /* string too long or no dot; fail */
  263|     29|    strcpy(buff, s);  /* copy string to buffer */
  264|     29|    buff[pdot - s] = lua_getlocaledecpoint();  /* correct decimal point */
  ------------------
  |  |  671|     29|#define lua_getlocaledecpoint()		(localeconv()->decimal_point[0])
  ------------------
  265|     29|    endptr = l_str2dloc(buff, result, mode);  /* try again */
  266|     29|    if (endptr != NULL)
  ------------------
  |  Branch (266:9): [True: 0, False: 29]
  ------------------
  267|      0|      endptr = s + (endptr - buff);  /* make relative to 's' */
  268|     29|  }
  269|     97|  return endptr;
  270|    176|}
lobject.c:l_str2dloc:
  228|    205|static const char *l_str2dloc (const char *s, lua_Number *result, int mode) {
  229|    205|  char *endptr;
  230|       |  *result = (mode == 'x') ? lua_strx2number(s, &endptr)  /* try to convert */
  ------------------
  |  |  610|     18|#define lua_strx2number(s,p)		lua_str2number(s,p)
  |  |  ------------------
  |  |  |  |  484|     18|#define lua_str2number(s,p)	strtod((s), (p))
  |  |  ------------------
  ------------------
  |  Branch (230:13): [True: 18, False: 187]
  ------------------
  231|    205|                          : lua_str2number(s, &endptr);
  ------------------
  |  |  484|    392|#define lua_str2number(s,p)	strtod((s), (p))
  ------------------
  232|    205|  if (endptr == s) return NULL;  /* nothing recognized? */
  ------------------
  |  Branch (232:7): [True: 58, False: 147]
  ------------------
  233|    391|  while (lisspace(cast_uchar(*endptr))) endptr++;  /* skip trailing spaces */
  234|    147|  return (*endptr == '\0') ? endptr : NULL;  /* OK iff no trailing chars */
  ------------------
  |  Branch (234:10): [True: 68, False: 79]
  ------------------
  235|    205|}

lua_newstate:
  360|    361|LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
  361|    361|  int i;
  362|    361|  lua_State *L;
  363|    361|  global_State *g;
  364|    361|  LG *l = cast(LG *, (*f)(ud, NULL, LUA_TTHREAD, sizeof(LG)));
  ------------------
  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  ------------------
  365|    361|  if (l == NULL) return NULL;
  ------------------
  |  Branch (365:7): [True: 0, False: 361]
  ------------------
  366|    361|  L = &l->l.l;
  367|    361|  g = &l->g;
  368|    361|  L->tt = LUA_VTHREAD;
  ------------------
  |  |  262|    361|#define LUA_VTHREAD		makevariant(LUA_TTHREAD, 0)
  |  |  ------------------
  |  |  |  |   42|    361|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  369|    361|  g->currentwhite = bitmask(WHITE0BIT);
  ------------------
  |  |   63|    361|#define bitmask(b)		(1<<(b))
  ------------------
  370|    361|  L->marked = luaC_white(g);
  ------------------
  |  |  102|    361|#define luaC_white(g)	cast_byte((g)->currentwhite & WHITEBITS)
  |  |  ------------------
  |  |  |  |  143|    361|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  371|    361|  preinit_thread(L, g);
  372|    361|  g->allgc = obj2gco(L);  /* by now, only object is the main thread */
  ------------------
  |  |  390|    361|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  ------------------
  |  |  |  |  115|    361|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  373|    361|  L->next = NULL;
  374|    361|  incnny(L);  /* main thread is always non yieldable */
  ------------------
  |  |  111|    361|#define incnny(L)	((L)->nCcalls += 0x10000)
  ------------------
  375|    361|  g->frealloc = f;
  376|    361|  g->ud = ud;
  377|    361|  g->warnf = NULL;
  378|    361|  g->ud_warn = NULL;
  379|    361|  g->mainthread = L;
  380|    361|  g->seed = luai_makeseed(L);
  381|    361|  g->gcstp = GCSTPGC;  /* no GC while building state */
  ------------------
  |  |  156|    361|#define GCSTPGC		2  /* bit true when GC stopped by itself */
  ------------------
  382|    361|  g->strt.size = g->strt.nuse = 0;
  383|    361|  g->strt.hash = NULL;
  384|    361|  setnilvalue(&g->l_registry);
  ------------------
  |  |  200|    361|#define setnilvalue(obj) settt_(obj, LUA_VNIL)
  |  |  ------------------
  |  |  |  |  114|    361|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  385|    361|  g->panic = NULL;
  386|    361|  g->gcstate = GCSpause;
  ------------------
  |  |   39|    361|#define GCSpause	8
  ------------------
  387|    361|  g->gckind = KGC_INC;
  ------------------
  |  |  151|    361|#define KGC_INC		0	/* incremental gc */
  ------------------
  388|    361|  g->gcstopem = 0;
  389|    361|  g->gcemergency = 0;
  390|    361|  g->finobj = g->tobefnz = g->fixedgc = NULL;
  391|    361|  g->firstold1 = g->survival = g->old1 = g->reallyold = NULL;
  392|    361|  g->finobjsur = g->finobjold1 = g->finobjrold = NULL;
  393|    361|  g->sweepgc = NULL;
  394|    361|  g->gray = g->grayagain = NULL;
  395|    361|  g->weak = g->ephemeron = g->allweak = NULL;
  396|    361|  g->twups = NULL;
  397|    361|  g->totalbytes = sizeof(LG);
  398|    361|  g->GCdebt = 0;
  399|    361|  g->lastatomic = 0;
  400|    361|  setivalue(&g->nilvalue, 0);  /* to signal that state is not yet built */
  ------------------
  |  |  345|    361|  { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_VNUMINT); }
  |  |  ------------------
  |  |  |  |   72|    361|#define val_(o)		((o)->value_)
  |  |  ------------------
  |  |                 { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_VNUMINT); }
  |  |  ------------------
  |  |  |  |  114|    361|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  401|    361|  setgcparam(g->gcpause, LUAI_GCPAUSE);
  ------------------
  |  |  136|    361|#define setgcparam(p,v)	((p) = (v) / 4)
  ------------------
  402|    361|  setgcparam(g->gcstepmul, LUAI_GCMUL);
  ------------------
  |  |  136|    361|#define setgcparam(p,v)	((p) = (v) / 4)
  ------------------
  403|    361|  g->gcstepsize = LUAI_GCSTEPSIZE;
  ------------------
  |  |  141|    361|#define LUAI_GCSTEPSIZE 13      /* 8 KB */
  ------------------
  404|    361|  setgcparam(g->genmajormul, LUAI_GENMAJORMUL);
  ------------------
  |  |  136|    361|#define setgcparam(p,v)	((p) = (v) / 4)
  ------------------
  405|    361|  g->genminormul = LUAI_GENMINORMUL;
  ------------------
  |  |  126|    361|#define LUAI_GENMINORMUL         20
  ------------------
  406|  3.61k|  for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL;
  ------------------
  |  |  426|  3.61k|#define LUA_NUMTAGS		LUA_NUMTYPES
  |  |  ------------------
  |  |  |  |   74|  3.61k|#define LUA_NUMTYPES		9
  |  |  ------------------
  ------------------
  |  Branch (406:13): [True: 3.24k, False: 361]
  ------------------
  407|    361|  if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) {
  ------------------
  |  |   48|    361|#define LUA_OK		0
  ------------------
  |  Branch (407:7): [True: 0, False: 361]
  ------------------
  408|       |    /* memory allocation error: free partial state */
  409|      0|    close_state(L);
  410|      0|    L = NULL;
  411|      0|  }
  412|    361|  return L;
  413|    361|}
lua_close:
  416|    361|LUA_API void lua_close (lua_State *L) {
  417|    361|  lua_lock(L);
  ------------------
  |  |  264|    361|#define lua_lock(L)	((void) 0)
  ------------------
  418|    361|  L = G(L)->mainthread;  /* only the main thread can be closed */
  ------------------
  |  |  335|    361|#define G(L)	(L->l_G)
  ------------------
  419|    361|  close_state(L);
  420|    361|}
lstate.c:preinit_thread:
  249|    361|static void preinit_thread (lua_State *L, global_State *g) {
  250|    361|  G(L) = g;
  ------------------
  |  |  335|    361|#define G(L)	(L->l_G)
  ------------------
  251|    361|  L->stack.p = NULL;
  252|    361|  L->ci = NULL;
  253|    361|  L->nci = 0;
  254|    361|  L->twups = L;  /* thread has no upvalues */
  255|    361|  L->nCcalls = 0;
  256|    361|  L->errorJmp = NULL;
  257|    361|  L->hook = NULL;
  258|    361|  L->hookmask = 0;
  259|    361|  L->basehookcount = 0;
  260|    361|  L->allowhook = 1;
  261|    361|  resethookcount(L);
  ------------------
  |  |   21|    361|#define resethookcount(L)	(L->hookcount = L->basehookcount)
  ------------------
  262|    361|  L->openupval = NULL;
  263|    361|  L->status = LUA_OK;
  ------------------
  |  |   48|    361|#define LUA_OK		0
  ------------------
  264|    361|  L->errfunc = 0;
  265|    361|  L->oldpc = 0;
  266|    361|}
lstate.c:stack_init:
  180|    361|static void stack_init (lua_State *L1, lua_State *L) {
  181|    361|  int i; CallInfo *ci;
  182|       |  /* initialize stack array */
  183|    361|  L1->stack.p = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, StackValue);
  ------------------
  |  |   60|    361|#define luaM_newvector(L,n,t)	cast(t*, luaM_malloc_(L, (n)*sizeof(t), 0))
  |  |  ------------------
  |  |  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  184|    361|  L1->tbclist.p = L1->stack.p;
  185|  16.6k|  for (i = 0; i < BASIC_STACK_SIZE + EXTRA_STACK; i++)
  ------------------
  |  |  145|  16.6k|#define BASIC_STACK_SIZE        (2*LUA_MINSTACK)
  |  |  ------------------
  |  |  |  |   79|  16.6k|#define LUA_MINSTACK	20
  |  |  ------------------
  ------------------
                for (i = 0; i < BASIC_STACK_SIZE + EXTRA_STACK; i++)
  ------------------
  |  |  142|  16.6k|#define EXTRA_STACK   5
  ------------------
  |  Branch (185:15): [True: 16.2k, False: 361]
  ------------------
  186|  16.2k|    setnilvalue(s2v(L1->stack.p + i));  /* erase new stack */
  ------------------
  |  |  200|  16.2k|#define setnilvalue(obj) settt_(obj, LUA_VNIL)
  |  |  ------------------
  |  |  |  |  114|  16.2k|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  187|    361|  L1->top.p = L1->stack.p;
  188|    361|  L1->stack_last.p = L1->stack.p + BASIC_STACK_SIZE;
  ------------------
  |  |  145|    361|#define BASIC_STACK_SIZE        (2*LUA_MINSTACK)
  |  |  ------------------
  |  |  |  |   79|    361|#define LUA_MINSTACK	20
  |  |  ------------------
  ------------------
  189|       |  /* initialize first ci */
  190|    361|  ci = &L1->base_ci;
  191|    361|  ci->next = ci->previous = NULL;
  192|    361|  ci->callstatus = CIST_C;
  ------------------
  |  |  211|    361|#define CIST_C		(1<<1)	/* call is running a C function */
  ------------------
  193|    361|  ci->func.p = L1->top.p;
  194|    361|  ci->u.c.k = NULL;
  195|    361|  ci->nresults = 0;
  196|    361|  setnilvalue(s2v(L1->top.p));  /* 'function' entry for this 'ci' */
  ------------------
  |  |  200|    361|#define setnilvalue(obj) settt_(obj, LUA_VNIL)
  |  |  ------------------
  |  |  |  |  114|    361|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  197|    361|  L1->top.p++;
  198|    361|  ci->top.p = L1->top.p + LUA_MINSTACK;
  ------------------
  |  |   79|    361|#define LUA_MINSTACK	20
  ------------------
  199|    361|  L1->ci = ci;
  200|    361|}
lstate.c:freestack:
  203|    361|static void freestack (lua_State *L) {
  204|    361|  if (L->stack.p == NULL)
  ------------------
  |  Branch (204:7): [True: 0, False: 361]
  ------------------
  205|      0|    return;  /* stack not completely built yet */
  206|    361|  L->ci = &L->base_ci;  /* free the entire 'ci' list */
  207|    361|  freeCI(L);
  208|    361|  lua_assert(L->nci == 0);
  ------------------
  |  |  114|    361|#define lua_assert(c)		((void)0)
  ------------------
  209|    361|  luaM_freearray(L, L->stack.p, stacksize(L) + EXTRA_STACK);  /* free stack */
  ------------------
  |  |   57|    361|#define luaM_freearray(L, b, n)   luaM_free_(L, (b), (n)*sizeof(*(b)))
  ------------------
  210|    361|}
lstate.c:freeCI:
  122|    361|static void freeCI (lua_State *L) {
  123|    361|  CallInfo *ci = L->ci;
  124|    361|  CallInfo *next = ci->next;
  125|    361|  ci->next = NULL;
  126|    361|  while ((ci = next) != NULL) {
  ------------------
  |  Branch (126:10): [True: 0, False: 361]
  ------------------
  127|      0|    next = ci->next;
  128|      0|    luaM_free(L, ci);
  ------------------
  |  |   56|      0|#define luaM_free(L, b)		luaM_free_(L, (b), sizeof(*(b)))
  ------------------
  129|      0|    L->nci--;
  130|      0|  }
  131|    361|}
lstate.c:luai_makeseed:
   71|    361|static unsigned int luai_makeseed (lua_State *L) {
   72|    361|  char buff[3 * sizeof(size_t)];
   73|    361|  unsigned int h = cast_uint(time(NULL));
  ------------------
  |  |  142|    361|#define cast_uint(i)	cast(unsigned int, (i))
  |  |  ------------------
  |  |  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
   74|    361|  int p = 0;
   75|    361|  addbuff(buff, p, L);  /* heap variable */
  ------------------
  |  |   68|    361|  { size_t t = cast_sizet(e); \
  |  |  ------------------
  |  |  |  |  147|    361|#define cast_sizet(i)	cast(size_t, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|    361|    memcpy(b + p, &t, sizeof(t)); p += sizeof(t); }
  ------------------
   76|    361|  addbuff(buff, p, &h);  /* local variable */
  ------------------
  |  |   68|    361|  { size_t t = cast_sizet(e); \
  |  |  ------------------
  |  |  |  |  147|    361|#define cast_sizet(i)	cast(size_t, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|    361|    memcpy(b + p, &t, sizeof(t)); p += sizeof(t); }
  ------------------
   77|    361|  addbuff(buff, p, &lua_newstate);  /* public function */
  ------------------
  |  |   68|    361|  { size_t t = cast_sizet(e); \
  |  |  ------------------
  |  |  |  |  147|    361|#define cast_sizet(i)	cast(size_t, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   69|    361|    memcpy(b + p, &t, sizeof(t)); p += sizeof(t); }
  ------------------
   78|    361|  lua_assert(p == sizeof(buff));
  ------------------
  |  |  114|    361|#define lua_assert(c)		((void)0)
  ------------------
   79|    361|  return luaS_hash(buff, p, h);
   80|    361|}
lstate.c:f_luaopen:
  231|    361|static void f_luaopen (lua_State *L, void *ud) {
  232|    361|  global_State *g = G(L);
  ------------------
  |  |  335|    361|#define G(L)	(L->l_G)
  ------------------
  233|    361|  UNUSED(ud);
  ------------------
  |  |  131|    361|#define UNUSED(x)	((void)(x))
  ------------------
  234|    361|  stack_init(L, L);  /* init stack */
  235|    361|  init_registry(L, g);
  236|    361|  luaS_init(L);
  237|    361|  luaT_init(L);
  238|    361|  luaX_init(L);
  239|    361|  g->gcstp = 0;  /* allow gc */
  240|    361|  setnilvalue(&g->nilvalue);  /* now state is complete */
  ------------------
  |  |  200|    361|#define setnilvalue(obj) settt_(obj, LUA_VNIL)
  |  |  ------------------
  |  |  |  |  114|    361|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  241|    361|  luai_userstateopen(L);
  ------------------
  |  |  282|    361|#define luai_userstateopen(L)		((void)L)
  ------------------
  242|    361|}
lstate.c:init_registry:
  216|    361|static void init_registry (lua_State *L, global_State *g) {
  217|       |  /* create registry */
  218|    361|  Table *registry = luaH_new(L);
  219|    361|  sethvalue(L, &g->l_registry, registry);
  ------------------
  |  |  685|    361|  { TValue *io = (obj); Table *x_ = (x); \
  |  |  686|    361|    val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTABLE)); \
  |  |  ------------------
  |  |  |  |   72|    361|#define val_(o)		((o)->value_)
  |  |  ------------------
  |  |                   val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTABLE)); \
  |  |  ------------------
  |  |  |  |  390|    361|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|    361|#define check_exp(c,e)		(e)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTABLE)); \
  |  |  ------------------
  |  |  |  |  114|    361|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  |  |  687|    361|    checkliveness(L,io); }
  |  |  ------------------
  |  |  |  |  107|    361|	((void)L, lua_longassert(!iscollectable(obj) || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|    361|#define lua_longassert(c)	((void)0)
  |  |  |  |  ------------------
  |  |  |  |  108|    361|		(righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj))))))
  |  |  ------------------
  ------------------
  220|    361|  luaH_resize(L, registry, LUA_RIDX_LAST, 0);
  ------------------
  |  |   85|    361|#define LUA_RIDX_LAST		LUA_RIDX_GLOBALS
  |  |  ------------------
  |  |  |  |   84|    361|#define LUA_RIDX_GLOBALS	2
  |  |  ------------------
  ------------------
  221|       |  /* registry[LUA_RIDX_MAINTHREAD] = L */
  222|    361|  setthvalue(L, &registry->array[LUA_RIDX_MAINTHREAD - 1], L);
  ------------------
  |  |  269|    361|  { TValue *io = (obj); lua_State *x_ = (x); \
  |  |  270|    361|    val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTHREAD)); \
  |  |  ------------------
  |  |  |  |   72|    361|#define val_(o)		((o)->value_)
  |  |  ------------------
  |  |                   val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTHREAD)); \
  |  |  ------------------
  |  |  |  |  390|    361|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|    361|#define check_exp(c,e)		(e)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTHREAD)); \
  |  |  ------------------
  |  |  |  |  114|    361|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  |  |  271|    361|    checkliveness(L,io); }
  |  |  ------------------
  |  |  |  |  107|    361|	((void)L, lua_longassert(!iscollectable(obj) || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|    361|#define lua_longassert(c)	((void)0)
  |  |  |  |  ------------------
  |  |  |  |  108|    361|		(righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj))))))
  |  |  ------------------
  ------------------
  223|       |  /* registry[LUA_RIDX_GLOBALS] = new table (table of globals) */
  224|    361|  sethvalue(L, &registry->array[LUA_RIDX_GLOBALS - 1], luaH_new(L));
  ------------------
  |  |  685|    361|  { TValue *io = (obj); Table *x_ = (x); \
  |  |  686|    361|    val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTABLE)); \
  |  |  ------------------
  |  |  |  |   72|    361|#define val_(o)		((o)->value_)
  |  |  ------------------
  |  |                   val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTABLE)); \
  |  |  ------------------
  |  |  |  |  390|    361|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|    361|#define check_exp(c,e)		(e)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTABLE)); \
  |  |  ------------------
  |  |  |  |  114|    361|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  |  |  687|    361|    checkliveness(L,io); }
  |  |  ------------------
  |  |  |  |  107|    361|	((void)L, lua_longassert(!iscollectable(obj) || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|    361|#define lua_longassert(c)	((void)0)
  |  |  |  |  ------------------
  |  |  |  |  108|    361|		(righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj))))))
  |  |  ------------------
  ------------------
  225|    361|}
lstate.c:close_state:
  269|    361|static void close_state (lua_State *L) {
  270|    361|  global_State *g = G(L);
  ------------------
  |  |  335|    361|#define G(L)	(L->l_G)
  ------------------
  271|    361|  if (!completestate(g))  /* closing a partially built state? */
  ------------------
  |  |  341|    361|#define completestate(g)	ttisnil(&g->nilvalue)
  |  |  ------------------
  |  |  |  |  193|    361|#define ttisnil(v)		checktype((v), LUA_TNIL)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|    361|#define checktype(o,t)		(ttype(o) == (t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|    361|#define ttype(o)	(novariant(rawtt(o)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   80|    361|#define novariant(t)	((t) & 0x0F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (271:7): [True: 0, False: 361]
  ------------------
  272|      0|    luaC_freeallobjects(L);  /* just collect its objects */
  273|    361|  else {  /* closing a fully built state */
  274|    361|    L->ci = &L->base_ci;  /* unwind CallInfo list */
  275|    361|    luaD_closeprotected(L, 1, LUA_OK);  /* close all upvalues */
  ------------------
  |  |   48|    361|#define LUA_OK		0
  ------------------
  276|    361|    luaC_freeallobjects(L);  /* collect all objects */
  277|    361|    luai_userstateclose(L);
  ------------------
  |  |  286|    361|#define luai_userstateclose(L)		((void)L)
  ------------------
  278|    361|  }
  279|    361|  luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size);
  ------------------
  |  |   57|    361|#define luaM_freearray(L, b, n)   luaM_free_(L, (b), (n)*sizeof(*(b)))
  ------------------
  280|    361|  freestack(L);
  281|    361|  lua_assert(gettotalbytes(g) == sizeof(LG));
  ------------------
  |  |  114|    361|#define lua_assert(c)		((void)0)
  ------------------
  282|    361|  (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0);  /* free main block */
  ------------------
  |  |   51|    361|#define fromstate(L)	(cast(LX *, cast(lu_byte *, (L)) - offsetof(LX, l)))
  |  |  ------------------
  |  |  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  283|    361|}

luaS_hash:
   43|  18.0k|unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) {
   44|  18.0k|  unsigned int h = seed ^ cast_uint(l);
  ------------------
  |  |  142|  18.0k|#define cast_uint(i)	cast(unsigned int, (i))
  |  |  ------------------
  |  |  |  |  136|  18.0k|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
   45|   116k|  for (; l > 0; l--)
  ------------------
  |  Branch (45:10): [True: 98.9k, False: 18.0k]
  ------------------
   46|  98.9k|    h ^= ((h<<5) + (h>>2) + cast_byte(str[l - 1]));
  ------------------
  |  |  143|  98.9k|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  ------------------
  |  |  |  |  136|  98.9k|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
   47|  18.0k|  return h;
   48|  18.0k|}
luaS_init:
  123|    361|void luaS_init (lua_State *L) {
  124|    361|  global_State *g = G(L);
  ------------------
  |  |  335|    361|#define G(L)	(L->l_G)
  ------------------
  125|    361|  int i, j;
  126|    361|  stringtable *tb = &G(L)->strt;
  ------------------
  |  |  335|    361|#define G(L)	(L->l_G)
  ------------------
  127|    361|  tb->hash = luaM_newvector(L, MINSTRTABSIZE, TString*);
  ------------------
  |  |   60|    361|#define luaM_newvector(L,n,t)	cast(t*, luaM_malloc_(L, (n)*sizeof(t), 0))
  |  |  ------------------
  |  |  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  128|    361|  tablerehash(tb->hash, 0, MINSTRTABSIZE);  /* clear array */
  ------------------
  |  |  227|    361|#define MINSTRTABSIZE	128
  ------------------
  129|    361|  tb->size = MINSTRTABSIZE;
  ------------------
  |  |  227|    361|#define MINSTRTABSIZE	128
  ------------------
  130|       |  /* pre-create memory-error message */
  131|    361|  g->memerrmsg = luaS_newliteral(L, MEMERRMSG);
  ------------------
  |  |   28|    361|#define luaS_newliteral(L, s)	(luaS_newlstr(L, "" s, \
  |  |   29|    361|                                 (sizeof(s)/sizeof(char))-1))
  ------------------
  132|    361|  luaC_fix(L, obj2gco(g->memerrmsg));  /* it should never be collected */
  ------------------
  |  |  390|    361|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  ------------------
  |  |  |  |  115|    361|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  133|  19.4k|  for (i = 0; i < STRCACHE_N; i++)  /* fill cache with valid strings */
  ------------------
  |  |  237|  19.4k|#define STRCACHE_N		53
  ------------------
  |  Branch (133:15): [True: 19.1k, False: 361]
  ------------------
  134|  57.3k|    for (j = 0; j < STRCACHE_M; j++)
  ------------------
  |  |  238|  57.3k|#define STRCACHE_M		2
  ------------------
  |  Branch (134:17): [True: 38.2k, False: 19.1k]
  ------------------
  135|  38.2k|      g->strcache[i][j] = g->memerrmsg;
  136|    361|}
luaS_remove:
  165|  17.6k|void luaS_remove (lua_State *L, TString *ts) {
  166|  17.6k|  stringtable *tb = &G(L)->strt;
  ------------------
  |  |  335|  17.6k|#define G(L)	(L->l_G)
  ------------------
  167|  17.6k|  TString **p = &tb->hash[lmod(ts->hash, tb->size)];
  ------------------
  |  |  787|  17.6k|	(check_exp((size&(size-1))==0, (cast_int((s) & ((size)-1)))))
  |  |  ------------------
  |  |  |  |  115|  17.6k|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  168|  17.6k|  while (*p != ts)  /* find previous element */
  ------------------
  |  Branch (168:10): [True: 0, False: 17.6k]
  ------------------
  169|      0|    p = &(*p)->u.hnext;
  170|  17.6k|  *p = (*p)->u.hnext;  /* remove element from its list */
  171|  17.6k|  tb->nuse--;
  172|  17.6k|}
luaS_newlstr:
  222|  17.6k|TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
  223|  17.6k|  if (l <= LUAI_MAXSHORTLEN)  /* short string? */
  ------------------
  |  |  216|  17.6k|#define LUAI_MAXSHORTLEN	40
  ------------------
  |  Branch (223:7): [True: 17.6k, False: 0]
  ------------------
  224|  17.6k|    return internshrstr(L, str, l);
  225|      0|  else {
  226|      0|    TString *ts;
  227|      0|    if (l_unlikely(l >= (MAX_SIZE - sizeof(TString))/sizeof(char)))
  ------------------
  |  |  697|      0|#define l_unlikely(x)	luai_unlikely(x)
  |  |  ------------------
  |  |  |  |  685|      0|#define luai_unlikely(x)	(__builtin_expect(((x) != 0), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (685:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (685:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  228|      0|      luaM_toobig(L);
  229|      0|    ts = luaS_createlngstrobj(L, l);
  230|      0|    memcpy(getlngstr(ts), str, l * sizeof(char));
  ------------------
  |  |  405|      0|#define getlngstr(ts)	check_exp((ts)->shrlen == 0xFF, (ts)->contents)
  |  |  ------------------
  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  231|      0|    return ts;
  232|      0|  }
  233|  17.6k|}
luaS_new:
  242|  16.9k|TString *luaS_new (lua_State *L, const char *str) {
  243|  16.9k|  unsigned int i = point2uint(str) % STRCACHE_N;  /* hash */
  ------------------
  |  |   91|  16.9k|#define point2uint(p)	((unsigned int)((L_P2I)(p) & UINT_MAX))
  ------------------
                unsigned int i = point2uint(str) % STRCACHE_N;  /* hash */
  ------------------
  |  |  237|  16.9k|#define STRCACHE_N		53
  ------------------
  244|  16.9k|  int j;
  245|  16.9k|  TString **p = G(L)->strcache[i];
  ------------------
  |  |  335|  16.9k|#define G(L)	(L->l_G)
  ------------------
  246|  50.9k|  for (j = 0; j < STRCACHE_M; j++) {
  ------------------
  |  |  238|  50.9k|#define STRCACHE_M		2
  ------------------
  |  Branch (246:15): [True: 33.9k, False: 16.9k]
  ------------------
  247|  33.9k|    if (strcmp(str, getstr(p[j])) == 0)  /* hit? */
  ------------------
  |  |  404|  33.9k|#define getstr(ts)	((ts)->contents)
  ------------------
  |  Branch (247:9): [True: 0, False: 33.9k]
  ------------------
  248|      0|      return p[j];  /* that is it */
  249|  33.9k|  }
  250|       |  /* normal route */
  251|  33.9k|  for (j = STRCACHE_M - 1; j > 0; j--)
  ------------------
  |  |  238|  16.9k|#define STRCACHE_M		2
  ------------------
  |  Branch (251:28): [True: 16.9k, False: 16.9k]
  ------------------
  252|  16.9k|    p[j] = p[j - 1];  /* move out last element */
  253|       |  /* new element is first in the list */
  254|  16.9k|  p[0] = luaS_newlstr(L, str, strlen(str));
  255|  16.9k|  return p[0];
  256|  16.9k|}
lstring.c:tablerehash:
   62|    361|static void tablerehash (TString **vect, int osize, int nsize) {
   63|    361|  int i;
   64|  46.5k|  for (i = osize; i < nsize; i++)  /* clear new elements */
  ------------------
  |  Branch (64:19): [True: 46.2k, False: 361]
  ------------------
   65|  46.2k|    vect[i] = NULL;
   66|    361|  for (i = 0; i < osize; i++) {  /* rehash old part of the array */
  ------------------
  |  Branch (66:15): [True: 0, False: 361]
  ------------------
   67|      0|    TString *p = vect[i];
   68|      0|    vect[i] = NULL;
   69|      0|    while (p) {  /* for each string in the list */
  ------------------
  |  Branch (69:12): [True: 0, False: 0]
  ------------------
   70|      0|      TString *hnext = p->u.hnext;  /* save next */
   71|      0|      unsigned int h = lmod(p->hash, nsize);  /* new position */
  ------------------
  |  |  787|      0|	(check_exp((size&(size-1))==0, (cast_int((s) & ((size)-1)))))
  |  |  ------------------
  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
   72|      0|      p->u.hnext = vect[h];  /* chain it into array */
   73|      0|      vect[h] = p;
   74|      0|      p = hnext;
   75|      0|    }
   76|      0|  }
   77|    361|}
lstring.c:createstrobj:
  143|  17.6k|static TString *createstrobj (lua_State *L, size_t l, int tag, unsigned int h) {
  144|  17.6k|  TString *ts;
  145|  17.6k|  GCObject *o;
  146|  17.6k|  size_t totalsize;  /* total size of TString object */
  147|  17.6k|  totalsize = sizelstring(l);
  ------------------
  |  |   26|  17.6k|#define sizelstring(l)  (offsetof(TString, contents) + ((l) + 1) * sizeof(char))
  ------------------
  148|  17.6k|  o = luaC_newobj(L, tag, totalsize);
  149|  17.6k|  ts = gco2ts(o);
  ------------------
  |  |  374|  17.6k|	check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts))
  |  |  ------------------
  |  |  |  |  115|  17.6k|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  150|  17.6k|  ts->hash = h;
  151|  17.6k|  ts->extra = 0;
  152|  17.6k|  getstr(ts)[l] = '\0';  /* ending 0 */
  ------------------
  |  |  404|  17.6k|#define getstr(ts)	((ts)->contents)
  ------------------
  153|  17.6k|  return ts;
  154|  17.6k|}
lstring.c:internshrstr:
  189|  17.6k|static TString *internshrstr (lua_State *L, const char *str, size_t l) {
  190|  17.6k|  TString *ts;
  191|  17.6k|  global_State *g = G(L);
  ------------------
  |  |  335|  17.6k|#define G(L)	(L->l_G)
  ------------------
  192|  17.6k|  stringtable *tb = &g->strt;
  193|  17.6k|  unsigned int h = luaS_hash(str, l, g->seed);
  194|  17.6k|  TString **list = &tb->hash[lmod(h, tb->size)];
  ------------------
  |  |  787|  17.6k|	(check_exp((size&(size-1))==0, (cast_int((s) & ((size)-1)))))
  |  |  ------------------
  |  |  |  |  115|  17.6k|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  195|  17.6k|  lua_assert(str != NULL);  /* otherwise 'memcmp'/'memcpy' are undefined */
  ------------------
  |  |  114|  17.6k|#define lua_assert(c)		((void)0)
  ------------------
  196|  19.9k|  for (ts = *list; ts != NULL; ts = ts->u.hnext) {
  ------------------
  |  Branch (196:20): [True: 2.27k, False: 17.6k]
  ------------------
  197|  2.27k|    if (l == ts->shrlen && (memcmp(str, getshrstr(ts), l * sizeof(char)) == 0)) {
  ------------------
  |  |  406|     82|#define getshrstr(ts)	check_exp((ts)->shrlen != 0xFF, (ts)->contents)
  |  |  ------------------
  |  |  |  |  115|     82|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  |  Branch (197:9): [True: 82, False: 2.18k]
  |  Branch (197:28): [True: 0, False: 82]
  ------------------
  198|       |      /* found! */
  199|      0|      if (isdead(g, ts))  /* dead (but not collected yet)? */
  ------------------
  |  |   96|      0|#define isdead(g,v)	isdeadm(otherwhite(g), (v)->marked)
  |  |  ------------------
  |  |  |  |   95|      0|#define isdeadm(ow,m)	((m) & (ow))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  200|      0|        changewhite(ts);  /* resurrect it */
  ------------------
  |  |   98|      0|#define changewhite(x)	((x)->marked ^= WHITEBITS)
  |  |  ------------------
  |  |  |  |   84|      0|#define WHITEBITS	bit2mask(WHITE0BIT, WHITE1BIT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      0|#define bit2mask(b1,b2)		(bitmask(b1) | bitmask(b2))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define bitmask(b)		(1<<(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define bit2mask(b1,b2)		(bitmask(b1) | bitmask(b2))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define bitmask(b)		(1<<(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  201|      0|      return ts;
  202|      0|    }
  203|  2.27k|  }
  204|       |  /* else must create a new string */
  205|  17.6k|  if (tb->nuse >= tb->size) {  /* need to grow string table? */
  ------------------
  |  Branch (205:7): [True: 0, False: 17.6k]
  ------------------
  206|      0|    growstrtab(L, tb);
  207|      0|    list = &tb->hash[lmod(h, tb->size)];  /* rehash with new size */
  ------------------
  |  |  787|      0|	(check_exp((size&(size-1))==0, (cast_int((s) & ((size)-1)))))
  |  |  ------------------
  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  208|      0|  }
  209|  17.6k|  ts = createstrobj(L, l, LUA_VSHRSTR, h);
  ------------------
  |  |  360|  17.6k|#define LUA_VSHRSTR	makevariant(LUA_TSTRING, 0)  /* short strings */
  |  |  ------------------
  |  |  |  |   42|  17.6k|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  210|  17.6k|  ts->shrlen = cast_byte(l);
  ------------------
  |  |  143|  17.6k|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  ------------------
  |  |  |  |  136|  17.6k|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  211|  17.6k|  memcpy(getshrstr(ts), str, l * sizeof(char));
  ------------------
  |  |  406|  17.6k|#define getshrstr(ts)	check_exp((ts)->shrlen != 0xFF, (ts)->contents)
  |  |  ------------------
  |  |  |  |  115|  17.6k|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  212|  17.6k|  ts->u.hnext = *list;
  213|  17.6k|  *list = ts;
  214|  17.6k|  tb->nuse++;
  215|  17.6k|  return ts;
  216|  17.6k|}

luaH_realasize:
  250|  1.08k|LUAI_FUNC unsigned int luaH_realasize (const Table *t) {
  251|  1.08k|  if (limitequalsasize(t))
  ------------------
  |  |  244|  1.08k|#define limitequalsasize(t)	(isrealasize(t) || ispow2((t)->alimit))
  |  |  ------------------
  |  |  |  |  732|  2.16k|#define isrealasize(t)		(!((t)->flags & BITRAS))
  |  |  |  |  ------------------
  |  |  |  |  |  |  731|  1.08k|#define BITRAS		(1 << 7)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (732:25): [True: 1.08k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define limitequalsasize(t)	(isrealasize(t) || ispow2((t)->alimit))
  |  |  ------------------
  |  |  |  |   66|      0|#define ispow2(x)	(((x) & ((x) - 1)) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (66:19): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|  1.08k|    return t->alimit;  /* this is the size */
  253|      0|  else {
  254|      0|    unsigned int size = t->alimit;
  255|       |    /* compute the smallest power of 2 not smaller than 'n' */
  256|      0|    size |= (size >> 1);
  257|      0|    size |= (size >> 2);
  258|      0|    size |= (size >> 4);
  259|      0|    size |= (size >> 8);
  260|      0|#if (UINT_MAX >> 14) > 3  /* unsigned int has more than 16 bits */
  261|      0|    size |= (size >> 16);
  262|       |#if (UINT_MAX >> 30) > 3
  263|       |    size |= (size >> 32);  /* unsigned int has more than 32 bits */
  264|       |#endif
  265|      0|#endif
  266|      0|    size++;
  267|      0|    lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size);
  ------------------
  |  |  114|      0|#define lua_assert(c)		((void)0)
  ------------------
  268|      0|    return size;
  269|      0|  }
  270|  1.08k|}
luaH_resize:
  554|    361|                                          unsigned int nhsize) {
  555|    361|  unsigned int i;
  556|    361|  Table newt;  /* to keep the new hash part */
  557|    361|  unsigned int oldasize = setlimittosize(t);
  558|    361|  TValue *newarray;
  559|       |  /* create new hash part with appropriate size into 'newt' */
  560|    361|  setnodevector(L, &newt, nhsize);
  561|    361|  if (newasize < oldasize) {  /* will array shrink? */
  ------------------
  |  Branch (561:7): [True: 0, False: 361]
  ------------------
  562|      0|    t->alimit = newasize;  /* pretend array has new size... */
  563|      0|    exchangehashpart(t, &newt);  /* and new hash */
  564|       |    /* re-insert into the new hash the elements from vanishing slice */
  565|      0|    for (i = newasize; i < oldasize; i++) {
  ------------------
  |  Branch (565:24): [True: 0, False: 0]
  ------------------
  566|      0|      if (!isempty(&t->array[i]))
  ------------------
  |  |  217|      0|#define isempty(v)		ttisnil(v)
  |  |  ------------------
  |  |  |  |  193|      0|#define ttisnil(v)		checktype((v), LUA_TNIL)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|      0|#define checktype(o,t)		(ttype(o) == (t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|      0|#define ttype(o)	(novariant(rawtt(o)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   80|      0|#define novariant(t)	((t) & 0x0F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (566:11): [True: 0, False: 0]
  ------------------
  567|      0|        luaH_setint(L, t, i + 1, &t->array[i]);
  568|      0|    }
  569|      0|    t->alimit = oldasize;  /* restore current size... */
  570|      0|    exchangehashpart(t, &newt);  /* and hash (in case of errors) */
  571|      0|  }
  572|       |  /* allocate new array */
  573|    361|  newarray = luaM_reallocvector(L, t->array, oldasize, newasize, TValue);
  ------------------
  |  |   71|    361|   (cast(t *, luaM_realloc_(L, v, cast_sizet(oldn) * sizeof(t), \
  |  |  ------------------
  |  |  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  |  |   72|    361|                                  cast_sizet(n) * sizeof(t))))
  ------------------
  574|    361|  if (l_unlikely(newarray == NULL && newasize > 0)) {  /* allocation failed? */
  ------------------
  |  |  697|    361|#define l_unlikely(x)	luai_unlikely(x)
  |  |  ------------------
  |  |  |  |  685|    361|#define luai_unlikely(x)	(__builtin_expect(((x) != 0), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (685:26): [True: 0, False: 361]
  |  |  |  |  |  Branch (685:46): [True: 0, False: 361]
  |  |  |  |  |  Branch (685:46): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  575|      0|    freehash(L, &newt);  /* release new hash part */
  576|      0|    luaM_error(L);  /* raise error (with array unchanged) */
  ------------------
  |  |   17|      0|#define luaM_error(L)	luaD_throw(L, LUA_ERRMEM)
  |  |  ------------------
  |  |  |  |   52|      0|#define LUA_ERRMEM	4
  |  |  ------------------
  ------------------
  577|      0|  }
  578|       |  /* allocation ok; initialize new part of the array */
  579|    361|  exchangehashpart(t, &newt);  /* 't' has the new hash ('newt' has the old) */
  580|    361|  t->array = newarray;  /* set new array part */
  581|    361|  t->alimit = newasize;
  582|  1.08k|  for (i = oldasize; i < newasize; i++)  /* clear new slice of the array */
  ------------------
  |  Branch (582:22): [True: 722, False: 361]
  ------------------
  583|    722|     setempty(&t->array[i]);
  ------------------
  |  |  225|    722|#define setempty(v)		settt_(v, LUA_VEMPTY)
  |  |  ------------------
  |  |  |  |  114|  1.08k|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  584|       |  /* re-insert elements from old hash part into new parts */
  585|    361|  reinsert(L, &newt, t);  /* 'newt' now has the old hash */
  586|    361|  freehash(L, &newt);  /* free old hash part */
  587|    361|}
luaH_new:
  626|    722|Table *luaH_new (lua_State *L) {
  627|    722|  GCObject *o = luaC_newobj(L, LUA_VTABLE, sizeof(Table));
  ------------------
  |  |  678|    722|#define LUA_VTABLE	makevariant(LUA_TTABLE, 0)
  |  |  ------------------
  |  |  |  |   42|    722|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  628|    722|  Table *t = gco2t(o);
  ------------------
  |  |  380|    722|#define gco2t(o)  check_exp((o)->tt == LUA_VTABLE, &((cast_u(o))->h))
  |  |  ------------------
  |  |  |  |  115|    722|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
  629|    722|  t->metatable = NULL;
  630|    722|  t->flags = cast_byte(maskflags);  /* table has no metamethod fields */
  ------------------
  |  |  143|    722|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  ------------------
  |  |  |  |  136|    722|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  631|    722|  t->array = NULL;
  632|    722|  t->alimit = 0;
  633|    722|  setnodevector(L, t, 0);
  634|    722|  return t;
  635|    722|}
luaH_free:
  638|    722|void luaH_free (lua_State *L, Table *t) {
  639|    722|  freehash(L, t);
  640|    722|  luaM_freearray(L, t->array, luaH_realasize(t));
  ------------------
  |  |   57|    722|#define luaM_freearray(L, b, n)   luaM_free_(L, (b), (n)*sizeof(*(b)))
  ------------------
  641|    722|  luaM_free(L, t);
  ------------------
  |  |   56|    722|#define luaM_free(L, b)		luaM_free_(L, (b), sizeof(*(b)))
  ------------------
  642|    722|}
ltable.c:setlimittosize:
  283|    361|static unsigned int setlimittosize (Table *t) {
  284|    361|  t->alimit = luaH_realasize(t);
  285|    361|  setrealasize(t);
  ------------------
  |  |  733|    361|#define setrealasize(t)		((t)->flags &= cast_byte(~BITRAS))
  |  |  ------------------
  |  |  |  |  143|    361|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|    361|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  286|    361|  return t->alimit;
  287|    361|}
ltable.c:setnodevector:
  480|  1.08k|static void setnodevector (lua_State *L, Table *t, unsigned int size) {
  481|  1.08k|  if (size == 0) {  /* no elements to hash part? */
  ------------------
  |  Branch (481:7): [True: 1.08k, False: 0]
  ------------------
  482|  1.08k|    t->node = cast(Node *, dummynode);  /* use common 'dummynode' */
  ------------------
  |  |  136|  1.08k|#define cast(t, exp)	((t)(exp))
  ------------------
  483|  1.08k|    t->lsizenode = 0;
  484|  1.08k|    t->lastfree = NULL;  /* signal that it is using dummy node */
  485|  1.08k|  }
  486|      0|  else {
  487|      0|    int i;
  488|      0|    int lsize = luaO_ceillog2(size);
  489|      0|    if (lsize > MAXHBITS || (1u << lsize) > MAXHSIZE)
  ------------------
  |  |   60|      0|#define MAXHBITS	(MAXABITS - 1)
  |  |  ------------------
  |  |  |  |   46|      0|#define MAXABITS	cast_int(sizeof(int) * CHAR_BIT - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|      0|#define cast_int(i)	cast(int, (i))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|#define cast(t, exp)	((t)(exp))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (lsize > MAXHBITS || (1u << lsize) > MAXHSIZE)
  ------------------
  |  |   68|      0|#define MAXHSIZE	luaM_limitN(1u << MAXHBITS, Node)
  |  |  ------------------
  |  |  |  |   45|      0|  ((cast_sizet(n) <= MAX_SIZET/sizeof(t)) ? (n) :  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      0|#define cast_sizet(i)	cast(size_t, (i))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|#define cast(t, exp)	((t)(exp))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                 ((cast_sizet(n) <= MAX_SIZET/sizeof(t)) ? (n) :  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|      0|#define MAX_SIZET	((size_t)(~(size_t)0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (45:4): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   46|      0|     cast_uint((MAX_SIZET/sizeof(t))))
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|      0|#define cast_uint(i)	cast(unsigned int, (i))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|#define cast(t, exp)	((t)(exp))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (489:9): [True: 0, False: 0]
  |  Branch (489:29): [True: 0, False: 0]
  ------------------
  490|      0|      luaG_runerror(L, "table overflow");
  491|      0|    size = twoto(lsize);
  ------------------
  |  |  790|      0|#define twoto(x)	(1<<(x))
  ------------------
  492|      0|    t->node = luaM_newvector(L, size, Node);
  ------------------
  |  |   60|      0|#define luaM_newvector(L,n,t)	cast(t*, luaM_malloc_(L, (n)*sizeof(t), 0))
  |  |  ------------------
  |  |  |  |  136|      0|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  493|      0|    for (i = 0; i < cast_int(size); i++) {
  ------------------
  |  |  141|      0|#define cast_int(i)	cast(int, (i))
  |  |  ------------------
  |  |  |  |  136|      0|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  |  Branch (493:17): [True: 0, False: 0]
  ------------------
  494|      0|      Node *n = gnode(t, i);
  ------------------
  |  |   13|      0|#define gnode(t,i)	(&(t)->node[i])
  ------------------
  495|      0|      gnext(n) = 0;
  ------------------
  |  |   15|      0|#define gnext(n)	((n)->u.next)
  ------------------
  496|      0|      setnilkey(n);
  ------------------
  |  |  762|      0|#define setnilkey(node)		(keytt(node) = LUA_TNIL)
  |  |  ------------------
  |  |  |  |  753|      0|#define keytt(node)		((node)->u.key_tt)
  |  |  ------------------
  |  |               #define setnilkey(node)		(keytt(node) = LUA_TNIL)
  |  |  ------------------
  |  |  |  |   64|      0|#define LUA_TNIL		0
  |  |  ------------------
  ------------------
  497|      0|      setempty(gval(n));
  ------------------
  |  |  225|      0|#define setempty(v)		settt_(v, LUA_VEMPTY)
  |  |  ------------------
  |  |  |  |  114|      0|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  498|      0|    }
  499|      0|    t->lsizenode = cast_byte(lsize);
  ------------------
  |  |  143|      0|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  ------------------
  |  |  |  |  136|      0|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  500|      0|    t->lastfree = gnode(t, size);  /* all positions are free */
  ------------------
  |  |   13|      0|#define gnode(t,i)	(&(t)->node[i])
  ------------------
  501|      0|  }
  502|  1.08k|}
ltable.c:exchangehashpart:
  527|    361|static void exchangehashpart (Table *t1, Table *t2) {
  528|    361|  lu_byte lsizenode = t1->lsizenode;
  529|    361|  Node *node = t1->node;
  530|    361|  Node *lastfree = t1->lastfree;
  531|    361|  t1->lsizenode = t2->lsizenode;
  532|    361|  t1->node = t2->node;
  533|    361|  t1->lastfree = t2->lastfree;
  534|    361|  t2->lsizenode = lsizenode;
  535|    361|  t2->node = node;
  536|    361|  t2->lastfree = lastfree;
  537|    361|}
ltable.c:freehash:
  371|  1.08k|static void freehash (lua_State *L, Table *t) {
  372|  1.08k|  if (!isdummy(t))
  ------------------
  |  |   27|  1.08k|#define isdummy(t)		((t)->lastfree == NULL)
  ------------------
  |  Branch (372:7): [True: 0, False: 1.08k]
  ------------------
  373|      0|    luaM_freearray(L, t->node, cast_sizet(sizenode(t)));
  ------------------
  |  |   57|      0|#define luaM_freearray(L, b, n)   luaM_free_(L, (b), (n)*sizeof(*(b)))
  ------------------
  374|  1.08k|}
ltable.c:reinsert:
  508|    361|static void reinsert (lua_State *L, Table *ot, Table *t) {
  509|    361|  int j;
  510|    361|  int size = sizenode(ot);
  ------------------
  |  |  791|    361|#define sizenode(t)	(twoto((t)->lsizenode))
  |  |  ------------------
  |  |  |  |  790|    361|#define twoto(x)	(1<<(x))
  |  |  ------------------
  ------------------
  511|    722|  for (j = 0; j < size; j++) {
  ------------------
  |  Branch (511:15): [True: 361, False: 361]
  ------------------
  512|    361|    Node *old = gnode(ot, j);
  ------------------
  |  |   13|    361|#define gnode(t,i)	(&(t)->node[i])
  ------------------
  513|    361|    if (!isempty(gval(old))) {
  ------------------
  |  |  217|    361|#define isempty(v)		ttisnil(v)
  |  |  ------------------
  |  |  |  |  193|    361|#define ttisnil(v)		checktype((v), LUA_TNIL)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|    361|#define checktype(o,t)		(ttype(o) == (t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|    361|#define ttype(o)	(novariant(rawtt(o)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   80|    361|#define novariant(t)	((t) & 0x0F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (513:9): [True: 0, False: 361]
  ------------------
  514|       |      /* doesn't need barrier/invalidate cache, as entry was
  515|       |         already present in the table */
  516|      0|      TValue k;
  517|      0|      getnodekey(L, &k, old);
  ------------------
  |  |  719|      0|	{ TValue *io_=(obj); const Node *n_=(node); \
  |  |  720|      0|	  io_->value_ = n_->u.key_val; io_->tt_ = n_->u.key_tt; \
  |  |  721|      0|	  checkliveness(L,io_); }
  |  |  ------------------
  |  |  |  |  107|      0|	((void)L, lua_longassert(!iscollectable(obj) || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|      0|#define lua_longassert(c)	((void)0)
  |  |  |  |  ------------------
  |  |  |  |  108|      0|		(righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj))))))
  |  |  ------------------
  ------------------
  518|      0|      luaH_set(L, t, &k, gval(old));
  ------------------
  |  |   14|      0|#define gval(n)		(&(n)->i_val)
  ------------------
  519|      0|    }
  520|    361|  }
  521|    361|}

luaT_init:
   38|    361|void luaT_init (lua_State *L) {
   39|    361|  static const char *const luaT_eventname[] = {  /* ORDER TM */
   40|    361|    "__index", "__newindex",
   41|    361|    "__gc", "__mode", "__len", "__eq",
   42|    361|    "__add", "__sub", "__mul", "__mod", "__pow",
   43|    361|    "__div", "__idiv",
   44|    361|    "__band", "__bor", "__bxor", "__shl", "__shr",
   45|    361|    "__unm", "__bnot", "__lt", "__le",
   46|    361|    "__concat", "__call", "__close"
   47|    361|  };
   48|    361|  int i;
   49|  9.38k|  for (i=0; i<TM_N; i++) {
  ------------------
  |  Branch (49:13): [True: 9.02k, False: 361]
  ------------------
   50|  9.02k|    G(L)->tmname[i] = luaS_new(L, luaT_eventname[i]);
  ------------------
  |  |  335|  9.02k|#define G(L)	(L->l_G)
  ------------------
   51|  9.02k|    luaC_fix(L, obj2gco(G(L)->tmname[i]));  /* never collect these names */
  ------------------
  |  |  390|  9.02k|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  ------------------
  |  |  |  |  115|  9.02k|#define check_exp(c,e)		(e)
  |  |  ------------------
  ------------------
   52|  9.02k|  }
   53|    361|}

luaV_tonumber_:
  105|    184|int luaV_tonumber_ (const TValue *obj, lua_Number *n) {
  106|    184|  TValue v;
  107|    184|  if (ttisinteger(obj)) {
  ------------------
  |  |  328|    184|#define ttisinteger(o)		checktag((o), LUA_VNUMINT)
  |  |  ------------------
  |  |  |  |   91|    184|#define checktag(o,t)		(rawtt(o) == (t))
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|    184|#define rawtt(o)	((o)->tt_)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:24): [True: 184, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  108|    184|    *n = cast_num(ivalue(obj));
  ------------------
  |  |  140|    184|#define cast_num(i)	cast(lua_Number, (i))
  |  |  ------------------
  |  |  |  |  136|    184|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  109|    184|    return 1;
  110|    184|  }
  111|      0|  else if (l_strton(obj, &v)) {  /* string coercible to number? */
  ------------------
  |  Branch (111:12): [True: 0, False: 0]
  ------------------
  112|      0|    *n = nvalue(&v);  /* convert result of 'luaO_str2num' to a float */
  ------------------
  |  |  330|      0|#define nvalue(o)	check_exp(ttisnumber(o), \
  |  |  ------------------
  |  |  |  |  115|      0|#define check_exp(c,e)		(e)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (115:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  331|      0|	(ttisinteger(o) ? cast_num(ivalue(o)) : fltvalue(o)))
  ------------------
  113|      0|    return 1;
  114|      0|  }
  115|      0|  else
  116|      0|    return 0;  /* conversion failed */
  117|    184|}

LLVMFuzzerTestOneInput:
   12|    361|{
   13|    361|	lua_State *L = luaL_newstate();
   14|    361|	if (L == NULL)
  ------------------
  |  Branch (14:6): [True: 0, False: 361]
  ------------------
   15|      0|		return 0;
   16|       |
   17|    361|	size_t str_len = size + 1;
   18|    361|	char *str = calloc(str_len, sizeof(char));
   19|    361|	if (str == NULL) {
  ------------------
  |  Branch (19:6): [True: 0, False: 361]
  ------------------
   20|      0|		return 0;
   21|      0|	}
   22|    361|	memcpy(str, data, size);
   23|    361|	str[size] = '\0';
   24|       |
   25|    361|	size_t sz = lua_stringtonumber(L, str);
   26|    361|	if (sz == 0) {
  ------------------
  |  Branch (26:6): [True: 109, False: 252]
  ------------------
   27|    109|		assert(lua_gettop(L) == 0);
   28|    252|	} else {
   29|       |		/* assert(sz == size + 1); */
   30|    252|		assert(lua_gettop(L) == 1);
   31|    252|		assert(lua_isnumber(L, -1) == 1);
   32|    252|	}
   33|       |
   34|    361|	free(str);
   35|    361|	lua_settop(L, 0);
   36|    361|	lua_close(L);
   37|       |
   38|    361|	return 0;
   39|    361|}

