# UpgradeRace_View_UpgradeRaceActivityPopupHelper_1562.luac
; fn @UpgradeRaceActivityPopupHelper.lua  line 0-0 np=0 va=1 ms=4 code=32 consts=15 upvals=1 protos=5
;   K[0]='UpgradeRaceActivityPopupHelper'
;   K[1]='setmetatable'
;   K[2]='canPopScene'
;   K[3]='EPopupScene'
;   K[4]='Main'
;   K[5]=true
;   K[6]='Board'
;   K[7]='BasePopupHelper'
;   K[8]='__index'
;   K[9]='Create'
;   K[10]='UpgradeRaceActivityPopupHelper'
;   K[11]='Init'
;   K[12]='_SetNeedCheckPopup'
;   K[13]='CheckPopup'
;   K[14]='_CanPopupDailyPopup'
;   upvals: _ENV
0000  GETTABUP  R0 = _ENV[K1('setmetatable')]
0001  NEWTABLE  R1 = {} (0 items)
0002  NEWTABLE  R2 = {} (0 items)
0003  GETTABUP  R3 = _ENV[K3('EPopupScene')]
0004  GETTABLE  R3 = R3[K4('Main')]
0005  SETTABLE  R2[R3] = K5(true)
0006  GETTABUP  R3 = _ENV[K3('EPopupScene')]
0007  GETTABLE  R3 = R3[K6('Board')]
0008  SETTABLE  R2[R3] = K5(true)
0009  SETTABLE  R1[K2('canPopScene')] = R2
0010  GETTABUP  R2 = _ENV[K7('BasePopupHelper')]
0011  CALL      R0 = call(R0, 1 args, 2 rets)
0012  SETTABUP  _ENV[K0('UpgradeRaceActivityPopupHelper')] = R0
0013  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityPopupHelper')]
0014  GETTABUP  R1 = _ENV[K0('UpgradeRaceActivityPopupHelper')]
0015  SETTABLE  R0[K8('__index')] = R1
0016  GETTABUP  R0 = _ENV[K0('UpgradeRaceActivityPopupHelper')]
0017  CLOSURE   R1 = closure proto0
0018  SETTABLE  R0[K9('Create')] = R1
0019  GETTABUP  R0 = _ENV[K10('UpgradeRaceActivityPopupHelper')]
0020  CLOSURE   R1 = closure proto1
0021  SETTABLE  R0[K11('Init')] = R1
0022  GETTABUP  R0 = _ENV[K10('UpgradeRaceActivityPopupHelper')]
0023  CLOSURE   R1 = closure proto2
0024  SETTABLE  R0[K12('_SetNeedCheckPopup')] = R1
0025  GETTABUP  R0 = _ENV[K10('UpgradeRaceActivityPopupHelper')]
0026  CLOSURE   R1 = closure proto3
0027  SETTABLE  R0[K13('CheckPopup')] = R1
0028  GETTABUP  R0 = _ENV[K10('UpgradeRaceActivityPopupHelper')]
0029  CLOSURE   R1 = closure proto4
0030  SETTABLE  R0[K14('_CanPopupDailyPopup')] = R1
0031  RETURN    return R0..R-1
; ---------- proto0 [Create] ----------
  ; fn ?  line 10-14 np=0 va=0 ms=3 code=8 consts=3 upvals=1 protos=0
  ;   K[0]='setmetatable'
  ;   K[1]='UpgradeRaceActivityPopupHelper'
  ;   K[2]='Init'
  ;   upvals: _ENV
  ;   locals: helper(4-8)
  0000  GETTABUP  R0 = _ENV[K0('setmetatable')]
  0001  NEWTABLE  R1 = {} (0 items)
  0002  GETTABUP  R2 = _ENV[K1('UpgradeRaceActivityPopupHelper')]
  0003  CALL      R0 = call(R0, 1 args, 2 rets)
  0004  SELF      R2 = R0[K2('Init')] (self)
  0005  CALL      R1 = call(R1, 0 args, 1 rets)
  0006  RETURN    return R0..R-1
  0007  RETURN    return R0..R-1
; ---------- proto1 [Init] ----------
  ; fn ?  line 16-24 np=1 va=0 ms=10 code=36 consts=12 upvals=1 protos=0
  ;   K[0]='BasePopupHelper'
  ;   K[1]='Init'
  ;   K[2]='pairs'
  ;   K[3]='UpgradeRaceActivityDefinition'
  ;   K[4]='EventDispatcher'
  ;   K[5]='AddListener'
  ;   K[6]='StateChangedEvent'
  ;   K[7]='_SetNeedCheckPopup'
  ;   K[8]='FailEvent'
  ;   K[9]='MainWindowOpenedAtEventEndedEvent'
  ;   K[10]='EEventType'
  ;   K[11]='ActivityRaceCompleted'
  ;   upvals: _ENV
  ;   locals: self(0-36), (for generator)(7-28), (for state)(7-28), (for control)(7-28), _(8-26), definition(8-26)
  0000  GETTABUP  R1 = _ENV[K0('BasePopupHelper')]
  0001  GETTABLE  R1 = R1[K1('Init')]
  0002  MOVE      R2 = R0
  0003  CALL      R1 = call(R1, 0 args, 1 rets)
  0004  GETTABUP  R1 = _ENV[K2('pairs')]
  0005  GETTABUP  R2 = _ENV[K3('UpgradeRaceActivityDefinition')]
  0006  CALL      R1 = call(R1, 3 args, 1 rets)
  0007  JMP       (jump)   -> 26
  0008  GETTABUP  R6 = _ENV[K4('EventDispatcher')]
  0009  GETTABLE  R6 = R6[K5('AddListener')]
  0010  GETTABLE  R7 = R5[K6('StateChangedEvent')]
  0011  MOVE      R8 = R0
  0012  GETTABLE  R9 = R0[K7('_SetNeedCheckPopup')]
  0013  CALL      R6 = call(R6, 0 args, 3 rets)
  0014  GETTABUP  R6 = _ENV[K4('EventDispatcher')]
  0015  GETTABLE  R6 = R6[K5('AddListener')]
  0016  GETTABLE  R7 = R5[K8('FailEvent')]
  0017  MOVE      R8 = R0
  0018  GETTABLE  R9 = R0[K7('_SetNeedCheckPopup')]
  0019  CALL      R6 = call(R6, 0 args, 3 rets)
  0020  GETTABUP  R6 = _ENV[K4('EventDispatcher')]
  0021  GETTABLE  R6 = R6[K5('AddListener')]
  0022  GETTABLE  R7 = R5[K9('MainWindowOpenedAtEventEndedEvent')]
  0023  MOVE      R8 = R0
  0024  GETTABLE  R9 = R0[K7('_SetNeedCheckPopup')]
  0025  CALL      R6 = call(R6, 0 args, 3 rets)
  0026  TFORCALL  tforcall R1
  0027  TFORLOOP  tforloop R3(sBx=-20)   -> 8
  0028  GETTABUP  R1 = _ENV[K4('EventDispatcher')]
  0029  GETTABLE  R1 = R1[K5('AddListener')]
  0030  GETTABUP  R2 = _ENV[K10('EEventType')]
  0031  GETTABLE  R2 = R2[K11('ActivityRaceCompleted')]
  0032  MOVE      R3 = R0
  0033  GETTABLE  R4 = R0[K7('_SetNeedCheckPopup')]
  0034  CALL      R1 = call(R1, 0 args, 3 rets)
  0035  RETURN    return R0..R-1
; ---------- proto2 [_SetNeedCheckPopup] ----------
  ; fn ?  line 26-28 np=1 va=0 ms=4 code=4 consts=1 upvals=0 protos=0
  ;   K[0]='SetNeedCheckPopup'
  ;   locals: self(0-4)
  0000  SELF      R2 = R0[K0('SetNeedCheckPopup')] (self)
  0001  LOADBOOL  R3 = true
  0002  CALL      R1 = call(R1, 0 args, 2 rets)
  0003  RETURN    return R0..R-1
; ---------- proto3 [CheckPopup] ----------
  ; fn ?  line 30-65 np=1 va=0 ms=11 code=97 consts=18 upvals=1 protos=0
  ;   K[0]='pairs'
  ;   K[1]='UpgradeRaceActivityDefinition'
  ;   K[2]='GM'
  ;   K[3]='ActivityManager'
  ;   K[4]='GetModel'
  ;   K[5]='GetState'
  ;   K[6]='ActivityState'
  ;   K[7]='Started'
  ;   K[8]='NeedPopFailWindow'
  ;   K[9]='OpenMainWindow'
  ;   K[10]='_CanPopupDailyPopup'
  ;   K[11]='OpenCurrentRoundEntryWindow'
  ;   K[12]='HasNetwork'
  ;   K[13]='CanClaimReward'
  ;   K[14]='Ended'
  ;   K[15]='HasWindowOpenedOnce'
  ;   K[16]='IsEndWindowSkippedByAway'
  ;   K[17]='OpenFinishWindow'
  ;   upvals: _ENV
  ;   locals: self(0-97), (for generator)(3-94), (for state)(3-94), (for control)(3-94), activityType(4-92), definition(4-92), model(9-92), state(11-92)
  0000  GETTABUP  R1 = _ENV[K0('pairs')]
  0001  GETTABUP  R2 = _ENV[K1('UpgradeRaceActivityDefinition')]
  0002  CALL      R1 = call(R1, 3 args, 1 rets)
  0003  JMP       (jump)   -> 92
  0004  GETTABUP  R6 = _ENV[K2('GM')]
  0005  GETTABLE  R6 = R6[K3('ActivityManager')]
  0006  SELF      R7 = R6[K4('GetModel')] (self)
  0007  MOVE      R8 = R0
  0008  CALL      R6 = call(R6, 1 args, 2 rets)
  0009  SELF      R8 = R6[K5('GetState')] (self)
  0010  CALL      R7 = call(R7, 1 args, 1 rets)
  0011  GETTABUP  R8 = _ENV[K6('ActivityState')]
  0012  GETTABLE  R8 = R8[K7('Started')]
  0013  EQ        if R0 eq R8   -> -127465
  0014  JMP       (jump)   -> 50
  0015  SELF      R9 = R6[K8('NeedPopFailWindow')] (self)
  0016  CALL      R8 = call(R8, 1 args, 1 rets)
  0017  TEST      if not R8 then   -> -131053
  0018  JMP       (jump)   -> 25
  0019  SELF      R9 = R6[K9('OpenMainWindow')] (self)
  0020  LOADBOOL  R10 = true
  0021  CALL      R8 = call(R8, 0 args, 2 rets)
  0022  LOADBOOL  R8 = true
  0023  RETURN    return R8..R7
  0024  JMP       (jump)   -> 92
  0025  SELF      R9 = R0[K10('_CanPopupDailyPopup')] (self)
  0026  MOVE      R10 = R0
  0027  CALL      R8 = call(R8, 1 args, 2 rets)
  0028  TEST      if not R8 then   -> -131042
  0029  JMP       (jump)   -> 36
  0030  SELF      R9 = R6[K11('OpenCurrentRoundEntryWindow')] (self)
  0031  LOADBOOL  R10 = true
  0032  CALL      R8 = call(R8, 0 args, 2 rets)
  0033  LOADBOOL  R8 = true
  0034  RETURN    return R8..R7
  0035  JMP       (jump)   -> 92
  0036  SELF      R9 = R6[K12('HasNetwork')] (self)
  0037  CALL      R8 = call(R8, 1 args, 1 rets)
  0038  TEST      if not R8 then   -> -131032
  0039  JMP       (jump)   -> 92
  0040  SELF      R9 = R6[K13('CanClaimReward')] (self)
  0041  CALL      R8 = call(R8, 1 args, 1 rets)
  0042  TEST      if not R8 then   -> -131028
  0043  JMP       (jump)   -> 92
  0044  SELF      R9 = R6[K9('OpenMainWindow')] (self)
  0045  LOADBOOL  R10 = true
  0046  CALL      R8 = call(R8, 0 args, 2 rets)
  0047  LOADBOOL  R8 = true
  0048  RETURN    return R8..R7
  0049  JMP       (jump)   -> 92
  0050  GETTABUP  R8 = _ENV[K6('ActivityState')]
  0051  GETTABLE  R8 = R8[K14('Ended')]
  0052  EQ        if R0 eq R8   -> -127426
  0053  JMP       (jump)   -> 92
  0054  SELF      R9 = R6[K15('HasWindowOpenedOnce')] (self)
  0055  GETTABUP  R10 = _ENV[K6('ActivityState')]
  0056  GETTABLE  R10 = R10[K14('Ended')]
  0057  CALL      R8 = call(R8, 1 args, 2 rets)
  0058  TEST      if not R8 then   -> -131011
  0059  JMP       (jump)   -> 92
  0060  SELF      R9 = R6[K15('HasWindowOpenedOnce')] (self)
  0061  GETTABUP  R10 = _ENV[K6('ActivityState')]
  0062  GETTABLE  R10 = R10[K7('Started')]
  0063  CALL      R8 = call(R8, 1 args, 2 rets)
  0064  TEST      if not R8 then   -> -131006
  0065  JMP       (jump)   -> 92
  0066  SELF      R9 = R6[K12('HasNetwork')] (self)
  0067  CALL      R8 = call(R8, 1 args, 1 rets)
  0068  TEST      if not R8 then   -> -131002
  0069  JMP       (jump)   -> 79
  0070  SELF      R9 = R6[K13('CanClaimReward')] (self)
  0071  CALL      R8 = call(R8, 1 args, 1 rets)
  0072  TEST      if not R8 then   -> -130998
  0073  JMP       (jump)   -> 79
  0074  SELF      R9 = R6[K9('OpenMainWindow')] (self)
  0075  LOADBOOL  R10 = true
  0076  CALL      R8 = call(R8, 0 args, 2 rets)
  0077  LOADBOOL  R8 = true
  0078  RETURN    return R8..R7
  0079  SELF      R9 = R6[K13('CanClaimReward')] (self)
  0080  CALL      R8 = call(R8, 1 args, 1 rets)
  0081  TEST      if not R8 then   -> -130988
  0082  JMP       (jump)   -> 92
  0083  SELF      R9 = R6[K16('IsEndWindowSkippedByAway')] (self)
  0084  CALL      R8 = call(R8, 1 args, 1 rets)
  0085  TEST      if not R8 then   -> -130984
  0086  JMP       (jump)   -> 92
  0087  SELF      R9 = R6[K17('OpenFinishWindow')] (self)
  0088  LOADBOOL  R10 = true
  0089  CALL      R8 = call(R8, 0 args, 2 rets)
  0090  LOADBOOL  R8 = true
  0091  RETURN    return R8..R7
  0092  TFORCALL  tforcall R1
  0093  TFORLOOP  tforloop R3(sBx=-90)   -> 4
  0094  LOADNIL   R1..R1 = nil
  0095  RETURN    return R1..R0
  0096  RETURN    return R0..R-1
; ---------- proto4 [_CanPopupDailyPopup] ----------
  ; fn ?  line 68-84 np=2 va=0 ms=6 code=33 consts=11 upvals=1 protos=0
  ;   K[0]='IsDeadline'
  ;   K[1]='IsInRace'
  ;   K[2]='GM'
  ;   K[3]='GameModel'
  ;   K[4]='GetServerTime'
  ;   K[5]='PlayerPrefs'
  ;   K[6]='GetInt'
  ;   K[7]='EPlayerPrefKey'
  ;   K[8]='UpgradeRaceActivityDailyOpenTime'
  ;   K[9]=0
  ;   K[10]='Sec2Day'
  ;   upvals: _ENV
  ;   locals: self(0-33), model(0-33), serverTime(16-33), openTime(22-33)
  0000  SELF      R3 = R1[K0('IsDeadline')] (self)
  0001  CALL      R2 = call(R2, 1 args, 1 rets)
  0002  TEST      if not R2 then   -> -131068
  0003  JMP       (jump)   -> 6
  0004  LOADBOOL  R2 = false
  0005  RETURN    return R2..R1
  0006  SELF      R3 = R1[K1('IsInRace')] (self)
  0007  CALL      R2 = call(R2, 1 args, 1 rets)
  0008  TEST      if not R2 then   -> -131062
  0009  JMP       (jump)   -> 12
  0010  LOADBOOL  R2 = false
  0011  RETURN    return R2..R1
  0012  GETTABUP  R2 = _ENV[K2('GM')]
  0013  GETTABLE  R2 = R2[K3('GameModel')]
  0014  SELF      R3 = R2[K4('GetServerTime')] (self)
  0015  CALL      R2 = call(R2, 1 args, 1 rets)
  0016  GETTABUP  R3 = _ENV[K5('PlayerPrefs')]
  0017  GETTABLE  R3 = R3[K6('GetInt')]
  0018  GETTABUP  R4 = _ENV[K7('EPlayerPrefKey')]
  0019  GETTABLE  R4 = R4[K8('UpgradeRaceActivityDailyOpenTime')]
  0020  LOADK     R5 = K9 0
  0021  CALL      R3 = call(R3, 1 args, 2 rets)
  0022  GETTABUP  R4 = _ENV[K10('Sec2Day')]
  0023  IDIV      R4 = R4 idiv R2
  0024  GETTABUP  R5 = _ENV[K10('Sec2Day')]
  0025  IDIV      R5 = R5 idiv R3
  0026  LT        if R0 lt R4   -> -128480
  0027  JMP       (jump)   -> 30
  0028  LOADBOOL  R4 = true
  0029  RETURN    return R4..R3
  0030  LOADBOOL  R4 = false
  0031  RETURN    return R4..R3
  0032  RETURN    return R0..R-1
