# UpgradeRace_View_UpgradeRaceActivityBaseWindow_1568.luac
; fn @UpgradeRaceActivityBaseWindow.lua  line 0-0 np=0 va=1 ms=3 code=47 consts=20 upvals=1 protos=12
;   K[0]='UpgradeRaceActivityBaseWindow'
;   K[1]='setmetatable'
;   K[2]='m_bCloseWhenFinish'
;   K[3]=true
;   K[4]='m_bCloseWhenFail'
;   K[5]=false
;   K[6]='BaseWindow'
;   K[7]='__index'
;   K[8]='BeforeOpenCheck'
;   K[9]='Init'
;   K[10]='GetModel'
;   K[11]='GetActivityDefinition'
;   K[12]='_IsModelIdChanged'
;   K[13]='IsActivityValid'
;   K[14]='IsActivityCountdownValid'
;   K[15]='_OnStateChanged'
;   K[16]='_OnFail'
;   K[17]='CloseWhenNotValid'
;   K[18]='UpdatePerSecond'
;   K[19]='_GetCountDownEndTime'
;   upvals: _ENV
0000  GETTABUP  R0 = _ENV[K1('setmetatable')]
0001  NEWTABLE  R1 = {} (0 items)
0002  SETTABLE  R1[K2('m_bCloseWhenFinish')] = K3(true)
0003  SETTABLE  R1[K4('m_bCloseWhenFail')] = K5(false)
0004  GETTABUP  R2 = _ENV[K6('BaseWindow')]
0005  CALL      R0 = call(R0, 1 args, 2 rets)
0006  SETTABUP  _ENV[K0('UpgradeRaceActivityBaseWindow')] = R0
0007  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityBaseWindow')]
0008  GETTABUP  R1 = _ENV[K0('UpgradeRaceActivityBaseWindow')]
0009  SETTABLE  R0[K7('__index')] = R1
0010  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityBaseWindow')]
0011  CLOSURE   R1 = closure proto0
0012  SETTABLE  R0[K8('BeforeOpenCheck')] = R1
0013  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityBaseWindow')]
0014  CLOSURE   R1 = closure proto1
0015  SETTABLE  R0[K9('Init')] = R1
0016  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityBaseWindow')]
0017  CLOSURE   R1 = closure proto2
0018  SETTABLE  R0[K10('GetModel')] = R1
0019  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityBaseWindow')]
0020  CLOSURE   R1 = closure proto3
0021  SETTABLE  R0[K11('GetActivityDefinition')] = R1
0022  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityBaseWindow')]
0023  CLOSURE   R1 = closure proto4
0024  SETTABLE  R0[K12('_IsModelIdChanged')] = R1
0025  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityBaseWindow')]
0026  CLOSURE   R1 = closure proto5
0027  SETTABLE  R0[K13('IsActivityValid')] = R1
0028  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityBaseWindow')]
0029  CLOSURE   R1 = closure proto6
0030  SETTABLE  R0[K14('IsActivityCountdownValid')] = R1
0031  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityBaseWindow')]
0032  CLOSURE   R1 = closure proto7
0033  SETTABLE  R0[K15('_OnStateChanged')] = R1
0034  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityBaseWindow')]
0035  CLOSURE   R1 = closure proto8
0036  SETTABLE  R0[K16('_OnFail')] = R1
0037  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityBaseWindow')]
0038  CLOSURE   R1 = closure proto9
0039  SETTABLE  R0[K17('CloseWhenNotValid')] = R1
0040  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityBaseWindow')]
0041  CLOSURE   R1 = closure proto10
0042  SETTABLE  R0[K18('UpdatePerSecond')] = R1
0043  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityBaseWindow')]
0044  CLOSURE   R1 = closure proto11
0045  SETTABLE  R0[K19('_GetCountDownEndTime')] = R1
0046  RETURN    return R0..R-1
; ---------- proto0 [BeforeOpenCheck] ----------
  ; fn ?  line 18-23 np=3 va=0 ms=7 code=28 consts=10 upvals=1 protos=0
  ;   K[0]='GM'
  ;   K[1]='ActivityManager'
  ;   K[2]='GetModel'
  ;   K[3]='GetState'
  ;   K[4]=nil
  ;   K[5]='m_bCloseWhenFinish'
  ;   K[6]='ActivityState'
  ;   K[7]='Started'
  ;   K[8]='Ended'
  ;   K[9]='GetId'
  ;   upvals: _ENV
  ;   locals: self(0-28), activityType(0-28), id(0-28), model(5-28), state(7-28)
  0000  GETTABUP  R3 = _ENV[K0('GM')]
  0001  GETTABLE  R3 = R3[K1('ActivityManager')]
  0002  SELF      R4 = R3[K2('GetModel')] (self)
  0003  MOVE      R5 = R0
  0004  CALL      R3 = call(R3, 1 args, 2 rets)
  0005  SELF      R5 = R3[K3('GetState')] (self)
  0006  CALL      R4 = call(R4, 1 args, 1 rets)
  0007  EQ        if R1 eq K4(nil)   -> -129267
  0008  JMP       (jump)   -> 24
  0009  GETTABLE  R5 = R0[K5('m_bCloseWhenFinish')]
  0010  TEST      if not R5 then   -> -131060
  0011  JMP       (jump)   -> 25
  0012  GETTABUP  R5 = _ENV[K6('ActivityState')]
  0013  GETTABLE  R5 = R5[K7('Started')]
  0014  EQ        if R1 eq R5   -> -129003
  0015  JMP       (jump)   -> 20
  0016  GETTABUP  R5 = _ENV[K6('ActivityState')]
  0017  GETTABLE  R5 = R5[K8('Ended')]
  0018  EQ        if R0 eq R5   -> -128999
  0019  JMP       (jump)   -> 24
  0020  SELF      R6 = R3[K9('GetId')] (self)
  0021  CALL      R5 = call(R5, 1 args, 1 rets)
  0022  EQ        if R1 eq R2   -> -128486
  0023  JMP       (jump)   -> 25
  0024  LOADBOOL  R5 = false
  0025  LOADBOOL  R5 = true
  0026  RETURN    return R5..R4
  0027  RETURN    return R0..R-1
; ---------- proto1 [Init] ----------
  ; fn ?  line 28-44 np=4 va=0 ms=9 code=52 consts=24 upvals=1 protos=0
  ;   K[0]='m_activityType'
  ;   K[1]='m_model'
  ;   K[2]='GM'
  ;   K[3]='ActivityManager'
  ;   K[4]='GetModel'
  ;   K[5]='m_id'
  ;   K[6]='m_activityDefinition'
  ;   K[7]='GetActivityDefinition'
  ;   K[8]='LogWindowAction'
  ;   K[9]='EBIType'
  ;   K[10]='UIActionType'
  ;   K[11]='Open'
  ;   K[12]='EBIReferType'
  ;   K[13]='AutoPopup'
  ;   K[14]='UserClick'
  ;   K[15]='m_bCloseWhenFinish'
  ;   K[16]='EventDispatcher'
  ;   K[17]='AddListener'
  ;   K[18]='StateChangedEvent'
  ;   K[19]='_OnStateChanged'
  ;   K[20]='m_bCloseWhenFail'
  ;   K[21]='FailEvent'
  ;   K[22]='_OnFail'
  ;   K[23]='UpdatePerSecond'
  ;   upvals: _ENV
  ;   locals: self(0-52), activityType(0-52), id(0-52), bAutoPop(0-52)
  0000  SETTABLE  R0[K0('m_activityType')] = R1
  0001  GETTABUP  R4 = _ENV[K2('GM')]
  0002  GETTABLE  R4 = R4[K3('ActivityManager')]
  0003  SELF      R5 = R4[K4('GetModel')] (self)
  0004  MOVE      R6 = R0
  0005  CALL      R4 = call(R4, 1 args, 2 rets)
  0006  SETTABLE  R0[K1('m_model')] = R4
  0007  SETTABLE  R0[K5('m_id')] = R2
  0008  GETTABLE  R4 = R0[K1('m_model')]
  0009  SELF      R5 = R4[K7('GetActivityDefinition')] (self)
  0010  CALL      R4 = call(R4, 1 args, 1 rets)
  0011  SETTABLE  R0[K6('m_activityDefinition')] = R4
  0012  SELF      R5 = R0[K8('LogWindowAction')] (self)
  0013  GETTABUP  R6 = _ENV[K9('EBIType')]
  0014  GETTABLE  R6 = R6[K10('UIActionType')]
  0015  GETTABLE  R6 = R6[K11('Open')]
  0016  NEWTABLE  R7 = {} (1 items)
  0017  TEST      if not R3 then   -> -131053
  0018  JMP       (jump)   -> 23
  0019  GETTABUP  R8 = _ENV[K12('EBIReferType')]
  0020  GETTABLE  R8 = R8[K13('AutoPopup')]
  0021  TEST      if not R8 then   -> -131048
  0022  JMP       (jump)   -> 25
  0023  GETTABUP  R8 = _ENV[K12('EBIReferType')]
  0024  GETTABLE  R8 = R8[K14('UserClick')]
  0025  SETLIST   setlist R7[B=1,C=1]
  0026  CALL      R4 = call(R4, 0 args, 3 rets)
  0027  GETTABLE  R4 = R0[K15('m_bCloseWhenFinish')]
  0028  TEST      if not R4 then   -> -131042
  0029  JMP       (jump)   -> 38
  0030  GETTABUP  R4 = _ENV[K16('EventDispatcher')]
  0031  GETTABLE  R4 = R4[K17('AddListener')]
  0032  SELF      R6 = R0[K7('GetActivityDefinition')] (self)
  0033  CALL      R5 = call(R5, 1 args, 1 rets)
  0034  GETTABLE  R5 = R5[K18('StateChangedEvent')]
  0035  MOVE      R6 = R0
  0036  GETTABLE  R7 = R0[K19('_OnStateChanged')]
  0037  CALL      R4 = call(R4, 0 args, 3 rets)
  0038  GETTABLE  R4 = R0[K20('m_bCloseWhenFail')]
  0039  TEST      if not R4 then   -> -131031
  0040  JMP       (jump)   -> 49
  0041  GETTABUP  R4 = _ENV[K16('EventDispatcher')]
  0042  GETTABLE  R4 = R4[K17('AddListener')]
  0043  SELF      R6 = R0[K7('GetActivityDefinition')] (self)
  0044  CALL      R5 = call(R5, 1 args, 1 rets)
  0045  GETTABLE  R5 = R5[K21('FailEvent')]
  0046  MOVE      R6 = R0
  0047  GETTABLE  R7 = R0[K22('_OnFail')]
  0048  CALL      R4 = call(R4, 0 args, 3 rets)
  0049  SELF      R5 = R0[K23('UpdatePerSecond')] (self)
  0050  CALL      R4 = call(R4, 0 args, 1 rets)
  0051  RETURN    return R0..R-1
; ---------- proto2 [GetModel] ----------
  ; fn ?  line 46-48 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
; ---------- proto3 [GetActivityDefinition] ----------
  ; fn ?  line 50-52 np=1 va=0 ms=3 code=6 consts=2 upvals=0 protos=0
  ;   K[0]='GetModel'
  ;   K[1]='GetActivityDefinition'
  ;   locals: self(0-6)
  0000  SELF      R2 = R0[K0('GetModel')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  SELF      R2 = R1[K1('GetActivityDefinition')] (self)
  0003  TAILCALL  tailcall(R1, 0)
  0004  RETURN    return R1..R0
  0005  RETURN    return R0..R-1
; ---------- proto4 [_IsModelIdChanged] ----------
  ; fn ?  line 54-56 np=1 va=0 ms=4 code=11 consts=3 upvals=0 protos=0
  ;   K[0]='m_id'
  ;   K[1]='GetModel'
  ;   K[2]='GetId'
  ;   locals: self(0-11)
  0000  GETTABLE  R1 = R0[K0('m_id')]
  0001  SELF      R3 = R0[K1('GetModel')] (self)
  0002  CALL      R2 = call(R2, 1 args, 1 rets)
  0003  SELF      R3 = R2[K2('GetId')] (self)
  0004  CALL      R2 = call(R2, 1 args, 1 rets)
  0005  EQ        if R0 eq R2   -> -130551
  0006  JMP       (jump)   -> 8
  0007  LOADBOOL  R1 = false
  0008  LOADBOOL  R1 = true
  0009  RETURN    return R1..R0
  0010  RETURN    return R0..R-1
; ---------- proto5 [IsActivityValid] ----------
  ; fn ?  line 59-61 np=1 va=0 ms=3 code=11 consts=3 upvals=0 protos=0
  ;   K[0]='GetModel'
  ;   K[1]='IsActivityOpen'
  ;   K[2]='_IsModelIdChanged'
  ;   locals: self(0-11)
  0000  SELF      R2 = R0[K0('GetModel')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  SELF      R2 = R1[K1('IsActivityOpen')] (self)
  0003  CALL      R1 = call(R1, 1 args, 1 rets)
  0004  TEST      if not R1 then   -> -131066
  0005  JMP       (jump)   -> 9
  0006  SELF      R2 = R0[K2('_IsModelIdChanged')] (self)
  0007  CALL      R1 = call(R1, 1 args, 1 rets)
  0008  NOT       R1 = not R0
  0009  RETURN    return R1..R0
  0010  RETURN    return R0..R-1
; ---------- proto6 [IsActivityCountdownValid] ----------
  ; fn ?  line 63-66 np=1 va=0 ms=3 code=16 consts=5 upvals=1 protos=0
  ;   K[0]='GetModel'
  ;   K[1]='GetState'
  ;   K[2]='ActivityState'
  ;   K[3]='Started'
  ;   K[4]='_IsModelIdChanged'
  ;   upvals: _ENV
  ;   locals: self(0-16)
  0000  SELF      R2 = R0[K0('GetModel')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  SELF      R2 = R1[K1('GetState')] (self)
  0003  CALL      R1 = call(R1, 1 args, 1 rets)
  0004  GETTABUP  R2 = _ENV[K2('ActivityState')]
  0005  GETTABLE  R2 = R2[K3('Started')]
  0006  EQ        if R0 eq R2   -> -130550
  0007  JMP       (jump)   -> 12
  0008  SELF      R2 = R0[K4('_IsModelIdChanged')] (self)
  0009  CALL      R1 = call(R1, 1 args, 1 rets)
  0010  NOT       R1 = not R0
  0011  JMP       (jump)   -> 14
  0012  LOADBOOL  R1 = false
  0013  LOADBOOL  R1 = true
  0014  RETURN    return R1..R0
  0015  RETURN    return R0..R-1
; ---------- proto7 [_OnStateChanged] ----------
  ; fn ?  line 68-71 np=1 va=0 ms=3 code=3 consts=1 upvals=0 protos=0
  ;   K[0]='CloseWhenNotValid'
  ;   locals: self(0-3)
  0000  SELF      R2 = R0[K0('CloseWhenNotValid')] (self)
  0001  CALL      R1 = call(R1, 0 args, 1 rets)
  0002  RETURN    return R0..R-1
; ---------- proto8 [_OnFail] ----------
  ; fn ?  line 73-78 np=1 va=0 ms=3 code=13 consts=4 upvals=0 protos=0
  ;   K[0]='IsActivityValid'
  ;   K[1]='GetModel'
  ;   K[2]='NeedPopFailWindow'
  ;   K[3]='Close'
  ;   locals: self(0-13)
  0000  SELF      R2 = R0[K0('IsActivityValid')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  TEST      if not R1 then   -> -131068
  0003  JMP       (jump)   -> 12
  0004  SELF      R2 = R0[K1('GetModel')] (self)
  0005  CALL      R1 = call(R1, 1 args, 1 rets)
  0006  SELF      R2 = R1[K2('NeedPopFailWindow')] (self)
  0007  CALL      R1 = call(R1, 1 args, 1 rets)
  0008  TEST      if not R1 then   -> -131062
  0009  JMP       (jump)   -> 12
  0010  SELF      R2 = R0[K3('Close')] (self)
  0011  CALL      R1 = call(R1, 0 args, 1 rets)
  0012  RETURN    return R0..R-1
; ---------- proto9 [CloseWhenNotValid] ----------
  ; fn ?  line 80-84 np=1 va=0 ms=3 code=7 consts=2 upvals=0 protos=0
  ;   K[0]='IsActivityValid'
  ;   K[1]='Close'
  ;   locals: self(0-7)
  0000  SELF      R2 = R0[K0('IsActivityValid')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  TEST      if not R1 then   -> -131067
  0003  JMP       (jump)   -> 6
  0004  SELF      R2 = R0[K1('Close')] (self)
  0005  CALL      R1 = call(R1, 0 args, 1 rets)
  0006  RETURN    return R0..R-1
; ---------- proto10 [UpdatePerSecond] ----------
  ; fn ?  line 86-96 np=1 va=0 ms=8 code=39 consts=18 upvals=1 protos=0
  ;   K[0]='UIUtil'
  ;   K[1]='IsEmptyComponent'
  ;   K[2]='m_countDownText'
  ;   K[3]='IsActivityCountdownValid'
  ;   K[4]='text'
  ;   K[5]='GM'
  ;   K[6]='GameTextModel'
  ;   K[7]='GetText'
  ;   K[8]='countdown_finished'
  ;   K[9]='math'
  ;   K[10]='max'
  ;   K[11]=0
  ;   K[12]='_GetCountDownEndTime'
  ;   K[13]='GameModel'
  ;   K[14]='GetServerTime'
  ;   K[15]='TimeUtil'
  ;   K[16]='ParseTimeDescription'
  ;   K[17]=2
  ;   upvals: _ENV
  ;   locals: self(0-39), leftDuration(29-38)
  0000  GETTABUP  R1 = _ENV[K0('UIUtil')]
  0001  GETTABLE  R1 = R1[K1('IsEmptyComponent')]
  0002  GETTABLE  R2 = R0[K2('m_countDownText')]
  0003  CALL      R1 = call(R1, 1 args, 1 rets)
  0004  TEST      if not R1 then   -> -131065
  0005  JMP       (jump)   -> 38
  0006  SELF      R2 = R0[K3('IsActivityCountdownValid')] (self)
  0007  CALL      R1 = call(R1, 1 args, 1 rets)
  0008  TEST      if not R1 then   -> -131061
  0009  JMP       (jump)   -> 18
  0010  GETTABLE  R1 = R0[K2('m_countDownText')]
  0011  GETTABUP  R2 = _ENV[K5('GM')]
  0012  GETTABLE  R2 = R2[K6('GameTextModel')]
  0013  SELF      R3 = R2[K7('GetText')] (self)
  0014  LOADK     R4 = K8 'countdown_finished'
  0015  CALL      R2 = call(R2, 1 args, 2 rets)
  0016  SETTABLE  R1[K4('text')] = R2
  0017  JMP       (jump)   -> 38
  0018  GETTABUP  R1 = _ENV[K9('math')]
  0019  GETTABLE  R1 = R1[K10('max')]
  0020  LOADK     R2 = K11 0
  0021  SELF      R4 = R0[K12('_GetCountDownEndTime')] (self)
  0022  CALL      R3 = call(R3, 1 args, 1 rets)
  0023  GETTABUP  R4 = _ENV[K5('GM')]
  0024  GETTABLE  R4 = R4[K13('GameModel')]
  0025  SELF      R5 = R4[K14('GetServerTime')] (self)
  0026  CALL      R4 = call(R4, 1 args, 1 rets)
  0027  SUB       R3 = R4 sub R3
  0028  CALL      R1 = call(R1, 1 args, 2 rets)
  0029  GETTABLE  R2 = R0[K2('m_countDownText')]
  0030  GETTABUP  R3 = _ENV[K15('TimeUtil')]
  0031  GETTABLE  R3 = R3[K16('ParseTimeDescription')]
  0032  MOVE      R4 = R0
  0033  LOADK     R5 = K17 2
  0034  LOADBOOL  R6 = false
  0035  LOADBOOL  R7 = false
  0036  CALL      R3 = call(R3, 1 args, 4 rets)
  0037  SETTABLE  R2[K4('text')] = R3
  0038  RETURN    return R0..R-1
; ---------- proto11 [_GetCountDownEndTime] ----------
  ; fn ?  line 99-101 np=1 va=0 ms=3 code=6 consts=2 upvals=0 protos=0
  ;   K[0]='GetModel'
  ;   K[1]='GetEndTime'
  ;   locals: self(0-6)
  0000  SELF      R2 = R0[K0('GetModel')] (self)
  0001  CALL      R1 = call(R1, 1 args, 1 rets)
  0002  SELF      R2 = R1[K1('GetEndTime')] (self)
  0003  TAILCALL  tailcall(R1, 0)
  0004  RETURN    return R1..R0
  0005  RETURN    return R0..R-1
