{"type": "func", "start": 5001760, "end": 5002206, "name": "EditorBuildStats::fromString", "pseudocode": "// \n// EditorBuildStats::fromString from 0x4c5220 to 0x4c53de (446 bytes)\n// \n// 1 xrefs:\n// > GJGameLevel::dataLoaded @ 0x4cbfbc\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:50:29 +0000\n// \n\nint __fastcall EditorBuildStats::fromString(int a1, int a2)\n{\n  const char *v3; // r5\n  size_t v4; // r0\n  cocos2d::CCArray *v5; // r5\n  int result; // r0\n  cocos2d::CCString *v7; // r0\n  const char *CString; // r0\n  char **v9; // r8\n  unsigned int v10; // r7\n  cocos2d::CCString *v11; // r0\n  const char *v12; // r0\n  int v13; // s15\n  int v14; // r3\n  int *v15; // r3\n  int v16; // r2\n  int v17; // t1\n  cocos2d::CCString *v18; // r0\n  const char *v19; // r5\n  size_t v20; // r0\n  int v21; // r3\n  unsigned __int8 *v22; // r8\n  unsigned __int8 *v23; // r5\n  unsigned __int8 *v24; // r9\n  unsigned __int8 *v25; // r10\n  int v26; // r1\n  __int64 v27; // r0\n  int v28; // r3\n  int v29; // [sp+0h] [bp-Ch] BYREF\n  int v30; // [sp+4h] [bp-8h]\n  char *v31; // [sp+8h] [bp-4h] BYREF\n  int v32[22]; // [sp+Ch] [bp+0h] BYREF\n\n  memset(v32, 0, 12);\n  if ( (*(_BYTE *)a2 & 1) != 0 )\n    v3 = *(const char **)(a2 + 8);\n  else\n    v3 = (const char *)(a2 + 1);\n  v4 = strlen(v3);\n  std::string::__init(v32, v3, v4);\n  v5 = sub_4C1A88(v32, \",\");\n  std::string::~string((int)v32);\n  result = cocos2d::CCArray::count(v5);\n  if ( result )\n  {\n    v7 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v5, 0);\n    CString = (const char *)cocos2d::CCString::getCString(v7);\n    result = atoi(CString);\n    if ( result > 0 )\n    {\n      v9 = &v31;\n      memset(v32, 0, sizeof(v32));\n      v10 = 0;\n      do\n      {\n        if ( (signed int)++v10 >= cocos2d::CCArray::count(v5) )\n          break;\n        v11 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v5, v10);\n        v12 = (const char *)cocos2d::CCString::getCString(v11);\n        v9[1] = (char *)atoi(v12);\n        ++v9;\n      }\n      while ( v10 != 22 );\n      v13 = v32[7];\n      *(_DWORD *)a1 = v32[0];\n      *(_DWORD *)(a1 + 4) = v32[1];\n      *(_DWORD *)(a1 + 8) = v32[2];\n      v14 = v32[3];\n      *(float *)(a1 + 28) = (float)v13;\n      *(_DWORD *)(a1 + 12) = v14;\n      *(_DWORD *)(a1 + 16) = v32[4];\n      *(_DWORD *)(a1 + 20) = v32[5];\n      *(_DWORD *)(a1 + 24) = v32[6];\n      v15 = &v32[8];\n      *(_DWORD *)(a1 + 32) = v32[8];\n      v16 = a1 + 60;\n      do\n      {\n        v17 = v15[1];\n        ++v15;\n        *(_DWORD *)(v16 + 4) = v17;\n        v16 += 4;\n      }\n      while ( v16 != a1 + 92 );\n      *(_DWORD *)(a1 + 36) = v32[17];\n      *(_DWORD *)(a1 + 40) = v32[18];\n      if ( cocos2d::CCArray::count(v5) <= 0x14u )\n      {\n        v19 = (const char *)&unk_B6B226;\n      }\n      else\n      {\n        v18 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v5, 0x14u);\n        v19 = (const char *)cocos2d::CCString::getCString(v18);\n      }\n      v29 = 0;\n      v30 = 0;\n      v31 = nullptr;\n      v20 = strlen(v19);\n      std::string::__init(&v29, v19, v20);\n      if ( (v29 & 1) != 0 )\n      {\n        v21 = v30;\n        if ( (unsigned int)(v30 - 1) > 0x12 )\n        {\nLABEL_26:\n          v27 = 0;\nLABEL_27:\n          v28 = v32[20];\n          *(_QWORD *)(a1 + 48) = v27;\n          *(_DWORD *)(a1 + 56) = v28;\n          *(_DWORD *)(a1 + 60) = v32[21];\n          return std::string::~string((int)&v29);\n        }\n        v22 = (unsigned __int8 *)v31;\n      }\n      else\n      {\n        v21 = (int)(unsigned __int8)v29 >> 1;\n        if ( !v21 || v21 > 19 )\n          goto LABEL_26;\n        v22 = (unsigned __int8 *)&v29 + 1;\n      }\n      v23 = &v22[v21];\n      v24 = v22;\n      while ( 1 )\n      {\n        v25 = v24;\n        if ( v24 == v23 )\n          break;\n        v26 = *v24++;\n        if ( !memchr(\"0123456789\", v26, 0xAu) )\n        {\n          if ( v25 - v22 != -1 )\n            goto LABEL_26;\n          break;\n        }\n      }\n      LODWORD(v27) = std::stoull(&v29, 0, 10);\n      goto LABEL_27;\n    }\n  }\n  return result;\n}", "assembly": "; \n; EditorBuildStats::fromString from 0x4c5220 to 0x4c53de (446 bytes)\n; \n; 1 xrefs:\n; > GJGameLevel::dataLoaded @ 0x4cbfbc\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:50:29 +0000\n; \nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x4c5220\nSUB             SP, SP, #0x6C                                          ; +0x4, 0x4c5224\nLDR             R6, =(__stack_chk_guard_ptr - 0x4C5232)                ; +0x6, 0x4c5226\nMOV             R4, R0                                                 ; +0x8, 0x4c5228\nMOVS            R3, #0                                                 ; +0xa, 0x4c522a\nSTR             R3, [SP,#0x6C+var_60]                                  ; +0xc, 0x4c522c\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0xe, 0x4c522e\nLDR             R6, [R6]; __stack_chk_guard                            ; +0x10, 0x4c5230\nSTR             R3, [SP,#0x6C+var_5C]                                  ; +0x12, 0x4c5232\nSTR             R3, [SP,#0x6C+var_58]                                  ; +0x14, 0x4c5234\nADD             R7, SP, #0xC                                           ; +0x16, 0x4c5236\nLDR             R2, [R6]                                               ; +0x18, 0x4c5238\nSTR             R2, [SP,#0x6C+var_8]                                   ; +0x1a, 0x4c523a\nLDRB            R2, [R1]                                               ; +0x1c, 0x4c523c\nLSLS            R0, R2, #0x1F                                          ; +0x1e, 0x4c523e\nITE PL                                                                 ; +0x20, 0x4c5240\nADDPL           R5, R1, #1                                             ; +0x22, 0x4c5242\nLDRMI           R5, [R1,#8]                                            ; +0x24, 0x4c5244\nMOV             R0, R5; char *                                         ; +0x26, 0x4c5246\nBLX             strlen                                                 ; +0x28, 0x4c5248\nMOV             R1, R5                                                 ; +0x2c, 0x4c524c\nMOV             R2, R0                                                 ; +0x2e, 0x4c524e\nMOV             R0, R7                                                 ; +0x30, 0x4c5250\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x32, 0x4c5252\nLDR             R1, =(asc_B7A5B7 - 0x4C525E); \",\"                      ; +0x36, 0x4c5256\nMOV             R0, R7                                                 ; +0x38, 0x4c5258\nADD             R1, PC; \",\"                                            ; +0x3a, 0x4c525a\nBL              sub_4C1A88                                             ; +0x3c, 0x4c525c\nMOV             R5, R0                                                 ; +0x40, 0x4c5260\nMOV             R0, R7                                                 ; +0x42, 0x4c5262\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x44, 0x4c5264\nMOV             R0, R5; this                                           ; +0x48, 0x4c5268\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x4a, 0x4c526a\nCMP             R0, #0                                                 ; +0x4e, 0x4c526e\nBEQ.W           loc_4C53CC                                             ; +0x50, 0x4c5270\nMOVS            R1, #0; unsigned int                                   ; +0x54, 0x4c5274\nMOV             R0, R5; this                                           ; +0x56, 0x4c5276\nBL              _ZN7cocos2d7CCArray13stringAtIndexEj; cocos2d::CCArray::stringAtIndex(uint) ; +0x58, 0x4c5278\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x5c, 0x4c527c\nBLX             atoi                                                   ; +0x60, 0x4c5280\nCMP             R0, #0                                                 ; +0x64, 0x4c5284\nBLE.W           loc_4C53CC                                             ; +0x66, 0x4c5286\nMOV             R0, R7; void *                                         ; +0x6a, 0x4c528a\nMOVS            R1, #0; int                                            ; +0x6c, 0x4c528c\nMOVS            R2, #0x58 ; 'X'; size_t                                ; +0x6e, 0x4c528e\nADD.W           R8, SP, #0x6C+var_64                                   ; +0x70, 0x4c5290\nBLX             memset                                                 ; +0x74, 0x4c5294\nMOVS            R7, #0                                                 ; +0x78, 0x4c5298\nMOV             R0, R5; this                                           ; +0x7a, 0x4c529a\nADDS            R7, #1                                                 ; +0x7c, 0x4c529c\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x7e, 0x4c529e\nCMP             R7, R0                                                 ; +0x82, 0x4c52a2\nBLT             loc_4C52B4                                             ; +0x84, 0x4c52a4\nB               loc_4C52CC                                             ; +0x86, 0x4c52a6\nB               loc_4C52AA                                             ; +0x88, 0x4c52a8\nMOV             R0, R7                                                 ; +0x8a, 0x4c52aa\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x8c, 0x4c52ac\nBL              __cxa_end_cleanup                                      ; +0x90, 0x4c52b0\nMOV             R1, R7; unsigned int                                   ; +0x94, 0x4c52b4\nMOV             R0, R5; this                                           ; +0x96, 0x4c52b6\nBL              _ZN7cocos2d7CCArray13stringAtIndexEj; cocos2d::CCArray::stringAtIndex(uint) ; +0x98, 0x4c52b8\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x9c, 0x4c52bc\nBLX             atoi                                                   ; +0xa0, 0x4c52c0\nCMP             R7, #0x16                                              ; +0xa4, 0x4c52c4\nSTR.W           R0, [R8,#4]!                                           ; +0xa6, 0x4c52c6\nBNE             loc_4C529A                                             ; +0xaa, 0x4c52ca\nLDR             R3, [SP,#0x6C+var_60]                                  ; +0xac, 0x4c52cc\nADD.W           R1, R4, #0x5C ; '\\'                                    ; +0xae, 0x4c52ce\nVLDR            S15, [SP,#0x6C+var_44]                                 ; +0xb2, 0x4c52d2\nSTR             R3, [R4]                                               ; +0xb6, 0x4c52d6\nLDR             R3, [SP,#0x6C+var_5C]                                  ; +0xb8, 0x4c52d8\nVCVT.F32.S32    S15, S15                                               ; +0xba, 0x4c52da\nSTR             R3, [R4,#4]                                            ; +0xbe, 0x4c52de\nLDR             R3, [SP,#0x6C+var_58]                                  ; +0xc0, 0x4c52e0\nSTR             R3, [R4,#8]                                            ; +0xc2, 0x4c52e2\nLDR             R3, [SP,#0x6C+var_54]                                  ; +0xc4, 0x4c52e4\nVSTR            S15, [R4,#0x1C]                                        ; +0xc6, 0x4c52e6\nSTR             R3, [R4,#0xC]                                          ; +0xca, 0x4c52ea\nLDR             R3, [SP,#0x6C+var_50]                                  ; +0xcc, 0x4c52ec\nSTR             R3, [R4,#0x10]                                         ; +0xce, 0x4c52ee\nLDR             R3, [SP,#0x6C+var_4C]                                  ; +0xd0, 0x4c52f0\nSTR             R3, [R4,#0x14]                                         ; +0xd2, 0x4c52f2\nLDR             R3, [SP,#0x6C+var_48]                                  ; +0xd4, 0x4c52f4\nSTR             R3, [R4,#0x18]                                         ; +0xd6, 0x4c52f6\nADD             R3, SP, #0x6C+var_4                                    ; +0xd8, 0x4c52f8\nLDR.W           R2, [R3,#-0x3C]!                                       ; +0xda, 0x4c52fa\nSTR             R2, [R4,#0x20]                                         ; +0xde, 0x4c52fe\nADD.W           R2, R4, #0x3C ; '<'                                    ; +0xe0, 0x4c5300\nLDR.W           R0, [R3,#4]!                                           ; +0xe4, 0x4c5304\nSTR.W           R0, [R2,#4]!                                           ; +0xe8, 0x4c5308\nCMP             R2, R1                                                 ; +0xec, 0x4c530c\nBNE             loc_4C5304                                             ; +0xee, 0x4c530e\nLDR             R3, [SP,#0x6C+var_1C]                                  ; +0xf0, 0x4c5310\nMOV             R0, R5; this                                           ; +0xf2, 0x4c5312\nSTR             R3, [R4,#0x24]                                         ; +0xf4, 0x4c5314\nLDR             R3, [SP,#0x6C+var_18]                                  ; +0xf6, 0x4c5316\nSTR             R3, [R4,#0x28]                                         ; +0xf8, 0x4c5318\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xfa, 0x4c531a\nCMP             R0, #0x14                                              ; +0xfe, 0x4c531e\nBLS             loc_4C5332                                             ; +0x100, 0x4c5320\nMOV             R0, R5; this                                           ; +0x102, 0x4c5322\nMOVS            R1, #0x14; unsigned int                                ; +0x104, 0x4c5324\nBL              _ZN7cocos2d7CCArray13stringAtIndexEj; cocos2d::CCArray::stringAtIndex(uint) ; +0x106, 0x4c5326\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x10a, 0x4c532a\nMOV             R5, R0                                                 ; +0x10e, 0x4c532e\nB               loc_4C5336                                             ; +0x110, 0x4c5330\nLDR             R5, =(unk_B6B226 - 0x4C5338)                           ; +0x112, 0x4c5332\nADD             R5, PC; unk_B6B226                                     ; +0x114, 0x4c5334\nMOV             R0, R5; char *                                         ; +0x116, 0x4c5336\nMOVS            R3, #0                                                 ; +0x118, 0x4c5338\nSTR             R3, [SP,#0x6C+var_6C]                                  ; +0x11a, 0x4c533a\nMOV             R7, SP                                                 ; +0x11c, 0x4c533c\nSTR             R3, [SP,#0x6C+var_68]                                  ; +0x11e, 0x4c533e\nSTR             R3, [SP,#0x6C+var_64]                                  ; +0x120, 0x4c5340\nBLX             strlen                                                 ; +0x122, 0x4c5342\nMOV             R1, R5                                                 ; +0x126, 0x4c5346\nMOV             R2, R0                                                 ; +0x128, 0x4c5348\nMOV             R0, SP                                                 ; +0x12a, 0x4c534a\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x12c, 0x4c534c\nLDRB.W          R3, [SP,#0x6C+var_6C]                                  ; +0x130, 0x4c5350\nLSLS            R2, R3, #0x1F                                          ; +0x134, 0x4c5354\nBPL             loc_4C5362                                             ; +0x136, 0x4c5356\nLDR             R3, [SP,#0x6C+var_68]                                  ; +0x138, 0x4c5358\nSUBS            R2, R3, #1                                             ; +0x13a, 0x4c535a\nCMP             R2, #0x12                                              ; +0x13c, 0x4c535c\nBLS             loc_4C536C                                             ; +0x13e, 0x4c535e\nB               loc_4C53AE                                             ; +0x140, 0x4c5360\nASRS            R3, R3, #1                                             ; +0x142, 0x4c5362\nBEQ             loc_4C53AE                                             ; +0x144, 0x4c5364\nCMP             R3, #0x13                                              ; +0x146, 0x4c5366\nBLE             loc_4C53C6                                             ; +0x148, 0x4c5368\nB               loc_4C53AE                                             ; +0x14a, 0x4c536a\nLDR.W           R8, [SP,#0x6C+var_64]                                  ; +0x14c, 0x4c536c\nCBZ             R3, loc_4C53A2                                         ; +0x150, 0x4c5370\nLDR.W           R11, =(a0123456789_0 - 0x4C5380); \"0123456789\"         ; +0x152, 0x4c5372\nADD.W           R5, R8, R3                                             ; +0x156, 0x4c5376\nMOV             R9, R8                                                 ; +0x15a, 0x4c537a\nADD             R11, PC; \"0123456789\"                                  ; +0x15c, 0x4c537c\nCMP             R9, R5                                                 ; +0x15e, 0x4c537e\nMOV             R10, R9                                                ; +0x160, 0x4c5380\nBEQ             loc_4C53A2                                             ; +0x162, 0x4c5382\nMOV             R0, R11; void *                                        ; +0x164, 0x4c5384\nLDRB.W          R1, [R10]; int                                         ; +0x166, 0x4c5386\nMOVS            R2, #0xA; size_t                                       ; +0x16a, 0x4c538a\nADD.W           R9, R9, #1                                             ; +0x16c, 0x4c538c\nBLX             memchr                                                 ; +0x170, 0x4c5390\nCMP             R0, #0                                                 ; +0x174, 0x4c5394\nBNE             loc_4C537E                                             ; +0x176, 0x4c5396\nRSB.W           R8, R8, R10                                            ; +0x178, 0x4c5398\nCMP.W           R8, #0xFFFFFFFF                                        ; +0x17c, 0x4c539c\nBNE             loc_4C53AE                                             ; +0x180, 0x4c53a0\nMOV             R0, R7                                                 ; +0x182, 0x4c53a2\nMOVS            R1, #0                                                 ; +0x184, 0x4c53a4\nMOVS            R2, #0xA                                               ; +0x186, 0x4c53a6\nBL              _ZNSt6__ndk16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPji; std::stoull(std::string const&,uint *,int) ; +0x188, 0x4c53a8\nB               loc_4C53B2                                             ; +0x18c, 0x4c53ac\nMOVS            R0, #0                                                 ; +0x18e, 0x4c53ae\nMOVS            R1, #0                                                 ; +0x190, 0x4c53b0\nLDR             R3, [SP,#0x6C+var_10]                                  ; +0x192, 0x4c53b2\nSTRD.W          R0, R1, [R4,#0x30]                                     ; +0x194, 0x4c53b4\nMOV             R0, R7                                                 ; +0x198, 0x4c53b8\nSTR             R3, [R4,#0x38]                                         ; +0x19a, 0x4c53ba\nLDR             R3, [SP,#0x6C+var_C]                                   ; +0x19c, 0x4c53bc\nSTR             R3, [R4,#0x3C]                                         ; +0x19e, 0x4c53be\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x1a0, 0x4c53c0\nB               loc_4C53CC                                             ; +0x1a4, 0x4c53c4\nADD.W           R8, SP, #0x6C+var_6C+1                                 ; +0x1a6, 0x4c53c6\nB               loc_4C5372                                             ; +0x1aa, 0x4c53ca\nLDR             R2, [SP,#0x6C+var_8]                                   ; +0x1ac, 0x4c53cc\nLDR             R3, [R6]                                               ; +0x1ae, 0x4c53ce\nCMP             R2, R3                                                 ; +0x1b0, 0x4c53d0\nBEQ             loc_4C53D8                                             ; +0x1b2, 0x4c53d2\nBLX             __stack_chk_fail                                       ; +0x1b4, 0x4c53d4\nADD             SP, SP, #0x6C ; 'l'                                    ; +0x1b8, 0x4c53d8\nPOP.W           {R4-R11,PC}                                            ; +0x1ba, 0x4c53da", "xrefs": ["GJGameLevel::dataLoaded @ 0x4cbfbc"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}