function luaK.discharge2reg(l,I,T,N)l:dischargevars(I,T)local x=T.k if x=="\086\078\073\076"then l:_nil(I,N,1)elseif x=="\086\070\065\076\083\069"or x=="\086\084\082\085\069"then l:codeABC(I,"\079\080\095\076\079\065\068\066\079\079\076",N,T.k=="\086\084\082\085\069"and 1 or 0,0)elseif x=="\086\075"then l:codeABx(I,"\079\080\095\076\079\065\068\075",N,T.info)elseif x=="\086\075\078\085\077"then l:codeABx(I,"\079\080\095\076\079\065\068\075",N,l:numberK(I,T.nval))elseif x=="\086\082\069\076\079\067\065\066\076\069"then local x=l:getcode(I,T)luaP:SETARG_A(x,N)elseif x=="\086\078\079\078\082\069\076\079\067"then if N~=T.info then l:codeABC(I,"\079\080\095\077\079\086\069",N,T.info,0)end else assert(T.k=="\086\086\079\073\068"or T.k=="\086\074\077\080")return end T.info=N T.k="\086\078\079\078\082\069\076\079\067"end
------------------------------------------------------------------------
--
-- * used in luaK:discharge2anyreg(), luaK:exp2reg()
------------------------------------------------------------------------
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
