{"type": "func", "start": 4295566672, "end": 4295567004, "name": "GameLevelManager::createNewLevel", "pseudocode": "// \n// GameLevelManager::createNewLevel from 0x100092550 to 0x10009269c (332 bytes)\n// \n// 3 xrefs:\n// > LevelInfoLayer::onClone @ 0x10002aa34\n// > EditLevelLayer::onClone @ 0x1000ec37c\n// > LevelBrowserLayer::createNewLevel @ 0x100419268\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\nGJGameLevel *__fastcall GameLevelManager::createNewLevel(GameLevelManager *a1)\n{\n  GJGameLevel *v1; // x19\n  GameManager *v2; // x0\n  LocalLevelManager *v3; // x0\n  cocos2d::CCDictionary *AllLevelsInDict; // x20\n  unsigned int v5; // w23\n  cocos2d::CCString *v6; // x0\n  char *CString; // x22\n  bool v8; // cf\n  char v9; // w25\n  LocalLevelManager *v10; // x0\n  std::string v12; // [xsp+10h] [xbp-90h] BYREF\n  void *__p[2]; // [xsp+28h] [xbp-78h] BYREF\n  char v14; // [xsp+3Fh] [xbp-61h]\n  std::string __str; // [xsp+40h] [xbp-60h] BYREF\n\n  v1 = GJGameLevel::create_1();\n  v1->m_levelType = Editor;\n  v1->m_isEditable = 1;\n  v2 = GameManager::sharedState();\n  if ( v2->m_playerName.m_data.m_short.shortStorage.__elems_[22] < 0 )\n    sub_1000097D0(&__str, (void *)v2->m_playerName.m_data.m_long.capacitym1, v2->m_playerName.m_data.m_long.size);\n  else\n    __str = (std::string)v2->m_playerName;\n  std::string::operator=((std::string *)&v1->m_creatorName, &__str);\n  if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )\n    operator delete(__str.__r_.__value_.__l.__data_);\n  v3 = LocalLevelManager::sharedState();\n  AllLevelsInDict = LocalLevelManager::getAllLevelsInDict(v3);\n  v5 = 0;\n  do\n  {\n    v6 = (cocos2d::CCString *)sub_100268F4C(\"Unnamed %i\", v5);\n    CString = (char *)cocos2d::CCString::getCString(v6);\n    sub_100009900(__p, CString);\n    if ( cocos2d::CCDictionary::objectForKey_1(AllLevelsInDict, __p) )\n      v8 = v5 >= 0x3E7;\n    else\n      v8 = 1;\n    v9 = !v8;\n    if ( v14 < 0 )\n      operator delete(__p[0]);\n    ++v5;\n  }\n  while ( (v9 & 1) != 0 );\n  sub_100009900(&v12, CString);\n  std::string::operator=((std::string *)&v1->m_tempName, &v12);\n  if ( SHIBYTE(v12.__r_.__value_.__r.__words[2]) < 0 )\n    operator delete(v12.__r_.__value_.__l.__data_);\n  v10 = LocalLevelManager::sharedState();\n  sub_10024A428(v10->m_localLevels, v1, 0);\n  return v1;\n}", "assembly": "; \n; GameLevelManager::createNewLevel from 0x100092550 to 0x10009269c (332 bytes)\n; \n; 3 xrefs:\n; > LevelInfoLayer::onClone @ 0x10002aa34\n; > EditLevelLayer::onClone @ 0x1000ec37c\n; > LevelBrowserLayer::createNewLevel @ 0x100419268\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, #0xB0                                          ; +0x0, 0x100092550\nSTP             X26, X25, [SP,#0xA0+var_40]                            ; +0x4, 0x100092554\nSTP             X24, X23, [SP,#0xA0+var_30]                            ; +0x8, 0x100092558\nSTP             X22, X21, [SP,#0xA0+var_20]                            ; +0xc, 0x10009255c\nSTP             X20, X19, [SP,#0xA0+var_10]                            ; +0x10, 0x100092560\nSTP             X29, X30, [SP,#0xA0+var_s0]                            ; +0x14, 0x100092564\nADD             X29, SP, #0xA0                                         ; +0x18, 0x100092568\nBL              GJGameLevel__create_1                                  ; +0x1c, 0x10009256c\nMOV             X19, X0                                                ; +0x20, 0x100092570\nMOV             W8, #2                                                 ; +0x24, 0x100092574\nSTR             W8, [X0,#0x404]                                        ; +0x28, 0x100092578\nMOV             W8, #1                                                 ; +0x2c, 0x10009257c\nSTRB            W8, [X0,#0x280]                                        ; +0x30, 0x100092580\nBL              GameManager__sharedState                               ; +0x34, 0x100092584\nLDRSB           W8, [X0,#0x267]                                        ; +0x38, 0x100092588\nTBNZ            W8, #0x1F, loc_1000925A8                               ; +0x3c, 0x10009258c\nADD             X8, X0, #0x250                                         ; +0x40, 0x100092590\nLDR             Q0, [X8]                                               ; +0x44, 0x100092594\nSTR             Q0, [SP,#0xA0+__str]                                   ; +0x48, 0x100092598\nLDR             X8, [X8,#0x10]                                         ; +0x4c, 0x10009259c\nSTR             X8, [SP,#0xA0+__str.__r_.__value_+0x10]                ; +0x50, 0x1000925a0\nB               loc_1000925B8                                          ; +0x54, 0x1000925a4\nLDR             X1, [X0,#0x250]; __src                                 ; +0x58, 0x1000925a8\nLDR             X2, [X0,#0x258]                                        ; +0x5c, 0x1000925ac\nADD             X0, SP, #0xA0+__str; __dst                             ; +0x60, 0x1000925b0\nBL              sub_1000097D0                                          ; +0x64, 0x1000925b4\nADD             X0, X19, #0x1A0; this                                  ; +0x68, 0x1000925b8\nADD             X1, SP, #0xA0+__str; __str                             ; +0x6c, 0x1000925bc\nBL              __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_; std::string::operator=(std::string const&) ; +0x70, 0x1000925c0\nLDRSB           W8, [SP,#0xA0+__str.__r_.__value_+0x17]                ; +0x74, 0x1000925c4\nTBZ             W8, #0x1F, loc_1000925D4                               ; +0x78, 0x1000925c8\nLDR             X0, [SP,#0xA0+__str]; __p                              ; +0x7c, 0x1000925cc\nBL              __ZdlPv; operator delete(void *)                       ; +0x80, 0x1000925d0\nBL              LocalLevelManager__sharedState                         ; +0x84, 0x1000925d4\nBL              LocalLevelManager__getAllLevelsInDict                  ; +0x88, 0x1000925d8\nMOV             X20, X0                                                ; +0x8c, 0x1000925dc\nMOV             W23, #0                                                ; +0x90, 0x1000925e0\nMOV             W24, #0x3E7                                            ; +0x94, 0x1000925e4\nADRL            X21, aUnnamedI; \"Unnamed %i\"                           ; +0x98, 0x1000925e8\nSTR             X23, [SP,#0xA0+var_A0]                                 ; +0xa0, 0x1000925f0\nMOV             X0, X21                                                ; +0xa4, 0x1000925f4\nBL              sub_100268F4C                                          ; +0xa8, 0x1000925f8\nBL              cocos2d__CCString__getCString                          ; +0xac, 0x1000925fc\nMOV             X22, X0                                                ; +0xb0, 0x100092600\nADD             X0, SP, #0xA0+__p; int                                 ; +0xb4, 0x100092604\nMOV             X1, X22; __s                                           ; +0xb8, 0x100092608\nBL              sub_100009900                                          ; +0xbc, 0x10009260c\nADD             X1, SP, #0xA0+__p                                      ; +0xc0, 0x100092610\nMOV             X0, X20                                                ; +0xc4, 0x100092614\nBL              cocos2d__CCDictionary__objectForKey_1                  ; +0xc8, 0x100092618\nCMP             X0, #0                                                 ; +0xcc, 0x10009261c\nCCMP            W23, W24, #2, NE                                       ; +0xd0, 0x100092620\nCSET            W25, CC                                                ; +0xd4, 0x100092624\nLDRSB           W8, [SP,#0xA0+var_61]                                  ; +0xd8, 0x100092628\nTBZ             W8, #0x1F, loc_100092638                               ; +0xdc, 0x10009262c\nLDR             X0, [SP,#0xA0+__p]; __p                                ; +0xe0, 0x100092630\nBL              __ZdlPv; operator delete(void *)                       ; +0xe4, 0x100092634\nADD             W23, W23, #1                                           ; +0xe8, 0x100092638\nTBNZ            W25, #0, loc_1000925F0                                 ; +0xec, 0x10009263c\nADD             X0, SP, #0xA0+var_90; int                              ; +0xf0, 0x100092640\nMOV             X1, X22; __s                                           ; +0xf4, 0x100092644\nBL              sub_100009900                                          ; +0xf8, 0x100092648\nADD             X0, X19, #0x410; this                                  ; +0xfc, 0x10009264c\nADD             X1, SP, #0xA0+var_90; __str                            ; +0x100, 0x100092650\nBL              __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_; std::string::operator=(std::string const&) ; +0x104, 0x100092654\nLDRSB           W8, [SP,#0xA0+var_90.__r_.__value_+0x17]               ; +0x108, 0x100092658\nTBZ             W8, #0x1F, loc_100092668                               ; +0x10c, 0x10009265c\nLDR             X0, [SP,#0xA0+var_90]; __p                             ; +0x110, 0x100092660\nBL              __ZdlPv; operator delete(void *)                       ; +0x114, 0x100092664\nBL              LocalLevelManager__sharedState                         ; +0x118, 0x100092668\nLDR             X0, [X0,#0x160]                                        ; +0x11c, 0x10009266c\nMOV             X1, X19                                                ; +0x120, 0x100092670\nMOV             W2, #0                                                 ; +0x124, 0x100092674\nBL              sub_10024A428                                          ; +0x128, 0x100092678\nMOV             X0, X19                                                ; +0x12c, 0x10009267c\nLDP             X29, X30, [SP,#0xA0+var_s0]                            ; +0x130, 0x100092680\nLDP             X20, X19, [SP,#0xA0+var_10]                            ; +0x134, 0x100092684\nLDP             X22, X21, [SP,#0xA0+var_20]                            ; +0x138, 0x100092688\nLDP             X24, X23, [SP,#0xA0+var_30]                            ; +0x13c, 0x10009268c\nLDP             X26, X25, [SP,#0xA0+var_40]                            ; +0x140, 0x100092690\nADD             SP, SP, #0xB0                                          ; +0x144, 0x100092694\nRET                                                                    ; +0x148, 0x100092698", "xrefs": ["LevelInfoLayer::onClone @ 0x10002aa34", "EditLevelLayer::onClone @ 0x1000ec37c", "LevelBrowserLayer::createNewLevel @ 0x100419268"], "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"}