{"type": "func", "start": 4096404, "end": 4096734, "name": "AnimatedGameObject::init", "pseudocode": "// \n// AnimatedGameObject::init from 0x3e8194 to 0x3e82de (330 bytes)\n// \n// 1 xrefs:\n// > AnimatedGameObject::create @ 0x3e8368\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\nbool AnimatedGameObject::init(AnimatedGameObject *a1, int a2)\n{\n  const char *v4; // r0\n  _BOOL4 v5; // r7\n  CCAnimatedSprite *v7; // r0\n  cocos2d::CCTexture2D *v8; // r0\n  const cocos2d::CCSize *v9; // r0\n  CCAnimatedSprite *m_animatedSprite; // r8\n  void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9\n  cocos2d::CCSize v12; // [sp+4h] [bp-18h] BYREF\n  cocos2d::CCPoint v13; // [sp+Ch] [bp-10h] BYREF\n\n  a1->m_classType = Animated;\n  a1->m_objectID = a2;\n  if ( a2 == 1327 )\n  {\n    v4 = \"GJBeast02\";\n  }\n  else if ( a2 >= 1328 )\n  {\n    switch ( a2 )\n    {\n      case 1584:\n        a1->m_notGrounded = 1;\n        v4 = \"GJBeast04\";\n        break;\n      case 2012:\n        a1->m_notGrounded = 1;\n        v4 = \"GJBeast05\";\n        break;\n      case 1328:\n        v4 = \"GJBeast03\";\n        break;\n      default:\n        goto LABEL_13;\n    }\n  }\n  else\n  {\n    if ( a2 != 918 )\n    {\n      if ( a2 == 919 )\n      {\n        v4 = \"BlackSludge\";\n        goto LABEL_16;\n      }\nLABEL_13:\n      LOBYTE(v5) = 0;\n      return v5;\n    }\n    a1->m_notGrounded = 1;\n    v4 = \"GJBeast01\";\n  }\nLABEL_16:\n  v7 = CCAnimatedSprite::createWithType(v4, nullptr, 0);\n  a1->m_animatedSprite = v7;\n  SpriteAnimationManager::stopAnimations(v7->m_animationManager);\n  a1->m_animatedSprite->m_delegate = &a1->AnimatedSpriteDelegate;\n  v8 = a1->m_animatedSprite->getTexture(a1->m_animatedSprite);\n  v5 = GameObject::initWithTexture(a1, v8);\n  if ( v5 )\n  {\n    AnimatedGameObject::setupAnimatedSize(a1, a2);\n    a1->addChild(a1, a1->m_animatedSprite);\n    v9 = a1->getContentSize(a1);\n    cocos2d::CCSize::CCSize(&v12, v9);\n    m_animatedSprite = a1->m_animatedSprite;\n    setPosition = m_animatedSprite->setPosition;\n    cocos2d::CCPoint::CCPoint(&v13, v12.width * 0.5, v12.height * 0.5);\n    setPosition(m_animatedSprite, &v13);\n    a1->m_unk367 = 1;\n    a1->m_bUnkBool2 = 0;\n    AnimatedGameObject::setupChildSprites(a1);\n  }\n  return v5;\n}", "assembly": "; \n; AnimatedGameObject::init from 0x3e8194 to 0x3e82de (330 bytes)\n; \n; 1 xrefs:\n; > AnimatedGameObject::create @ 0x3e8368\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\nLDR             R3, =(__stack_chk_guard_ptr - 0x3E819E)                ; +0x0, 0x3e8194\nPUSH.W          {R4-R9,LR}                                             ; +0x2, 0x3e8196\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x6, 0x3e819a\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x8, 0x3e819c\nSUB             SP, SP, #0x1C                                          ; +0xa, 0x3e819e\nMOV             R4, R0                                                 ; +0xc, 0x3e81a0\nLDR             R2, [R3]                                               ; +0xe, 0x3e81a2\nMOV             R5, R1                                                 ; +0x10, 0x3e81a4\nMOV             R6, R3                                                 ; +0x12, 0x3e81a6\nSTR             R2, [SP,#0x1C+var_8]                                   ; +0x14, 0x3e81a8\nMOVS            R2, #2                                                 ; +0x16, 0x3e81aa\nSTR.W           R2, [R0,#0x434]                                        ; +0x18, 0x3e81ac\nMOVW            R2, #0x52F                                             ; +0x1c, 0x3e81b0\nCMP             R1, R2                                                 ; +0x20, 0x3e81b4\nSTR.W           R1, [R4,#0x374]                                        ; +0x22, 0x3e81b6\nBEQ             loc_3E8222                                             ; +0x26, 0x3e81ba\nCMP.W           R1, #0x530                                             ; +0x28, 0x3e81bc\nBGE             loc_3E81D8                                             ; +0x2c, 0x3e81c0\nMOVW            R3, #0x396                                             ; +0x2e, 0x3e81c2\nCMP             R1, R3                                                 ; +0x32, 0x3e81c6\nBEQ             loc_3E81EE                                             ; +0x34, 0x3e81c8\nMOVW            R3, #0x397                                             ; +0x36, 0x3e81ca\nCMP             R1, R3                                                 ; +0x3a, 0x3e81ce\nBNE             loc_3E8212                                             ; +0x3c, 0x3e81d0\nLDR             R0, =(aBlacksludge - 0x3E81D8); \"BlackSludge\"          ; +0x3e, 0x3e81d2\nADD             R0, PC; \"BlackSludge\"                                  ; +0x40, 0x3e81d4\nB               loc_3E822C                                             ; +0x42, 0x3e81d6\nCMP.W           R1, #0x630                                             ; +0x44, 0x3e81d8\nBEQ             loc_3E81FA                                             ; +0x48, 0x3e81dc\nMOVW            R3, #0x7DC; bool                                       ; +0x4a, 0x3e81de\nCMP             R1, R3                                                 ; +0x4e, 0x3e81e2\nBEQ             loc_3E8206                                             ; +0x50, 0x3e81e4\nCMP.W           R1, #0x530                                             ; +0x52, 0x3e81e6\nBNE             loc_3E8212                                             ; +0x56, 0x3e81ea\nB               loc_3E8228                                             ; +0x58, 0x3e81ec\nMOVS            R3, #1                                                 ; +0x5a, 0x3e81ee\nSTRB.W          R3, [R0,#0x508]                                        ; +0x5c, 0x3e81f0\nLDR             R0, =(aGjbeast01 - 0x3E81FA); \"GJBeast01\"              ; +0x60, 0x3e81f4\nADD             R0, PC; \"GJBeast01\"                                    ; +0x62, 0x3e81f6\nB               loc_3E822C                                             ; +0x64, 0x3e81f8\nMOVS            R3, #1                                                 ; +0x66, 0x3e81fa\nSTRB.W          R3, [R0,#0x508]                                        ; +0x68, 0x3e81fc\nLDR             R0, =(aGjbeast04 - 0x3E8206); \"GJBeast04\"              ; +0x6c, 0x3e8200\nADD             R0, PC; \"GJBeast04\"                                    ; +0x6e, 0x3e8202\nB               loc_3E822C                                             ; +0x70, 0x3e8204\nMOVS            R3, #1                                                 ; +0x72, 0x3e8206\nSTRB.W          R3, [R0,#0x508]                                        ; +0x74, 0x3e8208\nLDR             R0, =(aGjbeast05 - 0x3E8212); \"GJBeast05\"              ; +0x78, 0x3e820c\nADD             R0, PC; \"GJBeast05\"                                    ; +0x7a, 0x3e820e\nB               loc_3E822C                                             ; +0x7c, 0x3e8210\nMOVS            R7, #0                                                 ; +0x7e, 0x3e8212\nLDR             R2, [SP,#0x1C+var_8]                                   ; +0x80, 0x3e8214\nMOV             R0, R7                                                 ; +0x82, 0x3e8216\nLDR             R3, [R6]                                               ; +0x84, 0x3e8218\nCMP             R2, R3                                                 ; +0x86, 0x3e821a\nBEQ             loc_3E82D8                                             ; +0x88, 0x3e821c\nBLX             __stack_chk_fail                                       ; +0x8a, 0x3e821e\nLDR             R0, =(aGjbeast02 - 0x3E8228); \"GJBeast02\"              ; +0x8e, 0x3e8222\nADD             R0, PC; \"GJBeast02\"                                    ; +0x90, 0x3e8224\nB               loc_3E822C                                             ; +0x92, 0x3e8226\nLDR             R0, =(aGjbeast03 - 0x3E822E); \"GJBeast03\"              ; +0x94, 0x3e8228\nADD             R0, PC; \"GJBeast03\"                                    ; +0x96, 0x3e822a\nMOVS            R1, #0; char *                                         ; +0x98, 0x3e822c\nMOV             R2, R1; cocos2d::CCTexture2D *                         ; +0x9a, 0x3e822e\nBL              _ZN16CCAnimatedSprite14createWithTypeEPKcPN7cocos2d11CCTexture2DEb; CCAnimatedSprite::createWithType(char const*,cocos2d::CCTexture2D *,bool) ; +0x9c, 0x3e8230\nSTR.W           R0, [R4,#0x4F4]                                        ; +0xa0, 0x3e8234\nLDR.W           R0, [R0,#0x204]; this                                  ; +0xa4, 0x3e8238\nBL              _ZN22SpriteAnimationManager14stopAnimationsEv; SpriteAnimationManager::stopAnimations(void) ; +0xa8, 0x3e823c\nLDR.W           R3, [R4,#0x4F4]                                        ; +0xac, 0x3e8240\nADDW            R2, R4, #0x4EC                                         ; +0xb0, 0x3e8244\nSTR.W           R2, [R3,#0x21C]                                        ; +0xb4, 0x3e8248\nLDR.W           R0, [R4,#0x4F4]                                        ; +0xb8, 0x3e824c\nLDR             R3, [R0]                                               ; +0xbc, 0x3e8250\nLDR.W           R3, [R3,#0x210]                                        ; +0xbe, 0x3e8252\nBLX             R3                                                     ; +0xc2, 0x3e8256\nMOV             R1, R0; cocos2d::CCTexture2D *                         ; +0xc4, 0x3e8258\nMOV             R0, R4; this                                           ; +0xc6, 0x3e825a\nBL              _ZN10GameObject15initWithTextureEPN7cocos2d11CCTexture2DE; GameObject::initWithTexture(cocos2d::CCTexture2D *) ; +0xc8, 0x3e825c\nMOV             R7, R0                                                 ; +0xcc, 0x3e8260\nCMP             R0, #0                                                 ; +0xce, 0x3e8262\nBEQ             loc_3E8214                                             ; +0xd0, 0x3e8264\nMOV             R0, R4; this                                           ; +0xd2, 0x3e8266\nMOV             R1, R5; int                                            ; +0xd4, 0x3e8268\nBL              _ZN18AnimatedGameObject17setupAnimatedSizeEi; AnimatedGameObject::setupAnimatedSize(int) ; +0xd6, 0x3e826a\nLDR             R3, [R4]                                               ; +0xda, 0x3e826e\nLDR.W           R1, [R4,#0x4F4]                                        ; +0xdc, 0x3e8270\nMOV             R0, R4                                                 ; +0xe0, 0x3e8274\nADD             R5, SP, #0x1C+var_10                                   ; +0xe2, 0x3e8276\nLDR.W           R3, [R3,#0xDC]                                         ; +0xe4, 0x3e8278\nBLX             R3                                                     ; +0xe8, 0x3e827c\nLDR             R3, [R4]                                               ; +0xea, 0x3e827e\nMOV             R0, R4                                                 ; +0xec, 0x3e8280\nLDR.W           R3, [R3,#0x9C]                                         ; +0xee, 0x3e8282\nBLX             R3                                                     ; +0xf2, 0x3e8286\nMOV             R1, R0; cocos2d::CCSize *                              ; +0xf4, 0x3e8288\nADD             R0, SP, #0x1C+var_18; this                             ; +0xf6, 0x3e828a\nBL              _ZN7cocos2d6CCSizeC1ERKS0_; cocos2d::CCSize::CCSize(cocos2d::CCSize const&) ; +0xf8, 0x3e828c\nVMOV.F32        S15, #0.5                                              ; +0xfc, 0x3e8290\nVLDR            S14, [SP,#0x1C+var_18]                                 ; +0x100, 0x3e8294\nMOV             R0, R5; this                                           ; +0x104, 0x3e8298\nLDR.W           R8, [R4,#0x4F4]                                        ; +0x106, 0x3e829a\nLDR.W           R3, [R8]                                               ; +0x10a, 0x3e829e\nLDR.W           R9, [R3,#0x5C]                                         ; +0x10e, 0x3e82a2\nVMUL.F32        S14, S14, S15                                          ; +0x112, 0x3e82a6\nVMOV            R1, S14; float                                         ; +0x116, 0x3e82aa\nVLDR            S14, [SP,#0x1C+var_14]                                 ; +0x11a, 0x3e82ae\nVMUL.F32        S15, S14, S15                                          ; +0x11e, 0x3e82b2\nVMOV            R2, S15; float                                         ; +0x122, 0x3e82b6\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x126, 0x3e82ba\nMOV             R0, R8                                                 ; +0x12a, 0x3e82be\nMOV             R1, R5                                                 ; +0x12c, 0x3e82c0\nBLX             R9                                                     ; +0x12e, 0x3e82c2\nMOVS            R3, #1                                                 ; +0x130, 0x3e82c4\nMOV             R0, R4; this                                           ; +0x132, 0x3e82c6\nSTRB.W          R3, [R4,#0x2EB]                                        ; +0x134, 0x3e82c8\nMOVS            R3, #0                                                 ; +0x138, 0x3e82cc\nSTRB.W          R3, [R4,#0x105]                                        ; +0x13a, 0x3e82ce\nBL              _ZN18AnimatedGameObject17setupChildSpritesEv; AnimatedGameObject::setupChildSprites(void) ; +0x13e, 0x3e82d2\nB               loc_3E8214                                             ; +0x142, 0x3e82d6\nADD             SP, SP, #0x1C                                          ; +0x144, 0x3e82d8\nPOP.W           {R4-R9,PC}                                             ; +0x146, 0x3e82da", "xrefs": ["AnimatedGameObject::create @ 0x3e8368"], "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"}