lua_atpanic:
  154|    377|LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) {
  155|    377|  lua_CFunction old;
  156|    377|  lua_lock(L);
  ------------------
  |  |  267|    377|#define lua_lock(L)	((void) 0)
  ------------------
  157|    377|  old = G(L)->panic;
  ------------------
  |  |  333|    377|#define G(L)	(L->l_G)
  ------------------
  158|    377|  G(L)->panic = panicf;
  ------------------
  |  |  333|    377|#define G(L)	(L->l_G)
  ------------------
  159|    377|  lua_unlock(L);
  ------------------
  |  |  268|    377|#define lua_unlock(L)	((void) 0)
  ------------------
  160|    377|  return old;
  161|    377|}
lua_gettop:
  186|    377|LUA_API int lua_gettop (lua_State *L) {
  187|    377|  return cast_int(L->top.p - (L->ci->func.p + 1));
  ------------------
  |  |  144|    377|#define cast_int(i)	cast(int, (i))
  |  |  ------------------
  |  |  |  |  139|    377|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  188|    377|}
lua_settop:
  191|    377|LUA_API void lua_settop (lua_State *L, int idx) {
  192|    377|  CallInfo *ci;
  193|    377|  StkId func, newtop;
  194|    377|  ptrdiff_t diff;  /* difference for new top */
  195|    377|  lua_lock(L);
  ------------------
  |  |  267|    377|#define lua_lock(L)	((void) 0)
  ------------------
  196|    377|  ci = L->ci;
  197|    377|  func = ci->func.p;
  198|    377|  if (idx >= 0) {
  ------------------
  |  Branch (198:7): [True: 377, False: 0]
  ------------------
  199|    377|    api_check(L, idx <= ci->top.p - (func + 1), "new top too large");
  ------------------
  |  |  129|    377|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  ------------------
  |  |  |  |  727|    377|#define luai_apicheck(l,e)	assert(e)
  |  |  ------------------
  ------------------
  200|    377|    diff = ((func + 1) + idx) - L->top.p;
  201|    377|    for (; diff > 0; diff--)
  ------------------
  |  Branch (201:12): [True: 0, False: 377]
  ------------------
  202|    377|      setnilvalue(s2v(L->top.p++));  /* clear new slots */
  ------------------
  |  |  211|      0|#define setnilvalue(obj) settt_(obj, LUA_VNIL)
  |  |  ------------------
  |  |  |  |  114|    377|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  203|    377|  }
  204|      0|  else {
  205|      0|    api_check(L, -(idx+1) <= (L->top.p - (func + 1)), "invalid new top");
  ------------------
  |  |  129|      0|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  ------------------
  |  |  |  |  727|      0|#define luai_apicheck(l,e)	assert(e)
  |  |  ------------------
  ------------------
  206|      0|    diff = idx + 1;  /* will "subtract" index (as it is negative) */
  207|      0|  }
  208|    377|  newtop = L->top.p + diff;
  209|    377|  if (diff < 0 && L->tbclist.p >= newtop) {
  ------------------
  |  Branch (209:7): [True: 267, False: 110]
  |  Branch (209:19): [True: 0, False: 267]
  ------------------
  210|      0|    lua_assert(hastocloseCfunc(ci->nresults));
  ------------------
  |  |  109|      0|#define lua_assert(c)           assert(c)
  ------------------
  211|      0|    newtop = luaF_close(L, newtop, CLOSEKTOP, 0);
  ------------------
  |  |   47|      0|#define CLOSEKTOP	(-1)
  ------------------
  212|      0|  }
  213|    377|  L->top.p = newtop;  /* correct top only after closing any upvalue */
  214|    377|  lua_unlock(L);
  ------------------
  |  |  268|    377|#define lua_unlock(L)	((void) 0)
  ------------------
  215|    377|}
lua_isnumber:
  319|    267|LUA_API int lua_isnumber (lua_State *L, int idx) {
  320|    267|  lua_Number n;
  321|    267|  const TValue *o = index2value(L, idx);
  322|    267|  return tonumber(o, &n);
  ------------------
  |  |   52|    267|	(ttisfloat(o) ? (*(n) = fltvalue(o), 1) : luaV_tonumber_(o,n))
  |  |  ------------------
  |  |  |  |  340|    267|#define ttisfloat(o)		checktag((o), LUA_VNUMFLT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|    267|#define checktag(o,t)		(rawtt(o) == (t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|    267|#define rawtt(o)	((o)->tt_)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (91:24): [True: 84, False: 183]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(ttisfloat(o) ? (*(n) = fltvalue(o), 1) : luaV_tonumber_(o,n))
  |  |  ------------------
  |  |  |  |  345|     84|#define fltvalue(o)	check_exp(ttisfloat(o), val_(o).n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|     84|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|     84|#define lua_assert(c)           assert(c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  323|    267|}
lua_stringtonumber:
  381|    377|LUA_API size_t lua_stringtonumber (lua_State *L, const char *s) {
  382|    377|  size_t sz = luaO_str2num(s, s2v(L->top.p));
  ------------------
  |  |  172|    377|#define s2v(o)	(&(o)->val)
  ------------------
  383|    377|  if (sz != 0)
  ------------------
  |  Branch (383:7): [True: 267, False: 110]
  ------------------
  384|    267|    api_incr_top(L);
  ------------------
  |  |   17|    267|    (L->top.p++, api_check(L, L->top.p <= L->ci->top.p, "stack overflow"))
  |  |  ------------------
  |  |  |  |  129|    267|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  |  |  ------------------
  |  |  |  |  |  |  727|    267|#define luai_apicheck(l,e)	assert(e)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  385|    377|  return sz;
  386|    377|}
lua_setwarnf:
 1334|    377|void lua_setwarnf (lua_State *L, lua_WarnFunction f, void *ud) {
 1335|    377|  lua_lock(L);
  ------------------
  |  |  267|    377|#define lua_lock(L)	((void) 0)
  ------------------
 1336|    377|  G(L)->ud_warn = ud;
  ------------------
  |  |  333|    377|#define G(L)	(L->l_G)
  ------------------
 1337|    377|  G(L)->warnf = f;
  ------------------
  |  |  333|    377|#define G(L)	(L->l_G)
  ------------------
 1338|    377|  lua_unlock(L);
  ------------------
  |  |  268|    377|#define lua_unlock(L)	((void) 0)
  ------------------
 1339|    377|}
lapi.c:index2value:
   70|    267|static TValue *index2value (lua_State *L, int idx) {
   71|    267|  CallInfo *ci = L->ci;
   72|    267|  if (idx > 0) {
  ------------------
  |  Branch (72:7): [True: 0, False: 267]
  ------------------
   73|      0|    StkId o = ci->func.p + idx;
   74|      0|    api_check(L, idx <= ci->top.p - (ci->func.p + 1), "unacceptable index");
  ------------------
  |  |  129|      0|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  ------------------
  |  |  |  |  727|      0|#define luai_apicheck(l,e)	assert(e)
  |  |  ------------------
  ------------------
   75|      0|    if (o >= L->top.p) return &G(L)->nilvalue;
  ------------------
  |  |  333|      0|#define G(L)	(L->l_G)
  ------------------
  |  Branch (75:9): [True: 0, False: 0]
  ------------------
   76|      0|    else return s2v(o);
  ------------------
  |  |  172|      0|#define s2v(o)	(&(o)->val)
  ------------------
   77|      0|  }
   78|    267|  else if (!ispseudo(idx)) {  /* negative index */
  ------------------
  |  |   50|    267|#define ispseudo(i)		((i) <= LUA_REGISTRYINDEX)
  |  |  ------------------
  |  |  |  |   43|    267|#define LUA_REGISTRYINDEX	(-LUAI_MAXSTACK - 1000)
  |  |  |  |  ------------------
  |  |  |  |  |  |  749|    267|#define LUAI_MAXSTACK		1000000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (78:12): [True: 267, False: 0]
  ------------------
   79|    267|    api_check(L, idx != 0 && -idx <= L->top.p - (ci->func.p + 1),
  ------------------
  |  |  129|    267|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  ------------------
  |  |  |  |  727|    267|#define luai_apicheck(l,e)	assert(e)
  |  |  ------------------
  ------------------
   80|    267|                 "invalid index");
   81|    267|    return s2v(L->top.p + idx);
  ------------------
  |  |  172|    267|#define s2v(o)	(&(o)->val)
  ------------------
   82|    267|  }
   83|      0|  else if (idx == LUA_REGISTRYINDEX)
  ------------------
  |  |   43|      0|#define LUA_REGISTRYINDEX	(-LUAI_MAXSTACK - 1000)
  |  |  ------------------
  |  |  |  |  749|      0|#define LUAI_MAXSTACK		1000000
  |  |  ------------------
  ------------------
  |  Branch (83:12): [True: 0, False: 0]
  ------------------
   84|      0|    return &G(L)->l_registry;
  ------------------
  |  |  333|      0|#define G(L)	(L->l_G)
  ------------------
   85|      0|  else {  /* upvalues */
   86|      0|    idx = LUA_REGISTRYINDEX - idx;
  ------------------
  |  |   43|      0|#define LUA_REGISTRYINDEX	(-LUAI_MAXSTACK - 1000)
  |  |  ------------------
  |  |  |  |  749|      0|#define LUAI_MAXSTACK		1000000
  |  |  ------------------
  ------------------
   87|      0|    api_check(L, idx <= MAXUPVAL + 1, "upvalue index too large");
  ------------------
  |  |  129|      0|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  ------------------
  |  |  |  |  727|      0|#define luai_apicheck(l,e)	assert(e)
  |  |  ------------------
  ------------------
   88|      0|    if (ttisCclosure(s2v(ci->func.p))) {  /* C closure? */
  ------------------
  |  |  634|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   89|      0|      CClosure *func = clCvalue(s2v(ci->func.p));
  ------------------
  |  |  643|      0|#define clCvalue(o)	check_exp(ttisCclosure(o), gco2ccl(val_(o).gc))
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (113:42): [True: 0, False: 0]
  |  |  |  |  |  Branch (113:42): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   90|      0|      return (idx <= func->nupvalues) ? &func->upvalue[idx-1]
  ------------------
  |  Branch (90:14): [True: 0, False: 0]
  ------------------
   91|      0|                                      : &G(L)->nilvalue;
  ------------------
  |  |  333|      0|#define G(L)	(L->l_G)
  ------------------
   92|      0|    }
   93|      0|    else {  /* light C function or Lua function (through a hook)?) */
   94|      0|      api_check(L, ttislcf(s2v(ci->func.p)), "caller not a C function");
  ------------------
  |  |  129|      0|#define api_check(l,e,msg)	luai_apicheck(l,(e) && msg)
  |  |  ------------------
  |  |  |  |  727|      0|#define luai_apicheck(l,e)	assert(e)
  |  |  ------------------
  ------------------
   95|      0|      return &G(L)->nilvalue;  /* no upvalues */
  ------------------
  |  |  333|      0|#define G(L)	(L->l_G)
  ------------------
   96|      0|    }
   97|      0|  }
   98|    267|}

luaL_newstate:
 1166|    377|LUALIB_API lua_State *luaL_newstate (void) {
 1167|    377|  lua_State *L = lua_newstate(l_alloc, NULL, luai_makeseed());
 1168|    377|  if (l_likely(L)) {
  ------------------
  |  |  696|    377|#define l_likely(x)	luai_likely(x)
  |  |  ------------------
  |  |  |  |  684|    377|#define luai_likely(x)		(__builtin_expect(((x) != 0), 1))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (684:25): [True: 377, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1169|    377|    lua_atpanic(L, &panic);
 1170|    377|    lua_setwarnf(L, warnfoff, L);  /* default is warnings off */
 1171|    377|  }
 1172|    377|  return L;
 1173|    377|}
lauxlib.c:luai_makeseed:
 1141|    377|static unsigned int luai_makeseed (void) {
 1142|    377|  unsigned int buff[BUFSEED];
 1143|    377|  unsigned int res;
 1144|    377|  unsigned int i;
 1145|    377|  time_t t = time(NULL);
 1146|    377|  char *b = (char*)buff;
 1147|    377|  addbuff(b, b);  /* local variable's address */
  ------------------
  |  | 1138|    377|#define addbuff(b,v)	(memcpy(&b[0], &(v), sizeof(v)), b += sizeof(v))
  ------------------
 1148|    377|  addbuff(b, t);  /* time */
  ------------------
  |  | 1138|    377|#define addbuff(b,v)	(memcpy(&b[0], &(v), sizeof(v)), b += sizeof(v))
  ------------------
 1149|       |  /* fill (rare but possible) remain of the buffer with zeros */
 1150|    377|  memset(b, 0, sizeof(buff) - BUFSEEDB);
  ------------------
  |  | 1129|    377|#define BUFSEEDB	(sizeof(void*) + sizeof(time_t))
  ------------------
 1151|    377|  res = buff[0];
 1152|  1.50k|  for (i = 1; i < BUFSEED; i++)
  ------------------
  |  | 1132|  1.50k|#define BUFSEED		((BUFSEEDB + sizeof(int) - 1) / sizeof(int))
  |  |  ------------------
  |  |  |  | 1129|  1.50k|#define BUFSEEDB	(sizeof(void*) + sizeof(time_t))
  |  |  ------------------
  ------------------
  |  Branch (1152:15): [True: 1.13k, False: 377]
  ------------------
 1153|  1.13k|    res ^= (res >> 3) + (res << 7) + buff[i];
 1154|    377|  return res;
 1155|    377|}
lauxlib.c:l_alloc:
 1035|  41.4k|static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
 1036|  41.4k|  (void)ud; (void)osize;  /* not used */
 1037|  41.4k|  if (nsize == 0) {
  ------------------
  |  Branch (1037:7): [True: 20.7k, False: 20.7k]
  ------------------
 1038|  20.7k|    free(ptr);
 1039|  20.7k|    return NULL;
 1040|  20.7k|  }
 1041|  20.7k|  else
 1042|  20.7k|    return realloc(ptr, nsize);
 1043|  41.4k|}

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

luaF_closeupval:
  193|    377|void luaF_closeupval (lua_State *L, StkId level) {
  194|    377|  UpVal *uv;
  195|    377|  StkId upl;  /* stack index pointed by 'uv' */
  196|    377|  while ((uv = L->openupval) != NULL && (upl = uplevel(uv)) >= level) {
  ------------------
  |  |   35|      0|#define uplevel(up)	check_exp(upisopen(up), cast(StkId, (up)->v.p))
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (196:10): [True: 0, False: 377]
  |  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);
  ------------------
  |  |  109|      0|#define lua_assert(c)           assert(c)
  ------------------
  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) || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|      0|#define lua_longassert(c)	((c) ? (void)0 : lua_assert(0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  108|      0|		(righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj))))))
  |  |  ------------------
  |  |               	  checkliveness(L,io1); lua_assert(!isnonstrictnil(io1)); }
  |  |  ------------------
  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  ------------------
  ------------------
  201|      0|    uv->v.p = slot;  /* now current value lives here */
  202|      0|    if (!iswhite(uv)) {  /* neither white nor dead? */
  ------------------
  |  |   90|      0|#define iswhite(x)      testbits((x)->marked, WHITEBITS)
  |  |  ------------------
  |  |  |  |   65|      0|#define testbits(x,m)		((x) & (m))
  |  |  ------------------
  ------------------
  |  Branch (202:9): [True: 0, False: 0]
  ------------------
  203|      0|      nw2black(uv);  /* closed upvalues cannot be gray */
  ------------------
  |  |  103|      0|	check_exp(!iswhite(x), l_setbit((x)->marked, BLACKBIT))
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  204|      0|      luaC_barrier(L, uv, slot);
  ------------------
  |  |  226|      0|#define luaC_barrier(L,p,v) (  \
  |  |  227|      0|	iscollectable(v) ? luaC_objbarrier(L,p,gcvalue(v)) : cast_void(0))
  |  |  ------------------
  |  |  |  |  313|      0|#define iscollectable(o)	(rawtt(o) & BIT_ISCOLLECTABLE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|      0|#define rawtt(o)	((o)->tt_)
  |  |  |  |  ------------------
  |  |  |  |               #define iscollectable(o)	(rawtt(o) & BIT_ISCOLLECTABLE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  311|      0|#define BIT_ISCOLLECTABLE	(1 << 6)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (313:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	iscollectable(v) ? luaC_objbarrier(L,p,gcvalue(v)) : cast_void(0))
  |  |  ------------------
  |  |  |  |  222|      0|#define luaC_objbarrier(L,p,o) (  \
  |  |  |  |  223|      0|	(isblack(p) && iswhite(o)) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|      0|#define isblack(x)      testbit((x)->marked, BLACKBIT)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define testbit(x,b)		testbits(x, bitmask(b))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   65|      0|#define testbits(x,m)		((x) & (m))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (65:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(isblack(p) && iswhite(o)) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  |   90|      0|#define iswhite(x)      testbits((x)->marked, WHITEBITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   65|      0|#define testbits(x,m)		((x) & (m))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (65:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (65:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  224|      0|	luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0))
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|      0|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0))
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|      0|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (113:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (113:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0))
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|      0|#define cast_void(i)	cast(void, (i))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	iscollectable(v) ? luaC_objbarrier(L,p,gcvalue(v)) : cast_void(0))
  |  |  ------------------
  |  |  |  |  141|      0|#define cast_void(i)	cast(void, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|      0|    }
  206|      0|  }
  207|    377|}
luaF_close:
  227|    377|StkId luaF_close (lua_State *L, StkId level, int status, int yy) {
  228|    377|  ptrdiff_t levelrel = savestack(L, level);
  ------------------
  |  |   36|    377|#define savestack(L,pt)		(cast_charp(pt) - cast_charp(L->stack.p))
  |  |  ------------------
  |  |  |  |  149|    377|#define cast_charp(i)	cast(char *, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|    377|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define savestack(L,pt)		(cast_charp(pt) - cast_charp(L->stack.p))
  |  |  ------------------
  |  |  |  |  149|    377|#define cast_charp(i)	cast(char *, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|    377|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  229|    377|  luaF_closeupval(L, level);  /* first, close the upvalues */
  230|    377|  while (L->tbclist.p >= level) {  /* traverse tbc's down to that level */
  ------------------
  |  Branch (230:10): [True: 0, False: 377]
  ------------------
  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))
  |  |  ------------------
  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  235|      0|  }
  236|    377|  return level;
  237|    377|}

luaC_fix:
  234|  18.4k|void luaC_fix (lua_State *L, GCObject *o) {
  235|  18.4k|  global_State *g = G(L);
  ------------------
  |  |  333|  18.4k|#define G(L)	(L->l_G)
  ------------------
  236|  18.4k|  lua_assert(g->allgc == o);  /* object must be 1st in 'allgc' list! */
  ------------------
  |  |  109|  18.4k|#define lua_assert(c)           assert(c)
  ------------------
  237|  18.4k|  set2gray(o);  /* they will be gray forever */
  ------------------
  |  |   57|  18.4k|#define set2gray(x)	resetbits(x->marked, maskcolors)
  |  |  ------------------
  |  |  |  |   63|  18.4k|#define resetbits(x,m)		((x) &= cast_byte(~(m)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  18.4k|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|  18.4k|#define cast(t, exp)	((t)(exp))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|  18.4k|  setage(o, G_OLD);  /* and old forever */
  ------------------
  |  |  120|  18.4k|#define setage(o,a)  ((o)->marked = cast_byte(((o)->marked & (~AGEBITS)) | a))
  |  |  ------------------
  |  |  |  |  146|  18.4k|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|  18.4k|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|  18.4k|  g->allgc = o->next;  /* remove object from 'allgc' list */
  240|  18.4k|  o->next = g->fixedgc;  /* link it to 'fixedgc' list */
  241|  18.4k|  g->fixedgc = o;
  242|  18.4k|}
luaC_newobjdt:
  249|  19.2k|GCObject *luaC_newobjdt (lua_State *L, int tt, size_t sz, size_t offset) {
  250|  19.2k|  global_State *g = G(L);
  ------------------
  |  |  333|  19.2k|#define G(L)	(L->l_G)
  ------------------
  251|  19.2k|  char *p = cast_charp(luaM_newobject(L, novariant(tt), sz));
  ------------------
  |  |  149|  19.2k|#define cast_charp(i)	cast(char *, (i))
  |  |  ------------------
  |  |  |  |  139|  19.2k|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  252|  19.2k|  GCObject *o = cast(GCObject *, p + offset);
  ------------------
  |  |  139|  19.2k|#define cast(t, exp)	((t)(exp))
  ------------------
  253|  19.2k|  g->GCdebt--;
  254|  19.2k|  o->marked = luaC_white(g);
  ------------------
  |  |  105|  19.2k|#define luaC_white(g)	cast_byte((g)->currentwhite & WHITEBITS)
  |  |  ------------------
  |  |  |  |  146|  19.2k|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|  19.2k|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  255|  19.2k|  o->tt = tt;
  256|  19.2k|  o->next = g->allgc;
  257|  19.2k|  g->allgc = o;
  258|  19.2k|  return o;
  259|  19.2k|}
luaC_newobj:
  265|  19.2k|GCObject *luaC_newobj (lua_State *L, int tt, size_t sz) {
  266|  19.2k|  return luaC_newobjdt(L, tt, sz, 0);
  267|  19.2k|}
luaC_changemode:
 1374|    377|void luaC_changemode (lua_State *L, int newmode) {
 1375|    377|  global_State *g = G(L);
  ------------------
  |  |  333|    377|#define G(L)	(L->l_G)
  ------------------
 1376|    377|  if (g->gckind == KGC_GENMAJOR)  /* doing major collections? */
  ------------------
  |  |  153|    377|#define KGC_GENMAJOR	2	/* generational in major mode */
  ------------------
  |  Branch (1376:7): [True: 0, False: 377]
  ------------------
 1377|      0|    g->gckind = KGC_INC;  /* already incremental but in name */
  ------------------
  |  |  151|      0|#define KGC_INC		0	/* incremental gc */
  ------------------
 1378|    377|  if (newmode != g->gckind) {  /* does it need to change? */
  ------------------
  |  Branch (1378:7): [True: 0, False: 377]
  ------------------
 1379|      0|    if (newmode == KGC_INC)  /* entering incremental mode? */
  ------------------
  |  |  151|      0|#define KGC_INC		0	/* incremental gc */
  ------------------
  |  Branch (1379:9): [True: 0, False: 0]
  ------------------
 1380|      0|      minor2inc(L, g, KGC_INC);  /* entering incremental mode */
  ------------------
  |  |  151|      0|#define KGC_INC		0	/* incremental gc */
  ------------------
 1381|      0|    else {
 1382|      0|      lua_assert(newmode == KGC_GENMINOR);
  ------------------
  |  |  109|      0|#define lua_assert(c)           assert(c)
  ------------------
 1383|      0|      entergen(L, g);
 1384|      0|    }
 1385|      0|  }
 1386|    377|}
luaC_freeallobjects:
 1463|    377|void luaC_freeallobjects (lua_State *L) {
 1464|    377|  global_State *g = G(L);
  ------------------
  |  |  333|    377|#define G(L)	(L->l_G)
  ------------------
 1465|    377|  g->gcstp = GCSTPCLS;  /* no extra finalizers after here */
  ------------------
  |  |  204|    377|#define GCSTPCLS	4  /* bit true when closing Lua state */
  ------------------
 1466|    377|  luaC_changemode(L, KGC_INC);
  ------------------
  |  |  151|    377|#define KGC_INC		0	/* incremental gc */
  ------------------
 1467|    377|  separatetobefnz(g, 1);  /* separate all objects with finalizers */
 1468|    377|  lua_assert(g->finobj == NULL);
  ------------------
  |  |  109|    377|#define lua_assert(c)           assert(c)
  ------------------
 1469|    377|  callallpendingfinalizers(L);
 1470|    377|  deletelist(L, g->allgc, obj2gco(g->mainthread));
  ------------------
  |  |  388|    377|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  ------------------
  |  |  |  |  113|    377|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    377|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1471|    377|  lua_assert(g->finobj == NULL);  /* no new finalizers */
  ------------------
  |  |  109|    377|#define lua_assert(c)           assert(c)
  ------------------
 1472|    377|  deletelist(L, g->fixedgc, NULL);  /* collect fixed objects */
 1473|    377|  lua_assert(g->strt.nuse == 0);
  ------------------
  |  |  109|    377|#define lua_assert(c)           assert(c)
  ------------------
 1474|    377|}
lgc.c:freeobj:
  783|  19.2k|static void freeobj (lua_State *L, GCObject *o) {
  784|  19.2k|  G(L)->totalobjs--;
  ------------------
  |  |  333|  19.2k|#define G(L)	(L->l_G)
  ------------------
  785|  19.2k|  switch (o->tt) {
  786|      0|    case LUA_VPROTO:
  ------------------
  |  |  538|      0|#define LUA_VPROTO	makevariant(LUA_TPROTO, 0)
  |  |  ------------------
  |  |  |  |   42|      0|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (786:5): [True: 0, False: 19.2k]
  ------------------
  787|      0|      luaF_freeproto(L, gco2p(o));
  ------------------
  |  |  379|      0|#define gco2p(o)  check_exp((o)->tt == LUA_VPROTO, &((cast_u(o))->p))
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  788|      0|      break;
  789|      0|    case LUA_VUPVAL:
  ------------------
  |  |  623|      0|#define LUA_VUPVAL	makevariant(LUA_TUPVAL, 0)
  |  |  ------------------
  |  |  |  |   42|      0|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (789:5): [True: 0, False: 19.2k]
  ------------------
  790|      0|      freeupval(L, gco2upv(o));
  ------------------
  |  |  381|      0|#define gco2upv(o)	check_exp((o)->tt == LUA_VUPVAL, &((cast_u(o))->upv))
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  791|      0|      break;
  792|      0|    case LUA_VLCL: {
  ------------------
  |  |  627|      0|#define LUA_VLCL	makevariant(LUA_TFUNCTION, 0)  /* Lua closure */
  |  |  ------------------
  |  |  |  |   42|      0|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (792:5): [True: 0, False: 19.2k]
  ------------------
  793|      0|      LClosure *cl = gco2lcl(o);
  ------------------
  |  |  374|      0|#define gco2lcl(o)  check_exp((o)->tt == LUA_VLCL, &((cast_u(o))->cl.l))
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  794|      0|      luaM_freemem(L, cl, sizeLclosure(cl->nupvalues));
  ------------------
  |  |   55|      0|#define luaM_freemem(L, b, s)	luaM_free_(L, (b), (s))
  ------------------
  795|      0|      break;
  796|      0|    }
  797|      0|    case LUA_VCCL: {
  ------------------
  |  |  629|      0|#define LUA_VCCL	makevariant(LUA_TFUNCTION, 2)  /* C closure */
  |  |  ------------------
  |  |  |  |   42|      0|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (797:5): [True: 0, False: 19.2k]
  ------------------
  798|      0|      CClosure *cl = gco2ccl(o);
  ------------------
  |  |  375|      0|#define gco2ccl(o)  check_exp((o)->tt == LUA_VCCL, &((cast_u(o))->cl.c))
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  799|      0|      luaM_freemem(L, cl, sizeCclosure(cl->nupvalues));
  ------------------
  |  |   55|      0|#define luaM_freemem(L, b, s)	luaM_free_(L, (b), (s))
  ------------------
  800|      0|      break;
  801|      0|    }
  802|    754|    case LUA_VTABLE:
  ------------------
  |  |  717|    754|#define LUA_VTABLE	makevariant(LUA_TTABLE, 0)
  |  |  ------------------
  |  |  |  |   42|    754|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (802:5): [True: 754, False: 18.4k]
  ------------------
  803|    754|      luaH_free(L, gco2t(o));
  ------------------
  |  |  378|    754|#define gco2t(o)  check_exp((o)->tt == LUA_VTABLE, &((cast_u(o))->h))
  |  |  ------------------
  |  |  |  |  113|    754|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    754|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  804|      0|      break;
  805|      0|    case LUA_VTHREAD:
  ------------------
  |  |  275|      0|#define LUA_VTHREAD		makevariant(LUA_TTHREAD, 0)
  |  |  ------------------
  |  |  |  |   42|      0|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (805:5): [True: 0, False: 19.2k]
  ------------------
  806|      0|      luaE_freethread(L, gco2th(o));
  ------------------
  |  |  380|      0|#define gco2th(o)  check_exp((o)->tt == LUA_VTHREAD, &((cast_u(o))->th))
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  807|      0|      break;
  808|      0|    case LUA_VUSERDATA: {
  ------------------
  |  |  460|      0|#define LUA_VUSERDATA		makevariant(LUA_TUSERDATA, 0)
  |  |  ------------------
  |  |  |  |   42|      0|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (808:5): [True: 0, False: 19.2k]
  ------------------
  809|      0|      Udata *u = gco2u(o);
  ------------------
  |  |  373|      0|#define gco2u(o)  check_exp((o)->tt == LUA_VUSERDATA, &((cast_u(o))->u))
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  810|      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]
  |  |  ------------------
  ------------------
  811|      0|      break;
  812|      0|    }
  813|  18.4k|    case LUA_VSHRSTR: {
  ------------------
  |  |  373|  18.4k|#define LUA_VSHRSTR	makevariant(LUA_TSTRING, 0)  /* short strings */
  |  |  ------------------
  |  |  |  |   42|  18.4k|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (813:5): [True: 18.4k, False: 754]
  ------------------
  814|  18.4k|      TString *ts = gco2ts(o);
  ------------------
  |  |  372|  18.4k|	check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts))
  |  |  ------------------
  |  |  |  |  113|  18.4k|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  18.4k|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  815|      0|      luaS_remove(L, ts);  /* remove it from hash table */
  816|  18.4k|      luaM_freemem(L, ts, sizestrshr(ts->shrlen));
  ------------------
  |  |   55|  18.4k|#define luaM_freemem(L, b, s)	luaM_free_(L, (b), (s))
  ------------------
  817|  18.4k|      break;
  818|  18.4k|    }
  819|      0|    case LUA_VLNGSTR: {
  ------------------
  |  |  374|      0|#define LUA_VLNGSTR	makevariant(LUA_TSTRING, 1)  /* long strings */
  |  |  ------------------
  |  |  |  |   42|      0|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  |  Branch (819:5): [True: 0, False: 19.2k]
  ------------------
  820|      0|      TString *ts = gco2ts(o);
  ------------------
  |  |  372|      0|	check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts))
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  821|      0|      if (ts->shrlen == LSTRMEM)  /* must free external string? */
  ------------------
  |  |  399|      0|#define LSTRMEM		-3  /* external long string with deallocation */
  ------------------
  |  Branch (821:11): [True: 0, False: 0]
  ------------------
  822|      0|        (*ts->falloc)(ts->ud, ts->contents, ts->u.lnglen + 1, 0);
  823|      0|      luaM_freemem(L, ts, luaS_sizelngstr(ts->u.lnglen, ts->shrlen));
  ------------------
  |  |   55|      0|#define luaM_freemem(L, b, s)	luaM_free_(L, (b), (s))
  ------------------
  824|      0|      break;
  825|      0|    }
  826|      0|    default: lua_assert(0);
  ------------------
  |  |  109|      0|#define lua_assert(c)           assert(c)
  ------------------
  |  Branch (826:5): [True: 0, False: 19.2k]
  ------------------
  827|  19.2k|  }
  828|  19.2k|}
lgc.c:separatetobefnz:
  970|    377|static void separatetobefnz (global_State *g, int all) {
  971|    377|  GCObject *curr;
  972|    377|  GCObject **p = &g->finobj;
  973|    377|  GCObject **lastnext = findlast(&g->tobefnz);
  974|    377|  while ((curr = *p) != g->finobjold1) {  /* traverse all finalizable objects */
  ------------------
  |  Branch (974:10): [True: 0, False: 377]
  ------------------
  975|      0|    lua_assert(tofinalize(curr));
  ------------------
  |  |  109|      0|#define lua_assert(c)           assert(c)
  ------------------
  976|      0|    if (!(iswhite(curr) || all))  /* not being collected? */
  ------------------
  |  |   90|      0|#define iswhite(x)      testbits((x)->marked, WHITEBITS)
  |  |  ------------------
  |  |  |  |   65|      0|#define testbits(x,m)		((x) & (m))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (976:28): [True: 0, False: 0]
  ------------------
  977|      0|      p = &curr->next;  /* don't bother with it */
  978|      0|    else {
  979|      0|      if (curr == g->finobjsur)  /* removing 'finobjsur'? */
  ------------------
  |  Branch (979:11): [True: 0, False: 0]
  ------------------
  980|      0|        g->finobjsur = curr->next;  /* correct it */
  981|      0|      *p = curr->next;  /* remove 'curr' from 'finobj' list */
  982|      0|      curr->next = *lastnext;  /* link at the end of 'tobefnz' list */
  983|      0|      *lastnext = curr;
  984|      0|      lastnext = &curr->next;
  985|      0|    }
  986|      0|  }
  987|    377|}
lgc.c:findlast:
  956|    377|static GCObject **findlast (GCObject **p) {
  957|    377|  while (*p != NULL)
  ------------------
  |  Branch (957:10): [True: 0, False: 377]
  ------------------
  958|      0|    p = &(*p)->next;
  959|    377|  return p;
  960|    377|}
lgc.c:callallpendingfinalizers:
  946|    377|static void callallpendingfinalizers (lua_State *L) {
  947|    377|  global_State *g = G(L);
  ------------------
  |  |  333|    377|#define G(L)	(L->l_G)
  ------------------
  948|    377|  while (g->tobefnz)
  ------------------
  |  Branch (948:10): [True: 0, False: 377]
  ------------------
  949|      0|    GCTM(L);
  950|    377|}
lgc.c:deletelist:
 1450|    754|static void deletelist (lua_State *L, GCObject *p, GCObject *limit) {
 1451|  19.9k|  while (p != limit) {
  ------------------
  |  Branch (1451:10): [True: 19.2k, False: 754]
  ------------------
 1452|  19.2k|    GCObject *next = p->next;
 1453|  19.2k|    freeobj(L, p);
 1454|  19.2k|    p = next;
 1455|  19.2k|  }
 1456|    754|}

luaX_init:
   70|    377|void luaX_init (lua_State *L) {
   71|    377|  int i;
   72|    377|  TString *e = luaS_newliteral(L, LUA_ENV);  /* create env name */
  ------------------
  |  |   30|    377|#define luaS_newliteral(L, s)	(luaS_newlstr(L, "" s, \
  |  |   31|    377|                                 (sizeof(s)/sizeof(char))-1))
  ------------------
   73|    377|  luaC_fix(L, obj2gco(e));  /* never collect this name */
  ------------------
  |  |  388|    377|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  ------------------
  |  |  |  |  113|    377|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    377|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   74|  8.67k|  for (i=0; i<NUM_RESERVED; i++) {
  ------------------
  |  |   46|  8.67k|#define NUM_RESERVED	(cast_int(TK_WHILE-FIRST_RESERVED + 1))
  |  |  ------------------
  |  |  |  |  144|  8.67k|#define cast_int(i)	cast(int, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|  8.67k|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (74:13): [True: 8.29k, False: 377]
  ------------------
   75|  8.29k|    TString *ts = luaS_new(L, luaX_tokens[i]);
   76|  8.29k|    luaC_fix(L, obj2gco(ts));  /* reserved words are never collected */
  ------------------
  |  |  388|  8.29k|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  ------------------
  |  |  |  |  113|  8.29k|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  8.29k|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   77|  8.29k|    ts->extra = cast_byte(i+1);  /* reserved word */
  ------------------
  |  |  146|  8.29k|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  ------------------
  |  |  |  |  139|  8.29k|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
   78|  8.29k|  }
   79|    377|}

luaM_free_:
  150|  20.3k|void luaM_free_ (lua_State *L, void *block, size_t osize) {
  151|  20.3k|  global_State *g = G(L);
  ------------------
  |  |  333|  20.3k|#define G(L)	(L->l_G)
  ------------------
  152|  20.3k|  lua_assert((osize == 0) == (block == NULL));
  ------------------
  |  |  109|  20.3k|#define lua_assert(c)           assert(c)
  ------------------
  153|  20.3k|  callfrealloc(g, block, osize, 0);
  ------------------
  |  |   47|  20.3k|#define callfrealloc(g,block,os,ns)    ((*g->frealloc)(g->ud, block, os, ns))
  ------------------
  154|  20.3k|  g->totalbytes -= osize;
  155|  20.3k|}
luaM_realloc_:
  176|    377|void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) {
  177|    377|  void *newblock;
  178|    377|  global_State *g = G(L);
  ------------------
  |  |  333|    377|#define G(L)	(L->l_G)
  ------------------
  179|    377|  lua_assert((osize == 0) == (block == NULL));
  ------------------
  |  |  109|    377|#define lua_assert(c)           assert(c)
  ------------------
  180|    377|  newblock = firsttry(g, block, osize, nsize);
  ------------------
  |  |   76|    377|#define firsttry(g,block,os,ns)    callfrealloc(g, block, os, ns)
  |  |  ------------------
  |  |  |  |   47|    377|#define callfrealloc(g,block,os,ns)    ((*g->frealloc)(g->ud, block, os, ns))
  |  |  ------------------
  ------------------
  181|    377|  if (l_unlikely(newblock == NULL && nsize > 0)) {
  ------------------
  |  |  697|    377|#define l_unlikely(x)	luai_unlikely(x)
  |  |  ------------------
  |  |  |  |  685|    377|#define luai_unlikely(x)	(__builtin_expect(((x) != 0), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (685:26): [True: 0, False: 377]
  |  |  |  |  |  Branch (685:46): [True: 0, False: 377]
  |  |  |  |  |  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 'totalbytes' */
  185|      0|  }
  186|    377|  lua_assert((nsize == 0) == (newblock == NULL));
  ------------------
  |  |  109|    377|#define lua_assert(c)           assert(c)
  ------------------
  187|    377|  g->totalbytes += nsize - osize;
  188|    377|  return newblock;
  189|    377|}
luaM_malloc_:
  201|  19.9k|void *luaM_malloc_ (lua_State *L, size_t size, int tag) {
  202|  19.9k|  if (size == 0)
  ------------------
  |  Branch (202:7): [True: 0, False: 19.9k]
  ------------------
  203|      0|    return NULL;  /* that's all */
  204|  19.9k|  else {
  205|  19.9k|    global_State *g = G(L);
  ------------------
  |  |  333|  19.9k|#define G(L)	(L->l_G)
  ------------------
  206|  19.9k|    void *newblock = firsttry(g, NULL, tag, size);
  ------------------
  |  |   76|  19.9k|#define firsttry(g,block,os,ns)    callfrealloc(g, block, os, ns)
  |  |  ------------------
  |  |  |  |   47|  19.9k|#define callfrealloc(g,block,os,ns)    ((*g->frealloc)(g->ud, block, os, ns))
  |  |  ------------------
  ------------------
  207|  19.9k|    if (l_unlikely(newblock == NULL)) {
  ------------------
  |  |  697|  19.9k|#define l_unlikely(x)	luai_unlikely(x)
  |  |  ------------------
  |  |  |  |  685|  19.9k|#define luai_unlikely(x)	(__builtin_expect(((x) != 0), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (685:26): [True: 0, False: 19.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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.9k|    g->totalbytes += size;
  213|  19.9k|    return newblock;
  214|  19.9k|  }
  215|  19.9k|}

luaO_ceillog2:
   35|  2.26k|int luaO_ceillog2 (unsigned int x) {
   36|  2.26k|  static const lu_byte log_2[256] = {  /* log_2[i - 1] = ceil(log2(i)) */
   37|  2.26k|    0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
   38|  2.26k|    6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
   39|  2.26k|    7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
   40|  2.26k|    7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
   41|  2.26k|    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
   42|  2.26k|    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
   43|  2.26k|    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
   44|  2.26k|    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
   45|  2.26k|  };
   46|  2.26k|  int l = 0;
   47|  2.26k|  x--;
   48|  3.39k|  while (x >= 256) { l += 8; x >>= 8; }
  ------------------
  |  Branch (48:10): [True: 1.13k, False: 2.26k]
  ------------------
   49|  2.26k|  return l + log_2[x];
   50|  2.26k|}
luaO_codeparam:
   60|  2.26k|unsigned int luaO_codeparam (unsigned int p) {
   61|  2.26k|  if (p >= (cast(lu_mem, 0x1F) << (0xF - 7 - 1)) * 100u)  /* overflow? */
  ------------------
  |  |  139|  2.26k|#define cast(t, exp)	((t)(exp))
  ------------------
  |  Branch (61:7): [True: 0, False: 2.26k]
  ------------------
   62|      0|    return 0xFF;  /* return maximum value */
   63|  2.26k|  else {
   64|  2.26k|    p = (cast(l_uint32, p) * 128 + 99) / 100;  /* round up the division */
  ------------------
  |  |  139|  2.26k|#define cast(t, exp)	((t)(exp))
  ------------------
   65|  2.26k|    if (p < 0x10)  /* subnormal number? */
  ------------------
  |  Branch (65:9): [True: 0, False: 2.26k]
  ------------------
   66|      0|      return p;  /* exponent bits are already zero; nothing else to do */
   67|  2.26k|    else {
   68|  2.26k|      int log = luaO_ceillog2(p + 1) - 5;  /* preserve 5 bits */
   69|  2.26k|      return ((p >> log) - 0x10) | ((log + 1) << 4);
   70|  2.26k|    }
   71|  2.26k|  }
   72|  2.26k|}
luaO_hexavalue:
  192|  1.49k|int luaO_hexavalue (int c) {
  193|  1.49k|  if (lisdigit(c)) return c - '0';
  ------------------
  |  |   59|  1.49k|#define lisdigit(c)	testprop(c, MASK(DIGITBIT))
  |  |  ------------------
  |  |  |  |   52|  1.49k|#define testprop(c,p)	(luai_ctype_[(c)+1] & (p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:23): [True: 403, False: 1.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  194|  1.09k|  else return (ltolower(c) - 'a') + 10;
  ------------------
  |  |   72|  1.09k|  check_exp(('A' <= (c) && (c) <= 'Z') || (c) == ((c) | ('A' ^ 'a')),  \
  |  |  ------------------
  |  |  |  |  113|  1.09k|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.09k|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|  1.09k|            (c) | ('A' ^ 'a'))
  ------------------
  195|  1.49k|}
luaO_str2num:
  365|    377|size_t luaO_str2num (const char *s, TValue *o) {
  366|    377|  lua_Integer i; lua_Number n;
  367|    377|  const char *e;
  368|    377|  if ((e = l_str2int(s, &i)) != NULL) {  /* try as an integer */
  ------------------
  |  Branch (368:7): [True: 183, False: 194]
  ------------------
  369|    183|    setivalue(o, i);
  ------------------
  |  |  358|    183|  { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_VNUMINT); }
  |  |  ------------------
  |  |  |  |   72|    183|#define val_(o)		((o)->value_)
  |  |  ------------------
  |  |                 { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_VNUMINT); }
  |  |  ------------------
  |  |  |  |  114|    183|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  370|    183|  }
  371|    194|  else if ((e = l_str2d(s, &n)) != NULL) {  /* else try as a float */
  ------------------
  |  Branch (371:12): [True: 84, False: 110]
  ------------------
  372|     84|    setfltvalue(o, n);
  ------------------
  |  |  352|     84|  { TValue *io=(obj); val_(io).n=(x); settt_(io, LUA_VNUMFLT); }
  |  |  ------------------
  |  |  |  |   72|     84|#define val_(o)		((o)->value_)
  |  |  ------------------
  |  |                 { TValue *io=(obj); val_(io).n=(x); settt_(io, LUA_VNUMFLT); }
  |  |  ------------------
  |  |  |  |  114|     84|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  373|     84|  }
  374|    110|  else
  375|    110|    return 0;  /* conversion failed */
  376|    267|  return (e - s) + 1;  /* success; return string size */
  377|    377|}
lobject.c:l_str2int:
  333|    377|static const char *l_str2int (const char *s, lua_Integer *result) {
  334|    377|  lua_Unsigned a = 0;
  335|    377|  int empty = 1;
  336|    377|  int neg;
  337|    377|  while (lisspace(cast_uchar(*s))) s++;  /* skip initial spaces */
  338|    377|  neg = isneg(&s);
  339|    377|  if (s[0] == '0' &&
  ------------------
  |  Branch (339:7): [True: 85, False: 292]
  ------------------
  340|    377|      (s[1] == 'x' || s[1] == 'X')) {  /* hex? */
  ------------------
  |  Branch (340:8): [True: 17, False: 68]
  |  Branch (340:23): [True: 24, False: 44]
  ------------------
  341|     41|    s += 2;  /* skip '0x' */
  342|  1.49k|    for (; lisxdigit(cast_uchar(*s)); s++) {
  343|  1.49k|      a = a * 16 + luaO_hexavalue(*s);
  344|  1.49k|      empty = 0;
  345|  1.49k|    }
  346|     41|  }
  347|    336|  else {  /* decimal */
  348|  4.18k|    for (; lisdigit(cast_uchar(*s)); s++) {
  349|  4.18k|      int d = *s - '0';
  350|  4.18k|      if (a >= MAXBY10 && (a > MAXBY10 || d > MAXLASTD + neg))  /* overflow? */
  ------------------
  |  |  330|  4.18k|#define MAXBY10		cast(lua_Unsigned, LUA_MAXINTEGER / 10)
  |  |  ------------------
  |  |  |  |  139|  8.36k|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
                    if (a >= MAXBY10 && (a > MAXBY10 || d > MAXLASTD + neg))  /* overflow? */
  ------------------
  |  |  330|     97|#define MAXBY10		cast(lua_Unsigned, LUA_MAXINTEGER / 10)
  |  |  ------------------
  |  |  |  |  139|    194|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
                    if (a >= MAXBY10 && (a > MAXBY10 || d > MAXLASTD + neg))  /* overflow? */
  ------------------
  |  |  331|      6|#define MAXLASTD	cast_int(LUA_MAXINTEGER % 10)
  |  |  ------------------
  |  |  |  |  144|      6|#define cast_int(i)	cast(int, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|      6|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (350:11): [True: 97, False: 4.08k]
  |  Branch (350:28): [True: 91, False: 6]
  |  Branch (350:43): [True: 2, False: 4]
  ------------------
  351|     93|        return NULL;  /* do not accept it (as integer) */
  352|  4.08k|      a = a * 10 + d;
  353|  4.08k|      empty = 0;
  354|  4.08k|    }
  355|    336|  }
  356|    542|  while (lisspace(cast_uchar(*s))) s++;  /* skip trailing spaces */
  357|    284|  if (empty || *s != '\0') return NULL;  /* something wrong in the numeral */
  ------------------
  |  Branch (357:7): [True: 52, False: 232]
  |  Branch (357:16): [True: 49, False: 183]
  ------------------
  358|    183|  else {
  359|    183|    *result = l_castU2S((neg) ? 0u - a : a);
  ------------------
  |  |  164|    366|#define l_castU2S(i)	((lua_Integer)(i))
  |  |  ------------------
  |  |  |  Branch (164:37): [True: 1, False: 182]
  |  |  ------------------
  ------------------
  360|    183|    return s;
  361|    183|  }
  362|    284|}
lobject.c:isneg:
  198|    377|static int isneg (const char **s) {
  199|    377|  if (**s == '-') { (*s)++; return 1; }
  ------------------
  |  Branch (199:7): [True: 19, False: 358]
  ------------------
  200|    358|  else if (**s == '+') (*s)++;
  ------------------
  |  Branch (200:12): [True: 1, False: 357]
  ------------------
  201|    358|  return 0;
  202|    377|}
lobject.c:l_str2d:
  308|    194|static const char *l_str2d (const char *s, lua_Number *result) {
  309|    194|  const char *endptr;
  310|    194|  const char *pmode = strpbrk(s, ".xXnN");  /* look for special chars */
  311|    194|  int mode = pmode ? ltolower(cast_uchar(*pmode)) : 0;
  ------------------
  |  |   72|     51|  check_exp(('A' <= (c) && (c) <= 'Z') || (c) == ((c) | ('A' ^ 'a')),  \
  |  |  ------------------
  |  |  |  |  113|     51|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|     51|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   73|    194|            (c) | ('A' ^ 'a'))
  ------------------
  |  Branch (311:14): [True: 51, False: 143]
  ------------------
  312|    194|  if (mode == 'n')  /* reject 'inf' and 'nan' */
  ------------------
  |  Branch (312:7): [True: 2, False: 192]
  ------------------
  313|      2|    return NULL;
  314|    192|  endptr = l_str2dloc(s, result, mode);  /* try to convert */
  315|    192|  if (endptr == NULL) {  /* failed? may be a different locale */
  ------------------
  |  Branch (315:7): [True: 108, False: 84]
  ------------------
  316|    108|    char buff[L_MAXLENNUM + 1];
  317|    108|    const char *pdot = strchr(s, '.');
  318|    108|    if (pdot == NULL || strlen(s) > L_MAXLENNUM)
  ------------------
  |  |  277|     43|#define L_MAXLENNUM	200
  ------------------
  |  Branch (318:9): [True: 65, False: 43]
  |  Branch (318:25): [True: 13, False: 30]
  ------------------
  319|     78|      return NULL;  /* string too long or no dot; fail */
  320|     30|    strcpy(buff, s);  /* copy string to buffer */
  321|     30|    buff[pdot - s] = lua_getlocaledecpoint();  /* correct decimal point */
  ------------------
  |  |  671|     30|#define lua_getlocaledecpoint()		(localeconv()->decimal_point[0])
  ------------------
  322|     30|    endptr = l_str2dloc(buff, result, mode);  /* try again */
  323|     30|    if (endptr != NULL)
  ------------------
  |  Branch (323:9): [True: 0, False: 30]
  ------------------
  324|      0|      endptr = s + (endptr - buff);  /* make relative to 's' */
  325|     30|  }
  326|    114|  return endptr;
  327|    192|}
lobject.c:l_str2dloc:
  285|    222|static const char *l_str2dloc (const char *s, lua_Number *result, int mode) {
  286|    222|  char *endptr;
  287|       |  *result = (mode == 'x') ? lua_strx2number(s, &endptr)  /* try to convert */
  ------------------
  |  |  610|     12|#define lua_strx2number(s,p)		lua_str2number(s,p)
  |  |  ------------------
  |  |  |  |  484|     12|#define lua_str2number(s,p)	strtod((s), (p))
  |  |  ------------------
  ------------------
  |  Branch (287:13): [True: 12, False: 210]
  ------------------
  288|    222|                          : lua_str2number(s, &endptr);
  ------------------
  |  |  484|    432|#define lua_str2number(s,p)	strtod((s), (p))
  ------------------
  289|    222|  if (endptr == s) return NULL;  /* nothing recognized? */
  ------------------
  |  Branch (289:7): [True: 50, False: 172]
  ------------------
  290|    549|  while (lisspace(cast_uchar(*endptr))) endptr++;  /* skip trailing spaces */
  291|    172|  return (*endptr == '\0') ? endptr : NULL;  /* OK iff no trailing chars */
  ------------------
  |  Branch (291:10): [True: 84, False: 88]
  ------------------
  292|    222|}

lua_newstate:
  323|    377|LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud, unsigned seed) {
  324|    377|  int i;
  325|    377|  lua_State *L;
  326|    377|  global_State *g;
  327|    377|  LG *l = cast(LG *, (*f)(ud, NULL, LUA_TTHREAD, sizeof(LG)));
  ------------------
  |  |  139|    377|#define cast(t, exp)	((t)(exp))
  ------------------
  328|    377|  if (l == NULL) return NULL;
  ------------------
  |  Branch (328:7): [True: 0, False: 377]
  ------------------
  329|    377|  L = &l->l.l;
  330|    377|  g = &l->g;
  331|    377|  L->tt = LUA_VTHREAD;
  ------------------
  |  |  275|    377|#define LUA_VTHREAD		makevariant(LUA_TTHREAD, 0)
  |  |  ------------------
  |  |  |  |   42|    377|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  332|    377|  g->currentwhite = bitmask(WHITE0BIT);
  ------------------
  |  |   66|    377|#define bitmask(b)		(1<<(b))
  ------------------
  333|    377|  L->marked = luaC_white(g);
  ------------------
  |  |  105|    377|#define luaC_white(g)	cast_byte((g)->currentwhite & WHITEBITS)
  |  |  ------------------
  |  |  |  |  146|    377|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|    377|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  334|    377|  preinit_thread(L, g);
  335|    377|  g->allgc = obj2gco(L);  /* by now, only object is the main thread */
  ------------------
  |  |  388|    377|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  ------------------
  |  |  |  |  113|    377|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    377|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  336|      0|  L->next = NULL;
  337|    377|  incnny(L);  /* main thread is always non yieldable */
  ------------------
  |  |  111|    377|#define incnny(L)	((L)->nCcalls += 0x10000)
  ------------------
  338|    377|  g->frealloc = f;
  339|    377|  g->ud = ud;
  340|    377|  g->warnf = NULL;
  341|    377|  g->ud_warn = NULL;
  342|    377|  g->mainthread = L;
  343|    377|  g->seed = seed;
  344|    377|  g->gcstp = GCSTPGC;  /* no GC while building state */
  ------------------
  |  |  203|    377|#define GCSTPGC		2  /* bit true when GC stopped by itself */
  ------------------
  345|    377|  g->strt.size = g->strt.nuse = 0;
  346|    377|  g->strt.hash = NULL;
  347|    377|  setnilvalue(&g->l_registry);
  ------------------
  |  |  211|    377|#define setnilvalue(obj) settt_(obj, LUA_VNIL)
  |  |  ------------------
  |  |  |  |  114|    377|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  348|    377|  g->panic = NULL;
  349|    377|  g->gcstate = GCSpause;
  ------------------
  |  |   42|    377|#define GCSpause	8
  ------------------
  350|    377|  g->gckind = KGC_INC;
  ------------------
  |  |  151|    377|#define KGC_INC		0	/* incremental gc */
  ------------------
  351|    377|  g->gcstopem = 0;
  352|    377|  g->gcemergency = 0;
  353|    377|  g->finobj = g->tobefnz = g->fixedgc = NULL;
  354|    377|  g->firstold1 = g->survival = g->old1 = g->reallyold = NULL;
  355|    377|  g->finobjsur = g->finobjold1 = g->finobjrold = NULL;
  356|    377|  g->sweepgc = NULL;
  357|    377|  g->gray = g->grayagain = NULL;
  358|    377|  g->weak = g->ephemeron = g->allweak = NULL;
  359|    377|  g->twups = NULL;
  360|    377|  g->totalbytes = sizeof(LG);
  361|    377|  g->totalobjs = 1;
  362|    377|  g->marked = 0;
  363|    377|  g->GCdebt = 0;
  364|    377|  setivalue(&g->nilvalue, 0);  /* to signal that state is not yet built */
  ------------------
  |  |  358|    377|  { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_VNUMINT); }
  |  |  ------------------
  |  |  |  |   72|    377|#define val_(o)		((o)->value_)
  |  |  ------------------
  |  |                 { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_VNUMINT); }
  |  |  ------------------
  |  |  |  |  114|    377|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  365|    377|  setgcparam(g, PAUSE, LUAI_GCPAUSE);
  ------------------
  |  |  196|    377|#define setgcparam(g,p,v)  (g->gcparams[LUA_GCP##p] = luaO_codeparam(v))
  ------------------
  366|    377|  setgcparam(g, STEPMUL, LUAI_GCMUL);
  ------------------
  |  |  196|    377|#define setgcparam(g,p,v)  (g->gcparams[LUA_GCP##p] = luaO_codeparam(v))
  ------------------
  367|    377|  setgcparam(g, STEPSIZE, LUAI_GCSTEPSIZE);
  ------------------
  |  |  196|    377|#define setgcparam(g,p,v)  (g->gcparams[LUA_GCP##p] = luaO_codeparam(v))
  ------------------
  368|    377|  setgcparam(g, MINORMUL, LUAI_GENMINORMUL);
  ------------------
  |  |  196|    377|#define setgcparam(g,p,v)  (g->gcparams[LUA_GCP##p] = luaO_codeparam(v))
  ------------------
  369|    377|  setgcparam(g, MINORMAJOR, LUAI_MINORMAJOR);
  ------------------
  |  |  196|    377|#define setgcparam(g,p,v)  (g->gcparams[LUA_GCP##p] = luaO_codeparam(v))
  ------------------
  370|    377|  setgcparam(g, MAJORMINOR, LUAI_MAJORMINOR);
  ------------------
  |  |  196|    377|#define setgcparam(g,p,v)  (g->gcparams[LUA_GCP##p] = luaO_codeparam(v))
  ------------------
  371|  3.77k|  for (i=0; i < LUA_NUMTYPES; i++) g->mt[i] = NULL;
  ------------------
  |  |   74|  3.77k|#define LUA_NUMTYPES		9
  ------------------
  |  Branch (371:13): [True: 3.39k, False: 377]
  ------------------
  372|    377|  if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) {
  ------------------
  |  |   48|    377|#define LUA_OK		0
  ------------------
  |  Branch (372:7): [True: 0, False: 377]
  ------------------
  373|       |    /* memory allocation error: free partial state */
  374|      0|    close_state(L);
  375|      0|    L = NULL;
  376|      0|  }
  377|    377|  return L;
  378|    377|}
lua_close:
  381|    377|LUA_API void lua_close (lua_State *L) {
  382|    377|  lua_lock(L);
  ------------------
  |  |  267|    377|#define lua_lock(L)	((void) 0)
  ------------------
  383|    377|  L = G(L)->mainthread;  /* only the main thread can be closed */
  ------------------
  |  |  333|    377|#define G(L)	(L->l_G)
  ------------------
  384|    377|  close_state(L);
  385|    377|}
lstate.c:preinit_thread:
  219|    377|static void preinit_thread (lua_State *L, global_State *g) {
  220|    377|  G(L) = g;
  ------------------
  |  |  333|    377|#define G(L)	(L->l_G)
  ------------------
  221|    377|  L->stack.p = NULL;
  222|    377|  L->ci = NULL;
  223|    377|  L->nci = 0;
  224|    377|  L->twups = L;  /* thread has no upvalues */
  225|    377|  L->nCcalls = 0;
  226|    377|  L->errorJmp = NULL;
  227|    377|  L->hook = NULL;
  228|    377|  L->hookmask = 0;
  229|    377|  L->basehookcount = 0;
  230|    377|  L->allowhook = 1;
  231|    377|  resethookcount(L);
  ------------------
  |  |   21|    377|#define resethookcount(L)	(L->hookcount = L->basehookcount)
  ------------------
  232|    377|  L->openupval = NULL;
  233|    377|  L->status = LUA_OK;
  ------------------
  |  |   48|    377|#define LUA_OK		0
  ------------------
  234|    377|  L->errfunc = 0;
  235|    377|  L->oldpc = 0;
  236|    377|}
lstate.c:stack_init:
  144|    377|static void stack_init (lua_State *L1, lua_State *L) {
  145|    377|  int i; CallInfo *ci;
  146|       |  /* initialize stack array */
  147|    377|  L1->stack.p = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, StackValue);
  ------------------
  |  |   60|    377|#define luaM_newvector(L,n,t)	cast(t*, luaM_malloc_(L, (n)*sizeof(t), 0))
  |  |  ------------------
  |  |  |  |  139|    377|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  148|    377|  L1->tbclist.p = L1->stack.p;
  149|  17.3k|  for (i = 0; i < BASIC_STACK_SIZE + EXTRA_STACK; i++)
  ------------------
  |  |  145|  17.3k|#define BASIC_STACK_SIZE        (2*LUA_MINSTACK)
  |  |  ------------------
  |  |  |  |   79|  17.3k|#define LUA_MINSTACK	20
  |  |  ------------------
  ------------------
                for (i = 0; i < BASIC_STACK_SIZE + EXTRA_STACK; i++)
  ------------------
  |  |  142|  17.3k|#define EXTRA_STACK   5
  ------------------
  |  Branch (149:15): [True: 16.9k, False: 377]
  ------------------
  150|  16.9k|    setnilvalue(s2v(L1->stack.p + i));  /* erase new stack */
  ------------------
  |  |  211|  16.9k|#define setnilvalue(obj) settt_(obj, LUA_VNIL)
  |  |  ------------------
  |  |  |  |  114|  16.9k|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  151|    377|  L1->top.p = L1->stack.p;
  152|    377|  L1->stack_last.p = L1->stack.p + BASIC_STACK_SIZE;
  ------------------
  |  |  145|    377|#define BASIC_STACK_SIZE        (2*LUA_MINSTACK)
  |  |  ------------------
  |  |  |  |   79|    377|#define LUA_MINSTACK	20
  |  |  ------------------
  ------------------
  153|       |  /* initialize first ci */
  154|    377|  ci = &L1->base_ci;
  155|    377|  ci->next = ci->previous = NULL;
  156|    377|  ci->callstatus = CIST_C;
  ------------------
  |  |  212|    377|#define CIST_C		(1<<1)	/* call is running a C function */
  ------------------
  157|    377|  ci->func.p = L1->top.p;
  158|    377|  ci->u.c.k = NULL;
  159|    377|  ci->nresults = 0;
  160|    377|  setnilvalue(s2v(L1->top.p));  /* 'function' entry for this 'ci' */
  ------------------
  |  |  211|    377|#define setnilvalue(obj) settt_(obj, LUA_VNIL)
  |  |  ------------------
  |  |  |  |  114|    377|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  161|    377|  L1->top.p++;
  162|    377|  ci->top.p = L1->top.p + LUA_MINSTACK;
  ------------------
  |  |   79|    377|#define LUA_MINSTACK	20
  ------------------
  163|    377|  L1->ci = ci;
  164|    377|}
lstate.c:freestack:
  167|    377|static void freestack (lua_State *L) {
  168|    377|  if (L->stack.p == NULL)
  ------------------
  |  Branch (168:7): [True: 0, False: 377]
  ------------------
  169|      0|    return;  /* stack not completely built yet */
  170|    377|  L->ci = &L->base_ci;  /* free the entire 'ci' list */
  171|    377|  freeCI(L);
  172|    377|  lua_assert(L->nci == 0);
  ------------------
  |  |  109|    377|#define lua_assert(c)           assert(c)
  ------------------
  173|    377|  luaM_freearray(L, L->stack.p, stacksize(L) + EXTRA_STACK);  /* free stack */
  ------------------
  |  |   57|    377|#define luaM_freearray(L, b, n)   luaM_free_(L, (b), (n)*sizeof(*(b)))
  ------------------
  174|    377|}
lstate.c:freeCI:
   86|    377|static void freeCI (lua_State *L) {
   87|    377|  CallInfo *ci = L->ci;
   88|    377|  CallInfo *next = ci->next;
   89|    377|  ci->next = NULL;
   90|    377|  while ((ci = next) != NULL) {
  ------------------
  |  Branch (90:10): [True: 0, False: 377]
  ------------------
   91|      0|    next = ci->next;
   92|      0|    luaM_free(L, ci);
  ------------------
  |  |   56|      0|#define luaM_free(L, b)		luaM_free_(L, (b), sizeof(*(b)))
  ------------------
   93|      0|    L->nci--;
   94|      0|  }
   95|    377|}
lstate.c:f_luaopen:
  201|    377|static void f_luaopen (lua_State *L, void *ud) {
  202|    377|  global_State *g = G(L);
  ------------------
  |  |  333|    377|#define G(L)	(L->l_G)
  ------------------
  203|    377|  UNUSED(ud);
  ------------------
  |  |  134|    377|#define UNUSED(x)	((void)(x))
  ------------------
  204|    377|  stack_init(L, L);  /* init stack */
  205|    377|  init_registry(L, g);
  206|    377|  luaS_init(L);
  207|    377|  luaT_init(L);
  208|    377|  luaX_init(L);
  209|    377|  g->gcstp = 0;  /* allow gc */
  210|    377|  setnilvalue(&g->nilvalue);  /* now state is complete */
  ------------------
  |  |  211|    377|#define setnilvalue(obj) settt_(obj, LUA_VNIL)
  |  |  ------------------
  |  |  |  |  114|    377|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  211|    377|  luai_userstateopen(L);
  ------------------
  |  |  285|    377|#define luai_userstateopen(L)		((void)L)
  ------------------
  212|    377|}
lstate.c:init_registry:
  180|    377|static void init_registry (lua_State *L, global_State *g) {
  181|       |  /* create registry */
  182|    377|  TValue aux;
  183|    377|  Table *registry = luaH_new(L);
  184|    377|  sethvalue(L, &g->l_registry, registry);
  ------------------
  |  |  724|    377|  { TValue *io = (obj); Table *x_ = (x); \
  |  |  725|    377|    val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTABLE)); \
  |  |  ------------------
  |  |  |  |   72|    377|#define val_(o)		((o)->value_)
  |  |  ------------------
  |  |                   val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTABLE)); \
  |  |  ------------------
  |  |  |  |  388|    377|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|    377|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|    377|#define lua_assert(c)           assert(c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTABLE)); \
  |  |  ------------------
  |  |  |  |  114|    377|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  |  |  726|    377|    checkliveness(L,io); }
  |  |  ------------------
  |  |  |  |  107|    377|	((void)L, lua_longassert(!iscollectable(obj) || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|  6.03k|#define lua_longassert(c)	((c) ? (void)0 : lua_assert(0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|    377|#define lua_assert(c)           assert(c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 377]
  |  |  |  |  |  |  |  Branch (115:29): [True: 377, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 377]
  |  |  |  |  |  |  |  Branch (115:29): [True: 377, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 377]
  |  |  |  |  |  |  |  Branch (115:29): [True: 377, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 377, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 377]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  108|    377|		(righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj))))))
  |  |  ------------------
  ------------------
  185|    377|  luaH_resize(L, registry, LUA_RIDX_LAST, 0);
  ------------------
  |  |   86|    377|#define LUA_RIDX_LAST		3
  ------------------
  186|       |  /* registry[1] = false */
  187|    377|  setbfvalue(&aux);
  ------------------
  |  |  263|    377|#define setbfvalue(obj)		settt_(obj, LUA_VFALSE)
  |  |  ------------------
  |  |  |  |  114|    377|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  188|    377|  luaH_setint(L, registry, 1, &aux);
  189|       |  /* registry[LUA_RIDX_MAINTHREAD] = L */
  190|    377|  setthvalue(L, &aux, L);
  ------------------
  |  |  282|    377|  { TValue *io = (obj); lua_State *x_ = (x); \
  |  |  283|    377|    val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTHREAD)); \
  |  |  ------------------
  |  |  |  |   72|    377|#define val_(o)		((o)->value_)
  |  |  ------------------
  |  |                   val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTHREAD)); \
  |  |  ------------------
  |  |  |  |  388|    377|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|    377|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|    377|#define lua_assert(c)           assert(c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTHREAD)); \
  |  |  ------------------
  |  |  |  |  114|    377|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  |  |  284|    377|    checkliveness(L,io); }
  |  |  ------------------
  |  |  |  |  107|    377|	((void)L, lua_longassert(!iscollectable(obj) || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|  6.03k|#define lua_longassert(c)	((c) ? (void)0 : lua_assert(0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|    377|#define lua_assert(c)           assert(c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 377]
  |  |  |  |  |  |  |  Branch (115:29): [True: 377, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 377]
  |  |  |  |  |  |  |  Branch (115:29): [True: 377, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 377]
  |  |  |  |  |  |  |  Branch (115:29): [True: 377, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 377, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 377]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  108|    377|		(righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj))))))
  |  |  ------------------
  ------------------
  191|    377|  luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &aux);
  ------------------
  |  |   85|    377|#define LUA_RIDX_MAINTHREAD	3
  ------------------
  192|       |  /* registry[LUA_RIDX_GLOBALS] = new table (table of globals) */
  193|    377|  sethvalue(L, &aux, luaH_new(L));
  ------------------
  |  |  724|    377|  { TValue *io = (obj); Table *x_ = (x); \
  |  |  725|    377|    val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTABLE)); \
  |  |  ------------------
  |  |  |  |   72|    377|#define val_(o)		((o)->value_)
  |  |  ------------------
  |  |                   val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTABLE)); \
  |  |  ------------------
  |  |  |  |  388|    377|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|    377|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|    377|#define lua_assert(c)           assert(c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_VTABLE)); \
  |  |  ------------------
  |  |  |  |  114|    377|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  |  |  726|    377|    checkliveness(L,io); }
  |  |  ------------------
  |  |  |  |  107|    377|	((void)L, lua_longassert(!iscollectable(obj) || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|  6.03k|#define lua_longassert(c)	((c) ? (void)0 : lua_assert(0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|    377|#define lua_assert(c)           assert(c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 377]
  |  |  |  |  |  |  |  Branch (115:29): [True: 377, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 377]
  |  |  |  |  |  |  |  Branch (115:29): [True: 377, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 377]
  |  |  |  |  |  |  |  Branch (115:29): [True: 377, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 377, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 377]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  108|    377|		(righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj))))))
  |  |  ------------------
  ------------------
  194|    377|  luaH_setint(L, registry, LUA_RIDX_GLOBALS, &aux);
  ------------------
  |  |   84|    377|#define LUA_RIDX_GLOBALS	2
  ------------------
  195|    377|}
lstate.c:close_state:
  239|    377|static void close_state (lua_State *L) {
  240|    377|  global_State *g = G(L);
  ------------------
  |  |  333|    377|#define G(L)	(L->l_G)
  ------------------
  241|    377|  if (!completestate(g))  /* closing a partially built state? */
  ------------------
  |  |  339|    377|#define completestate(g)	ttisnil(&g->nilvalue)
  |  |  ------------------
  |  |  |  |  196|    377|#define ttisnil(v)		checktype((v), LUA_TNIL)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|    377|#define checktype(o,t)		(ttype(o) == (t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|    377|#define ttype(o)	(novariant(rawtt(o)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   80|    377|#define novariant(t)	((t) & 0x0F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (241:7): [True: 0, False: 377]
  ------------------
  242|      0|    luaC_freeallobjects(L);  /* just collect its objects */
  243|    377|  else {  /* closing a fully built state */
  244|    377|    L->ci = &L->base_ci;  /* unwind CallInfo list */
  245|    377|    luaD_closeprotected(L, 1, LUA_OK);  /* close all upvalues */
  ------------------
  |  |   48|    377|#define LUA_OK		0
  ------------------
  246|    377|    luaC_freeallobjects(L);  /* collect all objects */
  247|    377|    luai_userstateclose(L);
  ------------------
  |  |  289|    377|#define luai_userstateclose(L)		((void)L)
  ------------------
  248|    377|  }
  249|    377|  luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size);
  ------------------
  |  |   57|    377|#define luaM_freearray(L, b, n)   luaM_free_(L, (b), (n)*sizeof(*(b)))
  ------------------
  250|    377|  freestack(L);
  251|    377|  lua_assert(g->totalbytes == sizeof(LG));
  ------------------
  |  |  109|    377|#define lua_assert(c)           assert(c)
  ------------------
  252|    377|  lua_assert(gettotalobjs(g) == 1);
  ------------------
  |  |  109|    377|#define lua_assert(c)           assert(c)
  ------------------
  253|    377|  (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0);  /* free main block */
  ------------------
  |  |   51|    377|#define fromstate(L)	(cast(LX *, cast(lu_byte *, (L)) - offsetof(LX, l)))
  |  |  ------------------
  |  |  |  |  139|    377|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  254|    377|}

luaS_hash:
   43|  18.4k|unsigned luaS_hash (const char *str, size_t l, unsigned seed) {
   44|  18.4k|  unsigned int h = seed ^ cast_uint(l);
  ------------------
  |  |  145|  18.4k|#define cast_uint(i)	cast(unsigned int, (i))
  |  |  ------------------
  |  |  |  |  139|  18.4k|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
   45|   112k|  for (; l > 0; l--)
  ------------------
  |  Branch (45:10): [True: 94.2k, False: 18.4k]
  ------------------
   46|  94.2k|    h ^= ((h<<5) + (h>>2) + cast_byte(str[l - 1]));
  ------------------
  |  |  146|  94.2k|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  ------------------
  |  |  |  |  139|  94.2k|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
   47|  18.4k|  return h;
   48|  18.4k|}
luaS_init:
  123|    377|void luaS_init (lua_State *L) {
  124|    377|  global_State *g = G(L);
  ------------------
  |  |  333|    377|#define G(L)	(L->l_G)
  ------------------
  125|    377|  int i, j;
  126|    377|  stringtable *tb = &G(L)->strt;
  ------------------
  |  |  333|    377|#define G(L)	(L->l_G)
  ------------------
  127|    377|  tb->hash = luaM_newvector(L, MINSTRTABSIZE, TString*);
  ------------------
  |  |   60|    377|#define luaM_newvector(L,n,t)	cast(t*, luaM_malloc_(L, (n)*sizeof(t), 0))
  |  |  ------------------
  |  |  |  |  139|    377|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  128|    377|  tablerehash(tb->hash, 0, MINSTRTABSIZE);  /* clear array */
  ------------------
  |  |  230|    377|#define MINSTRTABSIZE	128
  ------------------
  129|    377|  tb->size = MINSTRTABSIZE;
  ------------------
  |  |  230|    377|#define MINSTRTABSIZE	128
  ------------------
  130|       |  /* pre-create memory-error message */
  131|    377|  g->memerrmsg = luaS_newliteral(L, MEMERRMSG);
  ------------------
  |  |   30|    377|#define luaS_newliteral(L, s)	(luaS_newlstr(L, "" s, \
  |  |   31|    377|                                 (sizeof(s)/sizeof(char))-1))
  ------------------
  132|    377|  luaC_fix(L, obj2gco(g->memerrmsg));  /* it should never be collected */
  ------------------
  |  |  388|    377|#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
  |  |  ------------------
  |  |  |  |  113|    377|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    377|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  133|  20.3k|  for (i = 0; i < STRCACHE_N; i++)  /* fill cache with valid strings */
  ------------------
  |  |  240|  20.3k|#define STRCACHE_N		53
  ------------------
  |  Branch (133:15): [True: 19.9k, False: 377]
  ------------------
  134|  59.9k|    for (j = 0; j < STRCACHE_M; j++)
  ------------------
  |  |  241|  59.9k|#define STRCACHE_M		2
  ------------------
  |  Branch (134:17): [True: 39.9k, False: 19.9k]
  ------------------
  135|  39.9k|      g->strcache[i][j] = g->memerrmsg;
  136|    377|}
luaS_remove:
  180|  18.4k|void luaS_remove (lua_State *L, TString *ts) {
  181|  18.4k|  stringtable *tb = &G(L)->strt;
  ------------------
  |  |  333|  18.4k|#define G(L)	(L->l_G)
  ------------------
  182|  18.4k|  TString **p = &tb->hash[lmod(ts->hash, tb->size)];
  ------------------
  |  |  825|  18.4k|	(check_exp((size&(size-1))==0, (cast_int((s) & ((size)-1)))))
  |  |  ------------------
  |  |  |  |  113|  18.4k|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  18.4k|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  183|  18.4k|  while (*p != ts)  /* find previous element */
  ------------------
  |  Branch (183:10): [True: 0, False: 18.4k]
  ------------------
  184|      0|    p = &(*p)->u.hnext;
  185|  18.4k|  *p = (*p)->u.hnext;  /* remove element from its list */
  186|  18.4k|  tb->nuse--;
  187|  18.4k|}
luaS_newlstr:
  239|  18.4k|TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
  240|  18.4k|  if (l <= LUAI_MAXSHORTLEN)  /* short string? */
  ------------------
  |  |  219|  18.4k|#define LUAI_MAXSHORTLEN	40
  ------------------
  |  Branch (240:7): [True: 18.4k, False: 0]
  ------------------
  241|  18.4k|    return internshrstr(L, str, l);
  242|      0|  else {
  243|      0|    TString *ts;
  244|      0|    if (l_unlikely(l * sizeof(char) >= (MAX_SIZE - sizeof(TString))))
  ------------------
  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  245|      0|      luaM_toobig(L);
  246|      0|    ts = luaS_createlngstrobj(L, l);
  247|      0|    memcpy(getlngstr(ts), str, l * sizeof(char));
  ------------------
  |  |  429|      0|#define getlngstr(ts)	check_exp(!strisshr(ts), (ts)->contents)
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  248|      0|    return ts;
  249|      0|  }
  250|  18.4k|}
luaS_new:
  259|  17.7k|TString *luaS_new (lua_State *L, const char *str) {
  260|  17.7k|  unsigned int i = point2uint(str) % STRCACHE_N;  /* hash */
  ------------------
  |  |   94|  17.7k|#define point2uint(p)	cast_uint((L_P2I)(p) & UINT_MAX)
  |  |  ------------------
  |  |  |  |  145|  17.7k|#define cast_uint(i)	cast(unsigned int, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|  17.7k|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                unsigned int i = point2uint(str) % STRCACHE_N;  /* hash */
  ------------------
  |  |  240|  17.7k|#define STRCACHE_N		53
  ------------------
  261|  17.7k|  int j;
  262|  17.7k|  TString **p = G(L)->strcache[i];
  ------------------
  |  |  333|  17.7k|#define G(L)	(L->l_G)
  ------------------
  263|  53.1k|  for (j = 0; j < STRCACHE_M; j++) {
  ------------------
  |  |  241|  53.1k|#define STRCACHE_M		2
  ------------------
  |  Branch (263:15): [True: 35.4k, False: 17.7k]
  ------------------
  264|  35.4k|    if (strcmp(str, getstr(p[j])) == 0)  /* hit? */
  ------------------
  |  |  430|  35.4k|#define getstr(ts) 	(strisshr(ts) ? rawgetshrstr(ts) : (ts)->contents)
  |  |  ------------------
  |  |  |  |  420|  35.4k|#define strisshr(ts)	((ts)->shrlen >= 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (420:22): [True: 35.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define getstr(ts) 	(strisshr(ts) ? rawgetshrstr(ts) : (ts)->contents)
  |  |  ------------------
  |  |  |  |  427|  35.4k|#define rawgetshrstr(ts)  (cast_charp(&(ts)->contents))
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|  35.4k|#define cast_charp(i)	cast(char *, (i))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|  35.4k|#define cast(t, exp)	((t)(exp))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (264:9): [True: 0, False: 35.4k]
  ------------------
  265|      0|      return p[j];  /* that is it */
  266|  35.4k|  }
  267|       |  /* normal route */
  268|  35.4k|  for (j = STRCACHE_M - 1; j > 0; j--)
  ------------------
  |  |  241|  17.7k|#define STRCACHE_M		2
  ------------------
  |  Branch (268:28): [True: 17.7k, False: 17.7k]
  ------------------
  269|  17.7k|    p[j] = p[j - 1];  /* move out last element */
  270|       |  /* new element is first in the list */
  271|  17.7k|  p[0] = luaS_newlstr(L, str, strlen(str));
  272|  17.7k|  return p[0];
  273|  17.7k|}
lstring.c:tablerehash:
   62|    377|static void tablerehash (TString **vect, int osize, int nsize) {
   63|    377|  int i;
   64|  48.6k|  for (i = osize; i < nsize; i++)  /* clear new elements */
  ------------------
  |  Branch (64:19): [True: 48.2k, False: 377]
  ------------------
   65|  48.2k|    vect[i] = NULL;
   66|    377|  for (i = 0; i < osize; i++) {  /* rehash old part of the array */
  ------------------
  |  Branch (66:15): [True: 0, False: 377]
  ------------------
   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 */
  ------------------
  |  |  825|      0|	(check_exp((size&(size-1))==0, (cast_int((s) & ((size)-1)))))
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   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|    377|}
lstring.c:createstrobj:
  158|  18.4k|                              unsigned h) {
  159|  18.4k|  TString *ts;
  160|  18.4k|  GCObject *o;
  161|  18.4k|  o = luaC_newobj(L, tag, totalsize);
  162|  18.4k|  ts = gco2ts(o);
  ------------------
  |  |  372|  18.4k|	check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts))
  |  |  ------------------
  |  |  |  |  113|  18.4k|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  18.4k|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|      0|  ts->hash = h;
  164|  18.4k|  ts->extra = 0;
  165|  18.4k|  return ts;
  166|  18.4k|}
lstring.c:internshrstr:
  204|  18.4k|static TString *internshrstr (lua_State *L, const char *str, size_t l) {
  205|  18.4k|  TString *ts;
  206|  18.4k|  global_State *g = G(L);
  ------------------
  |  |  333|  18.4k|#define G(L)	(L->l_G)
  ------------------
  207|  18.4k|  stringtable *tb = &g->strt;
  208|  18.4k|  unsigned int h = luaS_hash(str, l, g->seed);
  209|  18.4k|  TString **list = &tb->hash[lmod(h, tb->size)];
  ------------------
  |  |  825|  18.4k|	(check_exp((size&(size-1))==0, (cast_int((s) & ((size)-1)))))
  |  |  ------------------
  |  |  |  |  113|  18.4k|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  18.4k|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|  18.4k|  lua_assert(str != NULL);  /* otherwise 'memcmp'/'memcpy' are undefined */
  ------------------
  |  |  109|  18.4k|#define lua_assert(c)           assert(c)
  ------------------
  211|  21.4k|  for (ts = *list; ts != NULL; ts = ts->u.hnext) {
  ------------------
  |  Branch (211:20): [True: 3.01k, False: 18.4k]
  ------------------
  212|  3.01k|    if (l == cast_uint(ts->shrlen) &&
  ------------------
  |  |  145|  3.01k|#define cast_uint(i)	cast(unsigned int, (i))
  |  |  ------------------
  |  |  |  |  139|  6.03k|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  |  Branch (212:9): [True: 0, False: 3.01k]
  ------------------
  213|  3.01k|        (memcmp(str, getshrstr(ts), l * sizeof(char)) == 0)) {
  ------------------
  |  |  428|      0|#define getshrstr(ts)	check_exp(strisshr(ts), rawgetshrstr(ts))
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (213:9): [True: 0, False: 0]
  ------------------
  214|       |      /* found! */
  215|      0|      if (isdead(g, ts))  /* dead (but not collected yet)? */
  ------------------
  |  |   99|      0|#define isdead(g,v)	isdeadm(otherwhite(g), (v)->marked)
  |  |  ------------------
  |  |  |  |   98|      0|#define isdeadm(ow,m)	((m) & (ow))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (98:23): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  216|      0|        changewhite(ts);  /* resurrect it */
  ------------------
  |  |  101|      0|#define changewhite(x)	((x)->marked ^= WHITEBITS)
  |  |  ------------------
  |  |  |  |   87|      0|#define WHITEBITS	bit2mask(WHITE0BIT, WHITE1BIT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   67|      0|#define bit2mask(b1,b2)		(bitmask(b1) | bitmask(b2))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define bitmask(b)		(1<<(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define bit2mask(b1,b2)		(bitmask(b1) | bitmask(b2))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define bitmask(b)		(1<<(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  217|      0|      return ts;
  218|      0|    }
  219|  3.01k|  }
  220|       |  /* else must create a new string */
  221|  18.4k|  if (tb->nuse >= tb->size) {  /* need to grow string table? */
  ------------------
  |  Branch (221:7): [True: 0, False: 18.4k]
  ------------------
  222|      0|    growstrtab(L, tb);
  223|      0|    list = &tb->hash[lmod(h, tb->size)];  /* rehash with new size */
  ------------------
  |  |  825|      0|	(check_exp((size&(size-1))==0, (cast_int((s) & ((size)-1)))))
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|      0|  }
  225|  18.4k|  ts = createstrobj(L, sizestrshr(l), LUA_VSHRSTR, h);
  ------------------
  |  |   27|  18.4k|	(offsetof(TString, contents) + ((l) + 1) * sizeof(char))
  ------------------
                ts = createstrobj(L, sizestrshr(l), LUA_VSHRSTR, h);
  ------------------
  |  |  373|  18.4k|#define LUA_VSHRSTR	makevariant(LUA_TSTRING, 0)  /* short strings */
  |  |  ------------------
  |  |  |  |   42|  18.4k|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  226|  18.4k|  ts->shrlen = cast_byte(l);
  ------------------
  |  |  146|  18.4k|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  ------------------
  |  |  |  |  139|  18.4k|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  227|  18.4k|  getshrstr(ts)[l] = '\0';  /* ending 0 */
  ------------------
  |  |  428|  18.4k|#define getshrstr(ts)	check_exp(strisshr(ts), rawgetshrstr(ts))
  |  |  ------------------
  |  |  |  |  113|  18.4k|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  18.4k|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  228|  18.4k|  memcpy(getshrstr(ts), str, l * sizeof(char));
  ------------------
  |  |  428|  18.4k|#define getshrstr(ts)	check_exp(strisshr(ts), rawgetshrstr(ts))
  |  |  ------------------
  |  |  |  |  113|  18.4k|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  18.4k|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  229|      0|  ts->u.hnext = *list;
  230|  18.4k|  *list = ts;
  231|  18.4k|  tb->nuse++;
  232|  18.4k|  return ts;
  233|  18.4k|}

luaH_realasize:
  281|  1.13k|LUAI_FUNC unsigned int luaH_realasize (const Table *t) {
  282|  1.13k|  if (limitequalsasize(t))
  ------------------
  |  |  275|  1.13k|#define limitequalsasize(t)	(isrealasize(t) || ispow2((t)->alimit))
  |  |  ------------------
  |  |  |  |  771|  2.26k|#define isrealasize(t)		(!((t)->flags & BITRAS))
  |  |  |  |  ------------------
  |  |  |  |  |  |  770|  1.13k|#define BITRAS		(1 << 7)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (771:25): [True: 1.13k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define limitequalsasize(t)	(isrealasize(t) || ispow2((t)->alimit))
  |  |  ------------------
  |  |  |  |   69|      0|#define ispow2(x)	(((x) & ((x) - 1)) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:19): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  283|  1.13k|    return t->alimit;  /* this is the size */
  284|      0|  else {
  285|      0|    unsigned int size = t->alimit;
  286|       |    /* compute the smallest power of 2 not smaller than 'size' */
  287|      0|    size |= (size >> 1);
  288|      0|    size |= (size >> 2);
  289|      0|    size |= (size >> 4);
  290|      0|    size |= (size >> 8);
  291|      0|#if (UINT_MAX >> 14) > 3  /* unsigned int has more than 16 bits */
  292|      0|    size |= (size >> 16);
  293|       |#if (UINT_MAX >> 30) > 3
  294|       |    size |= (size >> 32);  /* unsigned int has more than 32 bits */
  295|       |#endif
  296|      0|#endif
  297|      0|    size++;
  298|      0|    lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size);
  ------------------
  |  |  109|      0|#define lua_assert(c)           assert(c)
  ------------------
  299|      0|    return size;
  300|      0|  }
  301|  1.13k|}
luaH_resize:
  726|    377|                                          unsigned nhsize) {
  727|    377|  Table newt;  /* to keep the new hash part */
  728|    377|  unsigned int oldasize = setlimittosize(t);
  729|    377|  Value *newarray;
  730|    377|  if (newasize > MAXASIZE)
  ------------------
  |  |   85|    377|    (((1u << MAXABITS) < MAXASIZEB) ? (1u << MAXABITS) : cast_uint(MAXASIZEB))
  |  |  ------------------
  |  |  |  |   70|    377|#define MAXABITS	cast_int(sizeof(int) * CHAR_BIT - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|    377|#define cast_int(i)	cast(int, (i))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|    377|#define cast(t, exp)	((t)(exp))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (((1u << MAXABITS) < MAXASIZEB) ? (1u << MAXABITS) : cast_uint(MAXASIZEB))
  |  |  ------------------
  |  |  |  |   77|    377|#define MAXASIZEB	(MAX_SIZET/(sizeof(Value) + 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|    377|#define MAX_SIZET	((size_t)(~(size_t)0))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (((1u << MAXABITS) < MAXASIZEB) ? (1u << MAXABITS) : cast_uint(MAXASIZEB))
  |  |  ------------------
  |  |  |  |   70|    377|#define MAXABITS	cast_int(sizeof(int) * CHAR_BIT - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|    377|#define cast_int(i)	cast(int, (i))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|    377|#define cast(t, exp)	((t)(exp))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (((1u << MAXABITS) < MAXASIZEB) ? (1u << MAXABITS) : cast_uint(MAXASIZEB))
  |  |  ------------------
  |  |  |  |  145|      0|#define cast_uint(i)	cast(unsigned int, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (85:6): [Folded - Ignored]
  |  |  ------------------
  ------------------
  |  Branch (730:7): [True: 0, False: 377]
  ------------------
  731|      0|    luaG_runerror(L, "table overflow");
  732|       |  /* create new hash part with appropriate size into 'newt' */
  733|    377|  newt.flags = 0;
  734|    377|  setnodevector(L, &newt, nhsize);
  735|    377|  if (newasize < oldasize) {  /* will array shrink? */
  ------------------
  |  Branch (735:7): [True: 0, False: 377]
  ------------------
  736|       |    /* re-insert into the new hash the elements from vanishing slice */
  737|      0|    exchangehashpart(t, &newt);  /* pretend table has new hash */
  738|      0|    reinsertOldSlice(L, t, oldasize, newasize);
  739|      0|    exchangehashpart(t, &newt);  /* restore old hash (in case of errors) */
  740|      0|  }
  741|       |  /* allocate new array */
  742|    377|  newarray = resizearray(L, t, oldasize, newasize);
  743|    377|  if (l_unlikely(newarray == NULL && newasize > 0)) {  /* allocation failed? */
  ------------------
  |  |  697|    377|#define l_unlikely(x)	luai_unlikely(x)
  |  |  ------------------
  |  |  |  |  685|    377|#define luai_unlikely(x)	(__builtin_expect(((x) != 0), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (685:26): [True: 0, False: 377]
  |  |  |  |  |  Branch (685:46): [True: 0, False: 377]
  |  |  |  |  |  Branch (685:46): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|      0|    freehash(L, &newt);  /* release new hash part */
  745|      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
  |  |  ------------------
  ------------------
  746|      0|  }
  747|       |  /* allocation ok; initialize new part of the array */
  748|    377|  exchangehashpart(t, &newt);  /* 't' has the new hash ('newt' has the old) */
  749|    377|  t->array = newarray;  /* set new array part */
  750|    377|  t->alimit = newasize;
  751|    377|  clearNewSlice(t, oldasize, newasize);
  752|       |  /* re-insert elements from old hash part into new parts */
  753|    377|  reinsert(L, &newt, t);  /* 'newt' now has the old hash */
  754|    377|  freehash(L, &newt);  /* free old hash part */
  755|    377|}
luaH_new:
  794|    754|Table *luaH_new (lua_State *L) {
  795|    754|  GCObject *o = luaC_newobj(L, LUA_VTABLE, sizeof(Table));
  ------------------
  |  |  717|    754|#define LUA_VTABLE	makevariant(LUA_TTABLE, 0)
  |  |  ------------------
  |  |  |  |   42|    754|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  796|    754|  Table *t = gco2t(o);
  ------------------
  |  |  378|    754|#define gco2t(o)  check_exp((o)->tt == LUA_VTABLE, &((cast_u(o))->h))
  |  |  ------------------
  |  |  |  |  113|    754|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    754|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  797|      0|  t->metatable = NULL;
  798|    754|  t->flags = cast_byte(maskflags);  /* table has no metamethod fields */
  ------------------
  |  |  146|    754|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  ------------------
  |  |  |  |  139|    754|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  799|    754|  t->array = NULL;
  800|    754|  t->alimit = 0;
  801|    754|  setnodevector(L, t, 0);
  802|    754|  return t;
  803|    754|}
luaH_free:
  809|    754|void luaH_free (lua_State *L, Table *t) {
  810|    754|  unsigned int realsize = luaH_realasize(t);
  811|    754|  freehash(L, t);
  812|    754|  resizearray(L, t, realsize, 0);
  813|    754|  luaM_free(L, t);
  ------------------
  |  |   56|    754|#define luaM_free(L, b)		luaM_free_(L, (b), sizeof(*(b)))
  ------------------
  814|    754|}
luaH_setint:
 1127|  1.13k|void luaH_setint (lua_State *L, Table *t, lua_Integer key, TValue *value) {
 1128|  1.13k|  if (keyinarray(t, key))
  ------------------
  |  Branch (1128:7): [True: 1.13k, False: 0]
  ------------------
 1129|  1.13k|    obj2arr(t, key, value);
  ------------------
  |  |  119|  1.13k|  (*getArrTag(h,(k)-1u) = (val)->tt_, *getArrVal(h,(k)-1u) = (val)->value_)
  |  |  ------------------
  |  |  |  |  106|  1.13k|#define getArrTag(t,k)	(cast(lu_byte*, (t)->array) + (k))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|  1.13k|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (*getArrTag(h,(k)-1u) = (val)->tt_, *getArrVal(h,(k)-1u) = (val)->value_)
  |  |  ------------------
  |  |  |  |  109|  1.13k|#define getArrVal(t,k)	((t)->array - 1 - (k))
  |  |  ------------------
  ------------------
 1130|      0|  else {
 1131|      0|    int ok = rawfinishnodeset(getintfromhash(t, key), value);
 1132|      0|    if (!ok) {
  ------------------
  |  Branch (1132:9): [True: 0, False: 0]
  ------------------
 1133|      0|      TValue k;
 1134|      0|      setivalue(&k, key);
  ------------------
  |  |  358|      0|  { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_VNUMINT); }
  |  |  ------------------
  |  |  |  |   72|      0|#define val_(o)		((o)->value_)
  |  |  ------------------
  |  |                 { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_VNUMINT); }
  |  |  ------------------
  |  |  |  |  114|      0|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
 1135|      0|      luaH_newkey(L, t, &k, value);
 1136|      0|    }
 1137|      0|  }
 1138|  1.13k|}
ltable.c:setlimittosize:
  314|    377|static unsigned int setlimittosize (Table *t) {
  315|    377|  t->alimit = luaH_realasize(t);
  316|    377|  setrealasize(t);
  ------------------
  |  |  772|    377|#define setrealasize(t)		((t)->flags &= cast_byte(~BITRAS))
  |  |  ------------------
  |  |  |  |  146|    377|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|    377|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  317|    377|  return t->alimit;
  318|    377|}
ltable.c:setnodevector:
  613|  1.13k|static void setnodevector (lua_State *L, Table *t, unsigned size) {
  614|  1.13k|  if (size == 0) {  /* no elements to hash part? */
  ------------------
  |  Branch (614:7): [True: 1.13k, False: 0]
  ------------------
  615|  1.13k|    t->node = cast(Node *, dummynode);  /* use common 'dummynode' */
  ------------------
  |  |  139|  1.13k|#define cast(t, exp)	((t)(exp))
  ------------------
  616|  1.13k|    t->lsizenode = 0;
  617|  1.13k|    setdummy(t);  /* signal that it is using dummy node */
  ------------------
  |  |   36|  1.13k|#define setdummy(t)		((t)->flags |= BITDUMMY)
  |  |  ------------------
  |  |  |  |   31|  1.13k|#define BITDUMMY		(1 << 6)
  |  |  ------------------
  ------------------
  618|  1.13k|  }
  619|      0|  else {
  620|      0|    int i;
  621|      0|    int lsize = luaO_ceillog2(size);
  622|      0|    if (lsize > MAXHBITS || (1u << lsize) > MAXHSIZE)
  ------------------
  |  |   91|      0|#define MAXHBITS	(MAXABITS - 1)
  |  |  ------------------
  |  |  |  |   70|      0|#define MAXABITS	cast_int(sizeof(int) * CHAR_BIT - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|      0|#define cast_int(i)	cast(int, (i))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (lsize > MAXHBITS || (1u << lsize) > MAXHSIZE)
  ------------------
  |  |   99|      0|#define MAXHSIZE	luaM_limitN(1u << MAXHBITS, Node)
  |  |  ------------------
  |  |  |  |   45|      0|  ((cast_sizet(n) <= MAX_SIZET/sizeof(t)) ? (n) :  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|#define cast_sizet(i)	cast(size_t, (i))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                 ((cast_sizet(n) <= MAX_SIZET/sizeof(t)) ? (n) :  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|      0|#define MAX_SIZET	((size_t)(~(size_t)0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (45:4): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   46|      0|     cast_uint((MAX_SIZET/sizeof(t))))
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|      0|#define cast_uint(i)	cast(unsigned int, (i))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (622:9): [True: 0, False: 0]
  |  Branch (622:29): [True: 0, False: 0]
  ------------------
  623|      0|      luaG_runerror(L, "table overflow");
  624|      0|    size = twoto(lsize);
  ------------------
  |  |  828|      0|#define twoto(x)	(1<<(x))
  ------------------
  625|      0|    if (lsize <= LIMFORLAST)  /* no 'lastfree' field? */
  ------------------
  |  |   49|      0|#define LIMFORLAST    2  /* log2 of real limit */
  ------------------
  |  Branch (625:9): [True: 0, False: 0]
  ------------------
  626|      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))
  |  |  ------------------
  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  627|      0|    else {
  628|      0|      size_t bsize = size * sizeof(Node) + sizeof(Limbox);
  629|      0|      char *node = luaM_newblock(L, bsize);
  ------------------
  |  |   66|      0|#define luaM_newblock(L, size)	luaM_newvector(L, size, char)
  |  |  ------------------
  |  |  |  |   60|      0|#define luaM_newvector(L,n,t)	cast(t*, luaM_malloc_(L, (n)*sizeof(t), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  630|      0|      t->node = cast(Node *, node + sizeof(Limbox));
  ------------------
  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  ------------------
  631|      0|      getlastfree(t) = gnode(t, size);  /* all positions are free */
  ------------------
  |  |   63|      0|#define getlastfree(t)     ((cast(Limbox *, (t)->node) - 1)->lastfree)
  |  |  ------------------
  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
                    getlastfree(t) = gnode(t, size);  /* all positions are free */
  ------------------
  |  |   13|      0|#define gnode(t,i)	(&(t)->node[i])
  ------------------
  632|      0|    }
  633|      0|    t->lsizenode = cast_byte(lsize);
  ------------------
  |  |  146|      0|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  ------------------
  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  634|      0|    setnodummy(t);
  ------------------
  |  |   35|      0|#define setnodummy(t)		((t)->flags &= NOTBITDUMMY)
  |  |  ------------------
  |  |  |  |   32|      0|#define NOTBITDUMMY		cast_byte(~BITDUMMY)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  635|      0|    for (i = 0; i < cast_int(size); i++) {
  ------------------
  |  |  144|      0|#define cast_int(i)	cast(int, (i))
  |  |  ------------------
  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  |  Branch (635:17): [True: 0, False: 0]
  ------------------
  636|      0|      Node *n = gnode(t, i);
  ------------------
  |  |   13|      0|#define gnode(t,i)	(&(t)->node[i])
  ------------------
  637|      0|      gnext(n) = 0;
  ------------------
  |  |   15|      0|#define gnext(n)	((n)->u.next)
  ------------------
  638|      0|      setnilkey(n);
  ------------------
  |  |  800|      0|#define setnilkey(node)		(keytt(node) = LUA_TNIL)
  |  |  ------------------
  |  |  |  |  791|      0|#define keytt(node)		((node)->u.key_tt)
  |  |  ------------------
  |  |               #define setnilkey(node)		(keytt(node) = LUA_TNIL)
  |  |  ------------------
  |  |  |  |   64|      0|#define LUA_TNIL		0
  |  |  ------------------
  ------------------
  639|      0|      setempty(gval(n));
  ------------------
  |  |  236|      0|#define setempty(v)		settt_(v, LUA_VEMPTY)
  |  |  ------------------
  |  |  |  |  114|      0|#define settt_(o,t)	((o)->tt_=(t))
  |  |  ------------------
  ------------------
  640|      0|    }
  641|      0|  }
  642|  1.13k|}
ltable.c:exchangehashpart:
  670|    377|static void exchangehashpart (Table *t1, Table *t2) {
  671|    377|  lu_byte lsizenode = t1->lsizenode;
  672|    377|  Node *node = t1->node;
  673|    377|  int bitdummy1 = t1->flags & BITDUMMY;
  ------------------
  |  |   31|    377|#define BITDUMMY		(1 << 6)
  ------------------
  674|    377|  t1->lsizenode = t2->lsizenode;
  675|    377|  t1->node = t2->node;
  676|    377|  t1->flags = (t1->flags & NOTBITDUMMY) | (t2->flags & BITDUMMY);
  ------------------
  |  |   32|    377|#define NOTBITDUMMY		cast_byte(~BITDUMMY)
  |  |  ------------------
  |  |  |  |  146|    377|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|    377|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                t1->flags = (t1->flags & NOTBITDUMMY) | (t2->flags & BITDUMMY);
  ------------------
  |  |   31|    377|#define BITDUMMY		(1 << 6)
  ------------------
  677|    377|  t2->lsizenode = lsizenode;
  678|    377|  t2->node = node;
  679|    377|  t2->flags = (t2->flags & NOTBITDUMMY) | bitdummy1;
  ------------------
  |  |   32|    377|#define NOTBITDUMMY		cast_byte(~BITDUMMY)
  |  |  ------------------
  |  |  |  |  146|    377|#define cast_byte(i)	cast(lu_byte, (i))
  |  |  |  |  ------------------
  |  |  |  |  |  |  139|    377|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  680|    377|}
ltable.c:resizearray:
  577|  1.13k|                               unsigned newasize) {
  578|  1.13k|  if (oldasize == newasize)
  ------------------
  |  Branch (578:7): [True: 377, False: 754]
  ------------------
  579|    377|    return t->array;  /* nothing to be done */
  580|    754|  else if (newasize == 0) {  /* erasing array? */
  ------------------
  |  Branch (580:12): [True: 377, False: 377]
  ------------------
  581|    377|    Value *op = t->array - oldasize;  /* original array's real address */
  582|    377|    luaM_freemem(L, op, concretesize(oldasize));  /* free it */
  ------------------
  |  |   55|    377|#define luaM_freemem(L, b, s)	luaM_free_(L, (b), (s))
  ------------------
  583|    377|    return NULL;
  584|    377|  }
  585|    377|  else {
  586|    377|    size_t newasizeb = concretesize(newasize);
  587|    377|    Value *np = cast(Value *,
  ------------------
  |  |  139|    377|#define cast(t, exp)	((t)(exp))
  ------------------
  588|    377|                  luaM_reallocvector(L, NULL, 0, newasizeb, lu_byte));
  589|    377|    if (np == NULL)  /* allocation error? */
  ------------------
  |  Branch (589:9): [True: 0, False: 377]
  ------------------
  590|      0|      return NULL;
  591|    377|    if (oldasize > 0) {
  ------------------
  |  Branch (591:9): [True: 0, False: 377]
  ------------------
  592|      0|      Value *op = t->array - oldasize;  /* real original array */
  593|      0|      unsigned tomove = (oldasize < newasize) ? oldasize : newasize;
  ------------------
  |  Branch (593:25): [True: 0, False: 0]
  ------------------
  594|      0|      lua_assert(tomove > 0);
  ------------------
  |  |  109|      0|#define lua_assert(c)           assert(c)
  ------------------
  595|       |      /* move common elements to new position */
  596|      0|      memcpy(np + newasize - tomove,
  597|      0|             op + oldasize - tomove,
  598|      0|             concretesize(tomove));
  599|      0|      luaM_freemem(L, op, concretesize(oldasize));
  ------------------
  |  |   55|      0|#define luaM_freemem(L, b, s)	luaM_free_(L, (b), (s))
  ------------------
  600|      0|    }
  601|    377|    return np + newasize;  /* shift pointer to the end of value segment */
  602|    377|  }
  603|  1.13k|}
ltable.c:concretesize:
  558|    754|static size_t concretesize (unsigned int size) {
  559|    754|  return size * sizeof(Value) + size;  /* space for the two arrays */
  560|    754|}
ltable.c:freehash:
  403|  1.13k|static void freehash (lua_State *L, Table *t) {
  404|  1.13k|  if (!isdummy(t)) {
  ------------------
  |  |   33|  1.13k|#define isdummy(t)		((t)->flags & BITDUMMY)
  |  |  ------------------
  |  |  |  |   31|  1.13k|#define BITDUMMY		(1 << 6)
  |  |  ------------------
  ------------------
  |  Branch (404:7): [True: 0, False: 1.13k]
  ------------------
  405|      0|    size_t bsize = sizenode(t) * sizeof(Node);  /* 'node' size in bytes */
  ------------------
  |  |  829|      0|#define sizenode(t)	(twoto((t)->lsizenode))
  |  |  ------------------
  |  |  |  |  828|      0|#define twoto(x)	(1<<(x))
  |  |  ------------------
  ------------------
  406|      0|    char *arr = cast_charp(t->node);
  ------------------
  |  |  149|      0|#define cast_charp(i)	cast(char *, (i))
  |  |  ------------------
  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  407|      0|    if (haslastfree(t)) {
  ------------------
  |  |   62|      0|#define haslastfree(t)     ((t)->lsizenode > LIMFORLAST)
  |  |  ------------------
  |  |  |  |   49|      0|#define LIMFORLAST    2  /* log2 of real limit */
  |  |  ------------------
  |  |  |  Branch (62:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  408|      0|      bsize += sizeof(Limbox);
  409|      0|      arr -= sizeof(Limbox);
  410|      0|    }
  411|      0|    luaM_freearray(L, arr, bsize);
  ------------------
  |  |   57|      0|#define luaM_freearray(L, b, n)   luaM_free_(L, (b), (n)*sizeof(*(b)))
  ------------------
  412|      0|  }
  413|  1.13k|}
ltable.c:clearNewSlice:
  706|    377|static void clearNewSlice (Table *t, unsigned oldasize, unsigned newasize) {
  707|  1.50k|  for (; oldasize < newasize; oldasize++)
  ------------------
  |  Branch (707:10): [True: 1.13k, False: 377]
  ------------------
  708|  1.13k|    *getArrTag(t, oldasize) = LUA_VEMPTY;
  ------------------
  |  |  106|  1.13k|#define getArrTag(t,k)	(cast(lu_byte*, (t)->array) + (k))
  |  |  ------------------
  |  |  |  |  139|  1.13k|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
                  *getArrTag(t, oldasize) = LUA_VEMPTY;
  ------------------
  |  |  186|  1.13k|#define LUA_VEMPTY	makevariant(LUA_TNIL, 1)
  |  |  ------------------
  |  |  |  |   42|  1.13k|#define makevariant(t,v)	((t) | ((v) << 4))
  |  |  ------------------
  ------------------
  709|    377|}
ltable.c:reinsert:
  648|    377|static void reinsert (lua_State *L, Table *ot, Table *t) {
  649|    377|  int j;
  650|    377|  int size = sizenode(ot);
  ------------------
  |  |  829|    377|#define sizenode(t)	(twoto((t)->lsizenode))
  |  |  ------------------
  |  |  |  |  828|    377|#define twoto(x)	(1<<(x))
  |  |  ------------------
  ------------------
  651|    754|  for (j = 0; j < size; j++) {
  ------------------
  |  Branch (651:15): [True: 377, False: 377]
  ------------------
  652|    377|    Node *old = gnode(ot, j);
  ------------------
  |  |   13|    377|#define gnode(t,i)	(&(t)->node[i])
  ------------------
  653|    377|    if (!isempty(gval(old))) {
  ------------------
  |  |  228|    377|#define isempty(v)		ttisnil(v)
  |  |  ------------------
  |  |  |  |  196|    377|#define ttisnil(v)		checktype((v), LUA_TNIL)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|    377|#define checktype(o,t)		(ttype(o) == (t))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|    377|#define ttype(o)	(novariant(rawtt(o)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   80|    377|#define novariant(t)	((t) & 0x0F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (653:9): [True: 0, False: 377]
  ------------------
  654|       |      /* doesn't need barrier/invalidate cache, as entry was
  655|       |         already present in the table */
  656|      0|      TValue k;
  657|      0|      getnodekey(L, &k, old);
  ------------------
  |  |  758|      0|	{ TValue *io_=(obj); const Node *n_=(node); \
  |  |  759|      0|	  io_->value_ = n_->u.key_val; io_->tt_ = n_->u.key_tt; \
  |  |  760|      0|	  checkliveness(L,io_); }
  |  |  ------------------
  |  |  |  |  107|      0|	((void)L, lua_longassert(!iscollectable(obj) || \
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|      0|#define lua_longassert(c)	((c) ? (void)0 : lua_assert(0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (115:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  108|      0|		(righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj))))))
  |  |  ------------------
  ------------------
  658|      0|      luaH_set(L, t, &k, gval(old));
  ------------------
  |  |   14|      0|#define gval(n)		(&(n)->i_val)
  ------------------
  659|      0|    }
  660|    377|  }
  661|    377|}
ltable.c:keyinarray:
  438|  1.13k|static int keyinarray (Table *t, lua_Integer key) {
  439|  1.13k|  lua_Unsigned alimit = t->alimit;
  440|  1.13k|  if (l_castS2U(key) - 1u < alimit)  /* 'key' in [1, t->alimit]? */
  ------------------
  |  |  155|  1.13k|#define l_castS2U(i)	((lua_Unsigned)(i))
  ------------------
  |  Branch (440:7): [True: 1.13k, False: 0]
  ------------------
  441|  1.13k|    return 1;
  442|      0|  else if (!isrealasize(t) &&  /* key still may be in the array part? */
  ------------------
  |  |  771|      0|#define isrealasize(t)		(!((t)->flags & BITRAS))
  |  |  ------------------
  |  |  |  |  770|      0|#define BITRAS		(1 << 7)
  |  |  ------------------
  ------------------
  |  Branch (442:12): [True: 0, False: 0]
  ------------------
  443|      0|           (((l_castS2U(key) - 1u) & ~(alimit - 1u)) < alimit)) {
  ------------------
  |  |  155|      0|#define l_castS2U(i)	((lua_Unsigned)(i))
  ------------------
  |  Branch (443:12): [True: 0, False: 0]
  ------------------
  444|      0|    t->alimit = cast_uint(key);  /* probably '#t' is here now */
  ------------------
  |  |  145|      0|#define cast_uint(i)	cast(unsigned int, (i))
  |  |  ------------------
  |  |  |  |  139|      0|#define cast(t, exp)	((t)(exp))
  |  |  ------------------
  ------------------
  445|      0|    return 1;
  446|      0|  }
  447|      0|  else
  448|      0|    return 0;
  449|  1.13k|}

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

luaV_tonumber_:
  107|    183|int luaV_tonumber_ (const TValue *obj, lua_Number *n) {
  108|    183|  TValue v;
  109|    183|  if (ttisinteger(obj)) {
  ------------------
  |  |  341|    183|#define ttisinteger(o)		checktag((o), LUA_VNUMINT)
  |  |  ------------------
  |  |  |  |   91|    183|#define checktag(o,t)		(rawtt(o) == (t))
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|    183|#define rawtt(o)	((o)->tt_)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:24): [True: 183, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  110|    183|    *n = cast_num(ivalue(obj));
  ------------------
  |  |  143|    183|#define cast_num(i)	cast(lua_Number, (i))
  |  |  ------------------
  |  |  |  |  139|    732|#define cast(t, exp)	((t)(exp))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:27): [True: 0, False: 183]
  |  |  |  |  |  Branch (139:27): [True: 183, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  111|      0|    return 1;
  112|    183|  }
  113|      0|  else if (l_strton(obj, &v)) {  /* string coercible to number? */
  ------------------
  |  Branch (113:12): [True: 0, False: 0]
  ------------------
  114|      0|    *n = nvalue(&v);  /* convert result of 'luaO_str2num' to a float */
  ------------------
  |  |  343|      0|#define nvalue(o)	check_exp(ttisnumber(o), \
  |  |  ------------------
  |  |  |  |  113|      0|#define check_exp(c,e)		(lua_assert(c), (e))
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define lua_assert(c)           assert(c)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (113:42): [True: 0, False: 0]
  |  |  |  |  |  Branch (113:42): [True: 0, False: 0]
  |  |  |  |  |  Branch (113:42): [True: 0, False: 0]
  |  |  |  |  |  Branch (113:42): [True: 0, False: 0]
  |  |  |  |  |  Branch (113:42): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  344|      0|	(ttisinteger(o) ? cast_num(ivalue(o)) : fltvalue(o)))
  ------------------
  115|      0|    return 1;
  116|      0|  }
  117|      0|  else
  118|      0|    return 0;  /* conversion failed */
  119|    183|}

LLVMFuzzerTestOneInput:
   18|    377|{
   19|    377|	lua_State *L = luaL_newstate();
   20|    377|	if (L == NULL)
  ------------------
  |  Branch (20:6): [True: 0, False: 377]
  ------------------
   21|      0|		return 0;
   22|       |
   23|    377|	char *str = malloc(size + 1);
   24|    377|	if (str == NULL) {
  ------------------
  |  Branch (24:6): [True: 0, False: 377]
  ------------------
   25|      0|		return 0;
   26|      0|	}
   27|    377|	memcpy(str, data, size);
   28|    377|	str[size] = '\0';
   29|       |
   30|    377|	size_t sz = lua_stringtonumber(L, str);
   31|    377|	if (sz == 0) {
  ------------------
  |  Branch (31:6): [True: 110, False: 267]
  ------------------
   32|    110|		assert(lua_gettop(L) == 0);
   33|    267|	} else {
   34|       |		/* assert(sz == size + 1); */
   35|    267|		assert(lua_gettop(L) == 1);
   36|    267|		assert(lua_isnumber(L, -1) == 1);
   37|    267|	}
   38|       |
   39|    377|	free(str);
   40|    377|	lua_settop(L, 0);
   41|    377|	lua_close(L);
   42|       |
   43|    377|	return 0;
   44|    377|}

