{"type": "func", "start": 3947440, "end": 3947684, "name": "CCAnimatedSprite::initWithType", "pseudocode": "// \n// CCAnimatedSprite::initWithType from 0x3c3bb0 to 0x3c3ca4 (244 bytes)\n// \n// 3 xrefs:\n// > CCAnimatedSprite::createWithType @ 0x3c3d2c\n// > GJRobotSprite::init @ 0x5e6b22\n// > AnimatedShopKeeper::init @ 0x611204\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:46:32 +0000\n// \n\nint __fastcall CCAnimatedSprite::initWithType(\n        CCAnimatedSprite *this,\n        const char *a2,\n        cocos2d::CCTexture2D *a3,\n        cocos2d::CCTexture2D *a4)\n{\n  cocos2d::CCTexture2D *v7; // r4\n  ObjectManager *v8; // r0\n  int Definition; // r5\n  cocos2d::CCString *v10; // r0\n  const char *CString; // r10\n  size_t v12; // r0\n  cocos2d::CCTextureCache *v13; // r0\n  cocos2d::CCTextureCache *v14; // r0\n  char *v15; // r1\n  int v16; // r5\n  int v18[2]; // [sp+Ch] [bp-2Ch] BYREF\n  char *v19; // [sp+14h] [bp-24h]\n  int v20[3]; // [sp+18h] [bp-20h] BYREF\n  _BYTE v21[16]; // [sp+24h] [bp-14h] BYREF\n\n  v7 = a3;\n  if ( !a3 )\n  {\n    v8 = (ObjectManager *)ObjectManager::instance(this);\n    memset(v20, 0, sizeof(v20));\n    Definition = ObjectManager::getDefinition(v8, a2);\n    std::string::__init(v20, \"spriteSheet\", 0xBu);\n    v10 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(Definition, v20);\n    CString = (const char *)cocos2d::CCString::getCString(v10);\n    v18[0] = 0;\n    v18[1] = 0;\n    v19 = nullptr;\n    v12 = strlen(CString);\n    std::string::__init(v18, CString, v12);\n    std::string::~string((int)v20);\n    v13 = (cocos2d::CCTextureCache *)std::string::append(v18, \".png\");\n    v14 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v13);\n    if ( (v18[0] & 1) != 0 )\n      v15 = v19;\n    else\n      v15 = (char *)v18 + 1;\n    v7 = (cocos2d::CCTexture2D *)cocos2d::CCTextureCache::addImage(v14, v15, 0);\n    std::string::~string((int)v18);\n  }\n  cocos2d::CCRect::CCRect((cocos2d::CCRect *)v21, 0.0, 0.0, 0.0, 0.0);\n  v16 = cocos2d::CCSprite::initWithTexture(this, v7, (const cocos2d::CCRect *)v21);\n  if ( v16 )\n  {\n    *((_BYTE *)this + 471) = 1;\n    std::string::assign((int *)this + 127, (char *)&unk_B6B226);\n    CCAnimatedSprite::loadType(this, a2, v7, a4);\n  }\n  return v16;\n}", "assembly": "; \n; CCAnimatedSprite::initWithType from 0x3c3bb0 to 0x3c3ca4 (244 bytes)\n; \n; 3 xrefs:\n; > CCAnimatedSprite::createWithType @ 0x3c3d2c\n; > GJRobotSprite::init @ 0x5e6b22\n; > AnimatedShopKeeper::init @ 0x611204\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:46:32 +0000\n; \nPUSH.W          {R4-R10,LR}                                            ; +0x0, 0x3c3bb0\nMOV             R8, R3                                                 ; +0x4, 0x3c3bb4\nLDR             R3, =(__stack_chk_guard_ptr - 0x3C3BC2)                ; +0x6, 0x3c3bb6\nMOV             R7, R1                                                 ; +0x8, 0x3c3bb8\nSUB             SP, SP, #0x38                                          ; +0xa, 0x3c3bba\nMOV             R6, R0                                                 ; +0xc, 0x3c3bbc\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0xe, 0x3c3bbe\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x10, 0x3c3bc0\nMOV             R4, R2                                                 ; +0x12, 0x3c3bc2\nLDR             R1, [R3]                                               ; +0x14, 0x3c3bc4\nMOV             R9, R3                                                 ; +0x16, 0x3c3bc6\nSTR             R1, [SP,#0x38+var_4]                                   ; +0x18, 0x3c3bc8\nCMP             R2, #0                                                 ; +0x1a, 0x3c3bca\nBNE             loc_3C3C44                                             ; +0x1c, 0x3c3bcc\nBL              _ZN13ObjectManager8instanceEv; ObjectManager::instance(void) ; +0x1e, 0x3c3bce\nMOV             R1, R7; char *                                         ; +0x22, 0x3c3bd2\nBL              _ZN13ObjectManager13getDefinitionEPKc; ObjectManager::getDefinition(char const*) ; +0x24, 0x3c3bd4\nSTR             R4, [SP,#0x38+var_20]                                  ; +0x28, 0x3c3bd8\nSTR             R4, [SP,#0x38+var_1C]                                  ; +0x2a, 0x3c3bda\nMOVS            R2, #0xB                                               ; +0x2c, 0x3c3bdc\nSTR             R4, [SP,#0x38+var_18]                                  ; +0x2e, 0x3c3bde\nADD             R4, SP, #0x38+var_20                                   ; +0x30, 0x3c3be0\nLDR             R1, =(aSpritesheet - 0x3C3BE8); \"spriteSheet\"          ; +0x32, 0x3c3be2\nADD             R1, PC; \"spriteSheet\"                                  ; +0x34, 0x3c3be4\nMOV             R5, R0                                                 ; +0x36, 0x3c3be6\nMOV             R0, R4                                                 ; +0x38, 0x3c3be8\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x3a, 0x3c3bea\nMOV             R0, R5                                                 ; +0x3e, 0x3c3bee\nMOV             R1, R4                                                 ; +0x40, 0x3c3bf0\nBL              _ZN7cocos2d12CCDictionary11valueForKeyERKNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE; cocos2d::CCDictionary::valueForKey(std::string const&) ; +0x42, 0x3c3bf2\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x46, 0x3c3bf6\nMOVS            R3, #0                                                 ; +0x4a, 0x3c3bfa\nMOV             R10, R0                                                ; +0x4c, 0x3c3bfc\nSTR             R3, [SP,#0x38+var_2C]                                  ; +0x4e, 0x3c3bfe\nADD             R5, SP, #0x38+var_2C                                   ; +0x50, 0x3c3c00\nSTR             R3, [SP,#0x38+var_28]                                  ; +0x52, 0x3c3c02\nSTR             R3, [SP,#0x38+var_24]                                  ; +0x54, 0x3c3c04\nBLX             strlen                                                 ; +0x56, 0x3c3c06\nMOV             R1, R10                                                ; +0x5a, 0x3c3c0a\nMOV             R2, R0                                                 ; +0x5c, 0x3c3c0c\nMOV             R0, R5                                                 ; +0x5e, 0x3c3c0e\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x60, 0x3c3c10\nMOV             R0, R4                                                 ; +0x64, 0x3c3c14\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x66, 0x3c3c16\nLDR             R1, =(aPng - 0x3C3C22); \".png\"                         ; +0x6a, 0x3c3c1a\nMOV             R0, R5; int                                            ; +0x6c, 0x3c3c1c\nADD             R1, PC; \".png\"                                         ; +0x6e, 0x3c3c1e\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc; std::string::append(char const*) ; +0x70, 0x3c3c20\nBL              _ZN7cocos2d14CCTextureCache18sharedTextureCacheEv; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0x74, 0x3c3c24\nLDRB.W          R3, [SP,#0x38+var_2C]                                  ; +0x78, 0x3c3c28\nMOVS            R2, #0; bool                                           ; +0x7c, 0x3c3c2c\nLSLS            R3, R3, #0x1F                                          ; +0x7e, 0x3c3c2e\nITE PL                                                                 ; +0x80, 0x3c3c30\nADDPL.W         R1, SP, #0x38+var_2C+1                                 ; +0x82, 0x3c3c32\nLDRMI           R1, [SP,#0x38+var_24]; char *                          ; +0x86, 0x3c3c36\nBL              _ZN7cocos2d14CCTextureCache8addImageEPKcb; cocos2d::CCTextureCache::addImage(char const*,bool) ; +0x88, 0x3c3c38\nMOV             R4, R0                                                 ; +0x8c, 0x3c3c3c\nMOV             R0, R5                                                 ; +0x8e, 0x3c3c3e\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x90, 0x3c3c40\nADD             R5, SP, #0x38+var_14                                   ; +0x94, 0x3c3c44\nMOVS            R1, #0; float                                          ; +0x96, 0x3c3c46\nMOV             R2, R1; float                                          ; +0x98, 0x3c3c48\nMOV             R3, R1; float                                          ; +0x9a, 0x3c3c4a\nSTR             R1, [SP,#0x38+var_38]; float                           ; +0x9c, 0x3c3c4c\nMOV             R0, R5; this                                           ; +0x9e, 0x3c3c4e\nBL              _ZN7cocos2d6CCRectC1Effff; cocos2d::CCRect::CCRect(float,float,float,float) ; +0xa0, 0x3c3c50\nMOV             R2, R5                                                 ; +0xa4, 0x3c3c54\nMOV             R0, R6                                                 ; +0xa6, 0x3c3c56\nMOV             R1, R4                                                 ; +0xa8, 0x3c3c58\nBL              _ZN7cocos2d8CCSprite15initWithTextureEPNS_11CCTexture2DERKNS_6CCRectE; cocos2d::CCSprite::initWithTexture(cocos2d::CCTexture2D *,cocos2d::CCRect const&) ; +0xaa, 0x3c3c5a\nMOV             R5, R0                                                 ; +0xae, 0x3c3c5e\nCBZ             R0, loc_3C3C80                                         ; +0xb0, 0x3c3c60\nLDR             R1, =(unk_B6B226 - 0x3C3C72)                           ; +0xb2, 0x3c3c62\nMOVS            R3, #1                                                 ; +0xb4, 0x3c3c64\nADD.W           R0, R6, #0x1FC; int                                    ; +0xb6, 0x3c3c66\nSTRB.W          R3, [R6,#0x1D7]                                        ; +0xba, 0x3c3c6a\nADD             R1, PC; unk_B6B226 ; char *                            ; +0xbe, 0x3c3c6e\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc; std::string::assign(char const*) ; +0xc0, 0x3c3c70\nMOV             R0, R6; this                                           ; +0xc4, 0x3c3c74\nMOV             R1, R7; char *                                         ; +0xc6, 0x3c3c76\nMOV             R2, R4; cocos2d::CCTexture2D *                         ; +0xc8, 0x3c3c78\nMOV             R3, R8; bool                                           ; +0xca, 0x3c3c7a\nBL              _ZN16CCAnimatedSprite8loadTypeEPKcPN7cocos2d11CCTexture2DEb; CCAnimatedSprite::loadType(char const*,cocos2d::CCTexture2D *,bool) ; +0xcc, 0x3c3c7c\nLDR             R2, [SP,#0x38+var_4]                                   ; +0xd0, 0x3c3c80\nMOV             R0, R5                                                 ; +0xd2, 0x3c3c82\nLDR.W           R3, [R9]                                               ; +0xd4, 0x3c3c84\nCMP             R2, R3                                                 ; +0xd8, 0x3c3c88\nBEQ             loc_3C3C9E                                             ; +0xda, 0x3c3c8a\nBLX             __stack_chk_fail                                       ; +0xdc, 0x3c3c8c\nMOV             R0, R4                                                 ; +0xe0, 0x3c3c90\nB               loc_3C3C96                                             ; +0xe2, 0x3c3c92\nMOV             R0, R5                                                 ; +0xe4, 0x3c3c94\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xe6, 0x3c3c96\nBL              __cxa_end_cleanup                                      ; +0xea, 0x3c3c9a\nADD             SP, SP, #0x38 ; '8'                                    ; +0xee, 0x3c3c9e\nPOP.W           {R4-R10,PC}                                            ; +0xf0, 0x3c3ca0", "xrefs": ["CCAnimatedSprite::createWithType @ 0x3c3d2c", "GJRobotSprite::init @ 0x5e6b22", "AnimatedShopKeeper::init @ 0x611204"], "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"}