local a={}local b=2^32;local c=2^31;local function d(e)return e%b end;local function f(e)e=d(e)local g={}for h=0,31 do local i=e%2;g[h]=i;e=(e-i)/2 end;return g end;local function j(g)local e=0;local k=1;for h=0,31 do if g[h]==1 then e=e+k end;k=k*2 end;return d(e)end;function a.band(...)local l={...}if#l==0 then return 0xFFFFFFFF end;local m=f(l[1])for h=2,#l do local i=f(l[h])for n=0,31 do m[n]=m[n]==1 and i[n]==1 and 1 or 0 end end;return j(m)end;function a.bor(...)local l={...}if#l==0 then return 0 end;local m=f(l[1])for h=2,#l do local i=f(l[h])for n=0,31 do m[n]=(m[n]==1 or i[n]==1)and 1 or 0 end end;return j(m)end;function a.bxor(...)local l={...}if#l==0 then return 0 end;local m=f(l[1])for h=2,#l do local i=f(l[h])for n=0,31 do m[n]=m[n]~=i[n]and 1 or 0 end end;return j(m)end;function a.bnot(e)local m=f(e)for h=0,31 do m[h]=m[h]==1 and 0 or 1 end;return j(m)end;function a.lshift(e,o)return d(d(e)*2^o)end;function a.rshift(e,o)return math.floor(d(e)/2^o)end;function a.arshift(e,o)e=d(e)if e>=c then return math.floor((e-b)/2^o)else return math.floor(e/2^o)end end;function a.lrotate(e,o)o=o%32;e=d(e)local p=e*2^o%b;local q=math.floor(e/2^(32-o))return d(p+q)end;function a.rrotate(e,o)o=o%32;e=d(e)local q=math.floor(e/2^o)local p=e*2^(32-o)%b;return d(p+q)end;function a.extract(e,r,s)s=s or 1;return a.band(a.rshift(e,r),2^s-1)end;function a.replace(e,t,r,s)s=s or 1;local u=a.lshift(2^s-1,r)e=a.band(e,a.bnot(u))return a.bor(e,a.lshift(t,r))end;return a
