# Model_Network_BufferOperation_24.luac
; fn @BufferOperation.lua  line 0-0 np=0 va=1 ms=2 code=32 consts=11 upvals=1 protos=7
;   K[0]='BufferWriter'
;   K[1]='__index'
;   K[2]='Create'
;   K[3]='BufferWriter'
;   K[4]='write'
;   K[5]='GetString'
;   K[6]='BufferReader'
;   K[7]='BufferReader'
;   K[8]='read'
;   K[9]='GetLeftLength'
;   K[10]='End'
;   upvals: _ENV
0000  NEWTABLE  R0 = {} (0 items)
0001  SETTABUP  _ENV[K0('BufferWriter')] = R0
0002  GETTABUP  R0 = _ENV[K0('BufferWriter')]
0003  GETTABUP  R1 = _ENV[K0('BufferWriter')]
0004  SETTABLE  R0[K1('__index')] = R1
0005  GETTABUP  R0 = _ENV[K0('BufferWriter')]
0006  CLOSURE   R1 = closure proto0
0007  SETTABLE  R0[K2('Create')] = R1
0008  GETTABUP  R0 = _ENV[K3('BufferWriter')]
0009  CLOSURE   R1 = closure proto1
0010  SETTABLE  R0[K4('write')] = R1
0011  GETTABUP  R0 = _ENV[K3('BufferWriter')]
0012  CLOSURE   R1 = closure proto2
0013  SETTABLE  R0[K5('GetString')] = R1
0014  NEWTABLE  R0 = {} (0 items)
0015  SETTABUP  _ENV[K6('BufferReader')] = R0
0016  GETTABUP  R0 = _ENV[K6('BufferReader')]
0017  GETTABUP  R1 = _ENV[K6('BufferReader')]
0018  SETTABLE  R0[K1('__index')] = R1
0019  GETTABUP  R0 = _ENV[K6('BufferReader')]
0020  CLOSURE   R1 = closure proto3
0021  SETTABLE  R0[K2('Create')] = R1
0022  GETTABUP  R0 = _ENV[K7('BufferReader')]
0023  CLOSURE   R1 = closure proto4
0024  SETTABLE  R0[K8('read')] = R1
0025  GETTABUP  R0 = _ENV[K7('BufferReader')]
0026  CLOSURE   R1 = closure proto5
0027  SETTABLE  R0[K9('GetLeftLength')] = R1
0028  GETTABUP  R0 = _ENV[K7('BufferReader')]
0029  CLOSURE   R1 = closure proto6
0030  SETTABLE  R0[K10('End')] = R1
0031  RETURN    return R0..R-1
; ---------- proto0 [Create] ----------
  ; fn ?  line 6-10 np=0 va=0 ms=3 code=7 consts=4 upvals=1 protos=0
  ;   K[0]='setmetatable'
  ;   K[1]='BufferWriter'
  ;   K[2]='_buffer'
  ;   K[3]=''
  ;   upvals: _ENV
  ;   locals: newWriter(4-7)
  0000  GETTABUP  R0 = _ENV[K0('setmetatable')]
  0001  NEWTABLE  R1 = {} (0 items)
  0002  GETTABUP  R2 = _ENV[K1('BufferWriter')]
  0003  CALL      R0 = call(R0, 1 args, 2 rets)
  0004  SETTABLE  R0[K2('_buffer')] = K3('')
  0005  RETURN    return R0..R-1
  0006  RETURN    return R0..R-1
; ---------- proto1 [write] ----------
  ; fn ?  line 13-21 np=2 va=0 ms=4 code=11 consts=2 upvals=0 protos=0
  ;   K[0]=nil
  ;   K[1]='_buffer'
  ;   locals: self(0-11), str(0-11)
  0000  EQ        if R0 eq K0(nil)   -> -130302
  0001  JMP       (jump)   -> 4
  0002  LOADBOOL  R2 = false
  0003  RETURN    return R2..R1
  0004  GETTABLE  R2 = R0[K1('_buffer')]
  0005  MOVE      R3 = R0
  0006  CONCAT    R2 = concat(R2..R2)
  0007  SETTABLE  R0[K1('_buffer')] = R2
  0008  LOADBOOL  R2 = true
  0009  RETURN    return R2..R1
  0010  RETURN    return R0..R-1
; ---------- proto2 [GetString] ----------
  ; fn ?  line 23-25 np=1 va=0 ms=2 code=3 consts=1 upvals=0 protos=0
  ;   K[0]='_buffer'
  ;   locals: self(0-3)
  0000  GETTABLE  R1 = R0[K0('_buffer')]
  0001  RETURN    return R1..R0
  0002  RETURN    return R0..R-1
; ---------- proto3 [Create] ----------
  ; fn ?  line 30-36 np=1 va=0 ms=4 code=13 consts=8 upvals=1 protos=0
  ;   K[0]='setmetatable'
  ;   K[1]='BufferReader'
  ;   K[2]='_buffer'
  ;   K[3]='_bufferLength'
  ;   K[4]='string'
  ;   K[5]='len'
  ;   K[6]='_index'
  ;   K[7]=1
  ;   upvals: _ENV
  ;   locals: str(0-13), newReader(4-13)
  0000  GETTABUP  R1 = _ENV[K0('setmetatable')]
  0001  NEWTABLE  R2 = {} (0 items)
  0002  GETTABUP  R3 = _ENV[K1('BufferReader')]
  0003  CALL      R1 = call(R1, 1 args, 2 rets)
  0004  SETTABLE  R1[K2('_buffer')] = R0
  0005  GETTABUP  R2 = _ENV[K4('string')]
  0006  GETTABLE  R2 = R2[K5('len')]
  0007  MOVE      R3 = R0
  0008  CALL      R2 = call(R2, 1 args, 1 rets)
  0009  SETTABLE  R1[K3('_bufferLength')] = R2
  0010  SETTABLE  R1[K6('_index')] = K7(1)
  0011  RETURN    return R1..R0
  0012  RETURN    return R0..R-1
; ---------- proto4 [read] ----------
  ; fn ?  line 39-48 np=2 va=0 ms=7 code=19 consts=6 upvals=1 protos=0
  ;   K[0]='GetLeftLength'
  ;   K[1]='string'
  ;   K[2]='sub'
  ;   K[3]='_buffer'
  ;   K[4]='_index'
  ;   K[5]=1
  ;   upvals: _ENV
  ;   locals: self(0-19), byteNumber(0-19), avail(2-19), data(14-19)
  0000  SELF      R3 = R0[K0('GetLeftLength')] (self)
  0001  CALL      R2 = call(R2, 1 args, 1 rets)
  0002  LT        if R0 lt R1   -> -130043
  0003  JMP       (jump)   -> 6
  0004  LOADNIL   R3..R3 = nil
  0005  RETURN    return R3..R2
  0006  GETTABUP  R3 = _ENV[K1('string')]
  0007  GETTABLE  R3 = R3[K2('sub')]
  0008  GETTABLE  R4 = R0[K3('_buffer')]
  0009  GETTABLE  R5 = R0[K4('_index')]
  0010  GETTABLE  R6 = R0[K4('_index')]
  0011  ADD       R6 = R1 add R6
  0012  SUB       R6 = K5(1) sub R6
  0013  CALL      R3 = call(R3, 1 args, 3 rets)
  0014  GETTABLE  R4 = R0[K4('_index')]
  0015  ADD       R4 = R1 add R4
  0016  SETTABLE  R0[K4('_index')] = R4
  0017  RETURN    return R3..R2
  0018  RETURN    return R0..R-1
; ---------- proto5 [GetLeftLength] ----------
  ; fn ?  line 50-52 np=1 va=0 ms=3 code=6 consts=3 upvals=0 protos=0
  ;   K[0]='_bufferLength'
  ;   K[1]='_index'
  ;   K[2]=1
  ;   locals: self(0-6)
  0000  GETTABLE  R1 = R0[K0('_bufferLength')]
  0001  GETTABLE  R2 = R0[K1('_index')]
  0002  SUB       R1 = R2 sub R1
  0003  ADD       R1 = K2(1) add R1
  0004  RETURN    return R1..R0
  0005  RETURN    return R0..R-1
; ---------- proto6 [End] ----------
  ; fn ?  line 54-56 np=1 va=0 ms=3 code=8 consts=2 upvals=0 protos=0
  ;   K[0]='_index'
  ;   K[1]='_bufferLength'
  ;   locals: self(0-8)
  0000  GETTABLE  R1 = R0[K0('_index')]
  0001  GETTABLE  R2 = R0[K1('_bufferLength')]
  0002  LT        if R1 lt R1   -> -130043
  0003  JMP       (jump)   -> 5
  0004  LOADBOOL  R1 = false
  0005  LOADBOOL  R1 = true
  0006  RETURN    return R1..R0
  0007  RETURN    return R0..R-1
