# PkRace_View_PkRaceEntry_1053.luac
; fn @PkRaceEntry.lua  line 0-0 np=0 va=1 ms=3 code=27 consts=10 upvals=1 protos=6
;   K[0]='PkRaceEntry'
;   K[1]='setmetatable'
;   K[2]='HudGeneralButton'
;   K[3]='__index'
;   K[4]='Init'
;   K[5]='OnDestroy'
;   K[6]='UpdatePerSecond'
;   K[7]='OnBtnClicked'
;   K[8]='_UpdateTokenText'
;   K[9]='_UpdateRankText'
;   upvals: _ENV
0000  GETTABUP  R0 = _ENV[K1('setmetatable')]
0001  NEWTABLE  R1 = {} (0 items)
0002  GETTABUP  R2 = _ENV[K2('HudGeneralButton')]
0003  CALL      R0 = call(R0, 1 args, 2 rets)
0004  SETTABUP  _ENV[K0('PkRaceEntry')] = R0
0005  GETTABUP  R0 = _ENV[K0('PkRaceEntry')]
0006  GETTABUP  R1 = _ENV[K0('PkRaceEntry')]
0007  SETTABLE  R0[K3('__index')] = R1
0008  GETTABUP  R0 = _ENV[K0('PkRaceEntry')]
0009  CLOSURE   R1 = closure proto0
0010  SETTABLE  R0[K4('Init')] = R1
0011  GETTABUP  R0 = _ENV[K0('PkRaceEntry')]
0012  CLOSURE   R1 = closure proto1
0013  SETTABLE  R0[K5('OnDestroy')] = R1
0014  GETTABUP  R0 = _ENV[K0('PkRaceEntry')]
0015  CLOSURE   R1 = closure proto2
0016  SETTABLE  R0[K6('UpdatePerSecond')] = R1
0017  GETTABUP  R0 = _ENV[K0('PkRaceEntry')]
0018  CLOSURE   R1 = closure proto3
0019  SETTABLE  R0[K7('OnBtnClicked')] = R1
0020  GETTABUP  R0 = _ENV[K0('PkRaceEntry')]
0021  CLOSURE   R1 = closure proto4
0022  SETTABLE  R0[K8('_UpdateTokenText')] = R1
0023  GETTABUP  R0 = _ENV[K0('PkRaceEntry')]
0024  CLOSURE   R1 = closure proto5
0025  SETTABLE  R0[K9('_UpdateRankText')] = R1
0026  RETURN    return R0..R-1
; ---------- proto0 [Init] ----------
  ; fn ?  line 4-25 np=2 va=0 ms=7 code=49 consts=18 upvals=1 protos=0
  ;   K[0]='m_model'
  ;   K[1]=nil
  ;   K[2]='m_activityType'
  ;   K[3]='GetType'
  ;   K[4]='m_activityDefinition'
  ;   K[5]='GetActivityDefinition'
  ;   K[6]='m_lastUpdateTime'
  ;   K[7]=0
  ;   K[8]='_UpdateTokenText'
  ;   K[9]='UpdatePerSecond'
  ;   K[10]='AddHandlerAndRecordMap'
  ;   K[11]='event'
  ;   K[12]='RaceEventType'
  ;   K[13]='OpenMainWindow'
  ;   K[14]='obj'
  ;   K[15]='method'
  ;   K[16]='ScoreChanged'
  ;   K[17]='StateChanged'
  ;   upvals: _ENV
  ;   locals: self(0-49), model(0-49)
  0000  SETTABLE  R0[K0('m_model')] = R1
  0001  GETTABLE  R2 = R0[K0('m_model')]
  0002  EQ        if R0 eq K1(nil)   -> -129787
  0003  JMP       (jump)   -> 5
  0004  RETURN    return R0..R-1
  0005  GETTABLE  R2 = R0[K0('m_model')]
  0006  SELF      R3 = R2[K3('GetType')] (self)
  0007  CALL      R2 = call(R2, 1 args, 1 rets)
  0008  SETTABLE  R0[K2('m_activityType')] = R2
  0009  GETTABLE  R2 = R0[K0('m_model')]
  0010  SELF      R3 = R2[K5('GetActivityDefinition')] (self)
  0011  CALL      R2 = call(R2, 1 args, 1 rets)
  0012  SETTABLE  R0[K4('m_activityDefinition')] = R2
  0013  SETTABLE  R0[K6('m_lastUpdateTime')] = K7(0)
  0014  SELF      R3 = R0[K8('_UpdateTokenText')] (self)
  0015  CALL      R2 = call(R2, 0 args, 1 rets)
  0016  SELF      R3 = R0[K9('UpdatePerSecond')] (self)
  0017  CALL      R2 = call(R2, 0 args, 1 rets)
  0018  GETTABUP  R2 = _ENV[K10('AddHandlerAndRecordMap')]
  0019  GETTABLE  R3 = R0[K0('m_model')]
  0020  GETTABLE  R3 = R3[K11('event')]
  0021  GETTABUP  R4 = _ENV[K12('RaceEventType')]
  0022  GETTABLE  R4 = R4[K13('OpenMainWindow')]
  0023  NEWTABLE  R5 = {} (0 items)
  0024  SETTABLE  R5[K14('obj')] = R0
  0025  GETTABLE  R6 = R0[K8('_UpdateTokenText')]
  0026  SETTABLE  R5[K15('method')] = R6
  0027  CALL      R2 = call(R2, 0 args, 3 rets)
  0028  GETTABUP  R2 = _ENV[K10('AddHandlerAndRecordMap')]
  0029  GETTABLE  R3 = R0[K0('m_model')]
  0030  GETTABLE  R3 = R3[K11('event')]
  0031  GETTABUP  R4 = _ENV[K12('RaceEventType')]
  0032  GETTABLE  R4 = R4[K16('ScoreChanged')]
  0033  NEWTABLE  R5 = {} (0 items)
  0034  SETTABLE  R5[K14('obj')] = R0
  0035  GETTABLE  R6 = R0[K8('_UpdateTokenText')]
  0036  SETTABLE  R5[K15('method')] = R6
  0037  CALL      R2 = call(R2, 0 args, 3 rets)
  0038  GETTABUP  R2 = _ENV[K10('AddHandlerAndRecordMap')]
  0039  GETTABLE  R3 = R0[K0('m_model')]
  0040  GETTABLE  R3 = R3[K11('event')]
  0041  GETTABUP  R4 = _ENV[K12('RaceEventType')]
  0042  GETTABLE  R4 = R4[K17('StateChanged')]
  0043  NEWTABLE  R5 = {} (0 items)
  0044  SETTABLE  R5[K14('obj')] = R0
  0045  GETTABLE  R6 = R0[K8('_UpdateTokenText')]
  0046  SETTABLE  R5[K15('method')] = R6
  0047  CALL      R2 = call(R2, 0 args, 3 rets)
  0048  RETURN    return R0..R-1
; ---------- proto1 [OnDestroy] ----------
  ; fn ?  line 27-33 np=1 va=0 ms=4 code=17 consts=8 upvals=1 protos=0
  ;   K[0]='EventDispatcher'
  ;   K[1]='RemoveTarget'
  ;   K[2]='m_model'
  ;   K[3]=nil
  ;   K[4]='RemoveAllHandlers'
  ;   K[5]='event'
  ;   K[6]='HudGeneralButton'
  ;   K[7]='OnDestroy'
  ;   upvals: _ENV
  ;   locals: self(0-17)
  0000  GETTABUP  R1 = _ENV[K0('EventDispatcher')]
  0001  GETTABLE  R1 = R1[K1('RemoveTarget')]
  0002  MOVE      R2 = R0
  0003  CALL      R1 = call(R1, 0 args, 1 rets)
  0004  GETTABLE  R1 = R0[K2('m_model')]
  0005  EQ        if R1 eq K3(nil)   -> -130294
  0006  JMP       (jump)   -> 12
  0007  GETTABUP  R1 = _ENV[K4('RemoveAllHandlers')]
  0008  GETTABLE  R2 = R0[K2('m_model')]
  0009  GETTABLE  R2 = R2[K5('event')]
  0010  MOVE      R3 = R0
  0011  CALL      R1 = call(R1, 0 args, 2 rets)
  0012  GETTABUP  R1 = _ENV[K6('HudGeneralButton')]
  0013  GETTABLE  R1 = R1[K7('OnDestroy')]
  0014  MOVE      R2 = R0
  0015  CALL      R1 = call(R1, 0 args, 1 rets)
  0016  RETURN    return R0..R-1
; ---------- proto2 [UpdatePerSecond] ----------
  ; fn ?  line 35-55 np=1 va=0 ms=9 code=47 consts=17 upvals=1 protos=0
  ;   K[0]='m_model'
  ;   K[1]=nil
  ;   K[2]='GetNextStateTime'
  ;   K[3]='GM'
  ;   K[4]='GameModel'
  ;   K[5]='GetServerTime'
  ;   K[6]='m_countDownText'
  ;   K[7]='text'
  ;   K[8]='TimeUtil'
  ;   K[9]='ParseTimeDescription'
  ;   K[10]=2
  ;   K[11]='gameObject'
  ;   K[12]='activeSelf'
  ;   K[13]='SetActive'
  ;   K[14]='m_lastUpdateTime'
  ;   K[15]=120
  ;   K[16]='_UpdateRankText'
  ;   upvals: _ENV
  ;   locals: self(0-47), nextTime(7-47), delta(17-26), serTime(39-47)
  0000  GETTABLE  R1 = R0[K0('m_model')]
  0001  EQ        if R0 eq K1(nil)   -> -130300
  0002  JMP       (jump)   -> 4
  0003  RETURN    return R0..R-1
  0004  GETTABLE  R1 = R0[K0('m_model')]
  0005  SELF      R2 = R1[K2('GetNextStateTime')] (self)
  0006  CALL      R1 = call(R1, 1 args, 1 rets)
  0007  EQ        if R1 eq K1(nil)   -> -130294
  0008  JMP       (jump)   -> 27
  0009  GETTABLE  R2 = R0[K0('m_model')]
  0010  SELF      R3 = R2[K2('GetNextStateTime')] (self)
  0011  CALL      R2 = call(R2, 1 args, 1 rets)
  0012  GETTABUP  R3 = _ENV[K3('GM')]
  0013  GETTABLE  R3 = R3[K4('GameModel')]
  0014  SELF      R4 = R3[K5('GetServerTime')] (self)
  0015  CALL      R3 = call(R3, 1 args, 1 rets)
  0016  SUB       R2 = R3 sub R2
  0017  GETTABLE  R3 = R0[K6('m_countDownText')]
  0018  GETTABUP  R4 = _ENV[K8('TimeUtil')]
  0019  GETTABLE  R4 = R4[K9('ParseTimeDescription')]
  0020  MOVE      R5 = R0
  0021  LOADK     R6 = K10 2
  0022  LOADBOOL  R7 = false
  0023  LOADBOOL  R8 = false
  0024  CALL      R4 = call(R4, 1 args, 4 rets)
  0025  SETTABLE  R3[K7('text')] = R4
  0026  JMP       (jump)   -> 35
  0027  GETTABLE  R2 = R0[K11('gameObject')]
  0028  GETTABLE  R2 = R2[K12('activeSelf')]
  0029  TEST      if not R2 then   -> -131041
  0030  JMP       (jump)   -> 35
  0031  GETTABLE  R2 = R0[K11('gameObject')]
  0032  SELF      R3 = R2[K13('SetActive')] (self)
  0033  LOADBOOL  R4 = false
  0034  CALL      R2 = call(R2, 0 args, 2 rets)
  0035  GETTABUP  R2 = _ENV[K3('GM')]
  0036  GETTABLE  R2 = R2[K4('GameModel')]
  0037  SELF      R3 = R2[K5('GetServerTime')] (self)
  0038  CALL      R2 = call(R2, 1 args, 1 rets)
  0039  GETTABLE  R3 = R0[K14('m_lastUpdateTime')]
  0040  SUB       R3 = R3 sub R2
  0041  LT        if R0 lt R3   -> 7726
  0042  JMP       (jump)   -> 46
  0043  SETTABLE  R0[K14('m_lastUpdateTime')] = R2
  0044  SELF      R4 = R0[K16('_UpdateRankText')] (self)
  0045  CALL      R3 = call(R3, 0 args, 1 rets)
  0046  RETURN    return R0..R-1
; ---------- proto3 [OnBtnClicked] ----------
  ; fn ?  line 57-65 np=1 va=0 ms=8 code=22 consts=10 upvals=1 protos=0
  ;   K[0]='m_model'
  ;   K[1]='GetState'
  ;   K[2]='IsInRace'
  ;   K[3]='TryOpenMainWindow'
  ;   K[4]='GM'
  ;   K[5]='UIManager'
  ;   K[6]='OpenView'
  ;   K[7]='m_activityDefinition'
  ;   K[8]='NoticeWindowPrefabName'
  ;   K[9]='m_activityType'
  ;   upvals: _ENV
  ;   locals: self(0-22), state(3-22)
  0000  GETTABLE  R1 = R0[K0('m_model')]
  0001  SELF      R2 = R1[K1('GetState')] (self)
  0002  CALL      R1 = call(R1, 1 args, 1 rets)
  0003  GETTABLE  R2 = R0[K0('m_model')]
  0004  SELF      R3 = R2[K2('IsInRace')] (self)
  0005  CALL      R2 = call(R2, 1 args, 1 rets)
  0006  TEST      if not R2 then   -> -131064
  0007  JMP       (jump)   -> 12
  0008  GETTABLE  R2 = R0[K0('m_model')]
  0009  SELF      R3 = R2[K3('TryOpenMainWindow')] (self)
  0010  CALL      R2 = call(R2, 0 args, 1 rets)
  0011  JMP       (jump)   -> 21
  0012  GETTABUP  R2 = _ENV[K4('GM')]
  0013  GETTABLE  R2 = R2[K5('UIManager')]
  0014  SELF      R3 = R2[K6('OpenView')] (self)
  0015  GETTABLE  R4 = R0[K7('m_activityDefinition')]
  0016  GETTABLE  R4 = R4[K8('NoticeWindowPrefabName')]
  0017  GETTABLE  R5 = R0[K9('m_activityType')]
  0018  LOADBOOL  R6 = false
  0019  LOADBOOL  R7 = true
  0020  CALL      R2 = call(R2, 0 args, 5 rets)
  0021  RETURN    return R0..R-1
; ---------- proto4 [_UpdateTokenText] ----------
  ; fn ?  line 67-83 np=1 va=0 ms=7 code=33 consts=13 upvals=0 protos=0
  ;   K[0]='m_model'
  ;   K[1]=nil
  ;   K[2]='m_exclamationGo'
  ;   K[3]='SetActive'
  ;   K[4]='CanShowExclaimation'
  ;   K[5]='IsInRace'
  ;   K[6]='GetMyScore'
  ;   K[7]='GetTargetScore'
  ;   K[8]='m_tokenText'
  ;   K[9]='text'
  ;   K[10]='/'
  ;   K[11]='0'
  ;   K[12]='_UpdateRankText'
  ;   locals: self(0-33), tokenNum(18-27), targetNum(21-27)
  0000  GETTABLE  R1 = R0[K0('m_model')]
  0001  EQ        if R0 eq K1(nil)   -> -130300
  0002  JMP       (jump)   -> 4
  0003  RETURN    return R0..R-1
  0004  GETTABLE  R1 = R0[K2('m_exclamationGo')]
  0005  SELF      R2 = R1[K3('SetActive')] (self)
  0006  GETTABLE  R3 = R0[K0('m_model')]
  0007  SELF      R4 = R3[K4('CanShowExclaimation')] (self)
  0008  CALL      R3 = call(R3, -1 args, 1 rets)
  0009  CALL      R1 = call(R1, 0 args, -1 rets)
  0010  GETTABLE  R1 = R0[K0('m_model')]
  0011  SELF      R2 = R1[K5('IsInRace')] (self)
  0012  CALL      R1 = call(R1, 1 args, 1 rets)
  0013  TEST      if not R1 then   -> -131057
  0014  JMP       (jump)   -> 28
  0015  GETTABLE  R1 = R0[K0('m_model')]
  0016  SELF      R2 = R1[K6('GetMyScore')] (self)
  0017  CALL      R1 = call(R1, 1 args, 1 rets)
  0018  GETTABLE  R2 = R0[K0('m_model')]
  0019  SELF      R3 = R2[K7('GetTargetScore')] (self)
  0020  CALL      R2 = call(R2, 1 args, 1 rets)
  0021  GETTABLE  R3 = R0[K8('m_tokenText')]
  0022  MOVE      R4 = R0
  0023  LOADK     R5 = K10 '/'
  0024  MOVE      R6 = R0
  0025  CONCAT    R4 = concat(R4..R4)
  0026  SETTABLE  R3[K9('text')] = R4
  0027  JMP       (jump)   -> 30
  0028  GETTABLE  R1 = R0[K8('m_tokenText')]
  0029  SETTABLE  R1[K9('text')] = K11('0')
  0030  SELF      R2 = R0[K12('_UpdateRankText')] (self)
  0031  CALL      R1 = call(R1, 0 args, 1 rets)
  0032  RETURN    return R0..R-1
; ---------- proto5 [_UpdateRankText] ----------
  ; fn ?  line 85-97 np=1 va=0 ms=5 code=44 consts=14 upvals=1 protos=0
  ;   K[0]='m_model'
  ;   K[1]=nil
  ;   K[2]='HasNetwork'
  ;   K[3]='m_exclamationGo'
  ;   K[4]='SetActive'
  ;   K[5]='CanShowExclaimation'
  ;   K[6]='IsInRace'
  ;   K[7]=-1
  ;   K[8]='GetMyRank'
  ;   K[9]='UIUtil'
  ;   K[10]='m_firstRankGo'
  ;   K[11]=1
  ;   K[12]='m_secondRankGo'
  ;   K[13]=2
  ;   upvals: _ENV
  ;   locals: self(0-44), rank(27-44)
  0000  GETTABLE  R1 = R0[K0('m_model')]
  0001  EQ        if R1 eq K1(nil)   -> -130300
  0002  JMP       (jump)   -> 8
  0003  GETTABLE  R1 = R0[K0('m_model')]
  0004  SELF      R2 = R1[K2('HasNetwork')] (self)
  0005  CALL      R1 = call(R1, 1 args, 1 rets)
  0006  TEST      if not R1 then   -> -131063
  0007  JMP       (jump)   -> 9
  0008  RETURN    return R0..R-1
  0009  GETTABLE  R1 = R0[K3('m_exclamationGo')]
  0010  SELF      R2 = R1[K4('SetActive')] (self)
  0011  GETTABLE  R3 = R0[K0('m_model')]
  0012  SELF      R4 = R3[K5('CanShowExclaimation')] (self)
  0013  CALL      R3 = call(R3, -1 args, 1 rets)
  0014  CALL      R1 = call(R1, 0 args, -1 rets)
  0015  GETTABLE  R1 = R0[K0('m_model')]
  0016  SELF      R2 = R1[K6('IsInRace')] (self)
  0017  CALL      R1 = call(R1, 1 args, 1 rets)
  0018  TEST      if not R1 then   -> -131051
  0019  JMP       (jump)   -> 23
  0020  LOADK     R1 = K7 -1
  0021  TEST      if not R1 then   -> -131048
  0022  JMP       (jump)   -> 27
  0023  GETTABLE  R1 = R0[K0('m_model')]
  0024  SELF      R2 = R1[K8('GetMyRank')] (self)
  0025  LOADBOOL  R3 = true
  0026  CALL      R1 = call(R1, 1 args, 2 rets)
  0027  GETTABUP  R2 = _ENV[K9('UIUtil')]
  0028  GETTABLE  R2 = R2[K4('SetActive')]
  0029  GETTABLE  R3 = R0[K10('m_firstRankGo')]
  0030  EQ        if R1 eq K11(1)   -> -130261
  0031  JMP       (jump)   -> 33
  0032  LOADBOOL  R4 = false
  0033  LOADBOOL  R4 = true
  0034  CALL      R2 = call(R2, 0 args, 2 rets)
  0035  GETTABUP  R2 = _ENV[K9('UIUtil')]
  0036  GETTABLE  R2 = R2[K4('SetActive')]
  0037  GETTABLE  R3 = R0[K12('m_secondRankGo')]
  0038  EQ        if R1 eq K13(2)   -> -130251
  0039  JMP       (jump)   -> 41
  0040  LOADBOOL  R4 = false
  0041  LOADBOOL  R4 = true
  0042  CALL      R2 = call(R2, 0 args, 2 rets)
  0043  RETURN    return R0..R-1
