{"type": "func", "start": 5273400, "end": 5274020, "name": "EndPortalObject::init", "pseudocode": "// \n// EndPortalObject::init from 0x507738 to 0x5079a4 (620 bytes)\n// \n// 1 xrefs:\n// > EndPortalObject::create @ 0x507de2\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:51:25 +0000\n// \n\nint __fastcall EndPortalObject::init(EndPortalObject *this)\n{\n  int v2; // r9\n  cocos2d::CCDirector *v3; // r0\n  GameManager *v4; // r0\n  const char *v5; // r1\n  GameManager *v6; // r7\n  GameManager *v7; // r0\n  int (__fastcall *v8)(GameManager *, float *); // r8\n  unsigned __int8 *v9; // r2\n  int v10; // r10\n  int v11; // s17\n  int v12; // s19\n  GameManager *v13; // r0\n  void (__fastcall *v14)(GameManager *, float *); // r8\n  unsigned __int8 *v15; // r2\n  int v16; // r10\n  int v17; // s17\n  int v18; // s19\n  int v19; // r7\n  GameManager *v20; // r0\n  int v21; // r0\n  const char *v22; // r1\n  int v23; // r10\n  int v24; // r6\n  int v25; // s15\n  void (__fastcall *v27)(int, float *); // [sp+Ch] [bp-30h]\n  _BYTE v28[4]; // [sp+14h] [bp-28h] BYREF\n  float v29; // [sp+18h] [bp-24h]\n  _DWORD v30[2]; // [sp+1Ch] [bp-20h] BYREF\n  float v31; // [sp+24h] [bp-18h] BYREF\n  float v32; // [sp+28h] [bp-14h]\n  float v33; // [sp+2Ch] [bp-10h]\n  float v34; // [sp+30h] [bp-Ch]\n\n  v2 = GameObject::init(this, \"block001_01_001.png\");\n  if ( v2 )\n  {\n    v3 = (cocos2d::CCDirector *)(*(int (__fastcall **)(EndPortalObject *, void *))(*(_DWORD *)this + 568))(\n                                  this,\n                                  &unk_D2BC38);\n    cocos2d::CCDirector::sharedDirector(v3);\n    cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v28);\n    *((_BYTE *)this + 896) = 1;\n    *((_BYTE *)this + 863) = 0;\n    *((_DWORD *)this + 196) = 7;\n    v4 = GameObject::createAndAddParticle((int)this, 7, (int)\"endEffectPortal.plist\", 4, 2);\n    v6 = v4;\n    if ( v4 )\n    {\n      (*(void (__fastcall **)(GameManager *, _DWORD))(*(_DWORD *)v4 + 588))(v4, v29 * 0.5);\n      cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, -15.0, 0.0);\n      v7 = (GameManager *)cocos2d::CCPoint::operator=((char *)this + 680, &v31);\n      v8 = *(int (__fastcall **)(GameManager *, float *))(*(_DWORD *)v6 + 680);\n      v9 = *(unsigned __int8 **)(*(_DWORD *)(GameManager::sharedState(v7) + 404) + 2076);\n      v10 = v9[2107];\n      v11 = v9[2106];\n      v12 = v9[2108];\n      v34 = 1.0;\n      v32 = (float)v10 / 255.0;\n      v31 = (float)v11 / 255.0;\n      v33 = (float)v12 / 255.0;\n      v13 = (GameManager *)v8(v6, &v31);\n      v14 = *(void (__fastcall **)(GameManager *, float *))(*(_DWORD *)v6 + 696);\n      v15 = *(unsigned __int8 **)(*(_DWORD *)(GameManager::sharedState(v13) + 404) + 2076);\n      v16 = v15[2107];\n      v17 = v15[2106];\n      v18 = v15[2108];\n      v34 = 1.0;\n      v32 = (float)v16 / 255.0;\n      v31 = (float)v17 / 255.0;\n      v33 = (float)v18 / 255.0;\n      v14(v6, &v31);\n    }\n    v19 = 0;\n    v20 = (GameManager *)cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)\"gradientBar.png\", v5);\n    *((_DWORD *)this + 292) = v20;\n    v21 = GameManager::sharedState(v20);\n    (*(void (__fastcall **)(_DWORD, _DWORD))(**(_DWORD **)(*(_DWORD *)(v21 + 404) + 1720) + 228))(\n      *(_DWORD *)(*(_DWORD *)(v21 + 404) + 1720),\n      *((_DWORD *)this + 292));\n    v30[0] = 770;\n    v30[1] = 1;\n    (*(void (__fastcall **)(_DWORD, int, int, _DWORD *))(**((_DWORD **)this + 292) + 540))(\n      *((_DWORD *)this + 292),\n      770,\n      1,\n      v30);\n    (*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 292) + 72))(\n      *((_DWORD *)this + 292),\n      (float)(v29 * 1.5) / *(float *)(*((_DWORD *)this + 292) + 348));\n    v23 = lroundf();\n    while ( v19 < v23 )\n    {\n      v24 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)\"square_02_001.png\", v22);\n      (*(void (__fastcall **)(EndPortalObject *, int))(*(_DWORD *)this + 228))(this, v24);\n      (*(void (__fastcall **)(int, int))(*(_DWORD *)v24 + 180))(v24, -1028390912);\n      v25 = v19++;\n      v27 = *(void (__fastcall **)(int, float *))(*(_DWORD *)v24 + 92);\n      cocos2d::CCPoint::CCPoint(\n        (cocos2d::CCPoint *)&v31,\n        0.0,\n        (float)((float)(v23 / 2) * 30.0) - (float)((float)v25 * 30.0));\n      v27(v24, &v31);\n    }\n    *((_BYTE *)this + 760) = 1;\n  }\n  return v2;\n}", "assembly": "; \n; EndPortalObject::init from 0x507738 to 0x5079a4 (620 bytes)\n; \n; 1 xrefs:\n; > EndPortalObject::create @ 0x507de2\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:51:25 +0000\n; \nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x507738\nMOV             R4, R0                                                 ; +0x4, 0x50773c\nVPUSH           {D8-D9}                                                ; +0x6, 0x50773e\nLDR             R5, =(__stack_chk_guard_ptr - 0x50774A)                ; +0xa, 0x507742\nLDR             R1, =(aBlock00101001P - 0x507750); \"block001_01_001.png\" ; +0xc, 0x507744\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0xe, 0x507746\nLDR             R5, [R5]; __stack_chk_guard                            ; +0x10, 0x507748\nSUB             SP, SP, #0x3C                                          ; +0x12, 0x50774a\nADD             R1, PC; \"block001_01_001.png\"                          ; +0x14, 0x50774c\nLDR             R3, [R5]                                               ; +0x16, 0x50774e\nSTR             R3, [SP,#0x3C+var_8]                                   ; +0x18, 0x507750\nBL              _ZN10GameObject4initEPKc; GameObject::init(char const*) ; +0x1a, 0x507752\nMOV             R9, R0                                                 ; +0x1e, 0x507756\nCMP             R0, #0                                                 ; +0x20, 0x507758\nBEQ.W           loc_50798C                                             ; +0x22, 0x50775a\nLDR             R3, [R4]                                               ; +0x26, 0x50775e\nMOV             R0, R4                                                 ; +0x28, 0x507760\nLDR             R1, =(unk_D2BC38 - 0x507770)                           ; +0x2a, 0x507762\nMOV.W           R11, #0                                                ; +0x2c, 0x507764\nLDR.W           R3, [R3,#0x238]                                        ; +0x30, 0x507768\nADD             R1, PC; unk_D2BC38                                     ; +0x34, 0x50776c\nBLX             R3                                                     ; +0x36, 0x50776e\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x38, 0x507770\nMOV             R1, R0                                                 ; +0x3c, 0x507774\nADD             R0, SP, #0x3C+var_28; this                             ; +0x3e, 0x507776\nBL              _ZN7cocos2d10CCDirector10getWinSizeEv; cocos2d::CCDirector::getWinSize(void) ; +0x40, 0x507778\nLDR             R2, =(aEndeffectporta - 0x507794); \"endEffectPortal.plist\" ; +0x44, 0x50777c\nMOVS            R3, #1                                                 ; +0x46, 0x50777e\nMOVS            R1, #7                                                 ; +0x48, 0x507780\nSTRB.W          R3, [R4,#0x380]                                        ; +0x4a, 0x507782\nMOV             R0, R4                                                 ; +0x4e, 0x507786\nMOVS            R3, #2                                                 ; +0x50, 0x507788\nSTRB.W          R11, [R4,#0x35F]                                       ; +0x52, 0x50778a\nSTR             R3, [SP,#0x3C+var_3C]                                  ; +0x56, 0x50778e\nADD             R2, PC; \"endEffectPortal.plist\"                        ; +0x58, 0x507790\nSTR.W           R1, [R4,#0x310]                                        ; +0x5a, 0x507792\nMOVS            R3, #4                                                 ; +0x5e, 0x507796\nBL              _ZN10GameObject20createAndAddParticleEiPKciN7cocos2d15tCCPositionTypeE; GameObject::createAndAddParticle(int,char const*,int,cocos2d::tCCPositionType) ; +0x60, 0x507798\nMOV             R7, R0                                                 ; +0x64, 0x50779c\nCMP             R0, #0                                                 ; +0x66, 0x50779e\nBEQ             loc_50789C                                             ; +0x68, 0x5077a0\nVMOV.F32        S15, #0.5                                              ; +0x6a, 0x5077a2\nLDR             R3, [R0]                                               ; +0x6e, 0x5077a6\nVLDR            S14, [SP,#0x3C+var_24]                                 ; +0x70, 0x5077a8\nADD             R6, SP, #0x3C+var_18                                   ; +0x74, 0x5077ac\nLDR.W           R3, [R3,#0x24C]                                        ; +0x76, 0x5077ae\nVLDR            S16, =255.0                                            ; +0x7a, 0x5077b2\nVMUL.F32        S15, S14, S15                                          ; +0x7e, 0x5077b6\nVMOV            R1, S15                                                ; +0x82, 0x5077ba\nBLX             R3                                                     ; +0x86, 0x5077be\nMOVS            R2, #0; float                                          ; +0x88, 0x5077c0\nLDR             R1, flt_5079A8; float                                  ; +0x8a, 0x5077c2\nMOV             R0, R6; this                                           ; +0x8c, 0x5077c4\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x8e, 0x5077c6\nMOV             R1, R6                                                 ; +0x92, 0x5077ca\nADD.W           R0, R4, #0x2A8                                         ; +0x94, 0x5077cc\nVMOV.F32        S18, #1.0                                              ; +0x98, 0x5077d0\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x9c, 0x5077d4\nLDR             R3, [R7]                                               ; +0xa0, 0x5077d8\nLDR.W           R8, [R3,#0x2A8]                                        ; +0xa2, 0x5077da\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xa6, 0x5077de\nMOV             R1, R11; int                                           ; +0xaa, 0x5077e2\nLDR.W           R2, [R0,#0x194]                                        ; +0xac, 0x5077e4\nMOV             R0, R6; void *                                         ; +0xb0, 0x5077e8\nLDR.W           R2, [R2,#0x81C]                                        ; +0xb2, 0x5077ea\nLDRB.W          R3, [R2,#0x83A]                                        ; +0xb6, 0x5077ee\nLDRB.W          R10, [R2,#0x83B]                                       ; +0xba, 0x5077f2\nVMOV            S17, R3                                                ; +0xbe, 0x5077f6\nLDRB.W          R3, [R2,#0x83C]                                        ; +0xc2, 0x5077fa\nMOVS            R2, #0x10; size_t                                      ; +0xc6, 0x5077fe\nVMOV            S19, R3                                                ; +0xc8, 0x507800\nBLX             memset                                                 ; +0xcc, 0x507804\nVMOV            S15, R10                                               ; +0xd0, 0x507808\nMOV             R1, R6                                                 ; +0xd4, 0x50780c\nVCVT.F32.S32    S17, S17                                               ; +0xd6, 0x50780e\nMOV             R0, R7                                                 ; +0xda, 0x507812\nVSTR            S18, [SP,#0x3C+var_C]                                  ; +0xdc, 0x507814\nVCVT.F32.S32    S15, S15                                               ; +0xe0, 0x507818\nVDIV.F32        S15, S15, S16                                          ; +0xe4, 0x50781c\nVSTR            S15, [SP,#0x3C+var_14]                                 ; +0xe8, 0x507820\nVCVT.F32.S32    S15, S19                                               ; +0xec, 0x507824\nVDIV.F32        S17, S17, S16                                          ; +0xf0, 0x507828\nVDIV.F32        S15, S15, S16                                          ; +0xf4, 0x50782c\nVSTR            S17, [SP,#0x3C+var_18]                                 ; +0xf8, 0x507830\nVSTR            S15, [SP,#0x3C+var_10]                                 ; +0xfc, 0x507834\nBLX             R8                                                     ; +0x100, 0x507838\nLDR             R3, [R7]                                               ; +0x102, 0x50783a\nLDR.W           R8, [R3,#0x2B8]                                        ; +0x104, 0x50783c\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x108, 0x507840\nMOV             R1, R11; int                                           ; +0x10c, 0x507844\nLDR.W           R2, [R0,#0x194]                                        ; +0x10e, 0x507846\nMOV             R0, R6; void *                                         ; +0x112, 0x50784a\nLDR.W           R2, [R2,#0x81C]                                        ; +0x114, 0x50784c\nLDRB.W          R3, [R2,#0x83A]                                        ; +0x118, 0x507850\nLDRB.W          R10, [R2,#0x83B]                                       ; +0x11c, 0x507854\nVMOV            S17, R3                                                ; +0x120, 0x507858\nLDRB.W          R3, [R2,#0x83C]                                        ; +0x124, 0x50785c\nMOVS            R2, #0x10; size_t                                      ; +0x128, 0x507860\nVMOV            S19, R3                                                ; +0x12a, 0x507862\nBLX             memset                                                 ; +0x12e, 0x507866\nVMOV            S15, R10                                               ; +0x132, 0x50786a\nMOV             R0, R7                                                 ; +0x136, 0x50786e\nVCVT.F32.S32    S17, S17                                               ; +0x138, 0x507870\nMOV             R1, R6                                                 ; +0x13c, 0x507874\nVSTR            S18, [SP,#0x3C+var_C]                                  ; +0x13e, 0x507876\nVCVT.F32.S32    S15, S15                                               ; +0x142, 0x50787a\nVDIV.F32        S15, S15, S16                                          ; +0x146, 0x50787e\nVSTR            S15, [SP,#0x3C+var_14]                                 ; +0x14a, 0x507882\nVCVT.F32.S32    S15, S19                                               ; +0x14e, 0x507886\nVDIV.F32        S17, S17, S16                                          ; +0x152, 0x50788a\nVDIV.F32        S16, S15, S16                                          ; +0x156, 0x50788e\nVSTR            S17, [SP,#0x3C+var_18]                                 ; +0x15a, 0x507892\nVSTR            S16, [SP,#0x3C+var_10]                                 ; +0x15e, 0x507896\nBLX             R8                                                     ; +0x162, 0x50789a\nLDR             R0, =(aGradientbarPng - 0x5078AC); \"gradientBar.png\"   ; +0x164, 0x50789c\nMOVS            R7, #0                                                 ; +0x166, 0x50789e\nVMOV.F32        S17, #1.5                                              ; +0x168, 0x5078a0\nLDR.W           R11, =(aSquare02001Png_0 - 0x5078B2); \"square_02_001.png\" ; +0x16c, 0x5078a4\nADD             R0, PC; \"gradientBar.png\"                              ; +0x170, 0x5078a8\nBL              _ZN7cocos2d8CCSprite25createWithSpriteFrameNameEPKc; cocos2d::CCSprite::createWithSpriteFrameName(char const*) ; +0x172, 0x5078aa\nADD             R11, PC; \"square_02_001.png\"                           ; +0x176, 0x5078ae\nSTR.W           R0, [R4,#0x490]                                        ; +0x178, 0x5078b0\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x17c, 0x5078b4\nLDR.W           R1, [R4,#0x490]                                        ; +0x180, 0x5078b8\nLDR.W           R3, [R0,#0x194]                                        ; +0x184, 0x5078bc\nLDR.W           R0, [R3,#0x6B8]                                        ; +0x188, 0x5078c0\nLDR             R3, [R0]                                               ; +0x18c, 0x5078c4\nLDR.W           R3, [R3,#0xE4]                                         ; +0x18e, 0x5078c6\nBLX             R3                                                     ; +0x192, 0x5078ca\nLDR             R3, =(unk_BECA80 - 0x5078D2)                           ; +0x194, 0x5078cc\nADD             R3, PC; unk_BECA80                                     ; +0x196, 0x5078ce\nLDM.W           R3, {R0,R1}                                            ; +0x198, 0x5078d0\nADD             R3, SP, #0x3C+var_20                                   ; +0x19c, 0x5078d4\nSTM.W           R3, {R0,R1}                                            ; +0x19e, 0x5078d6\nLDR.W           R0, [R4,#0x490]                                        ; +0x1a2, 0x5078da\nLDR             R2, [R0]                                               ; +0x1a6, 0x5078de\nLDR.W           R6, [R2,#0x21C]                                        ; +0x1a8, 0x5078e0\nLDM.W           R3, {R1,R2}                                            ; +0x1ac, 0x5078e4\nBLX             R6                                                     ; +0x1b0, 0x5078e8\nVLDR            S16, [SP,#0x3C+var_24]                                 ; +0x1b2, 0x5078ea\nLDR.W           R0, [R4,#0x490]                                        ; +0x1b6, 0x5078ee\nVMUL.F32        S16, S16, S17                                          ; +0x1ba, 0x5078f2\nLDR             R3, [R0]                                               ; +0x1be, 0x5078f6\nVLDR            S15, [R0,#0x15C]                                       ; +0x1c0, 0x5078f8\nLDR             R3, [R3,#0x48]                                         ; +0x1c4, 0x5078fc\nVDIV.F32        S15, S16, S15                                          ; +0x1c6, 0x5078fe\nVMOV            R1, S15                                                ; +0x1ca, 0x507902\nBLX             R3                                                     ; +0x1ce, 0x507906\nVLDR            S15, [SP,#0x3C+var_24]                                 ; +0x1d0, 0x507908\nVMOV.F32        S16, #30.0                                             ; +0x1d4, 0x50790c\nVMUL.F32        S15, S15, S17                                          ; +0x1d8, 0x507910\nVDIV.F32        S15, S15, S16                                          ; +0x1dc, 0x507914\nVMOV            R0, S15                                                ; +0x1e0, 0x507918\nBLX             lroundf                                                ; +0x1e4, 0x50791c\nADD.W           R3, R0, R0,LSR#31                                      ; +0x1e8, 0x507920\nMOV             R10, R0                                                ; +0x1ec, 0x507924\nASRS            R3, R3, #1                                             ; +0x1ee, 0x507926\nVMOV            S17, R3                                                ; +0x1f0, 0x507928\nCMP             R7, R10                                                ; +0x1f4, 0x50792c\nBGE             loc_507986                                             ; +0x1f6, 0x50792e\nMOV             R0, R11; this                                          ; +0x1f8, 0x507930\nADD.W           R8, SP, #0x3C+var_18                                   ; +0x1fa, 0x507932\nBL              _ZN7cocos2d8CCSprite25createWithSpriteFrameNameEPKc; cocos2d::CCSprite::createWithSpriteFrameName(char const*) ; +0x1fe, 0x507936\nLDR             R3, [R4]                                               ; +0x202, 0x50793a\nLDR.W           R3, [R3,#0xE4]                                         ; +0x204, 0x50793c\nMOV             R6, R0                                                 ; +0x208, 0x507940\nMOV             R0, R4                                                 ; +0x20a, 0x507942\nMOV             R1, R6                                                 ; +0x20c, 0x507944\nBLX             R3                                                     ; +0x20e, 0x507946\nLDR             R3, [R6]                                               ; +0x210, 0x507948\nMOV             R0, R6                                                 ; +0x212, 0x50794a\nLDR             R1, =0xC2B40000                                        ; +0x214, 0x50794c\nLDR.W           R3, [R3,#0xB4]                                         ; +0x216, 0x50794e\nBLX             R3                                                     ; +0x21a, 0x507952\nVMOV            S15, R7                                                ; +0x21c, 0x507954\nVCVT.F32.S32    S14, S17                                               ; +0x220, 0x507958\nLDR             R3, [R6]                                               ; +0x224, 0x50795c\nMOVS            R1, #0; float                                          ; +0x226, 0x50795e\nMOV             R0, R8; this                                           ; +0x228, 0x507960\nADDS            R7, #1                                                 ; +0x22a, 0x507962\nLDR             R3, [R3,#0x5C]                                         ; +0x22c, 0x507964\nSTR             R3, [SP,#0x3C+var_30]                                  ; +0x22e, 0x507966\nVCVT.F32.S32    S15, S15                                               ; +0x230, 0x507968\nVMUL.F32        S15, S15, S16                                          ; +0x234, 0x50796c\nVNMLS.F32       S15, S14, S16                                          ; +0x238, 0x507970\nVMOV            R2, S15; float                                         ; +0x23c, 0x507974\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x240, 0x507978\nMOV             R0, R6                                                 ; +0x244, 0x50797c\nMOV             R1, R8                                                 ; +0x246, 0x50797e\nLDR             R3, [SP,#0x3C+var_30]                                  ; +0x248, 0x507980\nBLX             R3                                                     ; +0x24a, 0x507982\nB               loc_50792C                                             ; +0x24c, 0x507984\nMOVS            R3, #1                                                 ; +0x24e, 0x507986\nSTRB.W          R3, [R4,#0x2F8]                                        ; +0x250, 0x507988\nLDR             R2, [SP,#0x3C+var_8]                                   ; +0x254, 0x50798c\nMOV             R0, R9                                                 ; +0x256, 0x50798e\nLDR             R3, [R5]                                               ; +0x258, 0x507990\nCMP             R2, R3                                                 ; +0x25a, 0x507992\nBEQ             loc_50799A                                             ; +0x25c, 0x507994\nBLX             __stack_chk_fail                                       ; +0x25e, 0x507996\nADD             SP, SP, #0x3C ; '<'                                    ; +0x262, 0x50799a\nVPOP            {D8-D9}                                                ; +0x264, 0x50799c\nPOP.W           {R4-R11,PC}                                            ; +0x268, 0x5079a0", "xrefs": ["EndPortalObject::create @ 0x507de2"], "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"}