From 0efa3a061f72422424e5f3b4d1600ea290b54c82 Mon Sep 17 00:00:00 2001 From: ttwiz_z Date: Sun, 12 May 2024 09:50:57 +0300 Subject: [PATCH] Release 3.9 Bugfix & Optimization --- source-minified.lua | 4 ++-- source.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source-minified.lua b/source-minified.lua index 4ce686a..3dcc3fc 100644 --- a/source-minified.lua +++ b/source-minified.lua @@ -1,4 +1,4 @@ -pcall(function()local a=script;if a then script=nil;a.Parent=nil;a=nil;getfenv().script=nil end end)local a=game:GetService("Players")local b=game:GetService("TweenService")local c=game:GetService("UserInputService")local d=game:GetService("CoreGui")local a=a.LocalPlayer;local e=TweenInfo.new(0.075)local f=TweenInfo.new(0.1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)local g=Color3.fromRGB(120,120,120)local h=Color3.fromRGB(170,170,170)local i=Instance.new("CanvasGroup")local j=Instance.new("UICorner")local k=Instance.new("TextLabel")local l=Instance.new("UICorner")local m=Instance.new("Frame")local n=Instance.new("ScrollingFrame")local o=Instance.new("TextBox")local p=Instance.new("UIPadding")local q=Instance.new("Frame")local r=Instance.new("UIListLayout")local s=Instance.new("TextButton")local t=Instance.new("UIStroke")local u=Instance.new("UICorner")local v=Instance.new("TextButton")local w=Instance.new("UIStroke")local x=Instance.new("UICorner")local y=Instance.new("UIStroke")local function z()local a=math.random(11,22)local b={}for a=1,a do b[a]=string.char(math.random(48,90))end;return table.concat(b)end;local function A(a)while task.wait()do if typeof(a)=="Instance"and a.Parent then a.Name=z()else break end end end;local function B(a,c,d)if typeof(a)=="Instance"and typeof(c)=="TweenInfo"and type(d)=="table"then b:Create(a,c,d):Play()end end;local function b(a)if type(a)=="userdata"then local b,d,f,g;local function h(b)local b=b.Position-f;local b=UDim2.new(g.X.Scale,g.X.Offset+b.X,g.Y.Scale,g.Y.Offset+b.Y)B(a,e,{Position=b})end;a.InputBegan:Connect(function(d)if(d.UserInputType==Enum.UserInputType.MouseButton1 or d.UserInputType==Enum.UserInputType.Touch)and not c:GetFocusedTextBox()then b=true;f=d.Position;g=a.Position;d.Changed:Connect(function()if d.UserInputState==Enum.UserInputState.End then b=false end end)end end)a.InputChanged:Connect(function(a)if a.UserInputType==Enum.UserInputType.MouseMovement or a.UserInputType==Enum.UserInputType.Touch then d=a end end)c.InputChanged:Connect(function(a)if a==d and b then h(a)end end)end end;local c={}c.OpMode={iABC=0,iABx=1,iAsBx=2}c.SIZE_C=9;c.SIZE_B=9;c.SIZE_Bx=c.SIZE_C+c.SIZE_B;c.SIZE_A=8;c.SIZE_OP=6;c.POS_OP=0;c.POS_A=c.POS_OP+c.SIZE_OP;c.POS_C=c.POS_A+c.SIZE_A;c.POS_B=c.POS_C+c.SIZE_C;c.POS_Bx=c.POS_C;c.MAXARG_Bx=math.ldexp(1,c.SIZE_Bx)-1;c.MAXARG_sBx=math.floor(c.MAXARG_Bx/2)c.MAXARG_A=math.ldexp(1,c.SIZE_A)-1;c.MAXARG_B=math.ldexp(1,c.SIZE_B)-1;c.MAXARG_C=math.ldexp(1,c.SIZE_C)-1;function c:GET_OPCODE(a)return self.ROpCode[a.OP]end;function c:SET_OPCODE(a,b)a.OP=self.OpCode[b]end;function c:GETARG_A(a)return a.A end;function c:SETARG_A(a,b)a.A=b end;function c:GETARG_B(a)return a.B end;function c:SETARG_B(a,b)a.B=b end;function c:GETARG_C(a)return a.C end;function c:SETARG_C(a,b)a.C=b end;function c:GETARG_Bx(a)return a.Bx end;function c:SETARG_Bx(a,b)a.Bx=b end;function c:GETARG_sBx(a)return a.Bx-self.MAXARG_sBx end;function c:SETARG_sBx(a,b)a.Bx=b+self.MAXARG_sBx end;function c:CREATE_ABC(a,b,c,d)return{OP=self.OpCode[a],A=b,B=c,C=d}end;function c:CREATE_ABx(a,b,c)return{OP=self.OpCode[a],A=b,Bx=c}end;function c:CREATE_Inst(a)local b=a%64;a=(a-b)/64;local c=a%256;a=(a-c)/256;return self:CREATE_ABx(b,c,a)end;function c:Instruction(a)if a.Bx then a.C=a.Bx%512;a.B=(a.Bx-a.C)/512 end;local b=a.A*64+a.OP;local c=b%256;b=a.C*64+(b-c)/256;local d=b%256;b=a.B*128+(b-d)/256;local a=b%256;local b=(b-a)/256;return string.char(c,d,a,b)end;function c:DecodeInst(a)local b=string.byte;local c={}local d=b(a,1)local e=d%64;c.OP=e;d=b(a,2)*4+(d-e)/64;local f=d%256;c.A=f;d=b(a,3)*4+(d-f)/256;local f=d%512;c.C=f;c.B=b(a,4)*2+(d-f)/512;local a=self.OpMode[tonumber(string.sub(self.opmodes[e+1],7,7))]if a~="iABC"then c.Bx=c.B*512+c.C end;return c end;c.BITRK=math.ldexp(1,c.SIZE_B-1)function c:ISK(a)return a>=self.BITRK end;function c:INDEXK(a)return a-self.BITRK end;c.MAXINDEXRK=c.BITRK-1;function c:RKASK(a)return a+self.BITRK end;c.NO_REG=c.MAXARG_A;c.opnames={}c.OpCode={}c.ROpCode={}local e=0;for a in string.gmatch([[ +pcall(function()local a=script;if a then script=nil;a.Parent=nil;a=nil;getfenv().script=nil end end)local a=game:GetService("Players")local b=game:GetService("TweenService")local c=game:GetService("UserInputService")local d=game:GetService("CoreGui")local a=a.LocalPlayer;local e=TweenInfo.new(0.075)local f=TweenInfo.new(0.1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)local g=Color3.fromRGB(120,120,120)local h=Color3.fromRGB(170,170,170)local i=Instance.new("CanvasGroup")local j=Instance.new("UICorner")local k=Instance.new("TextLabel")local l=Instance.new("UICorner")local m=Instance.new("Frame")local n=Instance.new("ScrollingFrame")local o=Instance.new("TextBox")local p=Instance.new("UIPadding")local q=Instance.new("Frame")local r=Instance.new("UIListLayout")local s=Instance.new("TextButton")local t=Instance.new("UIStroke")local u=Instance.new("UICorner")local v=Instance.new("TextButton")local w=Instance.new("UIStroke")local x=Instance.new("UICorner")local y=Instance.new("UIStroke")local function z()local a=math.random(11,22)local b={}for a=1,a do b[a]=string.char(math.random(35,91))end;return table.concat(b)end;local function A(a)while task.wait()do if typeof(a)=="Instance"and a.Parent then a.Name=z()else break end end end;local function B(a,c,d)if typeof(a)=="Instance"and typeof(c)=="TweenInfo"and type(d)=="table"then b:Create(a,c,d):Play()end end;local function b(a)if type(a)=="userdata"then local b,d,f,g;local function h(b)local b=b.Position-f;local b=UDim2.new(g.X.Scale,g.X.Offset+b.X,g.Y.Scale,g.Y.Offset+b.Y)B(a,e,{Position=b})end;a.InputBegan:Connect(function(d)if(d.UserInputType==Enum.UserInputType.MouseButton1 or d.UserInputType==Enum.UserInputType.Touch)and not c:GetFocusedTextBox()then b=true;f=d.Position;g=a.Position;d.Changed:Connect(function()if d.UserInputState==Enum.UserInputState.End then b=false end end)end end)a.InputChanged:Connect(function(a)if a.UserInputType==Enum.UserInputType.MouseMovement or a.UserInputType==Enum.UserInputType.Touch then d=a end end)c.InputChanged:Connect(function(a)if a==d and b then h(a)end end)end end;local c={}c.OpMode={iABC=0,iABx=1,iAsBx=2}c.SIZE_C=9;c.SIZE_B=9;c.SIZE_Bx=c.SIZE_C+c.SIZE_B;c.SIZE_A=8;c.SIZE_OP=6;c.POS_OP=0;c.POS_A=c.POS_OP+c.SIZE_OP;c.POS_C=c.POS_A+c.SIZE_A;c.POS_B=c.POS_C+c.SIZE_C;c.POS_Bx=c.POS_C;c.MAXARG_Bx=math.ldexp(1,c.SIZE_Bx)-1;c.MAXARG_sBx=math.floor(c.MAXARG_Bx/2)c.MAXARG_A=math.ldexp(1,c.SIZE_A)-1;c.MAXARG_B=math.ldexp(1,c.SIZE_B)-1;c.MAXARG_C=math.ldexp(1,c.SIZE_C)-1;function c:GET_OPCODE(a)return self.ROpCode[a.OP]end;function c:SET_OPCODE(a,b)a.OP=self.OpCode[b]end;function c:GETARG_A(a)return a.A end;function c:SETARG_A(a,b)a.A=b end;function c:GETARG_B(a)return a.B end;function c:SETARG_B(a,b)a.B=b end;function c:GETARG_C(a)return a.C end;function c:SETARG_C(a,b)a.C=b end;function c:GETARG_Bx(a)return a.Bx end;function c:SETARG_Bx(a,b)a.Bx=b end;function c:GETARG_sBx(a)return a.Bx-self.MAXARG_sBx end;function c:SETARG_sBx(a,b)a.Bx=b+self.MAXARG_sBx end;function c:CREATE_ABC(a,b,c,d)return{OP=self.OpCode[a],A=b,B=c,C=d}end;function c:CREATE_ABx(a,b,c)return{OP=self.OpCode[a],A=b,Bx=c}end;function c:CREATE_Inst(a)local b=a%64;a=(a-b)/64;local c=a%256;a=(a-c)/256;return self:CREATE_ABx(b,c,a)end;function c:Instruction(a)if a.Bx then a.C=a.Bx%512;a.B=(a.Bx-a.C)/512 end;local b=a.A*64+a.OP;local c=b%256;b=a.C*64+(b-c)/256;local d=b%256;b=a.B*128+(b-d)/256;local a=b%256;local b=(b-a)/256;return string.char(c,d,a,b)end;function c:DecodeInst(a)local b=string.byte;local c={}local d=b(a,1)local e=d%64;c.OP=e;d=b(a,2)*4+(d-e)/64;local f=d%256;c.A=f;d=b(a,3)*4+(d-f)/256;local f=d%512;c.C=f;c.B=b(a,4)*2+(d-f)/512;local a=self.OpMode[tonumber(string.sub(self.opmodes[e+1],7,7))]if a~="iABC"then c.Bx=c.B*512+c.C end;return c end;c.BITRK=math.ldexp(1,c.SIZE_B-1)function c:ISK(a)return a>=self.BITRK end;function c:INDEXK(a)return a-self.BITRK end;c.MAXINDEXRK=c.BITRK-1;function c:RKASK(a)return a+self.BITRK end;c.NO_REG=c.MAXARG_A;c.opnames={}c.OpCode={}c.ROpCode={}local e=0;for a in string.gmatch([[ MOVE LOADK LOADBOOL LOADNIL GETUPVAL GETGLOBAL GETTABLE SETGLOBAL SETUPVAL SETTABLE NEWTABLE SELF ADD SUB MUL @@ -46,4 +46,4 @@ TK_NE ~= TK_NAME TK_NUMBER TK_STRING -TK_EOS ]]D.MAXSRC=80;D.MAX_INT=2147483645;D.LUA_QS="'%s'"D.LUA_COMPAT_LSTR=1;function D:init()local a,b={},{}for c in string.gmatch(self.RESERVED,"[^\n]+")do local c,c,c,d=string.find(c,"(%S+)%s+(%S+)")a[c]=d;b[d]=c end;self.tokens=a;self.enums=b end;function D:chunkid(a,b)local c;local d=string.sub(a,1,1)if d=="="then c=string.sub(a,2,b)else if d=="@"then a=string.sub(a,2)b=b-#" '...' "local d=#a;c=""if d>b then a=string.sub(a,1+d-b)c=c.."..."end;c=c..a else local d=string.find(a,"[\n\r]")d=d and(d-1)or#a;b=b-#(" [string \"...\"] ")if d>b then d=b end;c="[string \""if d<#a then c=c..string.sub(a,1,d).."..."else c=c..a end;c=c.."\"]"end end;return c end;function D:token2str(a,a)if string.sub(a,1,3)~="TK_"then if string.find(a,"%c")then return string.format("char(%d)",string.byte(a))end;return a else end;return self.tokens[a]end;function D:lexerror(a,b,c)local function d(a,b)if b=="TK_NAME"or b=="TK_STRING"or b=="TK_NUMBER"then return a.buff else return self:token2str(a,b)end end;local e=self:chunkid(a.source,self.MAXSRC)local b=string.format("%s:%d: %s",e,a.linenumber,b)if c then b=string.format("%s near "..self.LUA_QS,b,d(a,c))end;error(b)end;function D:syntaxerror(a,b)self:lexerror(a,b,a.t.token)end;function D:currIsNewline(a)return a.current=="\n"or a.current=="\r"end;function D:inclinenumber(a)local b=a.current;self:nextc(a)if self:currIsNewline(a)and a.current~=b then self:nextc(a)end;a.linenumber=a.linenumber+1;if a.linenumber>=self.MAX_INT then self:syntaxerror(a,"chunk has too many lines")end end;function D:setinput(a,b,c,d)if not b then b={}end;if not b.lookahead then b.lookahead={}end;if not b.t then b.t={}end;b.decpoint="."b.L=a;b.lookahead.token="TK_EOS"b.z=c;b.fs=nil;b.linenumber=1;b.lastline=1;b.source=d;self:nextc(b)end;function D:check_next(a,b)if not string.find(b,a.current,1)then return false end;self:save_and_next(a)return true end;function D:next(a)a.lastline=a.linenumber;if a.lookahead.token~="TK_EOS"then a.t.seminfo=a.lookahead.seminfo;a.t.token=a.lookahead.token;a.lookahead.token="TK_EOS"else a.t.token=self:llex(a,a.t)end end;function D:lookahead(a)a.lookahead.token=self:llex(a,a.lookahead)end;function D:nextc(a)local b=e:zgetc(a.z)a.current=b;return b end;function D:save(a,b)local c=a.buff;a.buff=c..b end;function D:save_and_next(a)self:save(a,a.current)return self:nextc(a)end;function D:str2d(a)if string.match(string.lower(a),"[^b%da-f_]_")or string.match(string.lower(a),"_[^%da-f_]")then return nil end;a=string.gsub(a,"_","")local b=tonumber(a)if b then return b end;if string.lower(string.sub(a,1,2))=="0x"then b=tonumber(a,16)if b then return b end elseif string.lower(string.sub(a,1,2))=="0b"then if string.match(string.sub(a,3),"[^01]")then return nil end;local a=string.reverse(string.sub(a,3))local b=0;for c=1,string.len(a)do local a=string.sub(a,c,c)=="1"and 1 or 0;b=b+a*math.pow(2,c-1)end;return b end;return nil end;function D:buffreplace(a,b,c)local d,e="",a.buff;for a=1,#e do local a=string.sub(e,a,a)if a==b then a=c end;d=d..a end;a.buff=d end;function D:trydecpoint(a,b)local c=a.decpoint;self:buffreplace(a,c,a.decpoint)local c=self:str2d(a.buff)b.seminfo=c;if not c then self:buffreplace(a,a.decpoint,".")self:lexerror(a,"malformed number","TK_NUMBER")end end;function D:read_numeral(a,b)repeat self:save_and_next(a)until string.find(a.current,"%D")and a.current~="."if self:check_next(a,"Ee")then self:check_next(a,"+-")end;while string.find(a.current,"^%w$")or a.current=="_"do self:save_and_next(a)end;self:buffreplace(a,".",a.decpoint)local c=self:str2d(a.buff)b.seminfo=c;if not c then self:trydecpoint(a,b)end end;function D:skip_sep(a)local b=0;local c=a.current;self:save_and_next(a)while a.current=="="do self:save_and_next(a)b=b+1 end;return(a.current==c)and b or(-b)-1 end;function D:read_long_string(a,b,c)local d=0;self:save_and_next(a)if self:currIsNewline(a)then self:inclinenumber(a)end;while true do local e=a.current;if e=="EOZ"then self:lexerror(a,b and"unfinished long string"or"unfinished long comment","TK_EOS")elseif e=="["then if self.LUA_COMPAT_LSTR then if self:skip_sep(a)==c then self:save_and_next(a)d=d+1;if self.LUA_COMPAT_LSTR==1 then if c==0 then self:lexerror(a,"nesting of [[...]] is deprecated","[")end end end end elseif e=="]"then if self:skip_sep(a)==c then self:save_and_next(a)if self.LUA_COMPAT_LSTR and self.LUA_COMPAT_LSTR==2 then d=d-1;if c==0 and d>=0 then break end end;break end elseif self:currIsNewline(a)then self:save(a,"\n")self:inclinenumber(a)if not b then a.buff=""end else if b then self:save_and_next(a)else self:nextc(a)end end end;if b then local c=3+c;b.seminfo=string.sub(a.buff,c,-c)end end;function D:read_string(a,b,c)self:save_and_next(a)while a.current~=b do local c=a.current;if c=="EOZ"then self:lexerror(a,"unfinished string","TK_EOS")elseif self:currIsNewline(a)then self:lexerror(a,"unfinished string","TK_STRING")elseif c=="\\"then c=self:nextc(a)if self:currIsNewline(a)then self:save(a,"\n")self:inclinenumber(a)elseif c~="EOZ"then local d=string.find("abfnrtv",c,1,1)if d then self:save(a,string.sub("\a\b\f\n\r\t\v",d,d))self:nextc(a)elseif c=="u"then assert(utf8 and utf8.char,"No utf8 library found! Cannot decode UTF8 string literal!")if self:nextc(a)~="{"then self:lexerror("Sounds like a skill issue","TK_STRING")end;local b=""while true do c=self:nextc(a)if c=="}"then break elseif string.match(c,"%x")then b=b..c else self:lexerror(string.format("Invalid unicode character sequence. Expected alphanumeric character, got %s. Did you forget to close the code sequence with a curly bracket?",c),"TK_STRING")end end;if not tonumber(b,16)or not utf8.char(tonumber(b,16))then self:lexerror(string.format("Invalid UTF8 char %s. Expected a valid UTF8 character code",b),"TK_STRING")else self:save(a,utf8.char(tonumber(b)))end elseif string.lower(c)=="x"then local b=self:nextc(a)..self:nextc(a)if not string.match(string.upper(b),"%x")then self:lexerror(string.format("Invalid hex string literal. Expected valid string literal, got %s",b),"TK_STRING")else self:save(a,string.char(tonumber(b,16)))end elseif string.lower(c)=="z"then local c=D:nextc(a)if c==b then break else self:save(a,c)end elseif not string.find(c,"%d")then self:save_and_next(a)else c,d=0,0;repeat c=10*c+a.current;self:nextc(a)d=d+1 until d>=3 or not string.find(a.current,"%d")if c>255 then self:lexerror(a,"escape sequence too large","TK_STRING")end;self:save(a,string.char(c))end end else self:save_and_next(a)end end;self:save_and_next(a)c.seminfo=string.sub(a.buff,2,-2)end;function D:llex(a,b)a.buff=""while true do local c=a.current;if self:currIsNewline(a)then self:inclinenumber(a)elseif c=="-"then c=self:nextc(a)if c=="="then self:nextc(a)return"TK_ASSIGN_SUB"elseif c~="-"then return"-"end;local b=-1;if self:nextc(a)=='['then b=self:skip_sep(a)a.buff=""end;if b>=0 then self:read_long_string(a,nil,b)a.buff=""else while not self:currIsNewline(a)and a.current~="EOZ"do self:nextc(a)end end elseif c=="["then local c=self:skip_sep(a)if c>=0 then self:read_long_string(a,b,c)return"TK_STRING"elseif c==-1 then return"["else self:lexerror(a,"invalid long string delimiter","TK_STRING")end elseif c=="+"then c=self:nextc(a)if c~="="then return"+"else self:nextc(a)return"TK_ASSIGN_ADD"end elseif c=="*"then c=self:nextc(a)if c~="="then return"*"else self:nextc(a)return"TK_ASSIGN_MUL"end elseif c=="/"then c=self:nextc(a)if c~="="then return"/"else self:nextc(a)return"TK_ASSIGN_DIV"end elseif c=="%"then c=self:nextc(a)if c~="="then return"%"else self:nextc(a)return"TK_ASSIGN_MOD"end elseif c=="^"then c=self:nextc(a)if c~="="then return"^"else self:nextc(a)return"TK_ASSIGN_POW"end elseif c=="="then c=self:nextc(a)if c~="="then return"="else self:nextc(a)return"TK_EQ"end elseif c=="<"then c=self:nextc(a)if c~="="then return"<"else self:nextc(a)return"TK_LE"end elseif c==">"then c=self:nextc(a)if c~="="then return">"else self:nextc(a)return"TK_GE"end elseif c=="~"then c=self:nextc(a)if c~="="then return"~"else self:nextc(a)return"TK_NE"end elseif c=="\""or c=="'"then self:read_string(a,c,b)return"TK_STRING"elseif c=="."then c=self:save_and_next(a)if self:check_next(a,".")then if self:check_next(a,".")then return"TK_DOTS"else return"TK_CONCAT"end elseif not string.find(c,"%d")then return"."else self:read_numeral(a,b)return"TK_NUMBER"end elseif c=="EOZ"then return"TK_EOS"else if string.find(c,"%s")then self:nextc(a)elseif string.find(c,"%d")then self:read_numeral(a,b)return"TK_NUMBER"elseif string.find(c,"[_%a]")then repeat c=self:save_and_next(a)until c=="EOZ"or not string.find(c,"[_%w]")local a=a.buff;local c=self.enums[a]if c then return c end;b.seminfo=a;return"TK_NAME"else self:nextc(a)return c end end end end;local E={}local F={}F.MAXSTACK=250;function F:ttisnumber(a)if a then return type(a.value)=="number"else return false end end;function F:nvalue(a)return a.value end;function F:setnilvalue(a)a.value=nil end;function F:setsvalue(a,b)a.value=b end;F.setnvalue=F.setsvalue;F.sethvalue=F.setsvalue;F.setbvalue=F.setsvalue;function F:numadd(a,b)return a+b end;function F:numsub(a,b)return a-b end;function F:nummul(a,b)return a*b end;function F:numdiv(a,b)return a/b end;function F:nummod(a,b)return a%b end;function F:numpow(a,b)return a^b end;function F:numunm(a)return-a end;function F:numisnan(a)return a~=a end;F.NO_JUMP=-1;F.BinOpr={OPR_ADD=0,OPR_SUB=1,OPR_MUL=2,OPR_DIV=3,OPR_MOD=4,OPR_POW=5,OPR_CONCAT=6,OPR_NE=7,OPR_EQ=8,OPR_LT=9,OPR_LE=10,OPR_GT=11,OPR_GE=12,OPR_AND=13,OPR_OR=14,OPR_NOBINOPR=15}F.UnOpr={OPR_MINUS=0,OPR_NOT=1,OPR_LEN=2,OPR_NOUNOPR=3}function F:getcode(a,b)return a.f.code[b.info]end;function F:codeAsBx(a,b,d,e)return self:codeABx(a,b,d,e+c.MAXARG_sBx)end;function F:setmultret(a,b)self:setreturns(a,b,E.LUA_MULTRET)end;function F:hasjumps(a)return a.t~=a.f end;function F:isnumeral(a)return a.k=="VKNUM"and a.t==self.NO_JUMP and a.f==self.NO_JUMP end;function F:_nil(a,b,d)if a.pc>a.lasttarget then if a.pc==0 then if b>=a.nactvar then return end else local a=a.f.code[a.pc-1]if c:GET_OPCODE(a)=="OP_LOADNIL"then local e=c:GETARG_A(a)local f=c:GETARG_B(a)if e<=b and b<=f+1 then if b+d-1>f then c:SETARG_B(a,b+d-1)end;return end end end end;self:codeABC(a,"OP_LOADNIL",b,b+d-1,0)end;function F:jump(a)local b=a.jpc;a.jpc=self.NO_JUMP;local c=self:codeAsBx(a,"OP_JMP",0,self.NO_JUMP)c=self:concat(a,c,b)return c end;function F:ret(a,b,c)self:codeABC(a,"OP_RETURN",b,c+1,0)end;function F:condjump(a,b,c,d,e)self:codeABC(a,b,c,d,e)return self:jump(a)end;function F:fixjump(a,b,d)local e=a.f.code[b]local b=d-(b+1)assert(d~=self.NO_JUMP)if math.abs(b)>c.MAXARG_sBx then D:syntaxerror(a.ls,"control structure too long")end;c:SETARG_sBx(e,b)end;function F:getlabel(a)a.lasttarget=a.pc;return a.pc end;function F:getjump(a,b)local a=c:GETARG_sBx(a.f.code[b])if a==self.NO_JUMP then return self.NO_JUMP else return(b+1)+a end end;function F:getjumpcontrol(a,b)local d=a.f.code[b]local a=a.f.code[b-1]if b>=1 and c:testTMode(c:GET_OPCODE(a))~=0 then return a else return d end end;function F:need_value(a,b)while b~=self.NO_JUMP do local d=self:getjumpcontrol(a,b)if c:GET_OPCODE(d)~="OP_TESTSET"then return true end;b=self:getjump(a,b)end;return false end;function F:patchtestreg(a,b,d)local a=self:getjumpcontrol(a,b)if c:GET_OPCODE(a)~="OP_TESTSET"then return false end;if d~=c.NO_REG and d~=c:GETARG_B(a)then c:SETARG_A(a,d)else c:SET_OPCODE(a,"OP_TEST")local b=c:GETARG_B(a)c:SETARG_A(a,b)c:SETARG_B(a,0)end;return true end;function F:removevalues(a,b)while b~=self.NO_JUMP do self:patchtestreg(a,b,c.NO_REG)b=self:getjump(a,b)end end;function F:patchlistaux(a,b,c,d,e)while b~=self.NO_JUMP do local f=self:getjump(a,b)if self:patchtestreg(a,b,d)then self:fixjump(a,b,c)else self:fixjump(a,b,e)end;b=f end end;function F:dischargejpc(a)self:patchlistaux(a,a.jpc,a.pc,c.NO_REG,a.pc)a.jpc=self.NO_JUMP end;function F:patchlist(a,b,d)if d==a.pc then self:patchtohere(a,b)else assert(da.f.maxstacksize then if b>=self.MAXSTACK then D:syntaxerror(a.ls,"function or expression too complex")end;a.f.maxstacksize=b end end;function F:reserveregs(a,b)self:checkstack(a,b)a.freereg=a.freereg+b end;function F:freereg(a,b)if not c:ISK(b)and b>=a.nactvar then a.freereg=a.freereg-1;assert(b==a.freereg)end end;function F:freeexp(a,b)if b.k=="VNONRELOC"then self:freereg(a,b.info)end end;function F:addk(a,b,d)local e=a.L;local f=a.h[b.value]local g=a.f;if self:ttisnumber(f)then return self:nvalue(f)else f={}self:setnvalue(f,a.nk)a.h[b.value]=f;E:growvector(e,g.k,a.nk,g.sizek,nil,c.MAXARG_Bx,"constant table overflow")g.k[a.nk]=d;local b=a.nk;a.nk=a.nk+1;return b end end;function F:stringK(a,b)local c={}self:setsvalue(c,b)return self:addk(a,c,c)end;function F:numberK(a,b)local c={}self:setnvalue(c,b)return self:addk(a,c,c)end;function F:boolK(a,b)local c={}self:setbvalue(c,b)return self:addk(a,c,c)end;function F:nilK(a)local b,c={},{}self:setnilvalue(c)self:sethvalue(b,a.h)return self:addk(a,b,c)end;function F:setreturns(a,b,d)if b.k=="VCALL"then c:SETARG_C(self:getcode(a,b),d+1)elseif b.k=="VVARARG"then c:SETARG_B(self:getcode(a,b),d+1)c:SETARG_A(self:getcode(a,b),a.freereg)F:reserveregs(a,1)end end;function F:setoneret(a,b)if b.k=="VCALL"then b.k="VNONRELOC"b.info=c:GETARG_A(self:getcode(a,b))elseif b.k=="VVARARG"then c:SETARG_B(self:getcode(a,b),2)b.k="VRELOCABLE"end end;function F:dischargevars(a,b)local c=b.k;if c=="VLOCAL"then b.k="VNONRELOC"elseif c=="VUPVAL"then b.info=self:codeABC(a,"OP_GETUPVAL",0,b.info,0)b.k="VRELOCABLE"elseif c=="VGLOBAL"then b.info=self:codeABx(a,"OP_GETGLOBAL",0,b.info)b.k="VRELOCABLE"elseif c=="VINDEXED"then self:freereg(a,b.aux)self:freereg(a,b.info)b.info=self:codeABC(a,"OP_GETTABLE",0,b.info,b.aux)b.k="VRELOCABLE"elseif c=="VVARARG"or c=="VCALL"then self:setoneret(a,b)else end end;function F:code_label(a,b,c,d)self:getlabel(a)return self:codeABC(a,"OP_LOADBOOL",b,c,d)end;function F:discharge2reg(a,b,d)self:dischargevars(a,b)local e=b.k;if e=="VNIL"then self:_nil(a,d,1)elseif e=="VFALSE"or e=="VTRUE"then self:codeABC(a,"OP_LOADBOOL",d,(b.k=="VTRUE")and 1 or 0,0)elseif e=="VK"then self:codeABx(a,"OP_LOADK",d,b.info)elseif e=="VKNUM"then self:codeABx(a,"OP_LOADK",d,self:numberK(a,b.nval))elseif e=="VRELOCABLE"then local a=self:getcode(a,b)c:SETARG_A(a,d)elseif e=="VNONRELOC"then if d~=b.info then self:codeABC(a,"OP_MOVE",d,b.info,0)end else assert(b.k=="VVOID"or b.k=="VJMP")return end;b.info=d;b.k="VNONRELOC"end;function F:discharge2anyreg(a,b)if b.k~="VNONRELOC"then self:reserveregs(a,1)self:discharge2reg(a,b,a.freereg-1)end end;function F:exp2reg(a,b,c)self:discharge2reg(a,b,c)if b.k=="VJMP"then b.t=self:concat(a,b.t,b.info)end;if self:hasjumps(b)then local d;local e=self.NO_JUMP;local f=self.NO_JUMP;if self:need_value(a,b.t)or self:need_value(a,b.f)then local b=(b.k=="VJMP")and self.NO_JUMP or self:jump(a)e=self:code_label(a,c,0,1)f=self:code_label(a,c,1,0)self:patchtohere(a,b)end;d=self:getlabel(a)self:patchlistaux(a,b.f,d,c,e)self:patchlistaux(a,b.t,d,c,f)end;b.f,b.t=self.NO_JUMP,self.NO_JUMP;b.info=c;b.k="VNONRELOC"end;function F:exp2nextreg(a,b)self:dischargevars(a,b)self:freeexp(a,b)self:reserveregs(a,1)self:exp2reg(a,b,a.freereg-1)end;function F:exp2anyreg(a,b)self:dischargevars(a,b)if b.k=="VNONRELOC"then if not self:hasjumps(b)then return b.info end;if b.info>=a.nactvar then self:exp2reg(a,b,b.info)return b.info end end;self:exp2nextreg(a,b)return b.info end;function F:exp2val(a,b)if self:hasjumps(b)then self:exp2anyreg(a,b)else self:dischargevars(a,b)end end;function F:exp2RK(a,b)self:exp2val(a,b)local d=b.k;if d=="VKNUM"or d=="VTRUE"or d=="VFALSE"or d=="VNIL"then if a.nk<=c.MAXINDEXRK then if b.k=="VNIL"then b.info=self:nilK(a)else b.info=(b.k=="VKNUM")and self:numberK(a,b.nval)or self:boolK(a,b.k=="VTRUE")end;b.k="VK"return c:RKASK(b.info)end elseif d=="VK"then if b.info<=c.MAXINDEXRK then return c:RKASK(b.info)end else end;return self:exp2anyreg(a,b)end;function F:storevar(a,b,c)local d=b.k;if d=="VLOCAL"then self:freeexp(a,c)self:exp2reg(a,c,b.info)return elseif d=="VUPVAL"then local c=self:exp2anyreg(a,c)self:codeABC(a,"OP_SETUPVAL",c,b.info,0)elseif d=="VGLOBAL"then local c=self:exp2anyreg(a,c)self:codeABx(a,"OP_SETGLOBAL",c,b.info)elseif d=="VINDEXED"then local c=self:exp2RK(a,c)self:codeABC(a,"OP_SETTABLE",b.info,b.aux,c)else assert(0)end;self:freeexp(a,c)end;function F:_self(a,b,c)self:exp2anyreg(a,b)self:freeexp(a,b)local d=a.freereg;self:reserveregs(a,2)self:codeABC(a,"OP_SELF",d,b.info,self:exp2RK(a,c))self:freeexp(a,c)b.info=d;b.k="VNONRELOC"end;function F:invertjump(a,b)local a=self:getjumpcontrol(a,b.info)assert(c:testTMode(c:GET_OPCODE(a))~=0 and c:GET_OPCODE(a)~="OP_TESTSET"and c:GET_OPCODE(a)~="OP_TEST")c:SETARG_A(a,(c:GETARG_A(a)==0)and 1 or 0)end;function F:jumponcond(a,b,d)if b.k=="VRELOCABLE"then local b=self:getcode(a,b)if c:GET_OPCODE(b)=="OP_NOT"then a.pc=a.pc-1;return self:condjump(a,"OP_TEST",c:GETARG_B(b),0,d and 0 or 1)end end;self:discharge2anyreg(a,b)self:freeexp(a,b)return self:condjump(a,"OP_TESTSET",c.NO_REG,b.info,d and 1 or 0)end;function F:goiftrue(a,b)local c;self:dischargevars(a,b)local d=b.k;if d=="VK"or d=="VKNUM"or d=="VTRUE"then c=self.NO_JUMP elseif d=="VFALSE"then c=self:jump(a)elseif d=="VJMP"then self:invertjump(a,b)c=b.info else c=self:jumponcond(a,b,false)end;b.f=self:concat(a,b.f,c)self:patchtohere(a,b.t)b.t=self.NO_JUMP end;function F:goiffalse(a,b)local c;self:dischargevars(a,b)local d=b.k;if d=="VNIL"or d=="VFALSE"then c=self.NO_JUMP elseif d=="VTRUE"then c=self:jump(a)elseif d=="VJMP"then c=b.info else c=self:jumponcond(a,b,true)end;b.t=self:concat(a,b.t,c)self:patchtohere(a,b.f)b.f=self.NO_JUMP end;function F:codenot(a,b)self:dischargevars(a,b)local c=b.k;if c=="VNIL"or c=="VFALSE"then b.k="VTRUE"elseif c=="VK"or c=="VKNUM"or c=="VTRUE"then b.k="VFALSE"elseif c=="VJMP"then self:invertjump(a,b)elseif c=="VRELOCABLE"or c=="VNONRELOC"then self:discharge2anyreg(a,b)self:freeexp(a,b)b.info=self:codeABC(a,"OP_NOT",0,b.info,0)b.k="VRELOCABLE"else assert(0)end;b.f,b.t=b.t,b.f;self:removevalues(a,b.f)self:removevalues(a,b.t)end;function F:indexed(a,b,c)b.aux=self:exp2RK(a,c)b.k="VINDEXED"end;function F:constfolding(a,b,c)local d;if not self:isnumeral(b)or not self:isnumeral(c)then return false end;local e=b.nval;local c=c.nval;if a=="OP_ADD"then d=self:numadd(e,c)elseif a=="OP_SUB"then d=self:numsub(e,c)elseif a=="OP_MUL"then d=self:nummul(e,c)elseif a=="OP_DIV"then if c==0 then return false end;d=self:numdiv(e,c)elseif a=="OP_MOD"then if c==0 then return false end;d=self:nummod(e,c)elseif a=="OP_POW"then d=self:numpow(e,c)elseif a=="OP_UNM"then d=self:numunm(e)elseif a=="OP_LEN"then return false else assert(0)d=0 end;if self:numisnan(d)then return false end;b.nval=d;return true end;function F:codearith(a,b,c,d)if self:constfolding(b,c,d)then return else local e=(b~="OP_UNM"and b~="OP_LEN")and self:exp2RK(a,d)or 0;local f=self:exp2RK(a,c)if f>e then self:freeexp(a,c)self:freeexp(a,d)else self:freeexp(a,d)self:freeexp(a,c)end;c.info=self:codeABC(a,b,0,f,e)c.k="VRELOCABLE"end end;function F:codecomp(a,b,c,d,e)local f=self:exp2RK(a,d)local g=self:exp2RK(a,e)self:freeexp(a,e)self:freeexp(a,d)if c==0 and b~="OP_EQ"then f,g=g,f;c=1 end;d.info=self:condjump(a,b,c,f,g)d.k="VJMP"end;function F:prefix(a,b,c)local d={}d.t,d.f=self.NO_JUMP,self.NO_JUMP;d.k="VKNUM"d.nval=0;if b=="OPR_MINUS"then if not self:isnumeral(c)then self:exp2anyreg(a,c)end;self:codearith(a,"OP_UNM",c,d)elseif b=="OPR_NOT"then self:codenot(a,c)elseif b=="OPR_LEN"then self:exp2anyreg(a,c)self:codearith(a,"OP_LEN",c,d)else assert(0)end end;function F:infix(a,b,c)if b=="OPR_AND"then self:goiftrue(a,c)elseif b=="OPR_OR"then self:goiffalse(a,c)elseif b=="OPR_CONCAT"then self:exp2nextreg(a,c)elseif b=="OPR_ADD"or b=="OPR_SUB"or b=="OPR_MUL"or b=="OPR_DIV"or b=="OPR_MOD"or b=="OPR_POW"then if not self:isnumeral(c)then self:exp2RK(a,c)end else self:exp2RK(a,c)end end;F.arith_op={OPR_ADD="OP_ADD",OPR_SUB="OP_SUB",OPR_MUL="OP_MUL",OPR_DIV="OP_DIV",OPR_MOD="OP_MOD",OPR_POW="OP_POW"}F.comp_op={OPR_EQ="OP_EQ",OPR_NE="OP_EQ",OPR_LT="OP_LT",OPR_LE="OP_LE",OPR_GT="OP_LT",OPR_GE="OP_LE"}F.comp_cond={OPR_EQ=1,OPR_NE=0,OPR_LT=1,OPR_LE=1,OPR_GT=0,OPR_GE=0}function F:posfix(a,b,d,e)local function f(a,b)a.k=b.k;a.info=b.info;a.aux=b.aux;a.nval=b.nval;a.t=b.t;a.f=b.f end;if b=="OPR_AND"then assert(d.t==self.NO_JUMP)self:dischargevars(a,e)e.f=self:concat(a,e.f,d.f)f(d,e)elseif b=="OPR_OR"then assert(d.f==self.NO_JUMP)self:dischargevars(a,e)e.t=self:concat(a,e.t,d.t)f(d,e)elseif b=="OPR_CONCAT"then self:exp2val(a,e)if e.k=="VRELOCABLE"and c:GET_OPCODE(self:getcode(a,e))=="OP_CONCAT"then assert(d.info==c:GETARG_B(self:getcode(a,e))-1)self:freeexp(a,d)c:SETARG_B(self:getcode(a,e),d.info)d.k="VRELOCABLE"d.info=e.info else self:exp2nextreg(a,e)self:codearith(a,"OP_CONCAT",d,e)end else local c=self.arith_op[b]if c then self:codearith(a,c,d,e)else local c=self.comp_op[b]if c then self:codecomp(a,c,self.comp_cond[b],d,e)else assert(0)end end end end;function F:fixline(a,b)a.f.lineinfo[a.pc-1]=b end;function F:code(a,b,c)local d=a.f;self:dischargejpc(a)E:growvector(a.L,d.code,a.pc,d.sizecode,nil,E.MAX_INT,"code size overflow")d.code[a.pc]=b;E:growvector(a.L,d.lineinfo,a.pc,d.sizelineinfo,nil,E.MAX_INT,"code size overflow")d.lineinfo[a.pc]=c;local b=a.pc;a.pc=a.pc+1;return b end;function F:codeABC(a,b,d,e,f)assert(c:getOpMode(b)==c.OpMode.iABC)assert(c:getBMode(b)~=c.OpArgMask.OpArgN or e==0)assert(c:getCMode(b)~=c.OpArgMask.OpArgN or f==0)return self:code(a,c:CREATE_ABC(b,d,e,f),a.ls.lastline)end;function F:codeABx(a,b,d,e)assert(c:getOpMode(b)==c.OpMode.iABx or c:getOpMode(b)==c.OpMode.iAsBx)assert(c:getCMode(b)==c.OpArgMask.OpArgN)return self:code(a,c:CREATE_ABx(b,d,e),a.ls.lastline)end;function F:setlist(a,b,d,e)local d=math.floor((d-1)/c.LFIELDS_PER_FLUSH)+1;local f=(e==E.LUA_MULTRET)and 0 or e;assert(e~=0)if d<=c.MAXARG_C then self:codeABC(a,"OP_SETLIST",b,f,d)else self:codeABC(a,"OP_SETLIST",b,f,0)self:code(a,c:CREATE_Inst(d),a.ls.lastline)end;a.freereg=b+1 end;E.LUA_QS=D.LUA_QS or"'%s'"E.SHRT_MAX=32767;E.LUAI_MAXVARS=200;E.LUAI_MAXUPVALUES=60;E.MAX_INT=D.MAX_INT or 2147483645;E.LUAI_MAXCCALLS=200;E.VARARG_HASARG=1;E.HASARG_MASK=2;E.VARARG_ISVARARG=2;E.VARARG_NEEDSARG=4;E.LUA_MULTRET=-1;function E:LUA_QL(a)return"'"..a.."'"end;function E:growvector(a,a,a,b,b,b,c)if a>=b then error(c)end end;function E:newproto(a)local a={}a.k={}a.sizek=0;a.p={}a.sizep=0;a.code={}a.sizecode=0;a.sizelineinfo=0;a.sizeupvalues=0;a.nups=0;a.upvalues={}a.numparams=0;a.is_vararg=0;a.maxstacksize=0;a.lineinfo={}a.sizelocvars=0;a.locvars={}a.lineDefined=0;a.lastlinedefined=0;a.source=nil;return a end;function E:int2fb(a)local b=0;while a>=16 do a=math.floor((a+1)/2)b=b+1 end;if a<8 then return a else return((b+1)*8)+(a-8)end end;function E:hasmultret(a)return a=="VCALL"or a=="VVARARG"end;function E:getlocvar(a,b)return a.f.locvars[a.actvar[b]]end;function E:checklimit(a,b,c,d)if b>c then self:errorlimit(a,c,d)end end;function E:anchor_token(a)if a.t.token=="TK_NAME"or a.t.token=="TK_STRING"then end end;function E:error_expected(a,b)D:syntaxerror(a,string.format(self.LUA_QS.." expected",D:token2str(a,b)))end;function E:errorlimit(a,b,c)local b=(a.f.linedefined==0)and string.format("main function has more than %d %s",b,c)or string.format("function at line %d has more than %d %s",a.f.linedefined,b,c)D:lexerror(a.ls,b,0)end;function E:testnext(a,b)if a.t.token==b then D:next(a)return true else return false end end;function E:check(a,b)if a.t.token~=b then self:error_expected(a,b)end end;function E:checknext(a,b)self:check(a,b)D:next(a)end;function E:check_condition(a,b,c)if not b then D:syntaxerror(a,c)end end;function E:check_match(a,b,c,d)if not self:testnext(a,b)then if d==a.linenumber then self:error_expected(a,b)else D:syntaxerror(a,string.format(self.LUA_QS.." expected (to close "..self.LUA_QS.." at line %d)",D:token2str(a,b),D:token2str(a,c),d))end end end;function E:str_checkname(a)self:check(a,"TK_NAME")local b=a.t.seminfo;D:next(a)return b end;function E:init_exp(a,b,c)a.f,a.t=F.NO_JUMP,F.NO_JUMP;a.k=b;a.info=c end;function E:codestring(a,b,c)self:init_exp(b,"VK",F:stringK(a.fs,c))end;function E:checkname(a,b)self:codestring(a,b,self:str_checkname(a))end;function E:registerlocalvar(a,b)local c=a.fs;local d=c.f;self:growvector(a.L,d.locvars,c.nlocvars,d.sizelocvars,nil,self.SHRT_MAX,"too many local variables")d.locvars[c.nlocvars]={}d.locvars[c.nlocvars].varname=b;local a=c.nlocvars;c.nlocvars=c.nlocvars+1;return a end;function E:new_localvarliteral(a,b,c)self:new_localvar(a,b,c)end;function E:new_localvar(a,b,c)local d=a.fs;self:checklimit(d,d.nactvar+c+1,self.LUAI_MAXVARS,"local variables")d.actvar[d.nactvar+c]=self:registerlocalvar(a,b)end;function E:adjustlocalvars(a,b)local a=a.fs;a.nactvar=a.nactvar+b;for b=b,1,-1 do self:getlocvar(a,a.nactvar-b).startpc=a.pc end end;function E:removevars(a,b)local a=a.fs;while a.nactvar>b do a.nactvar=a.nactvar-1;self:getlocvar(a,a.nactvar).endpc=a.pc end end;function E:indexupvalue(a,b,c)local d=a.f;for e=0,d.nups-1 do if a.upvalues[e].k==c.k and a.upvalues[e].info==c.info then assert(d.upvalues[e]==b)return e end end;self:checklimit(a,d.nups+1,self.LUAI_MAXUPVALUES,"upvalues")self:growvector(a.L,d.upvalues,d.nups,d.sizeupvalues,nil,self.MAX_INT,"")d.upvalues[d.nups]=b;assert(c.k=="VLOCAL"or c.k=="VUPVAL")a.upvalues[d.nups]={k=c.k,info=c.info}local a=d.nups;d.nups=d.nups+1;return a end;function E:searchvar(a,b)for c=a.nactvar-1,0,-1 do if b==self:getlocvar(a,c).varname then return c end end;return-1 end;function E:markupval(a,b)local a=a.bl;while a and a.nactvar>b do a=a.previous end;if a then a.upval=true end end;function E:singlevaraux(a,b,d,e)if a==nil then self:init_exp(d,"VGLOBAL",c.NO_REG)return"VGLOBAL"else local c=self:searchvar(a,b)if c>=0 then self:init_exp(d,"VLOCAL",c)if e==0 then self:markupval(a,c)end;return"VLOCAL"else if self:singlevaraux(a.prev,b,d,0)=="VGLOBAL"then return"VGLOBAL"end;d.info=self:indexupvalue(a,b,d)d.k="VUPVAL"return"VUPVAL"end end end;function E:singlevar(a,b)local c=self:str_checkname(a)local a=a.fs;if self:singlevaraux(a,c,b,1)=="VGLOBAL"then b.info=F:stringK(a,c)end end;function E:adjust_assign(a,b,c,d)local a=a.fs;local b=b-c;if self:hasmultret(d.k)then b=b+1;if b<=0 then b=0 end;F:setreturns(a,d,b)if b>1 then F:reserveregs(a,b-1)end else if d.k~="VVOID"then F:exp2nextreg(a,d)end;if b>0 then local c=a.freereg;F:reserveregs(a,b)F:_nil(a,c,b)end end end;function E:enterlevel(a)a.L.nCcalls=a.L.nCcalls+1;if a.L.nCcalls>self.LUAI_MAXCCALLS then D:lexerror(a,"chunk has too many syntax levels",0)end end;function E:leavelevel(a)a.L.nCcalls=a.L.nCcalls-1 end;function E:enterblock(a,b,c)b.breaklist=F.NO_JUMP;b.isbreakable=c;b.nactvar=a.nactvar;b.upval=false;b.previous=a.bl;a.bl=b;assert(a.freereg==a.nactvar)end;function E:leaveblock(a)local b=a.bl;a.bl=b.previous;self:removevars(a.ls,b.nactvar)if b.upval then F:codeABC(a,"OP_CLOSE",b.nactvar,0,0)end;assert(not b.isbreakable or not b.upval)assert(b.nactvar==a.nactvar)a.freereg=a.nactvar;F:patchtohere(a,b.breaklist)end;function E:pushclosure(a,b,d)local e=a.fs;local f=e.f;self:growvector(a.L,f.p,e.np,f.sizep,nil,c.MAXARG_Bx,"constant table overflow")f.p[e.np]=b.f;e.np=e.np+1;self:init_exp(d,"VRELOCABLE",F:codeABx(e,"OP_CLOSURE",0,e.np-1))for a=0,b.f.nups-1 do local c=(b.upvalues[a].k=="VLOCAL")and"OP_MOVE"or"OP_GETUPVAL"F:codeABC(e,c,0,b.upvalues[a].info,0)end end;function E:open_func(a,b)local c=a.L;local d=self:newproto(a.L)b.f=d;b.prev=a.fs;b.ls=a;b.L=c;a.fs=b;b.pc=0;b.lasttarget=-1;b.jpc=F.NO_JUMP;b.freereg=0;b.nk=0;b.np=0;b.nlocvars=0;b.nactvar=0;b.bl=nil;d.source=a.source;d.maxstacksize=2;b.h={}end;function E:close_func(a)local b=a.L;local b=a.fs;local c=b.f;self:removevars(a,0)F:ret(b,0,0)c.sizecode=b.pc;c.sizelineinfo=b.pc;c.sizek=b.nk;c.sizep=b.np;c.sizelocvars=b.nlocvars;c.sizeupvalues=c.nups;assert(b.bl==nil)a.fs=b.prev;if b then self:anchor_token(a)end end;function E:parser(a,b,c,d)local e={}e.t={}e.lookahead={}local f={}f.upvalues={}f.actvar={}a.nCcalls=0;e.buff=c;D:setinput(a,e,b,d)self:open_func(e,f)f.f.is_vararg=self.VARARG_ISVARARG;D:next(e)self:chunk(e)self:check(e,"TK_EOS")self:close_func(e)assert(f.prev==nil)assert(f.f.nups==0)assert(e.fs==nil)return f.f end;function E:field(a,b)local c=a.fs;local d={}F:exp2anyreg(c,b)D:next(a)self:checkname(a,d)F:indexed(c,b,d)end;function E:yindex(a,b)D:next(a)self:expr(a,b)F:exp2val(a.fs,b)self:checknext(a,"]")end;function E:recfield(a,b)local c=a.fs;local d=a.fs.freereg;local e,f={},{}if a.t.token=="TK_NAME"then self:checklimit(c,b.nh,self.MAX_INT,"items in a constructor")self:checkname(a,e)else self:yindex(a,e)end;b.nh=b.nh+1;self:checknext(a,"=")local e=F:exp2RK(c,e)self:expr(a,f)F:codeABC(c,"OP_SETTABLE",b.t.info,e,F:exp2RK(c,f))c.freereg=d end;function E:closelistfield(a,b)if b.v.k=="VVOID"then return end;F:exp2nextreg(a,b.v)b.v.k="VVOID"if b.tostore==c.LFIELDS_PER_FLUSH then F:setlist(a,b.t.info,b.na,b.tostore)b.tostore=0 end end;function E:lastlistfield(a,b)if b.tostore==0 then return end;if self:hasmultret(b.v.k)then F:setmultret(a,b.v)F:setlist(a,b.t.info,b.na,self.LUA_MULTRET)b.na=b.na-1 else if b.v.k~="VVOID"then F:exp2nextreg(a,b.v)end;F:setlist(a,b.t.info,b.na,b.tostore)end end;function E:listfield(a,b)self:expr(a,b.v)self:checklimit(a.fs,b.na,self.MAX_INT,"items in a constructor")b.na=b.na+1;b.tostore=b.tostore+1 end;function E:constructor(a,b)local d=a.fs;local e=a.linenumber;local f=F:codeABC(d,"OP_NEWTABLE",0,0,0)local g={}g.v={}g.na,g.nh,g.tostore=0,0,0;g.t=b;self:init_exp(b,"VRELOCABLE",f)self:init_exp(g.v,"VVOID",0)F:exp2nextreg(a.fs,b)self:checknext(a,"{")repeat assert(g.v.k=="VVOID"or g.tostore>0)if a.t.token=="}"then break end;self:closelistfield(d,g)local b=a.t.token;if b=="TK_NAME"then D:lookahead(a)if a.lookahead.token~="="then self:listfield(a,g)else self:recfield(a,g)end elseif b=="["then self:recfield(a,g)else self:listfield(a,g)end until not self:testnext(a,",")and not self:testnext(a,";")self:check_match(a,"}","{",e)self:lastlistfield(d,g)c:SETARG_B(d.f.code[f],self:int2fb(g.na))c:SETARG_C(d.f.code[f],self:int2fb(g.nh))end;function E:parlist(a)local b=a.fs;local c=b.f;local d=0;c.is_vararg=0;if a.t.token~=")"then repeat local b=a.t.token;if b=="TK_NAME"then self:new_localvar(a,self:str_checkname(a),d)d=d+1 elseif b=="TK_DOTS"then D:next(a)self:new_localvarliteral(a,"arg",d)d=d+1;c.is_vararg=self.VARARG_HASARG+self.VARARG_NEEDSARG;c.is_vararg=c.is_vararg+self.VARARG_ISVARARG else D:syntaxerror(a," or "..self:LUA_QL("...").." expected")end until c.is_vararg~=0 or not self:testnext(a,",")end;self:adjustlocalvars(a,d)c.numparams=b.nactvar-(c.is_vararg%self.HASARG_MASK)F:reserveregs(b,b.nactvar)end;function E:body(a,b,c,d)local e={}e.upvalues={}e.actvar={}self:open_func(a,e)e.f.lineDefined=d;self:checknext(a,"(")if c then self:new_localvarliteral(a,"self",0)self:adjustlocalvars(a,1)end;self:parlist(a)self:checknext(a,")")self:chunk(a)e.f.lastlinedefined=a.linenumber;self:check_match(a,"TK_END","TK_FUNCTION",d)self:close_func(a)self:pushclosure(a,e,b)end;function E:explist1(a,b)local c=1;self:expr(a,b)while self:testnext(a,",")do F:exp2nextreg(a.fs,b)self:expr(a,b)c=c+1 end;return c end;function E:funcargs(a,b)local c=a.fs;local d={}local e;local f=a.linenumber;local g=a.t.token;if g=="("then if f~=a.lastline then D:syntaxerror(a,"ambiguous syntax (function call x new statement)")end;D:next(a)if a.t.token==")"then d.k="VVOID"else self:explist1(a,d)F:setmultret(c,d)end;self:check_match(a,")","(",f)elseif g=="{"then self:constructor(a,d)elseif g=="TK_STRING"then self:codestring(a,d,a.t.seminfo)D:next(a)else D:syntaxerror(a,"function arguments expected")return end;assert(b.k=="VNONRELOC")local a=b.info;if self:hasmultret(d.k)then e=self.LUA_MULTRET else if d.k~="VVOID"then F:exp2nextreg(c,d)end;e=c.freereg-(a+1)end;self:init_exp(b,"VCALL",F:codeABC(c,"OP_CALL",a,e+1,2))F:fixline(c,f)c.freereg=a+1 end;function E:prefixexp(a,b)local c=a.t.token;if c=="("then local c=a.linenumber;D:next(a)self:expr(a,b)self:check_match(a,")","(",c)F:dischargevars(a.fs,b)elseif c=="TK_NAME"then self:singlevar(a,b)else D:syntaxerror(a,"unexpected symbol")end;return end;function E:primaryexp(a,b)local c=a.fs;self:prefixexp(a,b)while true do local d=a.t.token;if d=="."then self:field(a,b)elseif d=="["then local d={}F:exp2anyreg(c,b)self:yindex(a,d)F:indexed(c,b,d)elseif d==":"then local d={}D:next(a)self:checkname(a,d)F:_self(c,b,d)self:funcargs(a,b)elseif d=="("or d=="TK_STRING"or d=="{"then F:exp2nextreg(c,b)self:funcargs(a,b)else return end end end;function E:simpleexp(a,b)local c=a.t.token;if c=="TK_NUMBER"then self:init_exp(b,"VKNUM",0)b.nval=a.t.seminfo elseif c=="TK_STRING"then self:codestring(a,b,a.t.seminfo)elseif c=="TK_NIL"then self:init_exp(b,"VNIL",0)elseif c=="TK_TRUE"then self:init_exp(b,"VTRUE",0)elseif c=="TK_FALSE"then self:init_exp(b,"VFALSE",0)elseif c=="TK_DOTS"then local c=a.fs;self:check_condition(a,c.f.is_vararg~=0,"cannot use "..self:LUA_QL("...").." outside a vararg function")local a=c.f.is_vararg;if a>=self.VARARG_NEEDSARG then c.f.is_vararg=a-self.VARARG_NEEDSARG end;self:init_exp(b,"VVARARG",F:codeABC(c,"OP_VARARG",0,1,0))elseif c=="{"then self:constructor(a,b)return elseif c=="TK_FUNCTION"then D:next(a)self:body(a,b,false,a.linenumber)return else self:primaryexp(a,b)return end;D:next(a)end;function E:getunopr(a)if a=="TK_NOT"then return"OPR_NOT"elseif a=="-"then return"OPR_MINUS"elseif a=="#"then return"OPR_LEN"else return"OPR_NOUNOPR"end end;E.getbinopr_table={["+"]="OPR_ADD",["-"]="OPR_SUB",["*"]="OPR_MUL",["/"]="OPR_DIV",["%"]="OPR_MOD",["^"]="OPR_POW",["TK_CONCAT"]="OPR_CONCAT",["TK_NE"]="OPR_NE",["TK_EQ"]="OPR_EQ",["<"]="OPR_LT",["TK_LE"]="OPR_LE",[">"]="OPR_GT",["TK_GE"]="OPR_GE",["TK_AND"]="OPR_AND",["TK_OR"]="OPR_OR"}function E:getbinopr(a)local a=self.getbinopr_table[a]if a then return a else return"OPR_NOBINOPR"end end;E.COMPOUND_OP_TRANSLATE={TK_ASSIGN_ADD="OP_ADD",TK_ASSIGN_SUB="OP_SUB",TK_ASSIGN_MUL="OP_MUL",TK_ASSIGN_DIV="OP_DIV",TK_ASSIGN_MOD="OP_MOD",TK_ASSIGN_POW="OP_POW"}function E:getcompopr(a)local a=self.COMPOUND_OP_TRANSLATE[a]if a then return a else return"OP_NOCOMOPR"end end;E.priority={{6,6},{6,6},{7,7},{7,7},{7,7},{10,9},{5,4},{3,3},{3,3},{3,3},{3,3},{3,3},{3,3},{2,2},{1,1}}E.UNARY_PRIORITY=8;function E:subexpr(a,b,c)self:enterlevel(a)local d=self:getunopr(a.t.token)if d~="OPR_NOUNOPR"then D:next(a)self:subexpr(a,b,self.UNARY_PRIORITY)F:prefix(a.fs,d,b)else self:simpleexp(a,b)end;local d=self:getbinopr(a.t.token)while d~="OPR_NOBINOPR"and self.priority[F.BinOpr[d]+1][1]>c do local c={}D:next(a)F:infix(a.fs,d,b)local e=self:subexpr(a,c,self.priority[F.BinOpr[d]+1][2])F:posfix(a.fs,d,b,c)d=e end;self:leavelevel(a)return d end;function E:expr(a,b)self:subexpr(a,b,0)end;function E:block_follow(a)if a=="TK_ELSE"or a=="TK_ELSEIF"or a=="TK_END"or a=="TK_UNTIL"or a=="TK_EOS"then return true else return false end end;function E:block(a)local b=a.fs;local c={}self:enterblock(b,c,false)self:chunk(a)assert(c.breaklist==F.NO_JUMP)self:leaveblock(b)end;function E:check_conflict(a,b,c)local a=a.fs;local d=a.freereg;local e=false;while b do if b.v.k=="VINDEXED"then if b.v.info==c.info then e=true;b.v.info=d end;if b.v.aux==c.info then e=true;b.v.aux=d end end;b=b.prev end;if e then F:codeABC(a,"OP_MOVE",a.freereg,c.info,0)F:reserveregs(a,1)end end;function E:assignment(a,b,c)local d={}local e=b.v.k;self:check_condition(a,e=="VLOCAL"or e=="VUPVAL"or e=="VGLOBAL"or e=="VINDEXED","syntax error")if self:testnext(a,",")then local d={}d.v={}d.prev=b;self:primaryexp(a,d.v)if d.v.k=="VLOCAL"then self:check_conflict(a,b,d.v)end;self:checklimit(a.fs,c,self.LUAI_MAXCCALLS-a.L.nCcalls,"variables in assignment")self:assignment(a,d,c+1)else local e=self:getcompopr(a.t.token)if e~="OP_NOCOMOPR"then D:next(a)else self:checknext(a,"=")end;local f=self:explist1(a,d)if f~=c then self:adjust_assign(a,c,f,d)if f>c then a.fs.freereg=a.fs.freereg-(f-c)end else F:setoneret(a.fs,d)if e~="OP_NOCOMOPR"then F:exp2val(a.fs,b.v)F:exp2val(a.fs,d)F:codearith(a.fs,e,b.v,d)end;F:storevar(a.fs,b.v,d)return end end;self:init_exp(d,"VNONRELOC",a.fs.freereg-1)F:storevar(a.fs,b.v,d)end;function E:cond(a)local b={}self:expr(a,b)if b.k=="VNIL"then b.k="VFALSE"end;F:goiftrue(a.fs,b)return b.f end;function E:breakstat(a)local b=a.fs;local c=b.bl;local d=false;while c and not c.isbreakable do if c.upval then d=true end;c=c.previous end;if not c then D:syntaxerror(a,"no loop to break")end;if d then F:codeABC(b,"OP_CLOSE",c.nactvar,0,0)end;c.breaklist=F:concat(b,c.breaklist,F:jump(b))end;function E:continuestat(a)local b=a.fs;local c=b.bl;local d=false;while c and not c.isbreakable do if c.upval then d=true end;c=c.previous end;if not c then D:syntaxerror(a,"no loop to continue")end;if d then F:codeABC(b,"OP_CLOSE",c.nactvar,0,0)end;F:codeAsBx(b,"OP_JMP",0,c.breaklist.previous)end;function E:whilestat(a,b)local c=a.fs;local d={}D:next(a)local e=F:getlabel(c)local f=self:cond(a)self:enterblock(c,d,true)self:checknext(a,"TK_DO")self:block(a)F:patchlist(c,F:jump(c),e)self:check_match(a,"TK_END","TK_WHILE",b)self:leaveblock(c)F:patchtohere(c,f)end;function E:repeatstat(a,b)local c=a.fs;local d=F:getlabel(c)local e,f={},{}self:enterblock(c,e,true)self:enterblock(c,f,false)D:next(a)self:chunk(a)self:check_match(a,"TK_UNTIL","TK_REPEAT",b)local b=self:cond(a)if not f.upval then self:leaveblock(c)F:patchlist(a.fs,b,d)else self:breakstat(a)F:patchtohere(a.fs,b)self:leaveblock(c)F:patchlist(a.fs,F:jump(c),d)end;self:leaveblock(c)end;function E:exp1(a)local b={}self:expr(a,b)local c=b.k;F:exp2nextreg(a.fs,b)return c end;function E:forbody(a,b,c,d,e)local f={}local g=a.fs;self:adjustlocalvars(a,3)self:checknext(a,"TK_DO")local h=e and F:codeAsBx(g,"OP_FORPREP",b,F.NO_JUMP)or F:jump(g)self:enterblock(g,f,false)self:adjustlocalvars(a,d)F:reserveregs(g,d)self:block(a)self:leaveblock(g)F:patchtohere(g,h)local a=e and F:codeAsBx(g,"OP_FORLOOP",b,F.NO_JUMP)or F:codeABC(g,"OP_TFORLOOP",b,0,d)F:fixline(g,c)F:patchlist(g,e and a or F:jump(g),h+1)end;function E:fornum(a,b,c)local d=a.fs;local e=d.freereg;self:new_localvarliteral(a,"(for index)",0)self:new_localvarliteral(a,"(for limit)",1)self:new_localvarliteral(a,"(for step)",2)self:new_localvar(a,b,3)self:checknext(a,'=')self:exp1(a)self:checknext(a,",")self:exp1(a)if self:testnext(a,",")then self:exp1(a)else F:codeABx(d,"OP_LOADK",d.freereg,F:numberK(d,1))F:reserveregs(d,1)end;self:forbody(a,e,c,1,true)end;function E:forlist(a,b)local c=a.fs;local d={}local e=0;local f=c.freereg;self:new_localvarliteral(a,"(for generator)",e)e=e+1;self:new_localvarliteral(a,"(for state)",e)e=e+1;self:new_localvarliteral(a,"(for control)",e)e=e+1;self:new_localvar(a,b,e)e=e+1;while self:testnext(a,",")do self:new_localvar(a,self:str_checkname(a),e)e=e+1 end;self:checknext(a,"TK_IN")local b=a.linenumber;self:adjust_assign(a,3,self:explist1(a,d),d)F:checkstack(c,3)self:forbody(a,f,b,e-3,false)end;function E:forstat(a,b)local c=a.fs;local d={}self:enterblock(c,d,true)D:next(a)local d=self:str_checkname(a)local e=a.t.token;if e=="="then self:fornum(a,d,b)elseif e==","or e=="TK_IN"then self:forlist(a,d)else D:syntaxerror(a,self:LUA_QL("=").." or "..self:LUA_QL("in").." expected")end;self:check_match(a,"TK_END","TK_FOR",b)self:leaveblock(c)end;function E:test_then_block(a)D:next(a)local b=self:cond(a)self:checknext(a,"TK_THEN")self:block(a)return b end;function E:ifstat(a,b)local c=a.fs;local d=F.NO_JUMP;local e=self:test_then_block(a)while a.t.token=="TK_ELSEIF"do d=F:concat(c,d,F:jump(c))F:patchtohere(c,e)e=self:test_then_block(a)end;if a.t.token=="TK_ELSE"then d=F:concat(c,d,F:jump(c))F:patchtohere(c,e)D:next(a)self:block(a)else d=F:concat(c,d,e)end;F:patchtohere(c,d)self:check_match(a,"TK_END","TK_IF",b)end;function E:localfunc(a)local b,c={},{}local d=a.fs;self:new_localvar(a,self:str_checkname(a),0)self:init_exp(b,"VLOCAL",d.freereg)F:reserveregs(d,1)self:adjustlocalvars(a,1)self:body(a,c,false,a.linenumber)F:storevar(d,b,c)self:getlocvar(d,d.nactvar-1).startpc=d.pc end;function E:localstat(a)local b=0;local c;local d={}repeat self:new_localvar(a,self:str_checkname(a),b)b=b+1 until not self:testnext(a,",")if self:testnext(a,"=")then c=self:explist1(a,d)else d.k="VVOID"c=0 end;self:adjust_assign(a,b,c,d)self:adjustlocalvars(a,b)end;function E:funcname(a,b)local c=false;self:singlevar(a,b)while a.t.token=="."do self:field(a,b)end;if a.t.token==":"then c=true;self:field(a,b)end;return c end;function E:funcstat(a,b)local c,d={},{}D:next(a)local e=self:funcname(a,c)self:body(a,d,e,b)F:storevar(a.fs,c,d)F:fixline(a.fs,b)end;function E:exprstat(a)local b=a.fs;local d={}d.v={}self:primaryexp(a,d.v)if d.v.k=="VCALL"then c:SETARG_C(F:getcode(b,d.v),1)else d.prev=nil;self:assignment(a,d,1)end end;function E:retstat(a)local b=a.fs;local d={}local e,f;D:next(a)if self:block_follow(a.t.token)or a.t.token==";"then e,f=0,0 else f=self:explist1(a,d)if self:hasmultret(d.k)then F:setmultret(b,d)if d.k=="VCALL"and f==1 then c:SET_OPCODE(F:getcode(b,d),"OP_TAILCALL")assert(c:GETARG_A(F:getcode(b,d))==b.nactvar)end;e=b.nactvar;f=self.LUA_MULTRET else if f==1 then e=F:exp2anyreg(b,d)else F:exp2nextreg(b,d)e=b.nactvar;assert(f==b.freereg-e)end end end;F:ret(b,e,f)end;function E:statement(a)local b=a.linenumber;local c=a.t.token;if c=="TK_IF"then self:ifstat(a,b)return false elseif c=="TK_WHILE"then self:whilestat(a,b)return false elseif c=="TK_DO"then D:next(a)self:block(a)self:check_match(a,"TK_END","TK_DO",b)return false elseif c=="TK_FOR"then self:forstat(a,b)return false elseif c=="TK_REPEAT"then self:repeatstat(a,b)return false elseif c=="TK_FUNCTION"then self:funcstat(a,b)return false elseif c=="TK_LOCAL"then D:next(a)if self:testnext(a,"TK_FUNCTION")then self:localfunc(a)else self:localstat(a)end;return false elseif c=="TK_RETURN"then self:retstat(a)return true elseif c=="TK_BREAK"then D:next(a)self:breakstat(a)return true elseif c=="TK_CONTINUE"then D:next(a)self:continuestat(a)return true else self:exprstat(a)return false end end;function E:chunk(a)local b=false;self:enterlevel(a)while not b and not self:block_follow(a.t.token)do b=self:statement(a)self:testnext(a,";")assert(a.fs.f.maxstacksize>=a.fs.freereg and a.fs.freereg>=a.fs.nactvar)a.fs.freereg=a.fs.nactvar end;self:leavelevel(a)end;local c=bit32;local F=table.unpack or unpack;local G;local H;local I;local J=50;local K={[22]=18,[31]=8,[33]=28,[0]=3,[1]=13,[2]=23,[26]=33,[12]=1,[13]=6,[14]=10,[15]=16,[16]=20,[17]=26,[18]=30,[19]=36,[3]=0,[4]=2,[5]=4,[6]=7,[7]=9,[8]=12,[9]=14,[10]=17,[20]=19,[21]=22,[23]=24,[24]=27,[25]=29,[27]=32,[32]=34,[34]=37,[11]=5,[28]=11,[29]=15,[30]=21,[35]=25,[36]=31,[37]=35}local L={[0]='ABC','ABx','ABC','ABC','ABC','ABx','ABC','ABx','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','AsBx','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','AsBx','AsBx','ABC','ABC','ABC','ABx','ABC'}local M={[0]={b='OpArgR',c='OpArgN'},{b='OpArgK',c='OpArgN'},{b='OpArgU',c='OpArgU'},{b='OpArgR',c='OpArgN'},{b='OpArgU',c='OpArgN'},{b='OpArgK',c='OpArgN'},{b='OpArgR',c='OpArgK'},{b='OpArgK',c='OpArgN'},{b='OpArgU',c='OpArgN'},{b='OpArgK',c='OpArgK'},{b='OpArgU',c='OpArgU'},{b='OpArgR',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgR',c='OpArgN'},{b='OpArgR',c='OpArgN'},{b='OpArgR',c='OpArgN'},{b='OpArgR',c='OpArgR'},{b='OpArgR',c='OpArgN'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgR',c='OpArgU'},{b='OpArgR',c='OpArgU'},{b='OpArgU',c='OpArgU'},{b='OpArgU',c='OpArgU'},{b='OpArgU',c='OpArgN'},{b='OpArgR',c='OpArgN'},{b='OpArgR',c='OpArgN'},{b='OpArgN',c='OpArgU'},{b='OpArgU',c='OpArgU'},{b='OpArgN',c='OpArgN'},{b='OpArgU',c='OpArgN'},{b='OpArgU',c='OpArgN'}}local function N(a,b,c,d)local e=0;for c=b,c,d do e=e+string.byte(a,c,c)*256^(c-b)end;return e end;local function O(a,b,d,e)local f=(-1)^c.rshift(e,7)local e=c.rshift(d,7)+c.lshift(c.band(e,127),1)local a=a+c.lshift(b,8)+c.lshift(c.band(d,127),16)local b=1;if e==0 then if a==0 then return f*0 else b=0;e=1 end elseif e==127 then if a==0 then return f*(1/0)else return f*(0/0)end end;return f*2^(e-127)*(1+b/2^23)end;local function P(a,b,d,e,f,g,h,i)local j=(-1)^c.rshift(i,7)local i=c.lshift(c.band(i,127),4)+c.rshift(h,4)local c=c.band(h,15)*2^48;local h=1;c=c+(g*2^40)+(f*2^32)+(e*2^24)+(d*2^16)+(b*2^8)+a;if i==0 then if c==0 then return j*0 else h=0;i=1 end elseif i==2047 then if c==0 then return j*(1/0)else return j*(0/0)end end;return j*2^(i-1023)*(h+c/2^52)end;local function Q(a,b,c)return N(a,b,c-1,1)end;local function R(a,b,c)return N(a,c-1,b,-1)end;local function N(a,b)return O(string.byte(a,b,b+3))end;local function S(a,b)local a,b,c,d=string.byte(a,b,b+3)return O(d,c,b,a)end;local function O(a,b)return P(string.byte(a,b,b+7))end;local function T(a,b)local a,b,c,d,e,f,g,h=string.byte(a,b,b+7)return P(h,g,f,e,d,c,b,a)end;local N={[4]={little=N,big=S},[8]={little=O,big=T}}local function O(a)local b=a.index;local c=string.byte(a.source,b,b)a.index=b+1;return c end;local function P(a,b)local b=a.index+b;local c=string.sub(a.source,a.index,b-1)a.index=b;return c end;local function S(a)local b=a:s_szt()local c;if b~=0 then c=string.sub(P(a,b),1,-2)end;return c end;local function T(a,b)return function(c)local a=c.index+a;local b=b(c.source,c.index,a)c.index=a;return b end end;local function U(a,b)return function(c)local b=b(c.source,c.index)c.index=c.index+a;return b end end;local function V(a)local b=a:s_int()local d={}for b=1,b do local a=a:s_ins()local e=c.band(a,63)local f=L[e]local g=M[e]local e={value=a,op=K[e],A=c.band(c.rshift(a,6),255)}if f=='ABC'then e.B=c.band(c.rshift(a,23),511)e.C=c.band(c.rshift(a,14),511)e.is_KB=g.b=='OpArgK'and e.B>255;e.is_KC=g.c=='OpArgK'and e.C>255 elseif f=='ABx'then e.Bx=c.band(c.rshift(a,14),262143)e.is_K=g.b=='OpArgK'elseif f=='AsBx'then e.sBx=c.band(c.rshift(a,14),262143)-131071 end;d[b]=e end;return d end;local function c(a)local b=a:s_int()local c={}for b=1,b do local d=O(a)local e;if d==1 then e=O(a)~=0 elseif d==3 then e=a:s_num()elseif d==4 then e=S(a)end;c[b]=e end;return c end;local function L(a,b)local c=a:s_int()local d={}for c=1,c do d[c]=I(a,b)end;return d end;local function M(a)local b=a:s_int()local c={}for b=1,b do c[b]=a:s_int()end;return c end;local function W(a)local b=a:s_int()local c={}for b=1,b do c[b]={varname=S(a),startpc=a:s_int(),endpc=a:s_int()}end;return c end;local function X(a)local b=a:s_int()local c={}for b=1,b do c[b]=S(a)end;return c end;function I(a,b)local d={}local b=S(a)or b;d.source=b;a:s_int()a:s_int()d.numupvals=O(a)d.numparams=O(a)O(a)O(a)d.code=V(a)d.const=c(a)d.subs=L(a,b)d.lines=M(a)W(a)X(a)for a,a in ipairs(d.code)do if a.is_K then a.const=d.const[a.Bx+1]else if a.is_KB then a.const_B=d.const[a.B-255]end;if a.is_KC then a.const_C=d.const[a.C-255]end end end;return d end;function G(a)local b;local c;local d;local e;local f;local g;local h;local a={index=1,source=a}assert(P(a,4)=='\27Lua','invalid Lua signature')assert(O(a)==81,'invalid Lua version')assert(O(a)==0,'invalid Lua format')c=O(a)~=0;d=O(a)e=O(a)f=O(a)g=O(a)h=O(a)~=0;b=c and Q or R;a.s_int=T(d,b)a.s_szt=T(e,b)a.s_ins=T(f,b)if h then a.s_num=T(g,b)elseif N[g]then a.s_num=U(g,N[g][c and'little'or'big'])else error('unsupported float size')end;return I(a,'@virtual')end;local function c(a,b)for c,d in pairs(a)do if d.index>=b then d.value=d.store[d.index]d.store=d;d.index='value'a[c]=nil end end end;local function I(a,b,c)local d=a[b]if not d then d={index=b,store=c}a[b]=d end;return d end;local function L(...)return select('#',...),{...}end;local function M(a,b)local c=a.source;local a=a.lines[a.pc-1]local d,e,f=string.match(b or'','^(.-):(%d+):%s+(.+)')local g='%s:%i: [%s:%i] %s'a=a or'0'd=d or'?'e=e or'0'f=f or b or''error(string.format(g,c,a,d,e,f),0)end;local function N(a)local b=a.code;local d=a.subs;local e=a.env;local f=a.upvals;local g=a.varargs;local h=-1;local i={}local j=a.stack;local k=a.pc;while true do local l=b[k]local m=l.op;k=k+1;if m<18 then if m<8 then if m<3 then if m<1 then for a=l.A,l.B do j[a]=nil end elseif m>1 then local a=f[l.B]j[l.A]=a.store[a.index]else local a,b;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then b=l.const_C else b=j[l.C]end;j[l.A]=a+b end elseif m>3 then if m<6 then if m>4 then local a=l.A;local b=l.B;local c;if l.is_KC then c=l.const_C else c=j[l.C]end;j[a+1]=j[b]j[a]=j[b][c]else j[l.A]=e[l.const]end elseif m>6 then local a;if l.is_KC then a=l.const_C else a=j[l.C]end;j[l.A]=j[l.B][a]else local a,b;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then b=l.const_C else b=j[l.C]end;j[l.A]=a-b end else j[l.A]=j[l.B]end elseif m>8 then if m<13 then if m<10 then e[l.const]=j[l.A]elseif m>10 then if m<12 then local a=l.A;local b=l.B;local c=l.C;local d;local e,f;if b==0 then d=h-a else d=b-1 end;e,f=L(j[a](F(j,a+1,a+d)))if c==0 then h=a+e-1 else e=c-1 end;for b=1,e do j[a+b-1]=f[b]end else local a=f[l.B]a.store[a.index]=j[l.A]end else local a,b;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then b=l.const_C else b=j[l.C]end;j[l.A]=a*b end elseif m>13 then if m<16 then if m>14 then local a=l.A;local b=l.B;local d;if b==0 then d=h-a else d=b-1 end;c(i,0)return L(j[a](F(j,a+1,a+d)))else local a,b;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then b=l.const_C else b=j[l.C]end;j[l.A][a]=b end elseif m>16 then j[l.A]={}else local a,b;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then b=l.const_C else b=j[l.C]end;j[l.A]=a/b end else j[l.A]=l.const end else local a=l.A;local b=j[a+2]local c=j[a]+b;local a=j[a+1]local d;if b==math.abs(b)then d=c<=a else d=c>=a end;if d then j[l.A]=c;j[l.A+3]=c;k=k+l.sBx end end elseif m>18 then if m<28 then if m<23 then if m<20 then j[l.A]=#j[l.B]elseif m>20 then if m<22 then local a=l.A;local b=l.B;local d={}local e;if b==0 then e=h-a+1 else e=b-1 end;for b=1,e do d[b]=j[a+b-1]end;c(i,0)return e,d else local a=j[l.B]for b=l.B+1,l.C do a=a..j[b]end;j[l.A]=a end else local a,b;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then b=l.const_C else b=j[l.C]end;j[l.A]=a%b end elseif m>23 then if m<26 then if m>24 then c(i,l.A)else local a,c;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then c=l.const_C else c=j[l.C]end;if(a==c)==(l.A~=0)then k=k+b[k].sBx end;k=k+1 end elseif m>26 then local a,c;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then c=l.const_C else c=j[l.C]end;if(a28 then if m<33 then if m<30 then local a,c;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then c=l.const_C else c=j[l.C]end;if(a<=c)==(l.A~=0)then k=k+b[k].sBx end;k=k+1 elseif m>30 then if m<32 then local a=d[l.Bx+1]local c=a.numupvals;local d;if c~=0 then d={}for a=1,c do local b=b[k+a-1]if b.op==K[0]then d[a-1]=I(i,b.B,j)elseif b.op==K[4]then d[a-1]=f[b.B]end end;k=k+c end;j[l.A]=H(a,e,d)else local a=l.A;local b=l.B;if(not j[b])==(l.C~=0)then k=k+1 else j[a]=j[b]end end else j[l.A]=-j[l.B]end elseif m>33 then if m<36 then if m>34 then local a=l.A;local b=l.B;if b==0 then b=g.size;h=a+b-1 end;for b=1,b do j[a+b-1]=g.list[b]end else local a=l.A;local b,c,d;b=assert(tonumber(j[a]),'`for` initial value must be a number')c=assert(tonumber(j[a+1]),'`for` limit must be a number')d=assert(tonumber(j[a+2]),'`for` step must be a number')j[a]=b-d;j[a+1]=c;j[a+2]=d;k=k+l.sBx end elseif m>36 then local a=l.A;local b=l.C;local c=l.B;local d=j[a]local e;if c==0 then c=h-a end;if b==0 then b=l[k].value;k=k+1 end;e=(b-1)*J;for b=1,c do d[b+e]=j[a+b]end else j[l.A]=not j[l.B]end else if(not j[l.A])==(l.C~=0)then k=k+1 end end else local a=l.A;local b=j[a]local c=j[a+1]local d=j[a+2]local e=a+3;local f;if not d and not c and type(b)=="table"then local e=pcall(getmetatable,b)local f=e and not pcall(setmetatable,b,getmetatable(b))or not e;local e=e and getmetatable(b)if not(table.isfrozen and table.isfrozen(b))and f and not e then warn("The table has a metatable buts it's hidden, __iter and __call won't work in forloop.")end;if not(type(e)=="table"and rawget(e,"__call"))then b,c,d=(type(e)=="table"and rawget(e,"__iter")or next),b,nil;j[a],j[a+1],j[a+2]=b,c,d end end;j[e+2]=d;j[e+1]=c;j[e]=b;f={b(c,d)}for a=1,l.C do j[e+a-1]=f[a]end;if j[e]~=nil then j[a+2]=j[e]else k=k+1 end end else k=k+l.sBx end;a.pc=k end end;function H(a,b,c)local d=a.code;local e=a.subs;local f=a.lines;local g=a.source;local a=a.numparams;local function h(...)local h={}local i={}local j=0;local k,l=L(...)local m;local n,o,p;for a=1,a do h[a-1]=l[a]end;if a]]D.MAXSRC=80;D.MAX_INT=2147483645;D.LUA_QS="'%s'"D.LUA_COMPAT_LSTR=1;function D:init()local a,b={},{}for c in string.gmatch(self.RESERVED,"[^\n]+")do local c,c,c,d=string.find(c,"(%S+)%s+(%S+)")a[c]=d;b[d]=c end;self.tokens=a;self.enums=b end;function D:chunkid(a,b)local c;local d=string.sub(a,1,1)if d=="="then c=string.sub(a,2,b)else if d=="@"then a=string.sub(a,2)b=b-#" '...' "local d=#a;c=""if d>b then a=string.sub(a,1+d-b)c=c.."..."end;c=c..a else local d=string.find(a,"[\n\r]")d=d and(d-1)or#a;b=b-#(" [string \"...\"] ")if d>b then d=b end;c="[string \""if d<#a then c=c..string.sub(a,1,d).."..."else c=c..a end;c=c.."\"]"end end;return c end;function D:token2str(a,a)if string.sub(a,1,3)~="TK_"then if string.find(a,"%c")then return string.format("char(%d)",string.byte(a))end;return a else end;return self.tokens[a]end;function D:lexerror(a,b,c)local function d(a,b)if b=="TK_NAME"or b=="TK_STRING"or b=="TK_NUMBER"then return a.buff else return self:token2str(a,b)end end;local e=self:chunkid(a.source,self.MAXSRC)local b=string.format("%s:%d: %s",e,a.linenumber,b)if c then b=string.format("%s near "..self.LUA_QS,b,d(a,c))end;error(b)end;function D:syntaxerror(a,b)self:lexerror(a,b,a.t.token)end;function D:currIsNewline(a)return a.current=="\n"or a.current=="\r"end;function D:inclinenumber(a)local b=a.current;self:nextc(a)if self:currIsNewline(a)and a.current~=b then self:nextc(a)end;a.linenumber=a.linenumber+1;if a.linenumber>=self.MAX_INT then self:syntaxerror(a,"chunk has too many lines")end end;function D:setinput(a,b,c,d)if not b then b={}end;if not b.lookahead then b.lookahead={}end;if not b.t then b.t={}end;b.decpoint="."b.L=a;b.lookahead.token="TK_EOS"b.z=c;b.fs=nil;b.linenumber=1;b.lastline=1;b.source=d;self:nextc(b)end;function D:check_next(a,b)if not string.find(b,a.current,1)then return false end;self:save_and_next(a)return true end;function D:next(a)a.lastline=a.linenumber;if a.lookahead.token~="TK_EOS"then a.t.seminfo=a.lookahead.seminfo;a.t.token=a.lookahead.token;a.lookahead.token="TK_EOS"else a.t.token=self:llex(a,a.t)end end;function D:lookahead(a)a.lookahead.token=self:llex(a,a.lookahead)end;function D:nextc(a)local b=e:zgetc(a.z)a.current=b;return b end;function D:save(a,b)local c=a.buff;a.buff=c..b end;function D:save_and_next(a)self:save(a,a.current)return self:nextc(a)end;function D:str2d(a)if string.match(string.lower(a),"[^b%da-f_]_")or string.match(string.lower(a),"_[^%da-f_]")then return nil end;a=string.gsub(a,"_","")local b=tonumber(a)if b then return b end;if string.lower(string.sub(a,1,2))=="0x"then b=tonumber(a,16)if b then return b end elseif string.lower(string.sub(a,1,2))=="0b"then if string.match(string.sub(a,3),"[^01]")then return nil end;local a=string.reverse(string.sub(a,3))local b=0;for c=1,string.len(a)do local a=string.sub(a,c,c)=="1"and 1 or 0;b=b+a*math.pow(2,c-1)end;return b end;return nil end;function D:buffreplace(a,b,c)local d,e="",a.buff;for a=1,#e do local a=string.sub(e,a,a)if a==b then a=c end;d=d..a end;a.buff=d end;function D:trydecpoint(a,b)local c=a.decpoint;self:buffreplace(a,c,a.decpoint)local c=self:str2d(a.buff)b.seminfo=c;if not c then self:buffreplace(a,a.decpoint,".")self:lexerror(a,"malformed number","TK_NUMBER")end end;function D:read_numeral(a,b)repeat self:save_and_next(a)until string.find(a.current,"%D")and a.current~="."if self:check_next(a,"Ee")then self:check_next(a,"+-")end;while string.find(a.current,"^%w$")or a.current=="_"do self:save_and_next(a)end;self:buffreplace(a,".",a.decpoint)local c=self:str2d(a.buff)b.seminfo=c;if not c then self:trydecpoint(a,b)end end;function D:skip_sep(a)local b=0;local c=a.current;self:save_and_next(a)while a.current=="="do self:save_and_next(a)b=b+1 end;return(a.current==c)and b or(-b)-1 end;function D:read_long_string(a,b,c)local d=0;self:save_and_next(a)if self:currIsNewline(a)then self:inclinenumber(a)end;while true do local e=a.current;if e=="EOZ"then self:lexerror(a,b and"unfinished long string"or"unfinished long comment","TK_EOS")elseif e=="["then if self.LUA_COMPAT_LSTR then if self:skip_sep(a)==c then self:save_and_next(a)d=d+1;if self.LUA_COMPAT_LSTR==1 then if c==0 then self:lexerror(a,"nesting of [[...]] is deprecated","[")end end end end elseif e=="]"then if self:skip_sep(a)==c then self:save_and_next(a)if self.LUA_COMPAT_LSTR and self.LUA_COMPAT_LSTR==2 then d=d-1;if c==0 and d>=0 then break end end;break end elseif self:currIsNewline(a)then self:save(a,"\n")self:inclinenumber(a)if not b then a.buff=""end else if b then self:save_and_next(a)else self:nextc(a)end end end;if b then local c=3+c;b.seminfo=string.sub(a.buff,c,-c)end end;function D:read_string(a,b,c)self:save_and_next(a)while a.current~=b do local c=a.current;if c=="EOZ"then self:lexerror(a,"unfinished string","TK_EOS")elseif self:currIsNewline(a)then self:lexerror(a,"unfinished string","TK_STRING")elseif c=="\\"then c=self:nextc(a)if self:currIsNewline(a)then self:save(a,"\n")self:inclinenumber(a)elseif c~="EOZ"then local d=string.find("abfnrtv",c,1,1)if d then self:save(a,string.sub("\a\b\f\n\r\t\v",d,d))self:nextc(a)elseif c=="u"then assert(utf8 and utf8.char,"No utf8 library found! Cannot decode UTF8 string literal!")if self:nextc(a)~="{"then self:lexerror("Sounds like a skill issue","TK_STRING")end;local b=""while true do c=self:nextc(a)if c=="}"then break elseif string.match(c,"%x")then b=b..c else self:lexerror(string.format("Invalid unicode character sequence. Expected alphanumeric character, got %s. Did you forget to close the code sequence with a curly bracket?",c),"TK_STRING")end end;if not tonumber(b,16)or not utf8.char(tonumber(b,16))then self:lexerror(string.format("Invalid UTF8 char %s. Expected a valid UTF8 character code",b),"TK_STRING")else self:save(a,utf8.char(tonumber(b)))end elseif string.lower(c)=="x"then local b=self:nextc(a)..self:nextc(a)if not string.match(string.upper(b),"%x")then self:lexerror(string.format("Invalid hex string literal. Expected valid string literal, got %s",b),"TK_STRING")else self:save(a,string.char(tonumber(b,16)))end elseif string.lower(c)=="z"then local c=D:nextc(a)if c==b then break else self:save(a,c)end elseif not string.find(c,"%d")then self:save_and_next(a)else c,d=0,0;repeat c=10*c+a.current;self:nextc(a)d=d+1 until d>=3 or not string.find(a.current,"%d")if c>255 then self:lexerror(a,"escape sequence too large","TK_STRING")end;self:save(a,string.char(c))end end else self:save_and_next(a)end end;self:save_and_next(a)c.seminfo=string.sub(a.buff,2,-2)end;function D:llex(a,b)a.buff=""while true do local c=a.current;if self:currIsNewline(a)then self:inclinenumber(a)elseif c=="-"then c=self:nextc(a)if c=="="then self:nextc(a)return"TK_ASSIGN_SUB"elseif c~="-"then return"-"end;local b=-1;if self:nextc(a)=='['then b=self:skip_sep(a)a.buff=""end;if b>=0 then self:read_long_string(a,nil,b)a.buff=""else while not self:currIsNewline(a)and a.current~="EOZ"do self:nextc(a)end end elseif c=="["then local c=self:skip_sep(a)if c>=0 then self:read_long_string(a,b,c)return"TK_STRING"elseif c==-1 then return"["else self:lexerror(a,"invalid long string delimiter","TK_STRING")end elseif c=="+"then c=self:nextc(a)if c~="="then return"+"else self:nextc(a)return"TK_ASSIGN_ADD"end elseif c=="*"then c=self:nextc(a)if c~="="then return"*"else self:nextc(a)return"TK_ASSIGN_MUL"end elseif c=="/"then c=self:nextc(a)if c~="="then return"/"else self:nextc(a)return"TK_ASSIGN_DIV"end elseif c=="%"then c=self:nextc(a)if c~="="then return"%"else self:nextc(a)return"TK_ASSIGN_MOD"end elseif c=="^"then c=self:nextc(a)if c~="="then return"^"else self:nextc(a)return"TK_ASSIGN_POW"end elseif c=="="then c=self:nextc(a)if c~="="then return"="else self:nextc(a)return"TK_EQ"end elseif c=="<"then c=self:nextc(a)if c~="="then return"<"else self:nextc(a)return"TK_LE"end elseif c==">"then c=self:nextc(a)if c~="="then return">"else self:nextc(a)return"TK_GE"end elseif c=="~"then c=self:nextc(a)if c~="="then return"~"else self:nextc(a)return"TK_NE"end elseif c=="\""or c=="'"then self:read_string(a,c,b)return"TK_STRING"elseif c=="."then c=self:save_and_next(a)if self:check_next(a,".")then if self:check_next(a,".")then return"TK_DOTS"else return"TK_CONCAT"end elseif not string.find(c,"%d")then return"."else self:read_numeral(a,b)return"TK_NUMBER"end elseif c=="EOZ"then return"TK_EOS"else if string.find(c,"%s")then self:nextc(a)elseif string.find(c,"%d")then self:read_numeral(a,b)return"TK_NUMBER"elseif string.find(c,"[_%a]")then repeat c=self:save_and_next(a)until c=="EOZ"or not string.find(c,"[_%w]")local a=a.buff;local c=self.enums[a]if c then return c end;b.seminfo=a;return"TK_NAME"else self:nextc(a)return c end end end end;local E={}local F={}F.MAXSTACK=250;function F:ttisnumber(a)if a then return type(a.value)=="number"else return false end end;function F:nvalue(a)return a.value end;function F:setnilvalue(a)a.value=nil end;function F:setsvalue(a,b)a.value=b end;F.setnvalue=F.setsvalue;F.sethvalue=F.setsvalue;F.setbvalue=F.setsvalue;function F:numadd(a,b)return a+b end;function F:numsub(a,b)return a-b end;function F:nummul(a,b)return a*b end;function F:numdiv(a,b)return a/b end;function F:nummod(a,b)return a%b end;function F:numpow(a,b)return a^b end;function F:numunm(a)return-a end;function F:numisnan(a)return a~=a end;F.NO_JUMP=-1;F.BinOpr={OPR_ADD=0,OPR_SUB=1,OPR_MUL=2,OPR_DIV=3,OPR_MOD=4,OPR_POW=5,OPR_CONCAT=6,OPR_NE=7,OPR_EQ=8,OPR_LT=9,OPR_LE=10,OPR_GT=11,OPR_GE=12,OPR_AND=13,OPR_OR=14,OPR_NOBINOPR=15}F.UnOpr={OPR_MINUS=0,OPR_NOT=1,OPR_LEN=2,OPR_NOUNOPR=3}function F:getcode(a,b)return a.f.code[b.info]end;function F:codeAsBx(a,b,d,e)return self:codeABx(a,b,d,e+c.MAXARG_sBx)end;function F:setmultret(a,b)self:setreturns(a,b,E.LUA_MULTRET)end;function F:hasjumps(a)return a.t~=a.f end;function F:isnumeral(a)return a.k=="VKNUM"and a.t==self.NO_JUMP and a.f==self.NO_JUMP end;function F:_nil(a,b,d)if a.pc>a.lasttarget then if a.pc==0 then if b>=a.nactvar then return end else local a=a.f.code[a.pc-1]if c:GET_OPCODE(a)=="OP_LOADNIL"then local e=c:GETARG_A(a)local f=c:GETARG_B(a)if e<=b and b<=f+1 then if b+d-1>f then c:SETARG_B(a,b+d-1)end;return end end end end;self:codeABC(a,"OP_LOADNIL",b,b+d-1,0)end;function F:jump(a)local b=a.jpc;a.jpc=self.NO_JUMP;local c=self:codeAsBx(a,"OP_JMP",0,self.NO_JUMP)c=self:concat(a,c,b)return c end;function F:ret(a,b,c)self:codeABC(a,"OP_RETURN",b,c+1,0)end;function F:condjump(a,b,c,d,e)self:codeABC(a,b,c,d,e)return self:jump(a)end;function F:fixjump(a,b,d)local e=a.f.code[b]local b=d-(b+1)assert(d~=self.NO_JUMP)if math.abs(b)>c.MAXARG_sBx then D:syntaxerror(a.ls,"control structure too long")end;c:SETARG_sBx(e,b)end;function F:getlabel(a)a.lasttarget=a.pc;return a.pc end;function F:getjump(a,b)local a=c:GETARG_sBx(a.f.code[b])if a==self.NO_JUMP then return self.NO_JUMP else return(b+1)+a end end;function F:getjumpcontrol(a,b)local d=a.f.code[b]local a=a.f.code[b-1]if b>=1 and c:testTMode(c:GET_OPCODE(a))~=0 then return a else return d end end;function F:need_value(a,b)while b~=self.NO_JUMP do local d=self:getjumpcontrol(a,b)if c:GET_OPCODE(d)~="OP_TESTSET"then return true end;b=self:getjump(a,b)end;return false end;function F:patchtestreg(a,b,d)local a=self:getjumpcontrol(a,b)if c:GET_OPCODE(a)~="OP_TESTSET"then return false end;if d~=c.NO_REG and d~=c:GETARG_B(a)then c:SETARG_A(a,d)else c:SET_OPCODE(a,"OP_TEST")local b=c:GETARG_B(a)c:SETARG_A(a,b)c:SETARG_B(a,0)end;return true end;function F:removevalues(a,b)while b~=self.NO_JUMP do self:patchtestreg(a,b,c.NO_REG)b=self:getjump(a,b)end end;function F:patchlistaux(a,b,c,d,e)while b~=self.NO_JUMP do local f=self:getjump(a,b)if self:patchtestreg(a,b,d)then self:fixjump(a,b,c)else self:fixjump(a,b,e)end;b=f end end;function F:dischargejpc(a)self:patchlistaux(a,a.jpc,a.pc,c.NO_REG,a.pc)a.jpc=self.NO_JUMP end;function F:patchlist(a,b,d)if d==a.pc then self:patchtohere(a,b)else assert(da.f.maxstacksize then if b>=self.MAXSTACK then D:syntaxerror(a.ls,"function or expression too complex")end;a.f.maxstacksize=b end end;function F:reserveregs(a,b)self:checkstack(a,b)a.freereg=a.freereg+b end;function F:freereg(a,b)if not c:ISK(b)and b>=a.nactvar then a.freereg=a.freereg-1;assert(b==a.freereg)end end;function F:freeexp(a,b)if b.k=="VNONRELOC"then self:freereg(a,b.info)end end;function F:addk(a,b,d)local e=a.L;local f=a.h[b.value]local g=a.f;if self:ttisnumber(f)then return self:nvalue(f)else f={}self:setnvalue(f,a.nk)a.h[b.value]=f;E:growvector(e,g.k,a.nk,g.sizek,nil,c.MAXARG_Bx,"constant table overflow")g.k[a.nk]=d;local b=a.nk;a.nk=a.nk+1;return b end end;function F:stringK(a,b)local c={}self:setsvalue(c,b)return self:addk(a,c,c)end;function F:numberK(a,b)local c={}self:setnvalue(c,b)return self:addk(a,c,c)end;function F:boolK(a,b)local c={}self:setbvalue(c,b)return self:addk(a,c,c)end;function F:nilK(a)local b,c={},{}self:setnilvalue(c)self:sethvalue(b,a.h)return self:addk(a,b,c)end;function F:setreturns(a,b,d)if b.k=="VCALL"then c:SETARG_C(self:getcode(a,b),d+1)elseif b.k=="VVARARG"then c:SETARG_B(self:getcode(a,b),d+1)c:SETARG_A(self:getcode(a,b),a.freereg)F:reserveregs(a,1)end end;function F:setoneret(a,b)if b.k=="VCALL"then b.k="VNONRELOC"b.info=c:GETARG_A(self:getcode(a,b))elseif b.k=="VVARARG"then c:SETARG_B(self:getcode(a,b),2)b.k="VRELOCABLE"end end;function F:dischargevars(a,b)local c=b.k;if c=="VLOCAL"then b.k="VNONRELOC"elseif c=="VUPVAL"then b.info=self:codeABC(a,"OP_GETUPVAL",0,b.info,0)b.k="VRELOCABLE"elseif c=="VGLOBAL"then b.info=self:codeABx(a,"OP_GETGLOBAL",0,b.info)b.k="VRELOCABLE"elseif c=="VINDEXED"then self:freereg(a,b.aux)self:freereg(a,b.info)b.info=self:codeABC(a,"OP_GETTABLE",0,b.info,b.aux)b.k="VRELOCABLE"elseif c=="VVARARG"or c=="VCALL"then self:setoneret(a,b)else end end;function F:code_label(a,b,c,d)self:getlabel(a)return self:codeABC(a,"OP_LOADBOOL",b,c,d)end;function F:discharge2reg(a,b,d)self:dischargevars(a,b)local e=b.k;if e=="VNIL"then self:_nil(a,d,1)elseif e=="VFALSE"or e=="VTRUE"then self:codeABC(a,"OP_LOADBOOL",d,(b.k=="VTRUE")and 1 or 0,0)elseif e=="VK"then self:codeABx(a,"OP_LOADK",d,b.info)elseif e=="VKNUM"then self:codeABx(a,"OP_LOADK",d,self:numberK(a,b.nval))elseif e=="VRELOCABLE"then local a=self:getcode(a,b)c:SETARG_A(a,d)elseif e=="VNONRELOC"then if d~=b.info then self:codeABC(a,"OP_MOVE",d,b.info,0)end else assert(b.k=="VVOID"or b.k=="VJMP")return end;b.info=d;b.k="VNONRELOC"end;function F:discharge2anyreg(a,b)if b.k~="VNONRELOC"then self:reserveregs(a,1)self:discharge2reg(a,b,a.freereg-1)end end;function F:exp2reg(a,b,c)self:discharge2reg(a,b,c)if b.k=="VJMP"then b.t=self:concat(a,b.t,b.info)end;if self:hasjumps(b)then local d;local e=self.NO_JUMP;local f=self.NO_JUMP;if self:need_value(a,b.t)or self:need_value(a,b.f)then local b=(b.k=="VJMP")and self.NO_JUMP or self:jump(a)e=self:code_label(a,c,0,1)f=self:code_label(a,c,1,0)self:patchtohere(a,b)end;d=self:getlabel(a)self:patchlistaux(a,b.f,d,c,e)self:patchlistaux(a,b.t,d,c,f)end;b.f,b.t=self.NO_JUMP,self.NO_JUMP;b.info=c;b.k="VNONRELOC"end;function F:exp2nextreg(a,b)self:dischargevars(a,b)self:freeexp(a,b)self:reserveregs(a,1)self:exp2reg(a,b,a.freereg-1)end;function F:exp2anyreg(a,b)self:dischargevars(a,b)if b.k=="VNONRELOC"then if not self:hasjumps(b)then return b.info end;if b.info>=a.nactvar then self:exp2reg(a,b,b.info)return b.info end end;self:exp2nextreg(a,b)return b.info end;function F:exp2val(a,b)if self:hasjumps(b)then self:exp2anyreg(a,b)else self:dischargevars(a,b)end end;function F:exp2RK(a,b)self:exp2val(a,b)local d=b.k;if d=="VKNUM"or d=="VTRUE"or d=="VFALSE"or d=="VNIL"then if a.nk<=c.MAXINDEXRK then if b.k=="VNIL"then b.info=self:nilK(a)else b.info=(b.k=="VKNUM")and self:numberK(a,b.nval)or self:boolK(a,b.k=="VTRUE")end;b.k="VK"return c:RKASK(b.info)end elseif d=="VK"then if b.info<=c.MAXINDEXRK then return c:RKASK(b.info)end else end;return self:exp2anyreg(a,b)end;function F:storevar(a,b,c)local d=b.k;if d=="VLOCAL"then self:freeexp(a,c)self:exp2reg(a,c,b.info)return elseif d=="VUPVAL"then local c=self:exp2anyreg(a,c)self:codeABC(a,"OP_SETUPVAL",c,b.info,0)elseif d=="VGLOBAL"then local c=self:exp2anyreg(a,c)self:codeABx(a,"OP_SETGLOBAL",c,b.info)elseif d=="VINDEXED"then local c=self:exp2RK(a,c)self:codeABC(a,"OP_SETTABLE",b.info,b.aux,c)else assert(0)end;self:freeexp(a,c)end;function F:_self(a,b,c)self:exp2anyreg(a,b)self:freeexp(a,b)local d=a.freereg;self:reserveregs(a,2)self:codeABC(a,"OP_SELF",d,b.info,self:exp2RK(a,c))self:freeexp(a,c)b.info=d;b.k="VNONRELOC"end;function F:invertjump(a,b)local a=self:getjumpcontrol(a,b.info)assert(c:testTMode(c:GET_OPCODE(a))~=0 and c:GET_OPCODE(a)~="OP_TESTSET"and c:GET_OPCODE(a)~="OP_TEST")c:SETARG_A(a,(c:GETARG_A(a)==0)and 1 or 0)end;function F:jumponcond(a,b,d)if b.k=="VRELOCABLE"then local b=self:getcode(a,b)if c:GET_OPCODE(b)=="OP_NOT"then a.pc=a.pc-1;return self:condjump(a,"OP_TEST",c:GETARG_B(b),0,d and 0 or 1)end end;self:discharge2anyreg(a,b)self:freeexp(a,b)return self:condjump(a,"OP_TESTSET",c.NO_REG,b.info,d and 1 or 0)end;function F:goiftrue(a,b)local c;self:dischargevars(a,b)local d=b.k;if d=="VK"or d=="VKNUM"or d=="VTRUE"then c=self.NO_JUMP elseif d=="VFALSE"then c=self:jump(a)elseif d=="VJMP"then self:invertjump(a,b)c=b.info else c=self:jumponcond(a,b,false)end;b.f=self:concat(a,b.f,c)self:patchtohere(a,b.t)b.t=self.NO_JUMP end;function F:goiffalse(a,b)local c;self:dischargevars(a,b)local d=b.k;if d=="VNIL"or d=="VFALSE"then c=self.NO_JUMP elseif d=="VTRUE"then c=self:jump(a)elseif d=="VJMP"then c=b.info else c=self:jumponcond(a,b,true)end;b.t=self:concat(a,b.t,c)self:patchtohere(a,b.f)b.f=self.NO_JUMP end;function F:codenot(a,b)self:dischargevars(a,b)local c=b.k;if c=="VNIL"or c=="VFALSE"then b.k="VTRUE"elseif c=="VK"or c=="VKNUM"or c=="VTRUE"then b.k="VFALSE"elseif c=="VJMP"then self:invertjump(a,b)elseif c=="VRELOCABLE"or c=="VNONRELOC"then self:discharge2anyreg(a,b)self:freeexp(a,b)b.info=self:codeABC(a,"OP_NOT",0,b.info,0)b.k="VRELOCABLE"else assert(0)end;b.f,b.t=b.t,b.f;self:removevalues(a,b.f)self:removevalues(a,b.t)end;function F:indexed(a,b,c)b.aux=self:exp2RK(a,c)b.k="VINDEXED"end;function F:constfolding(a,b,c)local d;if not self:isnumeral(b)or not self:isnumeral(c)then return false end;local e=b.nval;local c=c.nval;if a=="OP_ADD"then d=self:numadd(e,c)elseif a=="OP_SUB"then d=self:numsub(e,c)elseif a=="OP_MUL"then d=self:nummul(e,c)elseif a=="OP_DIV"then if c==0 then return false end;d=self:numdiv(e,c)elseif a=="OP_MOD"then if c==0 then return false end;d=self:nummod(e,c)elseif a=="OP_POW"then d=self:numpow(e,c)elseif a=="OP_UNM"then d=self:numunm(e)elseif a=="OP_LEN"then return false else assert(0)d=0 end;if self:numisnan(d)then return false end;b.nval=d;return true end;function F:codearith(a,b,c,d)if self:constfolding(b,c,d)then return else local e=(b~="OP_UNM"and b~="OP_LEN")and self:exp2RK(a,d)or 0;local f=self:exp2RK(a,c)if f>e then self:freeexp(a,c)self:freeexp(a,d)else self:freeexp(a,d)self:freeexp(a,c)end;c.info=self:codeABC(a,b,0,f,e)c.k="VRELOCABLE"end end;function F:codecomp(a,b,c,d,e)local f=self:exp2RK(a,d)local g=self:exp2RK(a,e)self:freeexp(a,e)self:freeexp(a,d)if c==0 and b~="OP_EQ"then f,g=g,f;c=1 end;d.info=self:condjump(a,b,c,f,g)d.k="VJMP"end;function F:prefix(a,b,c)local d={}d.t,d.f=self.NO_JUMP,self.NO_JUMP;d.k="VKNUM"d.nval=0;if b=="OPR_MINUS"then if not self:isnumeral(c)then self:exp2anyreg(a,c)end;self:codearith(a,"OP_UNM",c,d)elseif b=="OPR_NOT"then self:codenot(a,c)elseif b=="OPR_LEN"then self:exp2anyreg(a,c)self:codearith(a,"OP_LEN",c,d)else assert(0)end end;function F:infix(a,b,c)if b=="OPR_AND"then self:goiftrue(a,c)elseif b=="OPR_OR"then self:goiffalse(a,c)elseif b=="OPR_CONCAT"then self:exp2nextreg(a,c)elseif b=="OPR_ADD"or b=="OPR_SUB"or b=="OPR_MUL"or b=="OPR_DIV"or b=="OPR_MOD"or b=="OPR_POW"then if not self:isnumeral(c)then self:exp2RK(a,c)end else self:exp2RK(a,c)end end;F.arith_op={OPR_ADD="OP_ADD",OPR_SUB="OP_SUB",OPR_MUL="OP_MUL",OPR_DIV="OP_DIV",OPR_MOD="OP_MOD",OPR_POW="OP_POW"}F.comp_op={OPR_EQ="OP_EQ",OPR_NE="OP_EQ",OPR_LT="OP_LT",OPR_LE="OP_LE",OPR_GT="OP_LT",OPR_GE="OP_LE"}F.comp_cond={OPR_EQ=1,OPR_NE=0,OPR_LT=1,OPR_LE=1,OPR_GT=0,OPR_GE=0}function F:posfix(a,b,d,e)local function f(a,b)a.k=b.k;a.info=b.info;a.aux=b.aux;a.nval=b.nval;a.t=b.t;a.f=b.f end;if b=="OPR_AND"then assert(d.t==self.NO_JUMP)self:dischargevars(a,e)e.f=self:concat(a,e.f,d.f)f(d,e)elseif b=="OPR_OR"then assert(d.f==self.NO_JUMP)self:dischargevars(a,e)e.t=self:concat(a,e.t,d.t)f(d,e)elseif b=="OPR_CONCAT"then self:exp2val(a,e)if e.k=="VRELOCABLE"and c:GET_OPCODE(self:getcode(a,e))=="OP_CONCAT"then assert(d.info==c:GETARG_B(self:getcode(a,e))-1)self:freeexp(a,d)c:SETARG_B(self:getcode(a,e),d.info)d.k="VRELOCABLE"d.info=e.info else self:exp2nextreg(a,e)self:codearith(a,"OP_CONCAT",d,e)end else local c=self.arith_op[b]if c then self:codearith(a,c,d,e)else local c=self.comp_op[b]if c then self:codecomp(a,c,self.comp_cond[b],d,e)else assert(0)end end end end;function F:fixline(a,b)a.f.lineinfo[a.pc-1]=b end;function F:code(a,b,c)local d=a.f;self:dischargejpc(a)E:growvector(a.L,d.code,a.pc,d.sizecode,nil,E.MAX_INT,"code size overflow")d.code[a.pc]=b;E:growvector(a.L,d.lineinfo,a.pc,d.sizelineinfo,nil,E.MAX_INT,"code size overflow")d.lineinfo[a.pc]=c;local b=a.pc;a.pc=a.pc+1;return b end;function F:codeABC(a,b,d,e,f)assert(c:getOpMode(b)==c.OpMode.iABC)assert(c:getBMode(b)~=c.OpArgMask.OpArgN or e==0)assert(c:getCMode(b)~=c.OpArgMask.OpArgN or f==0)return self:code(a,c:CREATE_ABC(b,d,e,f),a.ls.lastline)end;function F:codeABx(a,b,d,e)assert(c:getOpMode(b)==c.OpMode.iABx or c:getOpMode(b)==c.OpMode.iAsBx)assert(c:getCMode(b)==c.OpArgMask.OpArgN)return self:code(a,c:CREATE_ABx(b,d,e),a.ls.lastline)end;function F:setlist(a,b,d,e)local d=math.floor((d-1)/c.LFIELDS_PER_FLUSH)+1;local f=(e==E.LUA_MULTRET)and 0 or e;assert(e~=0)if d<=c.MAXARG_C then self:codeABC(a,"OP_SETLIST",b,f,d)else self:codeABC(a,"OP_SETLIST",b,f,0)self:code(a,c:CREATE_Inst(d),a.ls.lastline)end;a.freereg=b+1 end;E.LUA_QS=D.LUA_QS or"'%s'"E.SHRT_MAX=32767;E.LUAI_MAXVARS=200;E.LUAI_MAXUPVALUES=60;E.MAX_INT=D.MAX_INT or 2147483645;E.LUAI_MAXCCALLS=200;E.VARARG_HASARG=1;E.HASARG_MASK=2;E.VARARG_ISVARARG=2;E.VARARG_NEEDSARG=4;E.LUA_MULTRET=-1;function E:LUA_QL(a)return"'"..a.."'"end;function E:growvector(a,a,a,b,b,b,c)if a>=b then error(c)end end;function E:newproto(a)local a={}a.k={}a.sizek=0;a.p={}a.sizep=0;a.code={}a.sizecode=0;a.sizelineinfo=0;a.sizeupvalues=0;a.nups=0;a.upvalues={}a.numparams=0;a.is_vararg=0;a.maxstacksize=0;a.lineinfo={}a.sizelocvars=0;a.locvars={}a.lineDefined=0;a.lastlinedefined=0;a.source=nil;return a end;function E:int2fb(a)local b=0;while a>=16 do a=math.floor((a+1)/2)b=b+1 end;if a<8 then return a else return((b+1)*8)+(a-8)end end;function E:hasmultret(a)return a=="VCALL"or a=="VVARARG"end;function E:getlocvar(a,b)return a.f.locvars[a.actvar[b]]end;function E:checklimit(a,b,c,d)if b>c then self:errorlimit(a,c,d)end end;function E:anchor_token(a)if a.t.token=="TK_NAME"or a.t.token=="TK_STRING"then end end;function E:error_expected(a,b)D:syntaxerror(a,string.format(self.LUA_QS.." expected",D:token2str(a,b)))end;function E:errorlimit(a,b,c)local b=(a.f.linedefined==0)and string.format("main function has more than %d %s",b,c)or string.format("function at line %d has more than %d %s",a.f.linedefined,b,c)D:lexerror(a.ls,b,0)end;function E:testnext(a,b)if a.t.token==b then D:next(a)return true else return false end end;function E:check(a,b)if a.t.token~=b then self:error_expected(a,b)end end;function E:checknext(a,b)self:check(a,b)D:next(a)end;function E:check_condition(a,b,c)if not b then D:syntaxerror(a,c)end end;function E:check_match(a,b,c,d)if not self:testnext(a,b)then if d==a.linenumber then self:error_expected(a,b)else D:syntaxerror(a,string.format(self.LUA_QS.." expected (to close "..self.LUA_QS.." at line %d)",D:token2str(a,b),D:token2str(a,c),d))end end end;function E:str_checkname(a)self:check(a,"TK_NAME")local b=a.t.seminfo;D:next(a)return b end;function E:init_exp(a,b,c)a.f,a.t=F.NO_JUMP,F.NO_JUMP;a.k=b;a.info=c end;function E:codestring(a,b,c)self:init_exp(b,"VK",F:stringK(a.fs,c))end;function E:checkname(a,b)self:codestring(a,b,self:str_checkname(a))end;function E:registerlocalvar(a,b)local c=a.fs;local d=c.f;self:growvector(a.L,d.locvars,c.nlocvars,d.sizelocvars,nil,self.SHRT_MAX,"too many local variables")d.locvars[c.nlocvars]={}d.locvars[c.nlocvars].varname=b;local a=c.nlocvars;c.nlocvars=c.nlocvars+1;return a end;function E:new_localvarliteral(a,b,c)self:new_localvar(a,b,c)end;function E:new_localvar(a,b,c)local d=a.fs;self:checklimit(d,d.nactvar+c+1,self.LUAI_MAXVARS,"local variables")d.actvar[d.nactvar+c]=self:registerlocalvar(a,b)end;function E:adjustlocalvars(a,b)local a=a.fs;a.nactvar=a.nactvar+b;for b=b,1,-1 do self:getlocvar(a,a.nactvar-b).startpc=a.pc end end;function E:removevars(a,b)local a=a.fs;while a.nactvar>b do a.nactvar=a.nactvar-1;self:getlocvar(a,a.nactvar).endpc=a.pc end end;function E:indexupvalue(a,b,c)local d=a.f;for e=0,d.nups-1 do if a.upvalues[e].k==c.k and a.upvalues[e].info==c.info then assert(d.upvalues[e]==b)return e end end;self:checklimit(a,d.nups+1,self.LUAI_MAXUPVALUES,"upvalues")self:growvector(a.L,d.upvalues,d.nups,d.sizeupvalues,nil,self.MAX_INT,"")d.upvalues[d.nups]=b;assert(c.k=="VLOCAL"or c.k=="VUPVAL")a.upvalues[d.nups]={k=c.k,info=c.info}local a=d.nups;d.nups=d.nups+1;return a end;function E:searchvar(a,b)for c=a.nactvar-1,0,-1 do if b==self:getlocvar(a,c).varname then return c end end;return-1 end;function E:markupval(a,b)local a=a.bl;while a and a.nactvar>b do a=a.previous end;if a then a.upval=true end end;function E:singlevaraux(a,b,d,e)if a==nil then self:init_exp(d,"VGLOBAL",c.NO_REG)return"VGLOBAL"else local c=self:searchvar(a,b)if c>=0 then self:init_exp(d,"VLOCAL",c)if e==0 then self:markupval(a,c)end;return"VLOCAL"else if self:singlevaraux(a.prev,b,d,0)=="VGLOBAL"then return"VGLOBAL"end;d.info=self:indexupvalue(a,b,d)d.k="VUPVAL"return"VUPVAL"end end end;function E:singlevar(a,b)local c=self:str_checkname(a)local a=a.fs;if self:singlevaraux(a,c,b,1)=="VGLOBAL"then b.info=F:stringK(a,c)end end;function E:adjust_assign(a,b,c,d)local a=a.fs;local b=b-c;if self:hasmultret(d.k)then b=b+1;if b<=0 then b=0 end;F:setreturns(a,d,b)if b>1 then F:reserveregs(a,b-1)end else if d.k~="VVOID"then F:exp2nextreg(a,d)end;if b>0 then local c=a.freereg;F:reserveregs(a,b)F:_nil(a,c,b)end end end;function E:enterlevel(a)a.L.nCcalls=a.L.nCcalls+1;if a.L.nCcalls>self.LUAI_MAXCCALLS then D:lexerror(a,"chunk has too many syntax levels",0)end end;function E:leavelevel(a)a.L.nCcalls=a.L.nCcalls-1 end;function E:enterblock(a,b,c)b.breaklist=F.NO_JUMP;b.isbreakable=c;b.nactvar=a.nactvar;b.upval=false;b.previous=a.bl;a.bl=b;assert(a.freereg==a.nactvar)end;function E:leaveblock(a)local b=a.bl;a.bl=b.previous;self:removevars(a.ls,b.nactvar)if b.upval then F:codeABC(a,"OP_CLOSE",b.nactvar,0,0)end;assert(not b.isbreakable or not b.upval)assert(b.nactvar==a.nactvar)a.freereg=a.nactvar;F:patchtohere(a,b.breaklist)end;function E:pushclosure(a,b,d)local e=a.fs;local f=e.f;self:growvector(a.L,f.p,e.np,f.sizep,nil,c.MAXARG_Bx,"constant table overflow")f.p[e.np]=b.f;e.np=e.np+1;self:init_exp(d,"VRELOCABLE",F:codeABx(e,"OP_CLOSURE",0,e.np-1))for a=0,b.f.nups-1 do local c=(b.upvalues[a].k=="VLOCAL")and"OP_MOVE"or"OP_GETUPVAL"F:codeABC(e,c,0,b.upvalues[a].info,0)end end;function E:open_func(a,b)local c=a.L;local d=self:newproto(a.L)b.f=d;b.prev=a.fs;b.ls=a;b.L=c;a.fs=b;b.pc=0;b.lasttarget=-1;b.jpc=F.NO_JUMP;b.freereg=0;b.nk=0;b.np=0;b.nlocvars=0;b.nactvar=0;b.bl=nil;d.source=a.source;d.maxstacksize=2;b.h={}end;function E:close_func(a)local b=a.L;local b=a.fs;local c=b.f;self:removevars(a,0)F:ret(b,0,0)c.sizecode=b.pc;c.sizelineinfo=b.pc;c.sizek=b.nk;c.sizep=b.np;c.sizelocvars=b.nlocvars;c.sizeupvalues=c.nups;assert(b.bl==nil)a.fs=b.prev;if b then self:anchor_token(a)end end;function E:parser(a,b,c,d)local e={}e.t={}e.lookahead={}local f={}f.upvalues={}f.actvar={}a.nCcalls=0;e.buff=c;D:setinput(a,e,b,d)self:open_func(e,f)f.f.is_vararg=self.VARARG_ISVARARG;D:next(e)self:chunk(e)self:check(e,"TK_EOS")self:close_func(e)assert(f.prev==nil)assert(f.f.nups==0)assert(e.fs==nil)return f.f end;function E:field(a,b)local c=a.fs;local d={}F:exp2anyreg(c,b)D:next(a)self:checkname(a,d)F:indexed(c,b,d)end;function E:yindex(a,b)D:next(a)self:expr(a,b)F:exp2val(a.fs,b)self:checknext(a,"]")end;function E:recfield(a,b)local c=a.fs;local d=a.fs.freereg;local e,f={},{}if a.t.token=="TK_NAME"then self:checklimit(c,b.nh,self.MAX_INT,"items in a constructor")self:checkname(a,e)else self:yindex(a,e)end;b.nh=b.nh+1;self:checknext(a,"=")local e=F:exp2RK(c,e)self:expr(a,f)F:codeABC(c,"OP_SETTABLE",b.t.info,e,F:exp2RK(c,f))c.freereg=d end;function E:closelistfield(a,b)if b.v.k=="VVOID"then return end;F:exp2nextreg(a,b.v)b.v.k="VVOID"if b.tostore==c.LFIELDS_PER_FLUSH then F:setlist(a,b.t.info,b.na,b.tostore)b.tostore=0 end end;function E:lastlistfield(a,b)if b.tostore==0 then return end;if self:hasmultret(b.v.k)then F:setmultret(a,b.v)F:setlist(a,b.t.info,b.na,self.LUA_MULTRET)b.na=b.na-1 else if b.v.k~="VVOID"then F:exp2nextreg(a,b.v)end;F:setlist(a,b.t.info,b.na,b.tostore)end end;function E:listfield(a,b)self:expr(a,b.v)self:checklimit(a.fs,b.na,self.MAX_INT,"items in a constructor")b.na=b.na+1;b.tostore=b.tostore+1 end;function E:constructor(a,b)local d=a.fs;local e=a.linenumber;local f=F:codeABC(d,"OP_NEWTABLE",0,0,0)local g={}g.v={}g.na,g.nh,g.tostore=0,0,0;g.t=b;self:init_exp(b,"VRELOCABLE",f)self:init_exp(g.v,"VVOID",0)F:exp2nextreg(a.fs,b)self:checknext(a,"{")repeat assert(g.v.k=="VVOID"or g.tostore>0)if a.t.token=="}"then break end;self:closelistfield(d,g)local b=a.t.token;if b=="TK_NAME"then D:lookahead(a)if a.lookahead.token~="="then self:listfield(a,g)else self:recfield(a,g)end elseif b=="["then self:recfield(a,g)else self:listfield(a,g)end until not self:testnext(a,",")and not self:testnext(a,";")self:check_match(a,"}","{",e)self:lastlistfield(d,g)c:SETARG_B(d.f.code[f],self:int2fb(g.na))c:SETARG_C(d.f.code[f],self:int2fb(g.nh))end;function E:parlist(a)local b=a.fs;local c=b.f;local d=0;c.is_vararg=0;if a.t.token~=")"then repeat local b=a.t.token;if b=="TK_NAME"then self:new_localvar(a,self:str_checkname(a),d)d=d+1 elseif b=="TK_DOTS"then D:next(a)self:new_localvarliteral(a,"arg",d)d=d+1;c.is_vararg=self.VARARG_HASARG+self.VARARG_NEEDSARG;c.is_vararg=c.is_vararg+self.VARARG_ISVARARG else D:syntaxerror(a," or "..self:LUA_QL("...").." expected")end until c.is_vararg~=0 or not self:testnext(a,",")end;self:adjustlocalvars(a,d)c.numparams=b.nactvar-(c.is_vararg%self.HASARG_MASK)F:reserveregs(b,b.nactvar)end;function E:body(a,b,c,d)local e={}e.upvalues={}e.actvar={}self:open_func(a,e)e.f.lineDefined=d;self:checknext(a,"(")if c then self:new_localvarliteral(a,"self",0)self:adjustlocalvars(a,1)end;self:parlist(a)self:checknext(a,")")self:chunk(a)e.f.lastlinedefined=a.linenumber;self:check_match(a,"TK_END","TK_FUNCTION",d)self:close_func(a)self:pushclosure(a,e,b)end;function E:explist1(a,b)local c=1;self:expr(a,b)while self:testnext(a,",")do F:exp2nextreg(a.fs,b)self:expr(a,b)c=c+1 end;return c end;function E:funcargs(a,b)local c=a.fs;local d={}local e;local f=a.linenumber;local g=a.t.token;if g=="("then if f~=a.lastline then D:syntaxerror(a,"ambiguous syntax (function call x new statement)")end;D:next(a)if a.t.token==")"then d.k="VVOID"else self:explist1(a,d)F:setmultret(c,d)end;self:check_match(a,")","(",f)elseif g=="{"then self:constructor(a,d)elseif g=="TK_STRING"then self:codestring(a,d,a.t.seminfo)D:next(a)else D:syntaxerror(a,"function arguments expected")return end;assert(b.k=="VNONRELOC")local a=b.info;if self:hasmultret(d.k)then e=self.LUA_MULTRET else if d.k~="VVOID"then F:exp2nextreg(c,d)end;e=c.freereg-(a+1)end;self:init_exp(b,"VCALL",F:codeABC(c,"OP_CALL",a,e+1,2))F:fixline(c,f)c.freereg=a+1 end;function E:prefixexp(a,b)local c=a.t.token;if c=="("then local c=a.linenumber;D:next(a)self:expr(a,b)self:check_match(a,")","(",c)F:dischargevars(a.fs,b)elseif c=="TK_NAME"then self:singlevar(a,b)else D:syntaxerror(a,"unexpected symbol")end;return end;function E:primaryexp(a,b)local c=a.fs;self:prefixexp(a,b)while true do local d=a.t.token;if d=="."then self:field(a,b)elseif d=="["then local d={}F:exp2anyreg(c,b)self:yindex(a,d)F:indexed(c,b,d)elseif d==":"then local d={}D:next(a)self:checkname(a,d)F:_self(c,b,d)self:funcargs(a,b)elseif d=="("or d=="TK_STRING"or d=="{"then F:exp2nextreg(c,b)self:funcargs(a,b)else return end end end;function E:simpleexp(a,b)local c=a.t.token;if c=="TK_NUMBER"then self:init_exp(b,"VKNUM",0)b.nval=a.t.seminfo elseif c=="TK_STRING"then self:codestring(a,b,a.t.seminfo)elseif c=="TK_NIL"then self:init_exp(b,"VNIL",0)elseif c=="TK_TRUE"then self:init_exp(b,"VTRUE",0)elseif c=="TK_FALSE"then self:init_exp(b,"VFALSE",0)elseif c=="TK_DOTS"then local c=a.fs;self:check_condition(a,c.f.is_vararg~=0,"cannot use "..self:LUA_QL("...").." outside a vararg function")local a=c.f.is_vararg;if a>=self.VARARG_NEEDSARG then c.f.is_vararg=a-self.VARARG_NEEDSARG end;self:init_exp(b,"VVARARG",F:codeABC(c,"OP_VARARG",0,1,0))elseif c=="{"then self:constructor(a,b)return elseif c=="TK_FUNCTION"then D:next(a)self:body(a,b,false,a.linenumber)return else self:primaryexp(a,b)return end;D:next(a)end;function E:getunopr(a)if a=="TK_NOT"then return"OPR_NOT"elseif a=="-"then return"OPR_MINUS"elseif a=="#"then return"OPR_LEN"else return"OPR_NOUNOPR"end end;E.getbinopr_table={["+"]="OPR_ADD",["-"]="OPR_SUB",["*"]="OPR_MUL",["/"]="OPR_DIV",["%"]="OPR_MOD",["^"]="OPR_POW",["TK_CONCAT"]="OPR_CONCAT",["TK_NE"]="OPR_NE",["TK_EQ"]="OPR_EQ",["<"]="OPR_LT",["TK_LE"]="OPR_LE",[">"]="OPR_GT",["TK_GE"]="OPR_GE",["TK_AND"]="OPR_AND",["TK_OR"]="OPR_OR"}function E:getbinopr(a)local a=self.getbinopr_table[a]if a then return a else return"OPR_NOBINOPR"end end;E.COMPOUND_OP_TRANSLATE={TK_ASSIGN_ADD="OP_ADD",TK_ASSIGN_SUB="OP_SUB",TK_ASSIGN_MUL="OP_MUL",TK_ASSIGN_DIV="OP_DIV",TK_ASSIGN_MOD="OP_MOD",TK_ASSIGN_POW="OP_POW"}function E:getcompopr(a)local a=self.COMPOUND_OP_TRANSLATE[a]if a then return a else return"OP_NOCOMOPR"end end;E.priority={{6,6},{6,6},{7,7},{7,7},{7,7},{10,9},{5,4},{3,3},{3,3},{3,3},{3,3},{3,3},{3,3},{2,2},{1,1}}E.UNARY_PRIORITY=8;function E:subexpr(a,b,c)self:enterlevel(a)local d=self:getunopr(a.t.token)if d~="OPR_NOUNOPR"then D:next(a)self:subexpr(a,b,self.UNARY_PRIORITY)F:prefix(a.fs,d,b)else self:simpleexp(a,b)end;local d=self:getbinopr(a.t.token)while d~="OPR_NOBINOPR"and self.priority[F.BinOpr[d]+1][1]>c do local c={}D:next(a)F:infix(a.fs,d,b)local e=self:subexpr(a,c,self.priority[F.BinOpr[d]+1][2])F:posfix(a.fs,d,b,c)d=e end;self:leavelevel(a)return d end;function E:expr(a,b)self:subexpr(a,b,0)end;function E:block_follow(a)if a=="TK_ELSE"or a=="TK_ELSEIF"or a=="TK_END"or a=="TK_UNTIL"or a=="TK_EOS"then return true else return false end end;function E:block(a)local b=a.fs;local c={}self:enterblock(b,c,false)self:chunk(a)assert(c.breaklist==F.NO_JUMP)self:leaveblock(b)end;function E:check_conflict(a,b,c)local a=a.fs;local d=a.freereg;local e=false;while b do if b.v.k=="VINDEXED"then if b.v.info==c.info then e=true;b.v.info=d end;if b.v.aux==c.info then e=true;b.v.aux=d end end;b=b.prev end;if e then F:codeABC(a,"OP_MOVE",a.freereg,c.info,0)F:reserveregs(a,1)end end;function E:assignment(a,b,c)local d={}local e=b.v.k;self:check_condition(a,e=="VLOCAL"or e=="VUPVAL"or e=="VGLOBAL"or e=="VINDEXED","syntax error")if self:testnext(a,",")then local d={}d.v={}d.prev=b;self:primaryexp(a,d.v)if d.v.k=="VLOCAL"then self:check_conflict(a,b,d.v)end;self:checklimit(a.fs,c,self.LUAI_MAXCCALLS-a.L.nCcalls,"variables in assignment")self:assignment(a,d,c+1)else local e=self:getcompopr(a.t.token)if e~="OP_NOCOMOPR"then D:next(a)else self:checknext(a,"=")end;local f=self:explist1(a,d)if f~=c then self:adjust_assign(a,c,f,d)if f>c then a.fs.freereg=a.fs.freereg-(f-c)end else F:setoneret(a.fs,d)if e~="OP_NOCOMOPR"then F:exp2val(a.fs,b.v)F:exp2val(a.fs,d)F:codearith(a.fs,e,b.v,d)end;F:storevar(a.fs,b.v,d)return end end;self:init_exp(d,"VNONRELOC",a.fs.freereg-1)F:storevar(a.fs,b.v,d)end;function E:cond(a)local b={}self:expr(a,b)if b.k=="VNIL"then b.k="VFALSE"end;F:goiftrue(a.fs,b)return b.f end;function E:breakstat(a)local b=a.fs;local c=b.bl;local d=false;while c and not c.isbreakable do if c.upval then d=true end;c=c.previous end;if not c then D:syntaxerror(a,"no loop to break")end;if d then F:codeABC(b,"OP_CLOSE",c.nactvar,0,0)end;c.breaklist=F:concat(b,c.breaklist,F:jump(b))end;function E:continuestat(a)local b=a.fs;local c=b.bl;local d=false;while c and not c.isbreakable do if c.upval then d=true end;c=c.previous end;if not c then D:syntaxerror(a,"no loop to continue")end;if d then F:codeABC(b,"OP_CLOSE",c.nactvar,0,0)end;F:codeAsBx(b,"OP_JMP",0,c.breaklist.previous)end;function E:whilestat(a,b)local c=a.fs;local d={}D:next(a)local e=F:getlabel(c)local f=self:cond(a)self:enterblock(c,d,true)self:checknext(a,"TK_DO")self:block(a)F:patchlist(c,F:jump(c),e)self:check_match(a,"TK_END","TK_WHILE",b)self:leaveblock(c)F:patchtohere(c,f)end;function E:repeatstat(a,b)local c=a.fs;local d=F:getlabel(c)local e,f={},{}self:enterblock(c,e,true)self:enterblock(c,f,false)D:next(a)self:chunk(a)self:check_match(a,"TK_UNTIL","TK_REPEAT",b)local b=self:cond(a)if not f.upval then self:leaveblock(c)F:patchlist(a.fs,b,d)else self:breakstat(a)F:patchtohere(a.fs,b)self:leaveblock(c)F:patchlist(a.fs,F:jump(c),d)end;self:leaveblock(c)end;function E:exp1(a)local b={}self:expr(a,b)local c=b.k;F:exp2nextreg(a.fs,b)return c end;function E:forbody(a,b,c,d,e)local f={}local g=a.fs;self:adjustlocalvars(a,3)self:checknext(a,"TK_DO")local h=e and F:codeAsBx(g,"OP_FORPREP",b,F.NO_JUMP)or F:jump(g)self:enterblock(g,f,false)self:adjustlocalvars(a,d)F:reserveregs(g,d)self:block(a)self:leaveblock(g)F:patchtohere(g,h)local a=e and F:codeAsBx(g,"OP_FORLOOP",b,F.NO_JUMP)or F:codeABC(g,"OP_TFORLOOP",b,0,d)F:fixline(g,c)F:patchlist(g,e and a or F:jump(g),h+1)end;function E:fornum(a,b,c)local d=a.fs;local e=d.freereg;self:new_localvarliteral(a,"(for index)",0)self:new_localvarliteral(a,"(for limit)",1)self:new_localvarliteral(a,"(for step)",2)self:new_localvar(a,b,3)self:checknext(a,'=')self:exp1(a)self:checknext(a,",")self:exp1(a)if self:testnext(a,",")then self:exp1(a)else F:codeABx(d,"OP_LOADK",d.freereg,F:numberK(d,1))F:reserveregs(d,1)end;self:forbody(a,e,c,1,true)end;function E:forlist(a,b)local c=a.fs;local d={}local e=0;local f=c.freereg;self:new_localvarliteral(a,"(for generator)",e)e=e+1;self:new_localvarliteral(a,"(for state)",e)e=e+1;self:new_localvarliteral(a,"(for control)",e)e=e+1;self:new_localvar(a,b,e)e=e+1;while self:testnext(a,",")do self:new_localvar(a,self:str_checkname(a),e)e=e+1 end;self:checknext(a,"TK_IN")local b=a.linenumber;self:adjust_assign(a,3,self:explist1(a,d),d)F:checkstack(c,3)self:forbody(a,f,b,e-3,false)end;function E:forstat(a,b)local c=a.fs;local d={}self:enterblock(c,d,true)D:next(a)local d=self:str_checkname(a)local e=a.t.token;if e=="="then self:fornum(a,d,b)elseif e==","or e=="TK_IN"then self:forlist(a,d)else D:syntaxerror(a,self:LUA_QL("=").." or "..self:LUA_QL("in").." expected")end;self:check_match(a,"TK_END","TK_FOR",b)self:leaveblock(c)end;function E:test_then_block(a)D:next(a)local b=self:cond(a)self:checknext(a,"TK_THEN")self:block(a)return b end;function E:ifstat(a,b)local c=a.fs;local d=F.NO_JUMP;local e=self:test_then_block(a)while a.t.token=="TK_ELSEIF"do d=F:concat(c,d,F:jump(c))F:patchtohere(c,e)e=self:test_then_block(a)end;if a.t.token=="TK_ELSE"then d=F:concat(c,d,F:jump(c))F:patchtohere(c,e)D:next(a)self:block(a)else d=F:concat(c,d,e)end;F:patchtohere(c,d)self:check_match(a,"TK_END","TK_IF",b)end;function E:localfunc(a)local b,c={},{}local d=a.fs;self:new_localvar(a,self:str_checkname(a),0)self:init_exp(b,"VLOCAL",d.freereg)F:reserveregs(d,1)self:adjustlocalvars(a,1)self:body(a,c,false,a.linenumber)F:storevar(d,b,c)self:getlocvar(d,d.nactvar-1).startpc=d.pc end;function E:localstat(a)local b=0;local c;local d={}repeat self:new_localvar(a,self:str_checkname(a),b)b=b+1 until not self:testnext(a,",")if self:testnext(a,"=")then c=self:explist1(a,d)else d.k="VVOID"c=0 end;self:adjust_assign(a,b,c,d)self:adjustlocalvars(a,b)end;function E:funcname(a,b)local c=false;self:singlevar(a,b)while a.t.token=="."do self:field(a,b)end;if a.t.token==":"then c=true;self:field(a,b)end;return c end;function E:funcstat(a,b)local c,d={},{}D:next(a)local e=self:funcname(a,c)self:body(a,d,e,b)F:storevar(a.fs,c,d)F:fixline(a.fs,b)end;function E:exprstat(a)local b=a.fs;local d={}d.v={}self:primaryexp(a,d.v)if d.v.k=="VCALL"then c:SETARG_C(F:getcode(b,d.v),1)else d.prev=nil;self:assignment(a,d,1)end end;function E:retstat(a)local b=a.fs;local d={}local e,f;D:next(a)if self:block_follow(a.t.token)or a.t.token==";"then e,f=0,0 else f=self:explist1(a,d)if self:hasmultret(d.k)then F:setmultret(b,d)if d.k=="VCALL"and f==1 then c:SET_OPCODE(F:getcode(b,d),"OP_TAILCALL")assert(c:GETARG_A(F:getcode(b,d))==b.nactvar)end;e=b.nactvar;f=self.LUA_MULTRET else if f==1 then e=F:exp2anyreg(b,d)else F:exp2nextreg(b,d)e=b.nactvar;assert(f==b.freereg-e)end end end;F:ret(b,e,f)end;function E:statement(a)local b=a.linenumber;local c=a.t.token;if c=="TK_IF"then self:ifstat(a,b)return false elseif c=="TK_WHILE"then self:whilestat(a,b)return false elseif c=="TK_DO"then D:next(a)self:block(a)self:check_match(a,"TK_END","TK_DO",b)return false elseif c=="TK_FOR"then self:forstat(a,b)return false elseif c=="TK_REPEAT"then self:repeatstat(a,b)return false elseif c=="TK_FUNCTION"then self:funcstat(a,b)return false elseif c=="TK_LOCAL"then D:next(a)if self:testnext(a,"TK_FUNCTION")then self:localfunc(a)else self:localstat(a)end;return false elseif c=="TK_RETURN"then self:retstat(a)return true elseif c=="TK_BREAK"then D:next(a)self:breakstat(a)return true elseif c=="TK_CONTINUE"then D:next(a)self:continuestat(a)return true else self:exprstat(a)return false end end;function E:chunk(a)local b=false;self:enterlevel(a)while not b and not self:block_follow(a.t.token)do b=self:statement(a)self:testnext(a,";")assert(a.fs.f.maxstacksize>=a.fs.freereg and a.fs.freereg>=a.fs.nactvar)a.fs.freereg=a.fs.nactvar end;self:leavelevel(a)end;local c=bit32;local F=table.unpack or unpack;local G;local H;local I;local J=50;local K={[22]=18,[31]=8,[33]=28,[0]=3,[1]=13,[2]=23,[26]=33,[12]=1,[13]=6,[14]=10,[15]=16,[16]=20,[17]=26,[18]=30,[19]=36,[3]=0,[4]=2,[5]=4,[6]=7,[7]=9,[8]=12,[9]=14,[10]=17,[20]=19,[21]=22,[23]=24,[24]=27,[25]=29,[27]=32,[32]=34,[34]=37,[11]=5,[28]=11,[29]=15,[30]=21,[35]=25,[36]=31,[37]=35}local L={[0]='ABC','ABx','ABC','ABC','ABC','ABx','ABC','ABx','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','AsBx','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','AsBx','AsBx','ABC','ABC','ABC','ABx','ABC'}local M={[0]={b='OpArgR',c='OpArgN'},{b='OpArgK',c='OpArgN'},{b='OpArgU',c='OpArgU'},{b='OpArgR',c='OpArgN'},{b='OpArgU',c='OpArgN'},{b='OpArgK',c='OpArgN'},{b='OpArgR',c='OpArgK'},{b='OpArgK',c='OpArgN'},{b='OpArgU',c='OpArgN'},{b='OpArgK',c='OpArgK'},{b='OpArgU',c='OpArgU'},{b='OpArgR',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgR',c='OpArgN'},{b='OpArgR',c='OpArgN'},{b='OpArgR',c='OpArgN'},{b='OpArgR',c='OpArgR'},{b='OpArgR',c='OpArgN'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgR',c='OpArgU'},{b='OpArgR',c='OpArgU'},{b='OpArgU',c='OpArgU'},{b='OpArgU',c='OpArgU'},{b='OpArgU',c='OpArgN'},{b='OpArgR',c='OpArgN'},{b='OpArgR',c='OpArgN'},{b='OpArgN',c='OpArgU'},{b='OpArgU',c='OpArgU'},{b='OpArgN',c='OpArgN'},{b='OpArgU',c='OpArgN'},{b='OpArgU',c='OpArgN'}}local function N(a,b,c,d)local e=0;for c=b,c,d do e=e+string.byte(a,c,c)*256^(c-b)end;return e end;local function O(a,b,d,e)local f=(-1)^c.rshift(e,7)local e=c.rshift(d,7)+c.lshift(c.band(e,127),1)local a=a+c.lshift(b,8)+c.lshift(c.band(d,127),16)local b=1;if e==0 then if a==0 then return f*0 else b=0;e=1 end elseif e==127 then if a==0 then return f*(1/0)else return f*(0/0)end end;return f*2^(e-127)*(1+b/2^23)end;local function P(a,b,d,e,f,g,h,i)local j=(-1)^c.rshift(i,7)local i=c.lshift(c.band(i,127),4)+c.rshift(h,4)local c=c.band(h,15)*2^48;local h=1;c=c+(g*2^40)+(f*2^32)+(e*2^24)+(d*2^16)+(b*2^8)+a;if i==0 then if c==0 then return j*0 else h=0;i=1 end elseif i==2047 then if c==0 then return j*(1/0)else return j*(0/0)end end;return j*2^(i-1023)*(h+c/2^52)end;local function Q(a,b,c)return N(a,b,c-1,1)end;local function R(a,b,c)return N(a,c-1,b,-1)end;local function N(a,b)return O(string.byte(a,b,b+3))end;local function S(a,b)local a,b,c,d=string.byte(a,b,b+3)return O(d,c,b,a)end;local function O(a,b)return P(string.byte(a,b,b+7))end;local function T(a,b)local a,b,c,d,e,f,g,h=string.byte(a,b,b+7)return P(h,g,f,e,d,c,b,a)end;local N={[4]={little=N,big=S},[8]={little=O,big=T}}local function O(a)local b=a.index;local c=string.byte(a.source,b,b)a.index=b+1;return c end;local function P(a,b)local b=a.index+b;local c=string.sub(a.source,a.index,b-1)a.index=b;return c end;local function S(a)local b=a:s_szt()local c;if b~=0 then c=string.sub(P(a,b),1,-2)end;return c end;local function T(a,b)return function(c)local a=c.index+a;local b=b(c.source,c.index,a)c.index=a;return b end end;local function U(a,b)return function(c)local b=b(c.source,c.index)c.index=c.index+a;return b end end;local function V(a)local b=a:s_int()local d={}for b=1,b do local a=a:s_ins()local e=c.band(a,63)local f=L[e]local g=M[e]local e={value=a,op=K[e],A=c.band(c.rshift(a,6),255)}if f=='ABC'then e.B=c.band(c.rshift(a,23),511)e.C=c.band(c.rshift(a,14),511)e.is_KB=g.b=='OpArgK'and e.B>255;e.is_KC=g.c=='OpArgK'and e.C>255 elseif f=='ABx'then e.Bx=c.band(c.rshift(a,14),262143)e.is_K=g.b=='OpArgK'elseif f=='AsBx'then e.sBx=c.band(c.rshift(a,14),262143)-131071 end;d[b]=e end;return d end;local function c(a)local b=a:s_int()local c={}for b=1,b do local d=O(a)local e;if d==1 then e=O(a)~=0 elseif d==3 then e=a:s_num()elseif d==4 then e=S(a)end;c[b]=e end;return c end;local function L(a,b)local c=a:s_int()local d={}for c=1,c do d[c]=I(a,b)end;return d end;local function M(a)local b=a:s_int()local c={}for b=1,b do c[b]=a:s_int()end;return c end;local function W(a)local b=a:s_int()local c={}for b=1,b do c[b]={varname=S(a),startpc=a:s_int(),endpc=a:s_int()}end;return c end;local function X(a)local b=a:s_int()local c={}for b=1,b do c[b]=S(a)end;return c end;function I(a,b)local d={}local b=S(a)or b;d.source=b;a:s_int()a:s_int()d.numupvals=O(a)d.numparams=O(a)O(a)O(a)d.code=V(a)d.const=c(a)d.subs=L(a,b)d.lines=M(a)W(a)X(a)for a,a in ipairs(d.code)do if a.is_K then a.const=d.const[a.Bx+1]else if a.is_KB then a.const_B=d.const[a.B-255]end;if a.is_KC then a.const_C=d.const[a.C-255]end end end;return d end;function G(a)local b;local c;local d;local e;local f;local g;local h;local a={index=1,source=a}assert(P(a,4)=='\27Lua','invalid Lua signature')assert(O(a)==81,'invalid Lua version')assert(O(a)==0,'invalid Lua format')c=O(a)~=0;d=O(a)e=O(a)f=O(a)g=O(a)h=O(a)~=0;b=c and Q or R;a.s_int=T(d,b)a.s_szt=T(e,b)a.s_ins=T(f,b)if h then a.s_num=T(g,b)elseif N[g]then a.s_num=U(g,N[g][c and'little'or'big'])else error('unsupported float size')end;return I(a,'@virtual')end;local function c(a,b)for c,d in pairs(a)do if d.index>=b then d.value=d.store[d.index]d.store=d;d.index='value'a[c]=nil end end end;local function I(a,b,c)local d=a[b]if not d then d={index=b,store=c}a[b]=d end;return d end;local function L(...)return select('#',...),{...}end;local function M(a,b)local c=a.source;local a=a.lines[a.pc-1]local d,e,f=string.match(b or'','^(.-):(%d+):%s+(.+)')local g='%s:%i: [%s:%i] %s'a=a or'0'd=d or'?'e=e or'0'f=f or b or''error(string.format(g,c,a,d,e,f),0)end;local function N(a)local b=a.code;local d=a.subs;local e=a.env;local f=a.upvals;local g=a.varargs;local h=-1;local i={}local j=a.stack;local k=a.pc;while true do local l=b[k]local m=l.op;k=k+1;if m<18 then if m<8 then if m<3 then if m<1 then for a=l.A,l.B do j[a]=nil end elseif m>1 then local a=f[l.B]j[l.A]=a.store[a.index]else local a,b;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then b=l.const_C else b=j[l.C]end;j[l.A]=a+b end elseif m>3 then if m<6 then if m>4 then local a=l.A;local b=l.B;local c;if l.is_KC then c=l.const_C else c=j[l.C]end;j[a+1]=j[b]j[a]=j[b][c]else j[l.A]=e[l.const]end elseif m>6 then local a;if l.is_KC then a=l.const_C else a=j[l.C]end;j[l.A]=j[l.B][a]else local a,b;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then b=l.const_C else b=j[l.C]end;j[l.A]=a-b end else j[l.A]=j[l.B]end elseif m>8 then if m<13 then if m<10 then e[l.const]=j[l.A]elseif m>10 then if m<12 then local a=l.A;local b=l.B;local c=l.C;local d;local e,f;if b==0 then d=h-a else d=b-1 end;e,f=L(j[a](F(j,a+1,a+d)))if c==0 then h=a+e-1 else e=c-1 end;for b=1,e do j[a+b-1]=f[b]end else local a=f[l.B]a.store[a.index]=j[l.A]end else local a,b;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then b=l.const_C else b=j[l.C]end;j[l.A]=a*b end elseif m>13 then if m<16 then if m>14 then local a=l.A;local b=l.B;local d;if b==0 then d=h-a else d=b-1 end;c(i,0)return L(j[a](F(j,a+1,a+d)))else local a,b;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then b=l.const_C else b=j[l.C]end;j[l.A][a]=b end elseif m>16 then j[l.A]={}else local a,b;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then b=l.const_C else b=j[l.C]end;j[l.A]=a/b end else j[l.A]=l.const end else local a=l.A;local b=j[a+2]local c=j[a]+b;local a=j[a+1]local d;if b==math.abs(b)then d=c<=a else d=c>=a end;if d then j[l.A]=c;j[l.A+3]=c;k=k+l.sBx end end elseif m>18 then if m<28 then if m<23 then if m<20 then j[l.A]=#j[l.B]elseif m>20 then if m<22 then local a=l.A;local b=l.B;local d={}local e;if b==0 then e=h-a+1 else e=b-1 end;for b=1,e do d[b]=j[a+b-1]end;c(i,0)return e,d else local a=j[l.B]for b=l.B+1,l.C do a=a..j[b]end;j[l.A]=a end else local a,b;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then b=l.const_C else b=j[l.C]end;j[l.A]=a%b end elseif m>23 then if m<26 then if m>24 then c(i,l.A)else local a,c;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then c=l.const_C else c=j[l.C]end;if(a==c)==(l.A~=0)then k=k+b[k].sBx end;k=k+1 end elseif m>26 then local a,c;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then c=l.const_C else c=j[l.C]end;if(a28 then if m<33 then if m<30 then local a,c;if l.is_KB then a=l.const_B else a=j[l.B]end;if l.is_KC then c=l.const_C else c=j[l.C]end;if(a<=c)==(l.A~=0)then k=k+b[k].sBx end;k=k+1 elseif m>30 then if m<32 then local a=d[l.Bx+1]local c=a.numupvals;local d;if c~=0 then d={}for a=1,c do local b=b[k+a-1]if b.op==K[0]then d[a-1]=I(i,b.B,j)elseif b.op==K[4]then d[a-1]=f[b.B]end end;k=k+c end;j[l.A]=H(a,e,d)else local a=l.A;local b=l.B;if(not j[b])==(l.C~=0)then k=k+1 else j[a]=j[b]end end else j[l.A]=-j[l.B]end elseif m>33 then if m<36 then if m>34 then local a=l.A;local b=l.B;if b==0 then b=g.size;h=a+b-1 end;for b=1,b do j[a+b-1]=g.list[b]end else local a=l.A;local b,c,d;b=assert(tonumber(j[a]),'`for` initial value must be a number')c=assert(tonumber(j[a+1]),'`for` limit must be a number')d=assert(tonumber(j[a+2]),'`for` step must be a number')j[a]=b-d;j[a+1]=c;j[a+2]=d;k=k+l.sBx end elseif m>36 then local a=l.A;local b=l.C;local c=l.B;local d=j[a]local e;if c==0 then c=h-a end;if b==0 then b=l[k].value;k=k+1 end;e=(b-1)*J;for b=1,c do d[b+e]=j[a+b]end else j[l.A]=not j[l.B]end else if(not j[l.A])==(l.C~=0)then k=k+1 end end else local a=l.A;local b=j[a]local c=j[a+1]local d=j[a+2]local e=a+3;local f;if not d and not c and type(b)=="table"then local e=pcall(getmetatable,b)local f=e and not pcall(setmetatable,b,getmetatable(b))or not e;local e=e and getmetatable(b)if not(table.isfrozen and table.isfrozen(b))and f and not e then warn("The table has a metatable buts it's hidden, __iter and __call won't work in forloop.")end;if not(type(e)=="table"and rawget(e,"__call"))then b,c,d=(type(e)=="table"and rawget(e,"__iter")or next),b,nil;j[a],j[a+1],j[a+2]=b,c,d end end;j[e+2]=d;j[e+1]=c;j[e]=b;f={b(c,d)}for a=1,l.C do j[e+a-1]=f[a]end;if j[e]~=nil then j[a+2]=j[e]else k=k+1 end end else k=k+l.sBx end;a.pc=k end end;function H(a,b,c)local d=a.code;local e=a.subs;local f=a.lines;local g=a.source;local a=a.numparams;local function h(...)local h={}local i={}local j=0;local k,l=L(...)local m;local n,o,p;for a=1,a do h[a-1]=l[a]end;if a