{"type": "func", "start": 4298650132, "end": 4298650544, "name": "AnimatedGameObject::init", "pseudocode": "// \n// AnimatedGameObject::init from 0x100383214 to 0x1003833b0 (412 bytes)\n// \n// 1 xrefs:\n// > AnimatedGameObject::create @ 0x1003831c8\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 __fastcall AnimatedGameObject::init(AnimatedGameObject *a1, int a2)\n{\n  bool v4; // w21\n  const char *v5; // x0\n  CCAnimatedSprite *v6; // x0\n  CCAnimatedSprite *m_animatedSprite; // x0\n  cocos2d::CCTexture2D *v8; // x0\n  double *v9; // x0\n  __n128 v10; // q0\n  CCAnimatedSprite *v11; // x20\n  __n128 v12; // q1\n  int v14; // [xsp+0h] [xbp-30h] BYREF\n  __int64 v15; // [xsp+8h] [xbp-28h] BYREF\n\n  v4 = 0;\n  a1->m_classType = Animated;\n  a1->m_objectID = a2;\n  if ( a2 > 1327 )\n  {\n    switch ( a2 )\n    {\n      case 1328:\n        v5 = \"GJBeast03\";\n        break;\n      case 1584:\n        a1->m_notGrounded = 1;\n        v5 = \"GJBeast04\";\n        break;\n      case 2012:\n        a1->m_notGrounded = 1;\n        v5 = \"GJBeast05\";\n        break;\n      default:\n        return v4;\n    }\n  }\n  else\n  {\n    switch ( a2 )\n    {\n      case 918:\n        a1->m_notGrounded = 1;\n        v5 = \"GJBeast01\";\n        break;\n      case 919:\n        v5 = \"BlackSludge\";\n        break;\n      case 1327:\n        v5 = \"GJBeast02\";\n        break;\n      default:\n        return v4;\n    }\n  }\n  v6 = CCAnimatedSprite::createWithType(v5, nullptr, 0);\n  a1->m_animatedSprite = v6;\n  SpriteAnimationManager::stopAnimations(v6->m_animationManager);\n  m_animatedSprite = a1->m_animatedSprite;\n  m_animatedSprite->m_delegate = &a1->AnimatedSpriteDelegate;\n  v8 = (cocos2d::CCTexture2D *)((__int64 (__fastcall *)(CCAnimatedSprite *))m_animatedSprite->getTexture)(m_animatedSprite);\n  v4 = 0;\n  if ( GameObject::initWithTexture(a1, v8) )\n  {\n    AnimatedGameObject::setupAnimatedSize(a1, a2);\n    ((void (__fastcall *)(AnimatedGameObject *, CCAnimatedSprite *))a1->addChild)(a1, a1->m_animatedSprite);\n    v9 = (double *)((__int64 (__fastcall *)(AnimatedGameObject *))a1->getContentSize)(a1);\n    v10.n128_f64[0] = sub_100022AFC(&v15, v9);\n    v11 = a1->m_animatedSprite;\n    v10.n128_f32[0] = *(float *)&v15 * 0.5;\n    v12.n128_f32[0] = *((float *)&v15 + 1) * 0.5;\n    sub_100022980(v10, v12, &v14);\n    ((void (__fastcall *)(CCAnimatedSprite *, int *))v11->setPosition)(v11, &v14);\n    v4 = 1;\n    a1->m_unk367 = 1;\n    a1->m_bUnkBool2 = 0;\n    AnimatedGameObject::setupChildSprites(a1);\n  }\n  return v4;\n}", "assembly": "; \n; AnimatedGameObject::init from 0x100383214 to 0x1003833b0 (412 bytes)\n; \n; 1 xrefs:\n; > AnimatedGameObject::create @ 0x1003831c8\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, #0x40                                          ; +0x0, 0x100383214\nSTP             X22, X21, [SP,#0x30+var_20]                            ; +0x4, 0x100383218\nSTP             X20, X19, [SP,#0x30+var_10]                            ; +0x8, 0x10038321c\nSTP             X29, X30, [SP,#0x30+var_s0]                            ; +0xc, 0x100383220\nADD             X29, SP, #0x30                                         ; +0x10, 0x100383224\nMOV             X20, X1                                                ; +0x14, 0x100383228\nMOV             X19, X0                                                ; +0x18, 0x10038322c\nMOV             W21, #0                                                ; +0x1c, 0x100383230\nMOV             W8, #2                                                 ; +0x20, 0x100383234\nSTR             W8, [X0,#0x4E0]                                        ; +0x24, 0x100383238\nSTR             W1, [X0,#0x404]                                        ; +0x28, 0x10038323c\nCMP             W1, #0x52F                                             ; +0x2c, 0x100383240\nB.GT            loc_10038326C                                          ; +0x30, 0x100383244\nCMP             W20, #0x396                                            ; +0x34, 0x100383248\nB.EQ            loc_100383298                                          ; +0x38, 0x10038324c\nCMP             W20, #0x397                                            ; +0x3c, 0x100383250\nB.EQ            loc_1003832B8                                          ; +0x40, 0x100383254\nCMP             W20, #0x52F                                            ; +0x44, 0x100383258\nB.NE            loc_100383398                                          ; +0x48, 0x10038325c\nADRL            X0, aGjbeast02; \"GJBeast02\"                            ; +0x4c, 0x100383260\nB               loc_1003832D4                                          ; +0x54, 0x100383268\nCMP             W20, #0x530                                            ; +0x58, 0x10038326c\nB.EQ            loc_1003832AC                                          ; +0x5c, 0x100383270\nCMP             W20, #0x630                                            ; +0x60, 0x100383274\nB.EQ            loc_1003832C4                                          ; +0x64, 0x100383278\nCMP             W20, #0x7DC                                            ; +0x68, 0x10038327c\nB.NE            loc_100383398                                          ; +0x6c, 0x100383280\nMOV             W8, #1                                                 ; +0x70, 0x100383284\nSTRB            W8, [X19,#0x5F0]                                       ; +0x74, 0x100383288\nADRL            X0, aGjbeast05; \"GJBeast05\"                            ; +0x78, 0x10038328c\nB               loc_1003832D4                                          ; +0x80, 0x100383294\nMOV             W8, #1                                                 ; +0x84, 0x100383298\nSTRB            W8, [X19,#0x5F0]                                       ; +0x88, 0x10038329c\nADRL            X0, aGjbeast01; \"GJBeast01\"                            ; +0x8c, 0x1003832a0\nB               loc_1003832D4                                          ; +0x94, 0x1003832a8\nADRL            X0, aGjbeast03; \"GJBeast03\"                            ; +0x98, 0x1003832ac\nB               loc_1003832D4                                          ; +0xa0, 0x1003832b4\nADRL            X0, aBlacksludge; \"BlackSludge\"                        ; +0xa4, 0x1003832b8\nB               loc_1003832D4                                          ; +0xac, 0x1003832c0\nMOV             W8, #1                                                 ; +0xb0, 0x1003832c4\nSTRB            W8, [X19,#0x5F0]                                       ; +0xb4, 0x1003832c8\nADRL            X0, aGjbeast04; \"GJBeast04\"                            ; +0xb8, 0x1003832cc\nMOV             X1, #0                                                 ; +0xc0, 0x1003832d4\nMOV             W2, #0                                                 ; +0xc4, 0x1003832d8\nBL              CCAnimatedSprite__createWithType                       ; +0xc8, 0x1003832dc\nSTR             X0, [X19,#0x5B8]                                       ; +0xcc, 0x1003832e0\nLDR             X0, [X0,#0x288]                                        ; +0xd0, 0x1003832e4\nBL              SpriteAnimationManager__stopAnimations                 ; +0xd4, 0x1003832e8\nLDR             X0, [X19,#0x5B8]                                       ; +0xd8, 0x1003832ec\nADD             X8, X19, #0x5A8                                        ; +0xdc, 0x1003832f0\nSTR             X8, [X0,#0x2C8]                                        ; +0xe0, 0x1003832f4\nLDR             X8, [X0]                                               ; +0xe4, 0x1003832f8\nLDR             X8, [X8,#0x420]                                        ; +0xe8, 0x1003832fc\nBLR             X8                                                     ; +0xec, 0x100383300\nMOV             X1, X0                                                 ; +0xf0, 0x100383304\nMOV             X0, X19                                                ; +0xf4, 0x100383308\nBL              GameObject__initWithTexture                            ; +0xf8, 0x10038330c\nMOV             W21, #0                                                ; +0xfc, 0x100383310\nCBZ             W0, loc_100383398                                      ; +0x100, 0x100383314\nMOV             X0, X19                                                ; +0x104, 0x100383318\nMOV             X1, X20                                                ; +0x108, 0x10038331c\nBL              AnimatedGameObject__setupAnimatedSize                  ; +0x10c, 0x100383320\nLDR             X1, [X19,#0x5B8]                                       ; +0x110, 0x100383324\nLDR             X8, [X19]                                              ; +0x114, 0x100383328\nLDR             X8, [X8,#0x1B8]                                        ; +0x118, 0x10038332c\nMOV             X0, X19                                                ; +0x11c, 0x100383330\nBLR             X8                                                     ; +0x120, 0x100383334\nLDR             X8, [X19]                                              ; +0x124, 0x100383338\nLDR             X8, [X8,#0x138]                                        ; +0x128, 0x10038333c\nMOV             X0, X19                                                ; +0x12c, 0x100383340\nBLR             X8                                                     ; +0x130, 0x100383344\nMOV             X1, X0                                                 ; +0x134, 0x100383348\nADD             X0, SP, #0x30+var_28                                   ; +0x138, 0x10038334c\nBL              sub_100022AFC                                          ; +0x13c, 0x100383350\nLDR             X20, [X19,#0x5B8]                                      ; +0x140, 0x100383354\nFMOV            S1, #0.5                                               ; +0x144, 0x100383358\nLDP             S0, S2, [SP,#0x30+var_28]                              ; +0x148, 0x10038335c\nFMUL            S0, S0, S1                                             ; +0x14c, 0x100383360\nFMUL            S1, S2, S1                                             ; +0x150, 0x100383364\nMOV             X0, SP                                                 ; +0x154, 0x100383368\nBL              sub_100022980                                          ; +0x158, 0x10038336c\nLDR             X8, [X20]                                              ; +0x15c, 0x100383370\nLDR             X8, [X8,#0xB8]                                         ; +0x160, 0x100383374\nMOV             X1, SP                                                 ; +0x164, 0x100383378\nMOV             X0, X20                                                ; +0x168, 0x10038337c\nBLR             X8                                                     ; +0x16c, 0x100383380\nMOV             W21, #1                                                ; +0x170, 0x100383384\nSTRB            W21, [X19,#0x377]                                      ; +0x174, 0x100383388\nSTRB            WZR, [X19,#0x139]                                      ; +0x178, 0x10038338c\nMOV             X0, X19                                                ; +0x17c, 0x100383390\nBL              AnimatedGameObject__setupChildSprites                  ; +0x180, 0x100383394\nMOV             X0, X21                                                ; +0x184, 0x100383398\nLDP             X29, X30, [SP,#0x30+var_s0]                            ; +0x188, 0x10038339c\nLDP             X20, X19, [SP,#0x30+var_10]                            ; +0x18c, 0x1003833a0\nLDP             X22, X21, [SP,#0x30+var_20]                            ; +0x190, 0x1003833a4\nADD             SP, SP, #0x40 ; '@'                                    ; +0x194, 0x1003833a8\nRET                                                                    ; +0x198, 0x1003833ac", "xrefs": ["AnimatedGameObject::create @ 0x1003831c8"], "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"}