/* Create a OP_LOADNIL instruction, but try to optimize: if the previous instruction is also OP_LOADNIL and ranges are compatible, adjust range of previous instruction instead of emitting a new one. (For instance, 'local a; local b' will generate a single opcode.)  */
void luaK_nil(FuncState *fs, int from, int n)
/* Create a OP_LOADNIL instruction, but try to optimize: if the previous instruction is also OP_LOADNIL and ranges are compatible, adjust range of previous instruction instead of emitting a new one. (For instance, 'local a; local b' will generate a single opcode.)  */
void luaK_nil(FuncState *fs, int from, int n)
{
    previous = &fs->f->code[fs->pc-1];
    if (GET_OPCODE(*previous) == OP_LOADNIL) {
      int pfrom = GETARG_A(*previous);
      int pl = pfrom + GETARG_B(*previous);
      if ((pfrom <= from && from <= pl + 1) ||
          (from <= pfrom && pfrom <= l + 1)) {
        if (pfrom < from) from = pfrom;
        if (pl > l) l = pl;
        SETARG_A(*previous, from);
        SETARG_B(*previous, l - from);
        return;
      }
    }
  }
  luaK_codeABC(fs, OP_LOADNIL, from, n - 1, 0);
}