function luaK.discharge2reg(p,c,g,o)p:dischargevars(c,g)local w=g.k if w=="\086\078\073\076"then p:_nil(c,o,1)elseif w=="\086\070\065\076\083\069"or w=="\086\084\082\085\069"then p:codeABC(c,"\079\080\095\076\079\065\068\066\079\079\076",o,g.k=="\086\084\082\085\069"and 1 or 0,0)elseif w=="\086\075"then p:codeABx(c,"\079\080\095\076\079\065\068\075",o,g.info)elseif w=="\086\075\078\085\077"then p:codeABx(c,"\079\080\095\076\079\065\068\075",o,p:numberK(c,g.nval))elseif w=="\086\082\069\076\079\067\065\066\076\069"then local w=p:getcode(c,g)luaP:SETARG_A(w,o)elseif w=="\086\078\079\078\082\069\076\079\067"then if o~=g.info then p:codeABC(c,"\079\080\095\077\079\086\069",o,g.info,0)end else assert(g.k=="\086\086\079\073\068"or g.k=="\086\074\077\080")return end g.info=o g.k="\086\078\079\078\082\069\076\079\067"end

function luaK:discharge2reg(fs, e, reg)
  self:dischargevars(fs, e)
  local k = e.k
  if k == "VNIL" then
    self:_nil(fs, reg, 1)
  elseif k == "VFALSE" or k == "VTRUE" then
    self:codeABC(fs, "OP_LOADBOOL", reg, (e.k == "VTRUE") and 1 or 0, 0)
  elseif k == "VK" then
    self:codeABx(fs, "OP_LOADK", reg, e.info)
  elseif k == "VKNUM" then
    self:codeABx(fs, "OP_LOADK", reg, self:numberK(fs, e.nval))
  elseif k == "VRELOCABLE" then
    local pc = self:getcode(fs, e)
    luaP:SETARG_A(pc, reg)
  elseif k == "VNONRELOC" then
    if reg ~= e.info then
      self:codeABC(fs, "OP_MOVE", reg, e.info, 0)
    end
  else
    assert(e.k == "VVOID" or e.k == "VJMP")
    return  -- nothing to do...
  end
  e.info = reg
  e.k = "VNONRELOC"
end
