# UpgradeRace_View_UpgradeRaceActivityMainEntry_1563.luac
; fn @UpgradeRaceActivityMainEntry.lua  line 0-0 np=0 va=1 ms=3 code=42 consts=15 upvals=1 protos=11
;   K[0]='UpgradeRaceActivityMainEntry'
;   K[1]='setmetatable'
;   K[2]='HudGeneralButton'
;   K[3]='__index'
;   K[4]='Awake'
;   K[5]='Init'
;   K[6]='_InitModelData'
;   K[7]='_TryAddListeners'
;   K[8]='GetModel'
;   K[9]='OnBtnClicked'
;   K[10]='UpdatePerSecond'
;   K[11]='_OnStateChanged'
;   K[12]='_OnMainWindowOpened'
;   K[13]='_UpdateView'
;   K[14]='_UpdateRedPoint'
;   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('UpgradeRaceActivityMainEntry')] = R0
0005  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityMainEntry')]
0006  GETTABUP  R1 = _ENV[K0('UpgradeRaceActivityMainEntry')]
0007  SETTABLE  R0[K3('__index')] = R1
0008  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityMainEntry')]
0009  CLOSURE   R1 = closure proto0
0010  SETTABLE  R0[K4('Awake')] = R1
0011  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityMainEntry')]
0012  CLOSURE   R1 = closure proto1
0013  SETTABLE  R0[K5('Init')] = R1
0014  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityMainEntry')]
0015  CLOSURE   R1 = closure proto2
0016  SETTABLE  R0[K6('_InitModelData')] = R1
0017  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityMainEntry')]
0018  CLOSURE   R1 = closure proto3
0019  SETTABLE  R0[K7('_TryAddListeners')] = R1
0020  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityMainEntry')]
0021  CLOSURE   R1 = closure proto4
0022  SETTABLE  R0[K8('GetModel')] = R1
0023  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityMainEntry')]
0024  CLOSURE   R1 = closure proto5
0025  SETTABLE  R0[K9('OnBtnClicked')] = R1
0026  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityMainEntry')]
0027  CLOSURE   R1 = closure proto6
0028  SETTABLE  R0[K10('UpdatePerSecond')] = R1
0029  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityMainEntry')]
0030  CLOSURE   R1 = closure proto7
0031  SETTABLE  R0[K11('_OnStateChanged')] = R1
0032  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityMainEntry')]
0033  CLOSURE   R1 = closure proto8
0034  SETTABLE  R0[K12('_OnMainWindowOpened')] = R1
0035  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityMainEntry')]
0036  CLOSURE   R1 = closure proto9
0037  SETTABLE  R0[K13('_UpdateView')] = R1
0038  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityMainEntry')]
0039  CLOSURE   R1 = closure proto10
0040  SETTABLE  R0[K14('_UpdateRedPoint')] = R1
0041  RETURN    return R0..R-1
; ---------- proto0 [Awake] ----------
  ; fn ?  line 15-20 np=1 va=0 ms=3 code=9 consts=4 upvals=1 protos=0
  ;   K[0]='HudGeneralButton'
  ;   K[1]='Awake'
  ;   K[2]='_InitModelData'
  ;   K[3]='_TryAddListeners'
  ;   upvals: _ENV
  ;   locals: self(0-9)
  0000  GETTABUP  R1 = _ENV[K0('HudGeneralButton')]
  0001  GETTABLE  R1 = R1[K1('Awake')]
  0002  MOVE      R2 = R0
  0003  CALL      R1 = call(R1, 0 args, 1 rets)
  0004  SELF      R2 = R0[K2('_InitModelData')] (self)
  0005  CALL      R1 = call(R1, 0 args, 1 rets)
  0006  SELF      R2 = R0[K3('_TryAddListeners')] (self)
  0007  CALL      R1 = call(R1, 0 args, 1 rets)
  0008  RETURN    return R0..R-1
; ---------- proto1 [Init] ----------
  ; fn ?  line 23-30 np=2 va=0 ms=5 code=9 consts=4 upvals=0 protos=0
  ;   K[0]='m_model'
  ;   K[1]='_InitModelData'
  ;   K[2]='_TryAddListeners'
  ;   K[3]='UpdatePerSecond'
  ;   locals: self(0-9), model(0-9)
  0000  SETTABLE  R0[K0('m_model')] = R1
  0001  SELF      R3 = R0[K1('_InitModelData')] (self)
  0002  CALL      R2 = call(R2, 0 args, 1 rets)
  0003  SELF      R3 = R0[K2('_TryAddListeners')] (self)
  0004  CALL      R2 = call(R2, 0 args, 1 rets)
  0005  SELF      R3 = R0[K3('UpdatePerSecond')] (self)
  0006  LOADBOOL  R4 = true
  0007  CALL      R2 = call(R2, 0 args, 2 rets)
  0008  RETURN    return R0..R-1
; ---------- proto2 [_InitModelData] ----------
  ; fn ?  line 32-35 np=1 va=0 ms=3 code=4 consts=3 upvals=0 protos=0
  ;   K[0]='GetModel'
  ;   K[1]='m_lastUpdateRankTime'
  ;   K[2]=0
  ;   locals: self(0-4), model(2-4)
  0000  SELF      R2 = R0[K0('GetModel')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  SETTABLE  R0[K1('m_lastUpdateRankTime')] = K2(0)
  0003  RETURN    return R0..R-1
; ---------- proto3 [_TryAddListeners] ----------
  ; fn ?  line 37-49 np=1 va=0 ms=8 code=33 consts=18 upvals=1 protos=0
  ;   K[0]='GetModel'
  ;   K[1]=nil
  ;   K[2]='gameObject'
  ;   K[3]='activeInHierarchy'
  ;   K[4]='GetActivityDefinition'
  ;   K[5]='EventDispatcher'
  ;   K[6]='AddListener'
  ;   K[7]='StateChangedEvent'
  ;   K[8]='_OnStateChanged'
  ;   K[9]='MainWindowOpenedEvent'
  ;   K[10]='_OnMainWindowOpened'
  ;   K[11]='AddHandlerAndRecordMap'
  ;   K[12]='event'
  ;   K[13]='RaceEventType'
  ;   K[14]='ScoreChanged'
  ;   K[15]='obj'
  ;   K[16]='method'
  ;   K[17]='_UpdateView'
  ;   upvals: _ENV
  ;   locals: self(0-33), model(2-33), activityDefinition(11-33)
  0000  SELF      R2 = R0[K0('GetModel')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  EQ        if R1 eq K1(nil)   -> -130299
  0003  JMP       (jump)   -> 8
  0004  GETTABLE  R2 = R0[K2('gameObject')]
  0005  GETTABLE  R2 = R2[K3('activeInHierarchy')]
  0006  TEST      if not R2 then   -> -131063
  0007  JMP       (jump)   -> 9
  0008  RETURN    return R0..R-1
  0009  SELF      R3 = R1[K4('GetActivityDefinition')] (self)
  0010  CALL      R2 = call(R2, 1 args, 1 rets)
  0011  GETTABUP  R3 = _ENV[K5('EventDispatcher')]
  0012  GETTABLE  R3 = R3[K6('AddListener')]
  0013  GETTABLE  R4 = R2[K7('StateChangedEvent')]
  0014  MOVE      R5 = R0
  0015  GETTABLE  R6 = R0[K8('_OnStateChanged')]
  0016  CALL      R3 = call(R3, 0 args, 3 rets)
  0017  GETTABUP  R3 = _ENV[K5('EventDispatcher')]
  0018  GETTABLE  R3 = R3[K6('AddListener')]
  0019  GETTABLE  R4 = R2[K9('MainWindowOpenedEvent')]
  0020  MOVE      R5 = R0
  0021  GETTABLE  R6 = R0[K10('_OnMainWindowOpened')]
  0022  CALL      R3 = call(R3, 0 args, 3 rets)
  0023  GETTABUP  R3 = _ENV[K11('AddHandlerAndRecordMap')]
  0024  GETTABLE  R4 = R1[K12('event')]
  0025  GETTABUP  R5 = _ENV[K13('RaceEventType')]
  0026  GETTABLE  R5 = R5[K14('ScoreChanged')]
  0027  NEWTABLE  R6 = {} (0 items)
  0028  SETTABLE  R6[K15('obj')] = R0
  0029  GETTABLE  R7 = R0[K17('_UpdateView')]
  0030  SETTABLE  R6[K16('method')] = R7
  0031  CALL      R3 = call(R3, 0 args, 3 rets)
  0032  RETURN    return R0..R-1
; ---------- proto4 [GetModel] ----------
  ; fn ?  line 51-53 np=1 va=0 ms=2 code=3 consts=1 upvals=0 protos=0
  ;   K[0]='m_model'
  ;   locals: self(0-3)
  0000  GETTABLE  R1 = R0[K0('m_model')]
  0001  RETURN    return R1..R0
  0002  RETURN    return R0..R-1
; ---------- proto5 [OnBtnClicked] ----------
  ; fn ?  line 55-57 np=1 va=0 ms=3 code=5 consts=2 upvals=0 protos=0
  ;   K[0]='GetModel'
  ;   K[1]='OnEntryClicked'
  ;   locals: self(0-5)
  0000  SELF      R2 = R0[K0('GetModel')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  SELF      R2 = R1[K1('OnEntryClicked')] (self)
  0003  CALL      R1 = call(R1, 0 args, 1 rets)
  0004  RETURN    return R0..R-1
; ---------- proto6 [UpdatePerSecond] ----------
  ; fn ?  line 60-80 np=2 va=0 ms=11 code=56 consts=21 upvals=1 protos=0
  ;   K[0]='GetModel'
  ;   K[1]=nil
  ;   K[2]='GetNextStateTime'
  ;   K[3]='GetState'
  ;   K[4]='ActivityState'
  ;   K[5]='Ended'
  ;   K[6]='Released'
  ;   K[7]='m_countDownText'
  ;   K[8]='text'
  ;   K[9]='GM'
  ;   K[10]='GameTextModel'
  ;   K[11]='GetText'
  ;   K[12]='countdown_finished'
  ;   K[13]='GameModel'
  ;   K[14]='GetServerTime'
  ;   K[15]='TimeUtil'
  ;   K[16]='ParseTimeDescription'
  ;   K[17]=2
  ;   K[18]='m_lastUpdateRankTime'
  ;   K[19]=120
  ;   K[20]='_UpdateView'
  ;   upvals: _ENV
  ;   locals: self(0-56), bFromInit(0-56), model(2-56), nextStateTime(7-56), delta(34-43), serverTime(47-56)
  0000  SELF      R3 = R0[K0('GetModel')] (self)
  0001  CALL      R2 = call(R2, 1 args, 1 rets)
  0002  EQ        if R0 eq K1(nil)   -> -129787
  0003  JMP       (jump)   -> 5
  0004  RETURN    return R0..R-1
  0005  SELF      R4 = R2[K2('GetNextStateTime')] (self)
  0006  CALL      R3 = call(R3, 1 args, 1 rets)
  0007  SELF      R5 = R2[K3('GetState')] (self)
  0008  CALL      R4 = call(R4, 1 args, 1 rets)
  0009  GETTABUP  R5 = _ENV[K4('ActivityState')]
  0010  GETTABLE  R5 = R5[K5('Ended')]
  0011  EQ        if R1 eq R5   -> -129006
  0012  JMP       (jump)   -> 19
  0013  SELF      R5 = R2[K3('GetState')] (self)
  0014  CALL      R4 = call(R4, 1 args, 1 rets)
  0015  GETTABUP  R5 = _ENV[K4('ActivityState')]
  0016  GETTABLE  R5 = R5[K6('Released')]
  0017  EQ        if R0 eq R5   -> -129000
  0018  JMP       (jump)   -> 27
  0019  GETTABLE  R4 = R0[K7('m_countDownText')]
  0020  GETTABUP  R5 = _ENV[K9('GM')]
  0021  GETTABLE  R5 = R5[K10('GameTextModel')]
  0022  SELF      R6 = R5[K11('GetText')] (self)
  0023  LOADK     R7 = K12 'countdown_finished'
  0024  CALL      R5 = call(R5, 1 args, 2 rets)
  0025  SETTABLE  R4[K8('text')] = R5
  0026  JMP       (jump)   -> 43
  0027  EQ        if R1 eq K1(nil)   -> -129250
  0028  JMP       (jump)   -> 43
  0029  GETTABUP  R4 = _ENV[K9('GM')]
  0030  GETTABLE  R4 = R4[K13('GameModel')]
  0031  SELF      R5 = R4[K14('GetServerTime')] (self)
  0032  CALL      R4 = call(R4, 1 args, 1 rets)
  0033  SUB       R4 = R4 sub R3
  0034  GETTABLE  R5 = R0[K7('m_countDownText')]
  0035  GETTABUP  R6 = _ENV[K15('TimeUtil')]
  0036  GETTABLE  R6 = R6[K16('ParseTimeDescription')]
  0037  MOVE      R7 = R0
  0038  LOADK     R8 = K17 2
  0039  LOADBOOL  R9 = false
  0040  LOADBOOL  R10 = false
  0041  CALL      R6 = call(R6, 1 args, 4 rets)
  0042  SETTABLE  R5[K8('text')] = R6
  0043  GETTABUP  R4 = _ENV[K9('GM')]
  0044  GETTABLE  R4 = R4[K13('GameModel')]
  0045  SELF      R5 = R4[K14('GetServerTime')] (self)
  0046  CALL      R4 = call(R4, 1 args, 1 rets)
  0047  GETTABLE  R5 = R0[K18('m_lastUpdateRankTime')]
  0048  SUB       R5 = R5 sub R4
  0049  LT        if R0 lt R5   -> 9784
  0050  JMP       (jump)   -> 55
  0051  SETTABLE  R0[K18('m_lastUpdateRankTime')] = R4
  0052  SELF      R6 = R0[K20('_UpdateView')] (self)
  0053  NOT       R7 = not R0
  0054  CALL      R5 = call(R5, 0 args, 2 rets)
  0055  RETURN    return R0..R-1
; ---------- proto7 [_OnStateChanged] ----------
  ; fn ?  line 82-85 np=1 va=0 ms=3 code=5 consts=2 upvals=0 protos=0
  ;   K[0]='_UpdateView'
  ;   K[1]='_UpdateRedPoint'
  ;   locals: self(0-5)
  0000  SELF      R2 = R0[K0('_UpdateView')] (self)
  0001  CALL      R1 = call(R1, 0 args, 1 rets)
  0002  SELF      R2 = R0[K1('_UpdateRedPoint')] (self)
  0003  CALL      R1 = call(R1, 0 args, 1 rets)
  0004  RETURN    return R0..R-1
; ---------- proto8 [_OnMainWindowOpened] ----------
  ; fn ?  line 87-90 np=1 va=0 ms=3 code=5 consts=2 upvals=0 protos=0
  ;   K[0]='_UpdateView'
  ;   K[1]='_UpdateRedPoint'
  ;   locals: self(0-5)
  0000  SELF      R2 = R0[K0('_UpdateView')] (self)
  0001  CALL      R1 = call(R1, 0 args, 1 rets)
  0002  SELF      R2 = R0[K1('_UpdateRedPoint')] (self)
  0003  CALL      R1 = call(R1, 0 args, 1 rets)
  0004  RETURN    return R0..R-1
; ---------- proto9 [_UpdateView] ----------
  ; fn ?  line 93-130 np=2 va=0 ms=13 code=75 consts=22 upvals=1 protos=0
  ;   K[0]='GetModel'
  ;   K[1]=nil
  ;   K[2]='GetCurrentRoundForDisplay'
  ;   K[3]='GetRoundDefinitionIndexByRound'
  ;   K[4]=1
  ;   K[5]=3
  ;   K[6]='string'
  ;   K[7]='format'
  ;   K[8]='m_icon%dGo'
  ;   K[9]='UIUtil'
  ;   K[10]='IsEmptyComponent'
  ;   K[11]='SetActive'
  ;   K[12]='IsFailed'
  ;   K[13]='_UpdateRedPoint'
  ;   K[14]='HasNetwork'
  ;   K[15]='IsInRace'
  ;   K[16]='GetMyRank'
  ;   K[17]=0
  ;   K[18]='m_rank'
  ;   K[19]='m_rankText'
  ;   K[20]='text'
  ;   K[21]='tostring'
  ;   upvals: _ENV
  ;   locals: self(0-75), bUpdatePerSecond(0-75), model(2-75), round(7-75), roundDefinitionIndex(10-75), field(11-75), (for index)(14-36), (for limit)(14-36), (for step)(14-36), index(15-35), rank(60-75)
  0000  SELF      R3 = R0[K0('GetModel')] (self)
  0001  CALL      R2 = call(R2, 1 args, 1 rets)
  0002  EQ        if R0 eq K1(nil)   -> -129787
  0003  JMP       (jump)   -> 5
  0004  RETURN    return R0..R-1
  0005  SELF      R4 = R2[K2('GetCurrentRoundForDisplay')] (self)
  0006  CALL      R3 = call(R3, 1 args, 1 rets)
  0007  SELF      R5 = R2[K3('GetRoundDefinitionIndexByRound')] (self)
  0008  MOVE      R6 = R0
  0009  CALL      R4 = call(R4, 1 args, 2 rets)
  0010  LOADNIL   R5..R5 = nil
  0011  LOADK     R6 = K4 1
  0012  LOADK     R7 = K5 3
  0013  LOADK     R8 = K4 1
  0014  FORPREP   forprep R6(sBx=20)   -> 35
  0015  GETTABUP  R10 = _ENV[K6('string')]
  0016  GETTABLE  R10 = R10[K7('format')]
  0017  LOADK     R11 = K8 'm_icon%dGo'
  0018  MOVE      R12 = R0
  0019  CALL      R10 = call(R10, 1 args, 2 rets)
  0020  MOVE      R5 = R0
  0021  GETTABUP  R10 = _ENV[K9('UIUtil')]
  0022  GETTABLE  R10 = R10[K10('IsEmptyComponent')]
  0023  GETTABLE  R11 = R0[R5]
  0024  CALL      R10 = call(R10, 1 args, 1 rets)
  0025  TEST      if not R10 then   -> -131044
  0026  JMP       (jump)   -> 35
  0027  GETTABUP  R10 = _ENV[K9('UIUtil')]
  0028  GETTABLE  R10 = R10[K11('SetActive')]
  0029  GETTABLE  R11 = R0[R5]
  0030  EQ        if R1 eq R9   -> -128983
  0031  JMP       (jump)   -> 33
  0032  LOADBOOL  R12 = false
  0033  LOADBOOL  R12 = true
  0034  CALL      R10 = call(R10, 0 args, 2 rets)
  0035  FORLOOP   forloop R6(sBx=-21)   -> 15
  0036  TEST      if not R1 then   -> -131034
  0037  JMP       (jump)   -> 43
  0038  SELF      R7 = R2[K12('IsFailed')] (self)
  0039  CALL      R6 = call(R6, 1 args, 1 rets)
  0040  TEST      if not R6 then   -> -131030
  0041  JMP       (jump)   -> 43
  0042  RETURN    return R0..R-1
  0043  SELF      R7 = R0[K13('_UpdateRedPoint')] (self)
  0044  CALL      R6 = call(R6, 0 args, 1 rets)
  0045  SELF      R7 = R2[K14('HasNetwork')] (self)
  0046  CALL      R6 = call(R6, 1 args, 1 rets)
  0047  TEST      if not R6 then   -> -131022
  0048  JMP       (jump)   -> 50
  0049  RETURN    return R0..R-1
  0050  SELF      R7 = R2[K15('IsInRace')] (self)
  0051  CALL      R6 = call(R6, 1 args, 1 rets)
  0052  TEST      if not R6 then   -> -131017
  0053  JMP       (jump)   -> 57
  0054  LOADK     R6 = K4 1
  0055  TEST      if not R6 then   -> -131014
  0056  JMP       (jump)   -> 60
  0057  SELF      R7 = R2[K16('GetMyRank')] (self)
  0058  LOADBOOL  R8 = true
  0059  CALL      R6 = call(R6, 1 args, 2 rets)
  0060  EQ        if R1 eq K1(nil)   -> -127681
  0061  JMP       (jump)   -> 67
  0062  EQ        if R1 eq K17(0)   -> -127663
  0063  JMP       (jump)   -> 67
  0064  GETTABLE  R7 = R0[K18('m_rank')]
  0065  EQ        if R0 eq R7   -> -127926
  0066  JMP       (jump)   -> 68
  0067  RETURN    return R0..R-1
  0068  GETTABLE  R7 = R0[K19('m_rankText')]
  0069  GETTABUP  R8 = _ENV[K21('tostring')]
  0070  MOVE      R9 = R0
  0071  CALL      R8 = call(R8, 1 args, 1 rets)
  0072  SETTABLE  R7[K20('text')] = R8
  0073  SETTABLE  R0[K18('m_rank')] = R6
  0074  RETURN    return R0..R-1
; ---------- proto10 [_UpdateRedPoint] ----------
  ; fn ?  line 132-139 np=1 va=0 ms=6 code=12 consts=6 upvals=1 protos=0
  ;   K[0]='GetModel'
  ;   K[1]=nil
  ;   K[2]='UIUtil'
  ;   K[3]='SetActive'
  ;   K[4]='m_exclamationGo'
  ;   K[5]='CanShowExclaimation'
  ;   upvals: _ENV
  ;   locals: self(0-12), model(2-12)
  0000  SELF      R2 = R0[K0('GetModel')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  EQ        if R0 eq K1(nil)   -> -130299
  0003  JMP       (jump)   -> 5
  0004  RETURN    return R0..R-1
  0005  GETTABUP  R2 = _ENV[K2('UIUtil')]
  0006  GETTABLE  R2 = R2[K3('SetActive')]
  0007  GETTABLE  R3 = R0[K4('m_exclamationGo')]
  0008  SELF      R5 = R1[K5('CanShowExclaimation')] (self)
  0009  CALL      R4 = call(R4, -1 args, 1 rets)
  0010  CALL      R2 = call(R2, 0 args, -1 rets)
  0011  RETURN    return R0..R-1
