# BakeOut_Model_BakeOutOrderCreator_849.luac
; fn @BakeOutOrderCreator.lua  line 0-0 np=0 va=1 ms=3 code=16 consts=8 upvals=1 protos=4
;   K[0]='BakeOutOrderCreator'
;   K[1]=5
;   K[2]='Create'
;   K[3]='BakeOutOrderCreator'
;   K[4]='_CreateDishWeights'
;   K[5]='_Create'
;   K[6]='BakeOutOrderCreator'
;   K[7]='_GetRewardCount'
;   upvals: _ENV
;   locals: MAX_ORDER_COUNT(3-16)
0000  NEWTABLE  R0 = {} (0 items)
0001  SETTABUP  _ENV[K0('BakeOutOrderCreator')] = R0
0002  LOADK     R0 = K1 5
0003  GETTABUP  R1 = _ENV[K0('BakeOutOrderCreator')]
0004  CLOSURE   R2 = closure proto0
0005  SETTABLE  R1[K2('Create')] = R2
0006  GETTABUP  R1 = _ENV[K3('BakeOutOrderCreator')]
0007  CLOSURE   R2 = closure proto1
0008  SETTABLE  R1[K4('_CreateDishWeights')] = R2
0009  GETTABUP  R1 = _ENV[K3('BakeOutOrderCreator')]
0010  CLOSURE   R2 = closure proto2
0011  SETTABLE  R1[K5('_Create')] = R2
0012  GETTABUP  R1 = _ENV[K6('BakeOutOrderCreator')]
0013  CLOSURE   R2 = closure proto3
0014  SETTABLE  R1[K7('_GetRewardCount')] = R2
0015  RETURN    return R0..R-1
; ---------- proto0 [Create] ----------
  ; fn ?  line 32-60 np=2 va=0 ms=22 code=66 consts=21 upvals=2 protos=0
  ;   K[0]='GM'
  ;   K[1]='ActivityManager'
  ;   K[2]='GetModel'
  ;   K[3]='ActivityType'
  ;   K[4]='BakeOut'
  ;   K[5]='GetId'
  ;   K[6]='GetLastIncremNum'
  ;   K[7]='ipairs'
  ;   K[8]='GetRequirements'
  ;   K[9]=1
  ;   K[10]=true
  ;   K[11]='GameConfig'
  ;   K[12]='IsTestMode'
  ;   K[13]='TestAccumulatedLogInfo'
  ;   K[14]='Start'
  ;   K[15]='BakeOutOrderCreator'
  ;   K[16]='_CreateDishWeights'
  ;   K[17]='_Create'
  ;   K[18]='SetLastIncremNum'
  ;   K[19]='SetAvatarIds'
  ;   K[20]='OrderType'
  ;   upvals: _ENV, MAX_ORDER_COUNT
  ;   locals: orderModel(0-66), arrCurrentOrders(0-66), bakeOutModel(6-66), eventId(8-66), incremNum(10-66), needCount(13-66), mapCurrentDishes(14-66), (for generator)(17-24), (for state)(17-24), (for control)(17-24), _(18-22), currentOrder(18-22), arrDishWeights(37-66), mapExtraWeight(37-66), mapExtraWeightStr(37-66), arrNewOrders(38-66), (for index)(41-59), (for limit)(41-59), (for step)(41-59), i(42-58), newOrder(52-58)
  0000  GETTABUP  R2 = _ENV[K0('GM')]
  0001  GETTABLE  R2 = R2[K1('ActivityManager')]
  0002  SELF      R3 = R2[K2('GetModel')] (self)
  0003  GETTABUP  R4 = _ENV[K3('ActivityType')]
  0004  GETTABLE  R4 = R4[K4('BakeOut')]
  0005  CALL      R2 = call(R2, 1 args, 2 rets)
  0006  SELF      R4 = R2[K5('GetId')] (self)
  0007  CALL      R3 = call(R3, 1 args, 1 rets)
  0008  SELF      R5 = R2[K6('GetLastIncremNum')] (self)
  0009  CALL      R4 = call(R4, 1 args, 1 rets)
  0010  GETUPVAL  R5 = _ENV
  0011  LEN       R6 = len R0
  0012  SUB       R5 = R6 sub R5
  0013  NEWTABLE  R6 = {} (0 items)
  0014  GETTABUP  R7 = _ENV[K7('ipairs')]
  0015  MOVE      R8 = R0
  0016  CALL      R7 = call(R7, 3 args, 1 rets)
  0017  JMP       (jump)   -> 22
  0018  SELF      R13 = R11[K8('GetRequirements')] (self)
  0019  CALL      R12 = call(R12, 1 args, 1 rets)
  0020  GETTABLE  R12 = R12[K9(1)]
  0021  SETTABLE  R6[R12] = K10(true)
  0022  TFORCALL  tforcall R7
  0023  TFORLOOP  tforloop R9(sBx=-6)   -> 18
  0024  GETTABUP  R7 = _ENV[K11('GameConfig')]
  0025  GETTABLE  R7 = R7[K12('IsTestMode')]
  0026  CALL      R7 = call(R7, 1 args, 0 rets)
  0027  TEST      if not R7 then   -> -131043
  0028  JMP       (jump)   -> 32
  0029  GETTABUP  R7 = _ENV[K13('TestAccumulatedLogInfo')]
  0030  GETTABLE  R7 = R7[K14('Start')]
  0031  CALL      R7 = call(R7, 0 args, 0 rets)
  0032  GETTABUP  R7 = _ENV[K15('BakeOutOrderCreator')]
  0033  GETTABLE  R7 = R7[K16('_CreateDishWeights')]
  0034  MOVE      R8 = R0
  0035  MOVE      R9 = R0
  0036  CALL      R7 = call(R7, 3 args, 2 rets)
  0037  NEWTABLE  R10 = {} (0 items)
  0038  LOADK     R11 = K9 1
  0039  MOVE      R12 = R0
  0040  LOADK     R13 = K9 1
  0041  FORPREP   forprep R11(sBx=16)   -> 58
  0042  ADD       R4 = K9(1) add R4
  0043  GETTABUP  R15 = _ENV[K15('BakeOutOrderCreator')]
  0044  GETTABLE  R15 = R15[K17('_Create')]
  0045  MOVE      R16 = R0
  0046  MOVE      R17 = R0
  0047  MOVE      R18 = R0
  0048  MOVE      R19 = R0
  0049  MOVE      R20 = R0
  0050  MOVE      R21 = R0
  0051  CALL      R15 = call(R15, 1 args, 6 rets)
  0052  LEN       R16 = len R0
  0053  ADD       R16 = K9(1) add R16
  0054  SETTABLE  R10[R16] = R15
  0055  SELF      R17 = R2[K18('SetLastIncremNum')] (self)
  0056  MOVE      R18 = R0
  0057  CALL      R16 = call(R16, 0 args, 2 rets)
  0058  FORLOOP   forloop R11(sBx=-17)   -> 42
  0059  SELF      R12 = R0[K19('SetAvatarIds')] (self)
  0060  MOVE      R13 = R0
  0061  GETTABUP  R14 = _ENV[K20('OrderType')]
  0062  GETTABLE  R14 = R14[K4('BakeOut')]
  0063  CALL      R11 = call(R11, 0 args, 3 rets)
  0064  RETURN    return R10..R9
  0065  RETURN    return R0..R-1
; ---------- proto1 [_CreateDishWeights] ----------
  ; fn ?  line 62-116 np=2 va=0 ms=34 code=108 consts=22 upvals=1 protos=0
  ;   K[0]='GM'
  ;   K[1]='MainBoardModel'
  ;   K[2]='GetCodeCountMap'
  ;   K[3]='ItemDataModel'
  ;   K[4]='pairs'
  ;   K[5]=0
  ;   K[6]='GetItemScore'
  ;   K[7]='dataModel'
  ;   K[8]='GetRandomDishMap'
  ;   K[9]=1
  ;   K[10]=''
  ;   K[11]='GetAllMaterials'
  ;   K[12]='ipairs'
  ;   K[13]='GetModelConfig'
  ;   K[14]='ChainId'
  ;   K[15]='ChainLevel'
  ;   K[16]='_'
  ;   K[17]='='
  ;   K[18]=' '
  ;   K[19]='Code'
  ;   K[20]='Weight'
  ;   K[21]=20
  ;   upvals: _ENV
  ;   locals: orderModel(0-108), mapCurrentDishes(0-108), codeCountMap(7-108), mapCodeScore(8-108), itemDataModel(10-108), (for generator)(13-26), (for state)(13-26), (for control)(13-26), itemCode(14-24), count(14-24), mapRandomDishes(29-108), arrDishWeights(30-108), mapExtraWeight(31-108), mapExtraWeightStr(32-108), index(33-108), (for generator)(36-103), (for state)(36-103), (for control)(36-103), dishType(37-101), _(37-101), extraWeight(42-101), strExtraWeight(43-101), arrAllMaterials(46-101), mapChainLevel(47-101), (for generator)(50-65), (for state)(50-65), (for control)(50-65), _(51-63), materialType(51-63), itemConfig(54-63), chainId(55-63), chainLevel(56-63), (for generator)(68-92), (for state)(68-92), (for control)(68-92), chainId(69-90), chainLevel(69-90), itemType(70-90), (for index)(73-90), (for limit)(73-90), (for step)(73-90), i(74-89)
  0000  GETTABUP  R2 = _ENV[K0('GM')]
  0001  GETTABLE  R2 = R2[K1('MainBoardModel')]
  0002  SELF      R3 = R2[K2('GetCodeCountMap')] (self)
  0003  LOADBOOL  R4 = true
  0004  LOADBOOL  R5 = false
  0005  LOADBOOL  R6 = true
  0006  CALL      R2 = call(R2, 1 args, 4 rets)
  0007  NEWTABLE  R3 = {} (0 items)
  0008  GETTABUP  R4 = _ENV[K0('GM')]
  0009  GETTABLE  R4 = R4[K3('ItemDataModel')]
  0010  GETTABUP  R5 = _ENV[K4('pairs')]
  0011  MOVE      R6 = R0
  0012  CALL      R5 = call(R5, 3 args, 1 rets)
  0013  JMP       (jump)   -> 24
  0014  GETTABLE  R10 = R3[R8]
  0015  TEST      if not R10 then   -> -131054
  0016  JMP       (jump)   -> 18
  0017  LOADK     R10 = K5 0
  0018  SELF      R12 = R4[K6('GetItemScore')] (self)
  0019  MOVE      R13 = R0
  0020  CALL      R11 = call(R11, 1 args, 2 rets)
  0021  MUL       R11 = R9 mul R11
  0022  ADD       R10 = R11 add R10
  0023  SETTABLE  R3[R8] = R10
  0024  TFORCALL  tforcall R5
  0025  TFORLOOP  tforloop R7(sBx=-12)   -> 14
  0026  GETTABLE  R5 = R0[K7('dataModel')]
  0027  SELF      R6 = R5[K8('GetRandomDishMap')] (self)
  0028  CALL      R5 = call(R5, 1 args, 1 rets)
  0029  NEWTABLE  R6 = {} (0 items)
  0030  NEWTABLE  R7 = {} (0 items)
  0031  NEWTABLE  R8 = {} (0 items)
  0032  LOADK     R9 = K5 0
  0033  GETTABUP  R10 = _ENV[K4('pairs')]
  0034  MOVE      R11 = R0
  0035  CALL      R10 = call(R10, 3 args, 1 rets)
  0036  JMP       (jump)   -> 101
  0037  GETTABLE  R15 = R1[R13]
  0038  TEST      if not R15 then   -> -131031
  0039  JMP       (jump)   -> 101
  0040  ADD       R9 = K9(1) add R9
  0041  LOADK     R15 = K5 0
  0042  LOADK     R16 = K10 ''
  0043  SELF      R18 = R4[K11('GetAllMaterials')] (self)
  0044  MOVE      R19 = R0
  0045  CALL      R17 = call(R17, 1 args, 2 rets)
  0046  NEWTABLE  R18 = {} (0 items)
  0047  GETTABUP  R19 = _ENV[K12('ipairs')]
  0048  MOVE      R20 = R0
  0049  CALL      R19 = call(R19, 3 args, 1 rets)
  0050  JMP       (jump)   -> 63
  0051  SELF      R25 = R4[K13('GetModelConfig')] (self)
  0052  MOVE      R26 = R0
  0053  CALL      R24 = call(R24, 1 args, 2 rets)
  0054  GETTABLE  R25 = R24[K14('ChainId')]
  0055  GETTABLE  R26 = R24[K15('ChainLevel')]
  0056  GETTABLE  R27 = R18[R25]
  0057  TEST      if not R27 then   -> -131012
  0058  JMP       (jump)   -> 60
  0059  LOADK     R27 = K5 0
  0060  LT        if R0 lt R26   -> -117160
  0061  JMP       (jump)   -> 63
  0062  SETTABLE  R18[R25] = R26
  0063  TFORCALL  tforcall R19
  0064  TFORLOOP  tforloop R21(sBx=-14)   -> 51
  0065  GETTABUP  R19 = _ENV[K4('pairs')]
  0066  MOVE      R20 = R0
  0067  CALL      R19 = call(R19, 3 args, 1 rets)
  0068  JMP       (jump)   -> 90
  0069  LOADNIL   R24..R24 = nil
  0070  LOADK     R25 = K9 1
  0071  MOVE      R26 = R0
  0072  LOADK     R27 = K9 1
  0073  FORPREP   forprep R25(sBx=15)   -> 89
  0074  MOVE      R29 = R0
  0075  LOADK     R30 = K16 '_'
  0076  MOVE      R31 = R0
  0077  CONCAT    R24 = concat(R24..R29)
  0078  GETTABLE  R29 = R3[R24]
  0079  TEST      if not R29 then   -> -130991
  0080  JMP       (jump)   -> 89
  0081  GETTABLE  R29 = R3[R24]
  0082  ADD       R15 = R29 add R15
  0083  MOVE      R29 = R0
  0084  MOVE      R30 = R0
  0085  LOADK     R31 = K17 '='
  0086  GETTABLE  R32 = R3[R24]
  0087  LOADK     R33 = K18 ' '
  0088  CONCAT    R16 = concat(R16..R29)
  0089  FORLOOP   forloop R25(sBx=-16)   -> 74
  0090  TFORCALL  tforcall R19
  0091  TFORLOOP  tforloop R21(sBx=-23)   -> 69
  0092  NEWTABLE  R19 = {} (0 items)
  0093  SETTABLE  R19[K19('Code')] = R13
  0094  ADD       R20 = R15 add K21(20)
  0095  SETTABLE  R19[K20('Weight')] = R20
  0096  SETTABLE  R6[R9] = R19
  0097  EQ        if R1 eq K10('')   -> -122515
  0098  JMP       (jump)   -> 101
  0099  SETTABLE  R8[R13] = R16
  0100  SETTABLE  R7[R13] = R15
  0101  TFORCALL  tforcall R10
  0102  TFORLOOP  tforloop R12(sBx=-66)   -> 37
  0103  MOVE      R10 = R0
  0104  MOVE      R11 = R0
  0105  MOVE      R12 = R0
  0106  RETURN    return R10..R9
  0107  RETURN    return R0..R-1
; ---------- proto2 [_Create] ----------
  ; fn ?  line 118-156 np=6 va=0 ms=20 code=91 consts=36 upvals=1 protos=0
  ;   K[0]='bakeOut_'
  ;   K[1]='_'
  ;   K[2]=1
  ;   K[3]='Table'
  ;   K[4]='ListWeightSelectOne'
  ;   K[5]='table'
  ;   K[6]='remove'
  ;   K[7]='Code'
  ;   K[8]=nil
  ;   K[9]='Log'
  ;   K[10]='Error'
  ;   K[11]='BakeOut 订单生成失败！'
  ;   K[12]='it_1_1_1'
  ;   K[13]='GameConfig'
  ;   K[14]='IsTestMode'
  ;   K[15]='TestAccumulatedLogInfo'
  ;   K[16]='TestPrintBakeOutOrderCreation'
  ;   K[17]='LogNow'
  ;   K[18]='BakeOutOrderCreator'
  ;   K[19]='_GetRewardCount'
  ;   K[20]=0
  ;   K[21]='PROPERTY_TYPE'
  ;   K[22]='EPropertyType'
  ;   K[23]='BakeOutToken'
  ;   K[24]='PROPERTY_COUNT'
  ;   K[25]='RewardApi'
  ;   K[26]='CryptRewards'
  ;   K[27]='MainOrder'
  ;   K[28]='Create'
  ;   K[29]='GM'
  ;   K[30]='TaskManager'
  ;   K[31]='GetOngoingChapterId'
  ;   K[32]='OrderType'
  ;   K[33]='BakeOut'
  ;   K[34]='GameModel'
  ;   K[35]='GetServerTime'
  ;   upvals: _ENV
  ;   locals: orderModel(0-91), arrDishWeights(0-91), mapExtraWeight(0-91), mapExtraWeightStr(0-91), eventId(0-91), incremNum(0-91), orderId(5-91), arrRequirements(6-91), selected(15-26), index(15-26), arrRewards(50-91), goldCount(54-91), groupId(71-91)
  0000  LOADK     R6 = K0 'bakeOut_'
  0001  MOVE      R7 = R0
  0002  LOADK     R8 = K1 '_'
  0003  MOVE      R9 = R0
  0004  CONCAT    R6 = concat(R6..R6)
  0005  NEWTABLE  R7 = {} (0 items)
  0006  TEST      if not R1 then   -> -131064
  0007  JMP       (jump)   -> 26
  0008  GETTABLE  R8 = R1[K2(1)]
  0009  TEST      if not R8 then   -> -131061
  0010  JMP       (jump)   -> 26
  0011  GETTABUP  R8 = _ENV[K3('Table')]
  0012  GETTABLE  R8 = R8[K4('ListWeightSelectOne')]
  0013  MOVE      R9 = R0
  0014  CALL      R8 = call(R8, 2 args, 1 rets)
  0015  TEST      if not R8 then   -> -131055
  0016  JMP       (jump)   -> 26
  0017  GETTABUP  R10 = _ENV[K5('table')]
  0018  GETTABLE  R10 = R10[K6('remove')]
  0019  MOVE      R11 = R0
  0020  MOVE      R12 = R0
  0021  CALL      R10 = call(R10, 0 args, 2 rets)
  0022  GETTABLE  R10 = R8[K7('Code')]
  0023  SETTABLE  R7[K2(1)] = R10
  0024  GETTABLE  R10 = R8[K7('Code')]
  0025  SETTABLE  R3[R10] = K8(nil)
  0026  GETTABLE  R8 = R7[K2(1)]
  0027  TEST      if not R8 then   -> -131042
  0028  JMP       (jump)   -> 34
  0029  GETTABUP  R8 = _ENV[K9('Log')]
  0030  GETTABLE  R8 = R8[K10('Error')]
  0031  LOADK     R9 = K11 'BakeOut 订单生成失败！'
  0032  CALL      R8 = call(R8, 0 args, 1 rets)
  0033  SETTABLE  R7[K2(1)] = K12('it_1_1_1')
  0034  GETTABUP  R8 = _ENV[K13('GameConfig')]
  0035  GETTABLE  R8 = R8[K14('IsTestMode')]
  0036  CALL      R8 = call(R8, 1 args, 0 rets)
  0037  TEST      if not R8 then   -> -131033
  0038  JMP       (jump)   -> 49
  0039  GETTABUP  R8 = _ENV[K15('TestAccumulatedLogInfo')]
  0040  GETTABLE  R8 = R8[K16('TestPrintBakeOutOrderCreation')]
  0041  MOVE      R9 = R0
  0042  MOVE      R10 = R0
  0043  MOVE      R11 = R0
  0044  GETTABLE  R12 = R7[K2(1)]
  0045  CALL      R8 = call(R8, 0 args, 4 rets)
  0046  GETTABUP  R8 = _ENV[K15('TestAccumulatedLogInfo')]
  0047  GETTABLE  R8 = R8[K17('LogNow')]
  0048  CALL      R8 = call(R8, 0 args, 0 rets)
  0049  NEWTABLE  R8 = {} (0 items)
  0050  GETTABUP  R9 = _ENV[K18('BakeOutOrderCreator')]
  0051  GETTABLE  R9 = R9[K19('_GetRewardCount')]
  0052  MOVE      R10 = R0
  0053  CALL      R9 = call(R9, 1 args, 1 rets)
  0054  LT        if R0 lt R9   -> 10305
  0055  JMP       (jump)   -> 66
  0056  LEN       R10 = len R0
  0057  ADD       R10 = K2(1) add R10
  0058  NEWTABLE  R11 = {} (0 items)
  0059  GETTABUP  R12 = _ENV[K21('PROPERTY_TYPE')]
  0060  GETTABUP  R13 = _ENV[K22('EPropertyType')]
  0061  GETTABLE  R13 = R13[K23('BakeOutToken')]
  0062  SETTABLE  R11[R12] = R13
  0063  GETTABUP  R12 = _ENV[K24('PROPERTY_COUNT')]
  0064  SETTABLE  R11[R12] = R9
  0065  SETTABLE  R8[R10] = R11
  0066  GETTABUP  R10 = _ENV[K25('RewardApi')]
  0067  GETTABLE  R10 = R10[K26('CryptRewards')]
  0068  MOVE      R11 = R0
  0069  CALL      R10 = call(R10, 0 args, 1 rets)
  0070  LOADK     R10 = K20 0
  0071  GETTABUP  R11 = _ENV[K27('MainOrder')]
  0072  GETTABLE  R11 = R11[K28('Create')]
  0073  MOVE      R12 = R0
  0074  MOVE      R13 = R0
  0075  MOVE      R14 = R0
  0076  GETTABUP  R15 = _ENV[K29('GM')]
  0077  GETTABLE  R15 = R15[K30('TaskManager')]
  0078  SELF      R16 = R15[K31('GetOngoingChapterId')] (self)
  0079  CALL      R15 = call(R15, 1 args, 1 rets)
  0080  MOVE      R16 = R0
  0081  GETTABUP  R17 = _ENV[K32('OrderType')]
  0082  GETTABLE  R17 = R17[K33('BakeOut')]
  0083  GETTABUP  R18 = _ENV[K29('GM')]
  0084  GETTABLE  R18 = R18[K34('GameModel')]
  0085  SELF      R19 = R18[K35('GetServerTime')] (self)
  0086  CALL      R18 = call(R18, 1 args, 1 rets)
  0087  MOVE      R19 = R0
  0088  TAILCALL  tailcall(R11, 0)
  0089  RETURN    return R11..R10
  0090  RETURN    return R0..R-1
; ---------- proto3 [_GetRewardCount] ----------
  ; fn ?  line 158-168 np=1 va=0 ms=10 code=21 consts=6 upvals=1 protos=0
  ;   K[0]=0
  ;   K[1]='ipairs'
  ;   K[2]='GM'
  ;   K[3]='ItemDataModel'
  ;   K[4]='GetModelConfig'
  ;   K[5]='Reward'
  ;   upvals: _ENV
  ;   locals: arrRequirements(0-21), total(1-21), (for generator)(4-19), (for state)(4-19), (for control)(4-19), _(5-17), itemType(5-17), itemModelConfig(10-17)
  0000  LOADK     R1 = K0 0
  0001  GETTABUP  R2 = _ENV[K1('ipairs')]
  0002  MOVE      R3 = R0
  0003  CALL      R2 = call(R2, 3 args, 1 rets)
  0004  JMP       (jump)   -> 17
  0005  GETTABUP  R7 = _ENV[K2('GM')]
  0006  GETTABLE  R7 = R7[K3('ItemDataModel')]
  0007  SELF      R8 = R7[K4('GetModelConfig')] (self)
  0008  MOVE      R9 = R0
  0009  CALL      R7 = call(R7, 1 args, 2 rets)
  0010  TEST      if not R7 then   -> -131060
  0011  JMP       (jump)   -> 17
  0012  GETTABLE  R8 = R7[K5('Reward')]
  0013  TEST      if not R8 then   -> -131057
  0014  JMP       (jump)   -> 17
  0015  GETTABLE  R8 = R7[K5('Reward')]
  0016  ADD       R1 = R8 add R1
  0017  TFORCALL  tforcall R2
  0018  TFORLOOP  tforloop R4(sBx=-14)   -> 5
  0019  RETURN    return R1..R0
  0020  RETURN    return R0..R-1
