# PassActivity_Common_View_PassActivityPopupHelper_818.luac
; fn @PassActivityPopupHelper.lua  line 0-0 np=0 va=1 ms=4 code=32 consts=15 upvals=1 protos=5
;   K[0]='PassActivityPopupHelper'
;   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]='PassActivityPopupHelper'
;   K[11]='Init'
;   K[12]='_OnStateChanged'
;   K[13]='_OnCloseView'
;   K[14]='CheckPopup'
;   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('PassActivityPopupHelper')] = R0
0013  GETTABUP  R0 = _ENV[K0('PassActivityPopupHelper')]
0014  GETTABUP  R1 = _ENV[K0('PassActivityPopupHelper')]
0015  SETTABLE  R0[K8('__index')] = R1
0016  GETTABUP  R0 = _ENV[K0('PassActivityPopupHelper')]
0017  CLOSURE   R1 = closure proto0
0018  SETTABLE  R0[K9('Create')] = R1
0019  GETTABUP  R0 = _ENV[K10('PassActivityPopupHelper')]
0020  CLOSURE   R1 = closure proto1
0021  SETTABLE  R0[K11('Init')] = R1
0022  GETTABUP  R0 = _ENV[K10('PassActivityPopupHelper')]
0023  CLOSURE   R1 = closure proto2
0024  SETTABLE  R0[K12('_OnStateChanged')] = R1
0025  GETTABUP  R0 = _ENV[K10('PassActivityPopupHelper')]
0026  CLOSURE   R1 = closure proto3
0027  SETTABLE  R0[K13('_OnCloseView')] = R1
0028  GETTABUP  R0 = _ENV[K10('PassActivityPopupHelper')]
0029  CLOSURE   R1 = closure proto4
0030  SETTABLE  R0[K14('CheckPopup')] = R1
0031  RETURN    return R0..R-1
; ---------- proto0 [Create] ----------
  ; fn ?  line 12-16 np=0 va=0 ms=3 code=8 consts=3 upvals=1 protos=0
  ;   K[0]='setmetatable'
  ;   K[1]='PassActivityPopupHelper'
  ;   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('PassActivityPopupHelper')]
  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 18-29 np=1 va=0 ms=10 code=49 consts=15 upvals=1 protos=0
  ;   K[0]='BasePopupHelper'
  ;   K[1]='Init'
  ;   K[2]='pairs'
  ;   K[3]='PassActivityDefinition'
  ;   K[4]='EventDispatcher'
  ;   K[5]='AddListener'
  ;   K[6]='ShouldRefreshTimelimitTasksEvent'
  ;   K[7]='_OnStateChanged'
  ;   K[8]='StateChangedEvent'
  ;   K[9]='BuyMaxTicketSuccessEvent'
  ;   K[10]='BuyUpTicketSuccessEvent'
  ;   K[11]='EEventType'
  ;   K[12]='ChangeGameMode'
  ;   K[13]='CloseView'
  ;   K[14]='_OnCloseView'
  ;   upvals: _ENV
  ;   locals: self(0-49), (for generator)(7-34), (for state)(7-34), (for control)(7-34), _(8-32), activityDefinition(8-32)
  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('PassActivityDefinition')]
  0006  CALL      R1 = call(R1, 3 args, 1 rets)
  0007  JMP       (jump)   -> 32
  0008  GETTABUP  R6 = _ENV[K4('EventDispatcher')]
  0009  GETTABLE  R6 = R6[K5('AddListener')]
  0010  GETTABLE  R7 = R5[K6('ShouldRefreshTimelimitTasksEvent')]
  0011  MOVE      R8 = R0
  0012  GETTABLE  R9 = R0[K7('_OnStateChanged')]
  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('StateChangedEvent')]
  0017  MOVE      R8 = R0
  0018  GETTABLE  R9 = R0[K7('_OnStateChanged')]
  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('BuyMaxTicketSuccessEvent')]
  0023  MOVE      R8 = R0
  0024  GETTABLE  R9 = R0[K7('_OnStateChanged')]
  0025  CALL      R6 = call(R6, 0 args, 3 rets)
  0026  GETTABUP  R6 = _ENV[K4('EventDispatcher')]
  0027  GETTABLE  R6 = R6[K5('AddListener')]
  0028  GETTABLE  R7 = R5[K10('BuyUpTicketSuccessEvent')]
  0029  MOVE      R8 = R0
  0030  GETTABLE  R9 = R0[K7('_OnStateChanged')]
  0031  CALL      R6 = call(R6, 0 args, 3 rets)
  0032  TFORCALL  tforcall R1
  0033  TFORLOOP  tforloop R3(sBx=-26)   -> 8
  0034  GETTABUP  R1 = _ENV[K4('EventDispatcher')]
  0035  GETTABLE  R1 = R1[K5('AddListener')]
  0036  GETTABUP  R2 = _ENV[K11('EEventType')]
  0037  GETTABLE  R2 = R2[K12('ChangeGameMode')]
  0038  MOVE      R3 = R0
  0039  GETTABLE  R4 = R0[K7('_OnStateChanged')]
  0040  CALL      R1 = call(R1, 0 args, 3 rets)
  0041  GETTABUP  R1 = _ENV[K4('EventDispatcher')]
  0042  GETTABLE  R1 = R1[K5('AddListener')]
  0043  GETTABUP  R2 = _ENV[K11('EEventType')]
  0044  GETTABLE  R2 = R2[K13('CloseView')]
  0045  MOVE      R3 = R0
  0046  GETTABLE  R4 = R0[K14('_OnCloseView')]
  0047  CALL      R1 = call(R1, 0 args, 3 rets)
  0048  RETURN    return R0..R-1
; ---------- proto2 [_OnStateChanged] ----------
  ; fn ?  line 31-33 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 [_OnCloseView] ----------
  ; fn ?  line 35-41 np=2 va=0 ms=10 code=16 consts=5 upvals=1 protos=0
  ;   K[0]='pairs'
  ;   K[1]='PassActivityDefinition'
  ;   K[2]='name'
  ;   K[3]='EndWindowPrefabName'
  ;   K[4]='SetNeedCheckPopup'
  ;   upvals: _ENV
  ;   locals: self(0-16), msg(0-16), (for generator)(3-15), (for state)(3-15), (for control)(3-15), _(4-13), activityDefinition(4-13)
  0000  GETTABUP  R2 = _ENV[K0('pairs')]
  0001  GETTABUP  R3 = _ENV[K1('PassActivityDefinition')]
  0002  CALL      R2 = call(R2, 3 args, 1 rets)
  0003  JMP       (jump)   -> 13
  0004  TEST      if not R1 then   -> -131066
  0005  JMP       (jump)   -> 13
  0006  GETTABLE  R7 = R1[K2('name')]
  0007  GETTABLE  R8 = R6[K3('EndWindowPrefabName')]
  0008  EQ        if R0 eq R8   -> -127470
  0009  JMP       (jump)   -> 13
  0010  SELF      R8 = R0[K4('SetNeedCheckPopup')] (self)
  0011  LOADBOOL  R9 = true
  0012  CALL      R7 = call(R7, 0 args, 2 rets)
  0013  TFORCALL  tforcall R2
  0014  TFORLOOP  tforloop R4(sBx=-11)   -> 4
  0015  RETURN    return R0..R-1
; ---------- proto4 [CheckPopup] ----------
  ; fn ?  line 43-97 np=1 va=0 ms=16 code=118 consts=33 upvals=1 protos=1
  ;   K[0]='pairs'
  ;   K[1]='PassActivityDefinition'
  ;   K[2]=1
  ;   K[3]='table'
  ;   K[4]='sort'
  ;   K[5]='ipairs'
  ;   K[6]='GM'
  ;   K[7]='ActivityManager'
  ;   K[8]='GetModel'
  ;   K[9]='GetState'
  ;   K[10]='ActivityState'
  ;   K[11]='Started'
  ;   K[12]='HasWindowOpenedOnce'
  ;   K[13]='ReadyWindowPrefabName'
  ;   K[14]='ShouldPopMainWindow'
  ;   K[15]='PassActivityViewHelper'
  ;   K[16]='SetViewChain'
  ;   K[17]='MainWindowPrefabName'
  ;   K[18]='CanPopMaxTicketTokenWindow'
  ;   K[19]='SceneManager'
  ;   K[20]='GetGameMode'
  ;   K[21]='EGameMode'
  ;   K[22]='Board'
  ;   K[23]='SetPopMaxTicketTokenWindow'
  ;   K[24]='UIPrefabConfigName'
  ;   K[25]='PassActivityMaxTicketTokenWindow'
  ;   K[26]='Ended'
  ;   K[27]='EndWindowPrefabName'
  ;   K[28]='CanOpenBuyTicketPopupWindow'
  ;   K[29]='BuyTicketPopupWindowPrefabName'
  ;   K[30]='GetCanTakeRewards'
  ;   K[31]=0
  ;   K[32]='RewardRecoverWindowPrefabName'
  ;   upvals: _ENV
  ;   locals: self(0-118), arrPassType(1-118), (for generator)(4-10), (for state)(4-10), (for control)(4-10), activityType(5-8), _(5-8), (for generator)(18-117), (for state)(18-117), (for control)(18-117), _(19-115), activityType(19-115), activityDefinition(21-115), args(24-115), model(29-115), state(31-115), canTakeRewards(106-115)
  0000  NEWTABLE  R1 = {} (0 items)
  0001  GETTABUP  R2 = _ENV[K0('pairs')]
  0002  GETTABUP  R3 = _ENV[K1('PassActivityDefinition')]
  0003  CALL      R2 = call(R2, 3 args, 1 rets)
  0004  JMP       (jump)   -> 8
  0005  LEN       R7 = len R0
  0006  ADD       R7 = K2(1) add R7
  0007  SETTABLE  R1[R7] = R5
  0008  TFORCALL  tforcall R2
  0009  TFORLOOP  tforloop R4(sBx=-5)   -> 5
  0010  GETTABUP  R2 = _ENV[K3('table')]
  0011  GETTABLE  R2 = R2[K4('sort')]
  0012  MOVE      R3 = R0
  0013  CLOSURE   R4 = closure proto0
  0014  CALL      R2 = call(R2, 0 args, 2 rets)
  0015  GETTABUP  R2 = _ENV[K5('ipairs')]
  0016  MOVE      R3 = R0
  0017  CALL      R2 = call(R2, 3 args, 1 rets)
  0018  JMP       (jump)   -> 115
  0019  GETTABUP  R7 = _ENV[K1('PassActivityDefinition')]
  0020  GETTABLE  R7 = R7[R6]
  0021  NEWTABLE  R8 = {} (1 items)
  0022  MOVE      R9 = R0
  0023  SETLIST   setlist R8[B=1,C=1]
  0024  GETTABUP  R9 = _ENV[K6('GM')]
  0025  GETTABLE  R9 = R9[K7('ActivityManager')]
  0026  SELF      R10 = R9[K8('GetModel')] (self)
  0027  MOVE      R11 = R0
  0028  CALL      R9 = call(R9, 1 args, 2 rets)
  0029  SELF      R11 = R9[K9('GetState')] (self)
  0030  CALL      R10 = call(R10, 1 args, 1 rets)
  0031  GETTABUP  R11 = _ENV[K10('ActivityState')]
  0032  GETTABLE  R11 = R11[K11('Started')]
  0033  EQ        if R0 eq R11   -> -125906
  0034  JMP       (jump)   -> 78
  0035  SELF      R12 = R9[K12('HasWindowOpenedOnce')] (self)
  0036  GETTABUP  R13 = _ENV[K10('ActivityState')]
  0037  GETTABLE  R13 = R13[K11('Started')]
  0038  CALL      R11 = call(R11, 1 args, 2 rets)
  0039  TEST      if not R11 then   -> -131030
  0040  JMP       (jump)   -> 44
  0041  GETTABLE  R11 = R7[K13('ReadyWindowPrefabName')]
  0042  MOVE      R12 = R0
  0043  RETURN    return R11..R10
  0044  SELF      R12 = R9[K14('ShouldPopMainWindow')] (self)
  0045  CALL      R11 = call(R11, 1 args, 1 rets)
  0046  TEST      if not R11 then   -> -131024
  0047  JMP       (jump)   -> 57
  0048  GETTABUP  R11 = _ENV[K15('PassActivityViewHelper')]
  0049  GETTABLE  R11 = R11[K16('SetViewChain')]
  0050  LOADBOOL  R12 = false
  0051  CALL      R11 = call(R11, 0 args, 1 rets)
  0052  GETTABLE  R11 = R7[K17('MainWindowPrefabName')]
  0053  NEWTABLE  R12 = {} (1 items)
  0054  MOVE      R13 = R0
  0055  SETLIST   setlist R12[B=1,C=1]
  0056  RETURN    return R11..R10
  0057  SELF      R12 = R9[K18('CanPopMaxTicketTokenWindow')] (self)
  0058  CALL      R11 = call(R11, 1 args, 1 rets)
  0059  TEST      if not R11 then   -> -131011
  0060  JMP       (jump)   -> 115
  0061  GETTABUP  R11 = _ENV[K6('GM')]
  0062  GETTABLE  R11 = R11[K19('SceneManager')]
  0063  SELF      R12 = R11[K20('GetGameMode')] (self)
  0064  CALL      R11 = call(R11, 1 args, 1 rets)
  0065  GETTABUP  R12 = _ENV[K21('EGameMode')]
  0066  GETTABLE  R12 = R12[K22('Board')]
  0067  EQ        if R0 eq R12   -> -125359
  0068  JMP       (jump)   -> 115
  0069  SELF      R12 = R9[K23('SetPopMaxTicketTokenWindow')] (self)
  0070  CALL      R11 = call(R11, 0 args, 1 rets)
  0071  GETTABUP  R11 = _ENV[K24('UIPrefabConfigName')]
  0072  GETTABLE  R11 = R11[K25('PassActivityMaxTicketTokenWindow')]
  0073  NEWTABLE  R12 = {} (1 items)
  0074  MOVE      R13 = R0
  0075  SETLIST   setlist R12[B=1,C=1]
  0076  RETURN    return R11..R10
  0077  JMP       (jump)   -> 115
  0078  GETTABUP  R11 = _ENV[K10('ActivityState')]
  0079  GETTABLE  R11 = R11[K26('Ended')]
  0080  EQ        if R0 eq R11   -> -125859
  0081  JMP       (jump)   -> 115
  0082  SELF      R12 = R9[K12('HasWindowOpenedOnce')] (self)
  0083  GETTABUP  R13 = _ENV[K10('ActivityState')]
  0084  GETTABLE  R13 = R13[K11('Started')]
  0085  CALL      R11 = call(R11, 1 args, 2 rets)
  0086  TEST      if not R11 then   -> -130984
  0087  JMP       (jump)   -> 115
  0088  SELF      R12 = R9[K12('HasWindowOpenedOnce')] (self)
  0089  GETTABUP  R13 = _ENV[K10('ActivityState')]
  0090  GETTABLE  R13 = R13[K26('Ended')]
  0091  CALL      R11 = call(R11, 1 args, 2 rets)
  0092  TEST      if not R11 then   -> -130977
  0093  JMP       (jump)   -> 97
  0094  GETTABLE  R11 = R7[K27('EndWindowPrefabName')]
  0095  MOVE      R12 = R0
  0096  RETURN    return R11..R10
  0097  SELF      R12 = R9[K28('CanOpenBuyTicketPopupWindow')] (self)
  0098  CALL      R11 = call(R11, 1 args, 1 rets)
  0099  TEST      if not R11 then   -> -130971
  0100  JMP       (jump)   -> 104
  0101  GETTABLE  R11 = R7[K29('BuyTicketPopupWindowPrefabName')]
  0102  MOVE      R12 = R0
  0103  RETURN    return R11..R10
  0104  SELF      R12 = R9[K30('GetCanTakeRewards')] (self)
  0105  CALL      R11 = call(R11, 1 args, 1 rets)
  0106  LEN       R12 = len R0
  0107  EQ        if R1 eq K31(0)   -> -124532
  0108  JMP       (jump)   -> 115
  0109  GETTABLE  R12 = R7[K32('RewardRecoverWindowPrefabName')]
  0110  NEWTABLE  R13 = {} (2 items)
  0111  MOVE      R14 = R0
  0112  MOVE      R15 = R0
  0113  SETLIST   setlist R13[B=1,C=2]
  0114  RETURN    return R12..R11
  0115  TFORCALL  tforcall R2
  0116  TFORLOOP  tforloop R4(sBx=-98)   -> 19
  0117  RETURN    return R0..R-1
  ; ---------- proto0 [] ----------
    ; fn ?  line 48-56 np=2 va=0 ms=7 code=30 consts=5 upvals=1 protos=0
    ;   K[0]='GM'
    ;   K[1]='ActivityManager'
    ;   K[2]='GetModel'
    ;   K[3]='GetState'
    ;   K[4]=nil
    ;   upvals: _ENV
    ;   locals: a(0-30), b(0-30), modelA(9-23), modelB(14-23)
    0000  TEST      if not R0 then   -> -131070
    0001  JMP       (jump)   -> 24
    0002  TEST      if not R1 then   -> -131068
    0003  JMP       (jump)   -> 24
    0004  GETTABUP  R2 = _ENV[K0('GM')]
    0005  GETTABLE  R2 = R2[K1('ActivityManager')]
    0006  SELF      R3 = R2[K2('GetModel')] (self)
    0007  MOVE      R4 = R0
    0008  CALL      R2 = call(R2, 1 args, 2 rets)
    0009  GETTABUP  R3 = _ENV[K0('GM')]
    0010  GETTABLE  R3 = R3[K1('ActivityManager')]
    0011  SELF      R4 = R3[K2('GetModel')] (self)
    0012  MOVE      R5 = R0
    0013  CALL      R3 = call(R3, 1 args, 2 rets)
    0014  SELF      R5 = R2[K3('GetState')] (self)
    0015  CALL      R4 = call(R4, 1 args, 1 rets)
    0016  SELF      R6 = R3[K3('GetState')] (self)
    0017  CALL      R5 = call(R5, 1 args, 1 rets)
    0018  LT        if R1 lt R4   -> -128488
    0019  JMP       (jump)   -> 21
    0020  LOADBOOL  R4 = false
    0021  LOADBOOL  R4 = true
    0022  RETURN    return R4..R3
    0023  JMP       (jump)   -> 29
    0024  EQ        if R0 eq K4(nil)   -> -130786
    0025  JMP       (jump)   -> 27
    0026  LOADBOOL  R2 = false
    0027  LOADBOOL  R2 = true
    0028  RETURN    return R2..R1
    0029  RETURN    return R0..R-1
