{"type": "func", "start": 4298448680, "end": 4298449368, "name": "InfoLayer::loadPage", "pseudocode": "// \n// InfoLayer::loadPage from 0x100351f28 to 0x1003521d8 (688 bytes)\n// \n// 7 xrefs:\n// > InfoLayer::init @ 0x100351068\n// > InfoLayer::onPrevPage @ 0x100351c78\n// > InfoLayer::onNextPage @ 0x100351c88\n// > InfoLayer::toggleCommentMode @ 0x100351dc8\n// > InfoLayer::onGetComments @ 0x100351f24\n// > InfoLayer::onRefreshComments @ 0x1003528e8\n// > InfoLayer::commentUploadFinished @ 0x1003530fc\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid __fastcall InfoLayer::loadPage(InfoLayer *a1, int a2, bool a3)\n{\n  GameManager *v6; // x0\n  _BOOL4 GameVariable; // w22\n  GJUserScore *m_score; // x8\n  int m_userID; // w1\n  GJLevelList *m_levelList; // x8\n  GJGameLevel *m_level; // x8\n  void **p_m_commentKey; // x23\n  GameLevelManager *v13; // x0\n  std::string *v14; // x1\n  _BOOL8 v15; // x1\n  GameLevelManager *v16; // x0\n  std::string *v17; // x1\n  cocos2d::CCArray *StoredOnlineLevels; // x0\n  cocos2d::CCArray *v19; // x24\n  GameLevelManager *v20; // x0\n  std::string *v21; // x1\n  char *PageInfo; // x0\n  std::string *v23; // x2\n  GameManager *v24; // x0\n  GameLevelManager *v25; // x0\n  GameLevelManager *v26; // x0\n  GJUserScore *v27; // x8\n  int v28; // w1\n  GJLevelList *v29; // x8\n  GJGameLevel *v30; // x8\n  void *__p[2]; // [xsp+0h] [xbp-60h] BYREF\n  char v32; // [xsp+17h] [xbp-49h]\n  __int128 v33; // [xsp+18h] [xbp-48h] BYREF\n  char *v34; // [xsp+28h] [xbp-38h]\n\n  ((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))a1->m_commentsBtn->setVisible)(a1->m_commentsBtn, 0);\n  v6 = GameManager::sharedState();\n  GameVariable = GameManager::getGameVariable(v6, \"0069\");\n  GameLevelManager::sharedState();\n  m_score = a1->m_score;\n  if ( m_score )\n  {\n    m_userID = m_score->m_userID;\n  }\n  else\n  {\n    m_levelList = a1->m_levelList;\n    if ( m_levelList )\n    {\n      m_userID = -m_levelList->m_listID;\n    }\n    else\n    {\n      m_level = a1->m_level;\n      if ( m_level )\n        m_userID = m_level->m_levelID.random - m_level->m_levelID.seed;\n      else\n        m_userID = 0;\n    }\n  }\n  GameLevelManager::getCommentKey(m_userID, a2, GameVariable, a1->m_mode, &v33);\n  p_m_commentKey = (void **)&a1->m_commentKey;\n  if ( a1->m_commentKey.m_data.m_short.shortStorage.__elems_[22] < 0 )\n    operator delete(*p_m_commentKey);\n  *(_OWORD *)p_m_commentKey = v33;\n  a1->m_commentKey.m_data.m_long.longStorage = v34;\n  ((void (__fastcall *)(LoadingCircle *, __int64))a1->m_loadingCircle->setVisible)(a1->m_loadingCircle, 1);\n  ((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))a1->m_noComments->setVisible)(a1->m_noComments, 0);\n  ((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))a1->m_leftArrow->setVisible)(a1->m_leftArrow, a2 > 0);\n  v13 = GameLevelManager::sharedState();\n  v14 = &a1->m_commentKey;\n  if ( a1->m_commentKey.m_data.m_short.shortStorage.__elems_[22] < 0 )\n    v14 = (std::string *)*p_m_commentKey;\n  v15 = GameLevelManager::getStoredLevelComments(v13, (const char *)v14) != nullptr;\n  ((void (__fastcall *)(CCMenuItemSpriteExtra *, _BOOL8))a1->m_rightArrow->setVisible)(a1->m_rightArrow, v15);\n  v16 = GameLevelManager::sharedState();\n  v17 = &a1->m_commentKey;\n  if ( a1->m_commentKey.m_data.m_short.shortStorage.__elems_[22] < 0 )\n    v17 = (std::string *)*p_m_commentKey;\n  StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v16, (const char *)v17);\n  if ( !StoredOnlineLevels )\n  {\n    if ( !a3 )\n      InfoLayer::setupCommentsBrowser(a1, nullptr);\n    GameLevelManager::sharedState()->m_levelCommentDelegate = &a1->LevelCommentDelegate;\n    v24 = GameManager::sharedState();\n    if ( v24->m_playerUserID.random == v24->m_playerUserID.seed )\n    {\n      a1->m_canUpdateUserScore = 1;\n      v25 = GameLevelManager::sharedState();\n      GameLevelManager::updateUserScore(v25);\n      if ( a3 )\n        goto LABEL_38;\n    }\n    else\n    {\n      v26 = GameLevelManager::sharedState();\n      v27 = a1->m_score;\n      if ( v27 )\n      {\n        v28 = v27->m_userID;\n      }\n      else\n      {\n        v29 = a1->m_levelList;\n        if ( v29 )\n        {\n          v28 = -v29->m_listID;\n        }\n        else\n        {\n          v30 = a1->m_level;\n          if ( v30 )\n            v28 = v30->m_levelID.random - v30->m_levelID.seed;\n          else\n            v28 = 0;\n        }\n      }\n      GameLevelManager::getLevelComments(v26, v28, a2, a1->m_itemCount, GameVariable, a1->m_mode);\n      if ( a3 )\n        goto LABEL_38;\n    }\n    ((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_pageLabel->setString)(a1->m_pageLabel, \" \");\n    goto LABEL_38;\n  }\n  v19 = StoredOnlineLevels;\n  v20 = GameLevelManager::sharedState();\n  v21 = &a1->m_commentKey;\n  if ( a1->m_commentKey.m_data.m_short.shortStorage.__elems_[22] < 0 )\n    v21 = (std::string *)*p_m_commentKey;\n  PageInfo = (char *)GameLevelManager::getPageInfo(v20, (const char *)v21);\n  sub_100009900(__p, PageInfo);\n  v23 = &a1->m_commentKey;\n  if ( a1->m_commentKey.m_data.m_short.shortStorage.__elems_[22] < 0 )\n    v23 = (std::string *)*p_m_commentKey;\n  ((void (__fastcall *)(InfoLayer *, void **, std::string *))a1->setupPageInfo)(a1, __p, v23);\n  if ( v32 < 0 )\n    operator delete(__p[0]);\n  if ( a1->m_commentKey.m_data.m_short.shortStorage.__elems_[22] < 0 )\n    p_m_commentKey = (void **)*p_m_commentKey;\n  ((void (__fastcall *)(InfoLayer *, cocos2d::CCArray *, void **))a1->loadCommentsFinished)(a1, v19, p_m_commentKey);\nLABEL_38:\n  a1->m_page = a2;\n}", "assembly": "; \n; InfoLayer::loadPage from 0x100351f28 to 0x1003521d8 (688 bytes)\n; \n; 7 xrefs:\n; > InfoLayer::init @ 0x100351068\n; > InfoLayer::onPrevPage @ 0x100351c78\n; > InfoLayer::onNextPage @ 0x100351c88\n; > InfoLayer::toggleCommentMode @ 0x100351dc8\n; > InfoLayer::onGetComments @ 0x100351f24\n; > InfoLayer::onRefreshComments @ 0x1003528e8\n; > InfoLayer::commentUploadFinished @ 0x1003530fc\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSUB             SP, SP, #0x70                                          ; +0x0, 0x100351f28\nSTP             X24, X23, [SP,#0x60+var_30]                            ; +0x4, 0x100351f2c\nSTP             X22, X21, [SP,#0x60+var_20]                            ; +0x8, 0x100351f30\nSTP             X20, X19, [SP,#0x60+var_10]                            ; +0xc, 0x100351f34\nSTP             X29, X30, [SP,#0x60+var_s0]                            ; +0x10, 0x100351f38\nADD             X29, SP, #0x60                                         ; +0x14, 0x100351f3c\nMOV             X21, X2                                                ; +0x18, 0x100351f40\nMOV             X19, X1                                                ; +0x1c, 0x100351f44\nMOV             X20, X0                                                ; +0x20, 0x100351f48\nLDR             X0, [X0,#0x308]                                        ; +0x24, 0x100351f4c\nLDR             X8, [X0]                                               ; +0x28, 0x100351f50\nLDR             X8, [X8,#0x148]                                        ; +0x2c, 0x100351f54\nMOV             W1, #0                                                 ; +0x30, 0x100351f58\nBLR             X8                                                     ; +0x34, 0x100351f5c\nBL              GameManager__sharedState                               ; +0x38, 0x100351f60\nADRL            X1, a0069; \"0069\"                                      ; +0x3c, 0x100351f64\nBL              GameManager__getGameVariable                           ; +0x44, 0x100351f6c\nMOV             X22, X0                                                ; +0x48, 0x100351f70\nBL              GameLevelManager__sharedState                          ; +0x4c, 0x100351f74\nLDR             X8, [X20,#0x298]                                       ; +0x50, 0x100351f78\nCBZ             X8, loc_100351F88                                      ; +0x54, 0x100351f7c\nLDR             W1, [X8,#0x174]                                        ; +0x58, 0x100351f80\nB               loc_100351FB8                                          ; +0x5c, 0x100351f84\nLDR             X8, [X20,#0x2A0]                                       ; +0x60, 0x100351f88\nCBZ             X8, loc_100351F9C                                      ; +0x64, 0x100351f8c\nLDR             W8, [X8,#0x158]                                        ; +0x68, 0x100351f90\nNEG             W1, W8                                                 ; +0x6c, 0x100351f94\nB               loc_100351FB8                                          ; +0x70, 0x100351f98\nLDR             X8, [X20,#0x290]                                       ; +0x74, 0x100351f9c\nCBZ             X8, loc_100351FB4                                      ; +0x78, 0x100351fa0\nLDR             W9, [X8,#0x148]                                        ; +0x7c, 0x100351fa4\nLDR             W8, [X8,#0x14C]                                        ; +0x80, 0x100351fa8\nSUB             W1, W9, W8                                             ; +0x84, 0x100351fac\nB               loc_100351FB8                                          ; +0x88, 0x100351fb0\nMOV             W1, #0                                                 ; +0x8c, 0x100351fb4\nLDR             W4, [X20,#0x32C]                                       ; +0x90, 0x100351fb8\nADD             X8, SP, #0x60+var_48                                   ; +0x94, 0x100351fbc\nMOV             X2, X19                                                ; +0x98, 0x100351fc0\nMOV             X3, X22                                                ; +0x9c, 0x100351fc4\nBL              GameLevelManager__getCommentKey                        ; +0xa0, 0x100351fc8\nADD             X23, X20, #0x2A8                                       ; +0xa4, 0x100351fcc\nLDRSB           W8, [X20,#0x2BF]                                       ; +0xa8, 0x100351fd0\nTBZ             W8, #0x1F, loc_100351FE0                               ; +0xac, 0x100351fd4\nLDR             X0, [X23]; __p                                         ; +0xb0, 0x100351fd8\nBL              __ZdlPv; operator delete(void *)                       ; +0xb4, 0x100351fdc\nLDUR            Q0, [SP,#0x60+var_48]                                  ; +0xb8, 0x100351fe0\nSTR             Q0, [X23]                                              ; +0xbc, 0x100351fe4\nLDR             X8, [SP,#0x60+var_38]                                  ; +0xc0, 0x100351fe8\nSTR             X8, [X23,#0x10]                                        ; +0xc4, 0x100351fec\nLDR             X0, [X20,#0x2C0]                                       ; +0xc8, 0x100351ff0\nLDR             X8, [X0]                                               ; +0xcc, 0x100351ff4\nLDR             X8, [X8,#0x148]                                        ; +0xd0, 0x100351ff8\nMOV             W1, #1                                                 ; +0xd4, 0x100351ffc\nBLR             X8                                                     ; +0xd8, 0x100352000\nLDR             X0, [X20,#0x2D0]                                       ; +0xdc, 0x100352004\nLDR             X8, [X0]                                               ; +0xe0, 0x100352008\nLDR             X8, [X8,#0x148]                                        ; +0xe4, 0x10035200c\nMOV             W1, #0                                                 ; +0xe8, 0x100352010\nBLR             X8                                                     ; +0xec, 0x100352014\nCMP             W19, #0                                                ; +0xf0, 0x100352018\nCSET            W1, GT                                                 ; +0xf4, 0x10035201c\nLDR             X0, [X20,#0x2E8]                                       ; +0xf8, 0x100352020\nLDR             X8, [X0]                                               ; +0xfc, 0x100352024\nLDR             X8, [X8,#0x148]                                        ; +0x100, 0x100352028\nBLR             X8                                                     ; +0x104, 0x10035202c\nBL              GameLevelManager__sharedState                          ; +0x108, 0x100352030\nLDRSB           W8, [X20,#0x2BF]                                       ; +0x10c, 0x100352034\nMOV             X1, X23                                                ; +0x110, 0x100352038\nTBZ             W8, #0x1F, loc_100352044                               ; +0x114, 0x10035203c\nLDR             X1, [X23]                                              ; +0x118, 0x100352040\nBL              GameLevelManager__getStoredLevelComments               ; +0x11c, 0x100352044\nCMP             X0, #0                                                 ; +0x120, 0x100352048\nCSET            W1, NE                                                 ; +0x124, 0x10035204c\nLDR             X0, [X20,#0x2E0]                                       ; +0x128, 0x100352050\nLDR             X8, [X0]                                               ; +0x12c, 0x100352054\nLDR             X8, [X8,#0x148]                                        ; +0x130, 0x100352058\nBLR             X8                                                     ; +0x134, 0x10035205c\nBL              GameLevelManager__sharedState                          ; +0x138, 0x100352060\nLDRSB           W8, [X20,#0x2BF]                                       ; +0x13c, 0x100352064\nMOV             X1, X23                                                ; +0x140, 0x100352068\nTBZ             W8, #0x1F, loc_100352074                               ; +0x144, 0x10035206c\nLDR             X1, [X23]                                              ; +0x148, 0x100352070\nBL              GameLevelManager__getStoredOnlineLevels                ; +0x14c, 0x100352074\nCBZ             X0, loc_100352100                                      ; +0x150, 0x100352078\nMOV             X24, X0                                                ; +0x154, 0x10035207c\nBL              GameLevelManager__sharedState                          ; +0x158, 0x100352080\nLDRSB           W8, [X20,#0x2BF]                                       ; +0x15c, 0x100352084\nMOV             X1, X23                                                ; +0x160, 0x100352088\nTBZ             W8, #0x1F, loc_100352094                               ; +0x164, 0x10035208c\nLDR             X1, [X23]                                              ; +0x168, 0x100352090\nBL              GameLevelManager__getPageInfo                          ; +0x16c, 0x100352094\nMOV             X1, X0; __s                                            ; +0x170, 0x100352098\nMOV             X0, SP; int                                            ; +0x174, 0x10035209c\nBL              sub_100009900                                          ; +0x178, 0x1003520a0\nLDRSB           W8, [X20,#0x2BF]                                       ; +0x17c, 0x1003520a4\nMOV             X2, X23                                                ; +0x180, 0x1003520a8\nTBZ             W8, #0x1F, loc_1003520B4                               ; +0x184, 0x1003520ac\nLDR             X2, [X23]                                              ; +0x188, 0x1003520b0\nLDR             X8, [X20]                                              ; +0x18c, 0x1003520b4\nLDR             X8, [X8,#0x520]                                        ; +0x190, 0x1003520b8\nMOV             X1, SP                                                 ; +0x194, 0x1003520bc\nMOV             X0, X20                                                ; +0x198, 0x1003520c0\nBLR             X8                                                     ; +0x19c, 0x1003520c4\nLDRSB           W8, [SP,#0x60+var_49]                                  ; +0x1a0, 0x1003520c8\nTBZ             W8, #0x1F, loc_1003520D8                               ; +0x1a4, 0x1003520cc\nLDR             X0, [SP,#0x60+__p]; __p                                ; +0x1a8, 0x1003520d0\nBL              __ZdlPv; operator delete(void *)                       ; +0x1ac, 0x1003520d4\nLDRSB           W8, [X20,#0x2BF]                                       ; +0x1b0, 0x1003520d8\nTBZ             W8, #0x1F, loc_1003520E4                               ; +0x1b4, 0x1003520dc\nLDR             X23, [X23]                                             ; +0x1b8, 0x1003520e0\nLDR             X8, [X20]                                              ; +0x1bc, 0x1003520e4\nLDR             X8, [X8,#0x510]                                        ; +0x1c0, 0x1003520e8\nMOV             X0, X20                                                ; +0x1c4, 0x1003520ec\nMOV             X1, X24                                                ; +0x1c8, 0x1003520f0\nMOV             X2, X23                                                ; +0x1cc, 0x1003520f4\nBLR             X8                                                     ; +0x1d0, 0x1003520f8\nB               loc_1003521BC                                          ; +0x1d4, 0x1003520fc\nTBNZ            W21, #0, loc_100352110                                 ; +0x1d8, 0x100352100\nMOV             X0, X20                                                ; +0x1dc, 0x100352104\nMOV             X1, #0                                                 ; +0x1e0, 0x100352108\nBL              InfoLayer__setupCommentsBrowser                        ; +0x1e4, 0x10035210c\nBL              GameLevelManager__sharedState                          ; +0x1e8, 0x100352110\nADD             X8, X20, #0x278                                        ; +0x1ec, 0x100352114\nSTR             X8, [X0,#0x2E0]                                        ; +0x1f0, 0x100352118\nBL              GameManager__sharedState                               ; +0x1f4, 0x10035211c\nLDR             W8, [X0,#0x26C]                                        ; +0x1f8, 0x100352120\nLDR             W9, [X0,#0x270]                                        ; +0x1fc, 0x100352124\nCMP             W8, W9                                                 ; +0x200, 0x100352128\nB.NE            loc_100352148                                          ; +0x204, 0x10035212c\nMOV             W8, #1                                                 ; +0x208, 0x100352130\nSTRB            W8, [X20,#0x328]                                       ; +0x20c, 0x100352134\nBL              GameLevelManager__sharedState                          ; +0x210, 0x100352138\nBL              GameLevelManager__updateUserScore                      ; +0x214, 0x10035213c\nTBZ             W21, #0, loc_1003521A4                                 ; +0x218, 0x100352140\nB               loc_1003521BC                                          ; +0x21c, 0x100352144\nBL              GameLevelManager__sharedState                          ; +0x220, 0x100352148\nLDR             X8, [X20,#0x298]                                       ; +0x224, 0x10035214c\nCBZ             X8, loc_10035215C                                      ; +0x228, 0x100352150\nLDR             W1, [X8,#0x174]                                        ; +0x22c, 0x100352154\nB               loc_10035218C                                          ; +0x230, 0x100352158\nLDR             X8, [X20,#0x2A0]                                       ; +0x234, 0x10035215c\nCBZ             X8, loc_100352170                                      ; +0x238, 0x100352160\nLDR             W8, [X8,#0x158]                                        ; +0x23c, 0x100352164\nNEG             W1, W8                                                 ; +0x240, 0x100352168\nB               loc_10035218C                                          ; +0x244, 0x10035216c\nLDR             X8, [X20,#0x290]                                       ; +0x248, 0x100352170\nCBZ             X8, loc_100352188                                      ; +0x24c, 0x100352174\nLDR             W9, [X8,#0x148]                                        ; +0x250, 0x100352178\nLDR             W8, [X8,#0x14C]                                        ; +0x254, 0x10035217c\nSUB             W1, W9, W8                                             ; +0x258, 0x100352180\nB               loc_10035218C                                          ; +0x25c, 0x100352184\nMOV             W1, #0                                                 ; +0x260, 0x100352188\nLDR             W3, [X20,#0x318]                                       ; +0x264, 0x10035218c\nLDR             W5, [X20,#0x32C]                                       ; +0x268, 0x100352190\nMOV             X2, X19                                                ; +0x26c, 0x100352194\nMOV             X4, X22                                                ; +0x270, 0x100352198\nBL              GameLevelManager__getLevelComments                     ; +0x274, 0x10035219c\nTBNZ            W21, #0, loc_1003521BC                                 ; +0x278, 0x1003521a0\nLDR             X0, [X20,#0x2C8]                                       ; +0x27c, 0x1003521a4\nLDR             X8, [X0]                                               ; +0x280, 0x1003521a8\nLDR             X8, [X8,#0x390]                                        ; +0x284, 0x1003521ac\nADRL            X1, asc_1006B11F7; \" \"                                 ; +0x288, 0x1003521b0\nBLR             X8                                                     ; +0x290, 0x1003521b8\nSTR             W19, [X20,#0x324]                                      ; +0x294, 0x1003521bc\nLDP             X29, X30, [SP,#0x60+var_s0]                            ; +0x298, 0x1003521c0\nLDP             X20, X19, [SP,#0x60+var_10]                            ; +0x29c, 0x1003521c4\nLDP             X22, X21, [SP,#0x60+var_20]                            ; +0x2a0, 0x1003521c8\nLDP             X24, X23, [SP,#0x60+var_30]                            ; +0x2a4, 0x1003521cc\nADD             SP, SP, #0x70 ; 'p'                                    ; +0x2a8, 0x1003521d0\nRET                                                                    ; +0x2ac, 0x1003521d4", "xrefs": ["InfoLayer::init @ 0x100351068", "InfoLayer::onPrevPage @ 0x100351c78", "InfoLayer::onNextPage @ 0x100351c88", "InfoLayer::toggleCommentMode @ 0x100351dc8", "InfoLayer::onGetComments @ 0x100351f24", "InfoLayer::onRefreshComments @ 0x1003528e8", "InfoLayer::commentUploadFinished @ 0x1003530fc"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}