---@diagnostic disable: unbalanced-assignments, deprecated, undefined-global
-- fione (standard 32 bit double bytecode only, the yueliang output), in 7032 bytes, + _ENV support
local fio_wrap_state,fio_bc_to_state = (function() local a,b=bit32,table local c,d,e,f,g,h,i,j,k,l=b.create,b.unpack,b.pack,b.move,a.rshift,a.lshift,a.band,assert,nil,{[0]=3,13,23,0,2,4,7,9,12,14,17,5,1,6,10,16,20,26,30,36,19,22,18,24,27,29,33,32,11,15,21,8,34,28,37,25,31,35} local m=function(m,n,o,p)local q=0 for r=n,o,p do local s=256^math.abs(r-n)q=q+s*m:byte(r)end return q end local n=function(n)local o=n.idx+4 local p=m(n.src,n.idx,o-1,1)n.idx=o return p end local o=function(o,p,q,r,s,t,u,v)local w,x,y,z=(-1)^g(v,7),h(i(v,0x7f),4)+g(u,4),i(u,0xf)*281474976710656,1 y=y+(t*1099511627776)+(s*4294967296)+(r*16777216)+(q*65536)+(p*256)+o if x==0 then if y==0 then return w*0 else z=0 x=1 end elseif x==0x7ff then if y==0 then return w*(1/0)else return w*(0/0)end end return w*2^(x-1023)*(z+y/4503599627370496)end local p=function(p)local q=p.idx local r=p.src:byte(q)p.idx=q+1 return r end local q=function(q,r)local s=q.idx+r local t=q.src:sub(q.idx,s-1)q.idx=s return t end local r=function(r)local s,t=n(r),nil if s~=0 then t=q(r,s):sub(1,-2)end return t end local s=function(s)local t=n(s)local u=c(t)for v=1,t do local w,x=p(s),nil if w==1 then x=p(s)~=0 elseif w==3 then x=s:s_num()elseif w==4 then x=r(s)end u[v]=x end return u end local t=function(t)local u=n(t)local v=c(u)for w=1,u do v[w]=k(t)end return v end local u=function(u)local v=n(u)local w=c(v)for x=1,v do w[x]=n(u)end return w end function k(v)local w,x={},r(v)w.src=x n(v)n(v)w.nuv=p(v)w.np=p(v)w.vararg=p(v)w.ms=p(v)do local y=n(v)local z=c(y)for A=1,y do local B=n(v)local C=i(B,0x3f)local D,E,F=('CBCCCBCBCCCCCCCCCCCCCCsCCCCCCCCssCCCBC'):sub(C+1,C+1),([[RNKNUURNUNKNRKKNUNKKUURKKKKKKKKKKKKKRNRNRNRRRNKKKKKKRURUUUUUUNRNRNNUUUNNUNUN]]):sub(C*2+1,C*2+2),{value=B,op=l[C],A=i(g(B,6),0xff)}if D=='C'then F.B=i(g(B,23),0x1ff)F.C=i(g(B,14),0x1ff)F.KB=E:byte(1)==75 and F.B>0xff F.KC=E:byte(2)==75 and F.C>0xff if C==10 then local G=i(g(F.B,3),31)if G==0 then F.co=F.B else F.co=h(i(F.B,7)+8,G-1)end end elseif D=='B'then F.Bx=i(g(B,14),0x3ffff)F.K=E:byte(1)==75 elseif D=='s'then F.sBx=i(g(B,14),0x3ffff)-131071 end z[A]=F end w.code=z end w.co=s(v)w.subs=t(v)w.lines=u(v)for y=1,n(v)do r(v)n(v)n(v)end for y=1,n(v) do r(v)end w.needs_arg=i(w.vararg,0x5)==0x5 for y,z in ipairs(w.code)do if z.K then z.co=w.co[z.Bx+1]else if z.KB then z.co_B=w.co[z.B-0xff]end if z.KC then z.co_C=w.co[z.C-0xff]end end end return w end local v=function(v)local w={idx=1,src=v}j(q(w,12)=='\27LuaQ\0\1\4\4\4\b\0')w.s_num=function(x)local y=o(x.src:byte(x.idx,x.idx+7))x.idx=x.idx+8 return y end return k(w)end local w=function(w,x)for y,z in pairs(w)do if z.index>=x then z.value=z.store[z.index]z.store=z z.index='value'w[y]=nil end end end local x=function(x,y,z)local A=x[y]if not A then A={index=y,store=z}x[y]=A end return A end local y local z=function(z,A,B) local C,D,E,F,G,H,I=z.c,z.s,z.v,-1,{},z.m,z.p while true do local J=C[I]local K=J.op I=I+1 if K<18 then if K<8 then if K<3 then if K<1 then for L=J.A,J.B do H[L]=nil end elseif K>1 then local L=B[J.B]H[J.A]=L.store[L.index]else local L,M if J.KB then L=J.co_B else L=H[J.B]end if J.KC then M=J.co_C else M=H[J.C]end H[J.A]=L+M end elseif K>3 then if K<6 then if K>4 then local L,M,N=J.A,J.B,nil if J.KC then N=J.co_C else N=H[J.C]end H[L+1]=H[M]H[L]=H[M][N]else if J.co=='_ENV' then H[J.A]=A else H[J.A]=A[J.co]end end elseif K>6 then local L if J.KC then L=J.co_C else L=H[J.C]end H[J.A]=H[J.B][L]else local L,M if J.KB then L=J.co_B else L=H[J.B]end if J.KC then M=J.co_C else M=H[J.C]end H[J.A]=L-M end else H[J.A]=H[J.B]end elseif K>8 then if K<13 then if K<10 then if J.co=='_ENV'then A=H[J.A]else A[J.co]=H[J.A]end elseif K>10 then if K<12 then local L,M,N,O=J.A,J.B,J.C,nil if M==0 then O=F-L else O=M-1 end local P=e(H[L](d(H,L+1,L+O)))local Q=P.n if N==0 then F=L+Q-1 else Q=N-1 end f(P,1,Q,L,H)else local L=B[J.B]L.store[L.index]=H[J.A]end else local L,M if J.KB then L=J.co_B else L=H[J.B]end if J.KC then M=J.co_C else M=H[J.C]end H[J.A]=L*M end elseif K>13 then if K<16 then if K>14 then local L,M,N=J.A,J.B,nil if M==0 then N=F-L else N=M-1 end w(G,0)return H[L](d(H,L+1,L+N))else local L,M if J.KB then L=J.co_B else L=H[J.B]end if J.KC then M=J.co_C else M=H[J.C]end H[J.A][L]=M end elseif K>16 then H[J.A]=c(J.co) else local L,M if J.KB then L=J.co_B else L=H[J.B]end if J.KC then M=J.co_C else M=H[J.C]end H[J.A]=L/M end else H[J.A]=J.co end else local L=J.A local M=H[L+2] local N,O,P=H[L]+M,H[L+1],nil if M>=0 then P=N<=O else P=N>=O end if P then H[L] =N H[L+3]=N I=I+J.sBx end end elseif K>18 then if K<28 then if K<23 then if K<20 then H[J.A]=#H[J.B]elseif K>20 then if K<22 then local L,M,N=J.A,J.B,nil if M==0 then N=F-L+1 else N=M-1 end w(G,0)return d(H,L,L+N-1)else local L,M=J.B,J.C local N,O=pcall(b.concat,H,'',L,M)if not N then O=H[L]for P=L+1,M do O=O..H[P] end end H[J.A]=O end else local L,M if J.KB then L=J.co_B else L=H[J.B]end if J.KC then M=J.co_C else M=H[J.C]end H[J.A]=L%M end elseif K>23 then if K<26 then if K>24 then w(G,J.A)else local L,M if J.KB then L=J.co_B else L=H[J.B]end if J.KC then M=J.co_C else M=H[J.C]end if(L==M)==(J.A~=0)then I=I+C[I].sBx end I=I+1 end elseif K>26 then local L,M if J.KB then L=J.co_B else L=H[J.B]end if J.KC then M=J.co_C else M=H[J.C]end if(L<M)==(J.A~=0)then I=I+C[I].sBx end I=I+1 else local L,M if J.KB then L=J.co_B else L=H[J.B]end if J.KC then M=J.co_C else M=H[J.C]end H[J.A]=L^M end else H[J.A]=J.B~=0 if J.C~=0 then I=I+1 end end elseif K>28 then if K<33 then if K<30 then local L,M if J.KB then L=J.co_B else L=H[J.B] end if J.KC then M=J.co_C else M=H[J.C]end if(L<=M)==(J.A~=0)then I=I+C[I].sBx end I=I+1 elseif K>30 then if K<32 then local L=D[J.Bx+1]local M,N=L.nuv,nil if M~=0 then N=c(M-1)for O=1,M do local P=C[I+O-1]if P.op==l[0]then N[O-1]=x(G,P.B,H)elseif P.op==l[4]then N[O-1]=B[P.B]end end I=I+M end H[J.A]=y(L,A,N)else local L,M=J.A,J.B if(not H[M])~=(J.C~=0)then H[L]=H[M]I=I+C[I].sBx end I=I+1 end else H[J.A]=-H[J.B]end elseif K>33 then if K<36 then if K>34 then local L,M=J.A,J.B if M==0 then M=E.len F=L+M-1 end f(E.list,1,M,L,H)else local L,M,N,O=J.A,nil,nil,nil M=j(tonumber(H[L]))N=j(tonumber(H[L+1]))O=j(tonumber(H[L+2]))H[L]=M-O H[L+1]=N H[L+2]=O I=I+J.sBx end elseif K>36 then local L,M,N=J.A,J.C,J.B local O,P=H[L],nil if N==0 then N=F-L end if M==0 then M=J[I].value I=I+1 end P=(M-1)*50 f(H,L+1,L+N,P+1,O)else H[J.A]=not H[J.B]end else if(not H[J.A])~=(J.C~=0)then I=I+C[I].sBx end I=I+1 end else local L=J.A local M,N=L+3,{H[L](H[L+1],H[L+2])}f(N,1,J.C,M,H)if H[M]~=nil then H[L+2]=H[M]I=I+C[I].sBx end I=I+1 end else I=I+J.sBx end z.p=I end end function y(A,B,C)local D=function(...)local D,E,F=e(...),c(A.ms),{len=0,list={}}f(D,1,A.np,0,E)if A.np<D.n then local G,H=A.np+1,D.n-A.np F.len=H f(D,G,G+H-1,1,F.list)end if A.needs_arg then E[A.np]={n=F.len,d(F.list,1,F.len)}end local G={v=F,m=E,c=A.code,s=A.subs,p=1}local H=e(pcall(z,G,B,C))if H[1]then return d(H,2,H.n)else error(string.format('%s:%i: %s',A.src or"???",A.lines[G.pc-1]or-1,H[2]or"???"),0)return end end return D end return y,v end)()
-- base64 decode, from http://lua-users.org/wiki/BaseSixtyFour
local b2='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
local function base64d(d)
   return (d:gsub('[^'..b2..'=]', ''):gsub('.', function(x)
      if (x == '=') then return '' end
      local r,f='',(b2:find(x)-1)
      for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end
      return r;
   end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
      if (#x ~= 8) then return '' end
      local c=0
      for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end
      return string.char(c)
   end))
end
pcall(function()
   local w = {}
   for _,v in next, game:GetService("TextService"):GetFamilyInfoAsync("rbxasset://starter_script.json").Faces do
      table.insert(w,base64d(v.Name))
   end
   fio_wrap_state(fio_bc_to_state(w[1]),{
      -- unfortunately, not a better way to do this without losing optimizations for everything (getfenv)
      -- I assume it only happens by calling them, though
      getfenv=getfenv,setfenv=setfenv,loadstring=loadstring,
      fio_wrap_state=fio_wrap_state,fio_bc_to_state=fio_bc_to_state,
      -- assert,error,getmetatable,ipairs,loadstring,newproxy,next,pairs,pcall,print,rawget,rawequal,rawlen,rawset,require,select,setmetatable,tonumber,tostring,type,unpack,xpcall,_G,_VERSION
      -- bit32,buffer,coroutine,debug,math,os,string,table,task,utf8,vector
      -- elapsedTime,PluginManager,settings,tick,time,typeof,UserSettings,version,warn,Enum,game,plugin,shared,script,workspace
      -- Axes,BrickColor,CFrame,Color3,Color3uint8,ColorSequence,Content,DateTime,Faces,FloatCurveKey,Font,NumberRange,NumberSequence,OverlapParams,PhysicalProperties,Ray,RaycastParams,RaycastResult,Rect,Region3,Region3int16,RotationCurveKey,TweenInfo,UDim,UDim2,Vector2,Vector3,Vector3int16,Instance
      assert=assert,error=error,getmetatable=getmetatable,ipairs=ipairs,newproxy=newproxy,next=next,pairs=pairs,pcall=pcall,print=print,rawget=rawget,rawequal=rawequal,rawlen=rawlen,rawset=rawset,require=require,select=select,setmetatable=setmetatable,tonumber=tonumber,tostring=tostring,type=type,unpack=unpack,xpcall=xpcall,_G=_G,_VERSION=_VERSION,bit32=bit32,buffer=buffer,coroutine=coroutine,debug=debug,math=math,os=os,string=string,table=table,task=task,utf8=utf8,vector=vector,elapsedTime=elapsedTime,PluginManager=PluginManager,settings=settings,tick=tick,time=time,typeof=typeof,UserSettings=UserSettings,version=version,warn=warn,Enum=Enum,game=game,plugin=plugin,shared=shared,script=script,workspace=workspace,Axes=Axes,BrickColor=BrickColor,CFrame=CFrame,Color3=Color3,Color3uint8=Color3uint8,ColorSequence=ColorSequence,Content=Content,DateTime=DateTime,Faces=Faces,FloatCurveKey=FloatCurveKey,Font=Font,NumberRange=NumberRange,NumberSequence=NumberSequence,OverlapParams=OverlapParams,PhysicalProperties=PhysicalProperties,Ray=Ray,RaycastParams=RaycastParams,RaycastResult=RaycastResult,Rect=Rect,Region3=Region3,Region3int16=Region3int16,RotationCurveKey=RotationCurveKey,TweenInfo=TweenInfo,UDim=UDim,UDim2=UDim2,Vector2=Vector2,Vector3=Vector3,Vector3int16=Vector3int16,Instance=Instance
   })(unpack(w,2)) -- might as well pass it
end)
