{"type": "func", "start": 4299156680, "end": 4299157316, "name": "EndPortalObject::updateEndPos", "pseudocode": "// \n// EndPortalObject::updateEndPos from 0x1003fecc8 to 0x1003fef44 (636 bytes)\n// \n// 2 xrefs:\n// > PlayLayer::checkForEnd @ 0x10011f7d4\n// > EndPortalObject::setVisible @ 0x1003fecb4\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\nvoid __fastcall EndPortalObject::updateEndPos(EndPortalObject *a1, bool a2)\n{\n  _BOOL4 v2; // w20\n  cocos2d::CCDirector *v4; // x0\n  __n128 v5; // q0\n  float v6; // s8\n  bool m_isShip; // w21\n  float y; // s8\n  bool v9; // cc\n  float v10; // s8\n  __n128 v11; // q0\n  __n128 v12; // q1\n  cocos2d::CCParticleSystemQuad *m_particle; // x21\n  float v14; // s8\n  GameManager *v15; // x0\n  float v16; // s10\n  GameManager *v17; // x0\n  GameManager *v18; // x0\n  cocos2d::CCSprite *m_gradientBar; // x20\n  float v20; // s10\n  GameManager *v21; // x0\n  __n128 v22; // q0\n  __int64 v23; // x0\n  __int64 v24; // [xsp+8h] [xbp-58h] BYREF\n  __int64 v25; // [xsp+10h] [xbp-50h] BYREF\n  float v26; // [xsp+1Ch] [xbp-44h]\n  cocos2d::CCSize WinSize; // 0:kr00_8.8\n\n  v2 = a2;\n  v4 = cocos2d::CCDirector::sharedDirector();\n  WinSize = cocos2d::CCDirector::getWinSize(v4);\n  if ( a1->m_startPosHeightRelated )\n  {\n    ((void (__fastcall *)(__int64 *__return_ptr, EndPortalObject *, float, float))a1->getStartPos)(\n      &v25,\n      a1,\n      WinSize.width,\n      WinSize.height);\n    v5.n128_u32[0] = HIDWORD(v25);\n    v6 = 225.0;\n    if ( *((float *)&v25 + 1) > 225.0 )\n    {\n      ((void (__fastcall *)(__int64 *__return_ptr, EndPortalObject *, float))a1->getStartPos)(\n        &v24,\n        a1,\n        *((float *)&v25 + 1));\n      v6 = *((float *)&v24 + 1);\n    }\n  }\n  else\n  {\n    m_isShip = GameManager::sharedState()->m_playLayer->m_player1->m_isShip;\n    y = GameManager::sharedState()->m_playLayer->m_gameState.m_cameraPosition2.y;\n    v5.n128_f32[0] = (float)(v26 * 0.5) / GameManager::sharedState()->m_playLayer->m_gameState.m_cameraZoom;\n    v6 = y + v5.n128_f32[0];\n    if ( !m_isShip )\n    {\n      v5.n128_u32[0] = 1130430464;\n      v9 = v6 <= 225.0;\n      v6 = 225.0;\n      if ( !v9 )\n      {\n        v10 = GameManager::sharedState()->m_playLayer->m_gameState.m_cameraPosition2.y;\n        v5.n128_f32[0] = (float)(v26 * 0.5) / GameManager::sharedState()->m_playLayer->m_gameState.m_cameraZoom;\n        v6 = v10 + v5.n128_f32[0];\n      }\n    }\n  }\n  v11.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(EndPortalObject *, __n128))a1->getPosition)(a1, v5);\n  v12.n128_f32[0] = v6;\n  sub_100022980(v11, v12, &v25);\n  ((void (__fastcall *)(EndPortalObject *, __int64 *))a1->setStartPos)(a1, &v25);\n  m_particle = a1->m_particle;\n  if ( m_particle )\n  {\n    if ( v2 )\n    {\n      ((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))m_particle->update)(a1->m_particle, 1.0);\n      m_particle = a1->m_particle;\n    }\n    if ( a1->m_flippedX )\n      v14 = -1.0;\n    else\n      v14 = 1.0;\n    v15 = GameManager::sharedState();\n    ((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, float))m_particle->setScale)(\n      m_particle,\n      v14 / v15->m_playLayer->m_gameState.m_targetCameraZoom);\n  }\n  if ( a1->m_flippedX )\n    v16 = -1.0;\n  else\n    v16 = 1.0;\n  v17 = GameManager::sharedState();\n  ((void (__fastcall *)(EndPortalObject *, float))a1->setScaleX)(\n    a1,\n    v16 / v17->m_playLayer->m_gameState.m_targetCameraZoom);\n  v18 = GameManager::sharedState();\n  ((void (__fastcall *)(EndPortalObject *, float))a1->setScaleY)(\n    a1,\n    1.0 / v18->m_playLayer->m_gameState.m_targetCameraZoom);\n  m_gradientBar = a1->m_gradientBar;\n  if ( m_gradientBar )\n  {\n    v20 = v26;\n    v21 = GameManager::sharedState();\n    ((void (__fastcall *)(cocos2d::CCSprite *, float))m_gradientBar->setScaleY)(\n      m_gradientBar,\n      (float)((float)(v20 / v21->m_playLayer->m_gameState.m_targetCameraZoom) * 1.5)\n    / a1->m_gradientBar->m_obRect.size.height);\n    if ( a1->m_flippedX )\n      v22.n128_f32[0] = -1.0;\n    else\n      v22.n128_f32[0] = 1.0;\n    ((void (__fastcall *)(cocos2d::CCSprite *, __n128))a1->m_gradientBar->setScaleX)(a1->m_gradientBar, v22);\n  }\n  v23 = ((__int64 (__fastcall *)(EndPortalObject *))a1->getPosition)(a1);\n  ((void (__fastcall *)(EndPortalObject *, __int64))a1->setPosition)(a1, v23);\n}", "assembly": "; \n; EndPortalObject::updateEndPos from 0x1003fecc8 to 0x1003fef44 (636 bytes)\n; \n; 2 xrefs:\n; > PlayLayer::checkForEnd @ 0x10011f7d4\n; > EndPortalObject::setVisible @ 0x1003fecb4\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, #0x70                                          ; +0x0, 0x1003fecc8\nSTP             D11, D10, [SP,#0x60+var_40]                            ; +0x4, 0x1003feccc\nSTP             D9, D8, [SP,#0x60+var_30]                              ; +0x8, 0x1003fecd0\nSTP             X22, X21, [SP,#0x60+var_20]                            ; +0xc, 0x1003fecd4\nSTP             X20, X19, [SP,#0x60+var_10]                            ; +0x10, 0x1003fecd8\nSTP             X29, X30, [SP,#0x60+var_s0]                            ; +0x14, 0x1003fecdc\nADD             X29, SP, #0x60                                         ; +0x18, 0x1003fece0\nMOV             X20, X1                                                ; +0x1c, 0x1003fece4\nMOV             X19, X0                                                ; +0x20, 0x1003fece8\nBL              cocos2d__CCDirector__sharedDirector                    ; +0x24, 0x1003fecec\nADD             X8, SP, #0x60+var_48                                   ; +0x28, 0x1003fecf0\nBL              cocos2d__CCDirector__getWinSize                        ; +0x2c, 0x1003fecf4\nLDRB            W8, [X19,#0x551]                                       ; +0x30, 0x1003fecf8\nCMP             W8, #1                                                 ; +0x34, 0x1003fecfc\nB.NE            loc_1003FED48                                          ; +0x38, 0x1003fed00\nLDR             X8, [X19]                                              ; +0x3c, 0x1003fed04\nLDR             X9, [X8,#0x708]                                        ; +0x40, 0x1003fed08\nADD             X8, SP, #0x60+var_50                                   ; +0x44, 0x1003fed0c\nMOV             X0, X19                                                ; +0x48, 0x1003fed10\nBLR             X9                                                     ; +0x4c, 0x1003fed14\nLDR             S0, [SP,#0x60+var_4C]                                  ; +0x50, 0x1003fed18\nMOV             W8, #0x43610000                                        ; +0x54, 0x1003fed1c\nFMOV            S8, W8                                                 ; +0x58, 0x1003fed20\nFCMP            S0, S8                                                 ; +0x5c, 0x1003fed24\nB.LE            loc_1003FEDC8                                          ; +0x60, 0x1003fed28\nLDR             X8, [X19]                                              ; +0x64, 0x1003fed2c\nLDR             X9, [X8,#0x708]                                        ; +0x68, 0x1003fed30\nADD             X8, SP, #0x60+var_58                                   ; +0x6c, 0x1003fed34\nMOV             X0, X19                                                ; +0x70, 0x1003fed38\nBLR             X9                                                     ; +0x74, 0x1003fed3c\nLDR             S8, [SP,#0x60+var_54]                                  ; +0x78, 0x1003fed40\nB               loc_1003FEDC8                                          ; +0x7c, 0x1003fed44\nBL              GameManager__sharedState                               ; +0x80, 0x1003fed48\nLDR             X8, [X0,#0x1F8]                                        ; +0x84, 0x1003fed4c\nLDR             X8, [X8,#0xCC8]                                        ; +0x88, 0x1003fed50\nLDRB            W21, [X8,#0x971]                                       ; +0x8c, 0x1003fed54\nBL              GameManager__sharedState                               ; +0x90, 0x1003fed58\nLDR             X8, [X0,#0x1F8]                                        ; +0x94, 0x1003fed5c\nLDR             S8, [X8,#0x4B8]                                        ; +0x98, 0x1003fed60\nLDR             S0, [SP,#0x60+var_44]                                  ; +0x9c, 0x1003fed64\nFMOV            S1, #0.5                                               ; +0xa0, 0x1003fed68\nFMUL            S9, S0, S1                                             ; +0xa4, 0x1003fed6c\nBL              GameManager__sharedState                               ; +0xa8, 0x1003fed70\nLDR             X8, [X0,#0x1F8]                                        ; +0xac, 0x1003fed74\nLDR             S0, [X8,#0x1A8]                                        ; +0xb0, 0x1003fed78\nFDIV            S0, S9, S0                                             ; +0xb4, 0x1003fed7c\nFADD            S8, S8, S0                                             ; +0xb8, 0x1003fed80\nTBNZ            W21, #0, loc_1003FEDC8                                 ; +0xbc, 0x1003fed84\nMOV             W8, #0x43610000                                        ; +0xc0, 0x1003fed88\nFMOV            S0, W8                                                 ; +0xc4, 0x1003fed8c\nFCMP            S8, S0                                                 ; +0xc8, 0x1003fed90\nFMOV            S8, S0                                                 ; +0xcc, 0x1003fed94\nB.LE            loc_1003FEDC8                                          ; +0xd0, 0x1003fed98\nBL              GameManager__sharedState                               ; +0xd4, 0x1003fed9c\nLDR             X8, [X0,#0x1F8]                                        ; +0xd8, 0x1003feda0\nLDR             S8, [X8,#0x4B8]                                        ; +0xdc, 0x1003feda4\nLDR             S0, [SP,#0x60+var_44]                                  ; +0xe0, 0x1003feda8\nFMOV            S1, #0.5                                               ; +0xe4, 0x1003fedac\nFMUL            S9, S0, S1                                             ; +0xe8, 0x1003fedb0\nBL              GameManager__sharedState                               ; +0xec, 0x1003fedb4\nLDR             X8, [X0,#0x1F8]                                        ; +0xf0, 0x1003fedb8\nLDR             S0, [X8,#0x1A8]                                        ; +0xf4, 0x1003fedbc\nFDIV            S0, S9, S0                                             ; +0xf8, 0x1003fedc0\nFADD            S8, S8, S0                                             ; +0xfc, 0x1003fedc4\nLDR             X8, [X19]                                              ; +0x100, 0x1003fedc8\nLDR             X8, [X8,#0xC0]                                         ; +0x104, 0x1003fedcc\nMOV             X0, X19                                                ; +0x108, 0x1003fedd0\nBLR             X8                                                     ; +0x10c, 0x1003fedd4\nLDR             S0, [X0]                                               ; +0x110, 0x1003fedd8\nADD             X0, SP, #0x60+var_50                                   ; +0x114, 0x1003feddc\nFMOV            S1, S8                                                 ; +0x118, 0x1003fede0\nBL              sub_100022980                                          ; +0x11c, 0x1003fede4\nLDR             X8, [X19]                                              ; +0x120, 0x1003fede8\nLDR             X8, [X8,#0x548]                                        ; +0x124, 0x1003fedec\nADD             X1, SP, #0x60+var_50                                   ; +0x128, 0x1003fedf0\nMOV             X0, X19                                                ; +0x12c, 0x1003fedf4\nBLR             X8                                                     ; +0x130, 0x1003fedf8\nLDR             X21, [X19,#0x308]                                      ; +0x134, 0x1003fedfc\nCBZ             X21, loc_1003FEE54                                     ; +0x138, 0x1003fee00\nCBZ             W20, loc_1003FEE20                                     ; +0x13c, 0x1003fee04\nLDR             X8, [X21]                                              ; +0x140, 0x1003fee08\nLDR             X8, [X8,#0x28]                                         ; +0x144, 0x1003fee0c\nFMOV            S0, #1.0                                               ; +0x148, 0x1003fee10\nMOV             X0, X21                                                ; +0x14c, 0x1003fee14\nBLR             X8                                                     ; +0x150, 0x1003fee18\nLDR             X21, [X19,#0x308]                                      ; +0x154, 0x1003fee1c\nLDRB            W8, [X19,#0x550]                                       ; +0x158, 0x1003fee20\nCMP             W8, #0                                                 ; +0x15c, 0x1003fee24\nFMOV            S0, #1.0                                               ; +0x160, 0x1003fee28\nFMOV            S1, #-1.0                                              ; +0x164, 0x1003fee2c\nFCSEL           S8, S1, S0, NE                                         ; +0x168, 0x1003fee30\nBL              GameManager__sharedState                               ; +0x16c, 0x1003fee34\nLDR             X8, [X0,#0x1F8]                                        ; +0x170, 0x1003fee38\nLDR             S0, [X8,#0x1AC]                                        ; +0x174, 0x1003fee3c\nFDIV            S0, S8, S0                                             ; +0x178, 0x1003fee40\nLDR             X8, [X21]                                              ; +0x17c, 0x1003fee44\nLDR             X8, [X8,#0xA0]                                         ; +0x180, 0x1003fee48\nMOV             X0, X21                                                ; +0x184, 0x1003fee4c\nBLR             X8                                                     ; +0x188, 0x1003fee50\nLDRB            W8, [X19,#0x550]                                       ; +0x18c, 0x1003fee54\nCMP             W8, #0                                                 ; +0x190, 0x1003fee58\nFMOV            S8, #1.0                                               ; +0x194, 0x1003fee5c\nFMOV            S9, #-1.0                                              ; +0x198, 0x1003fee60\nFCSEL           S10, S9, S8, NE                                        ; +0x19c, 0x1003fee64\nBL              GameManager__sharedState                               ; +0x1a0, 0x1003fee68\nLDR             X8, [X0,#0x1F8]                                        ; +0x1a4, 0x1003fee6c\nLDR             S0, [X8,#0x1AC]                                        ; +0x1a8, 0x1003fee70\nFDIV            S0, S10, S0                                            ; +0x1ac, 0x1003fee74\nLDR             X8, [X19]                                              ; +0x1b0, 0x1003fee78\nLDR             X8, [X8,#0x80]                                         ; +0x1b4, 0x1003fee7c\nMOV             X0, X19                                                ; +0x1b8, 0x1003fee80\nBLR             X8                                                     ; +0x1bc, 0x1003fee84\nBL              GameManager__sharedState                               ; +0x1c0, 0x1003fee88\nLDR             X8, [X0,#0x1F8]                                        ; +0x1c4, 0x1003fee8c\nLDR             S0, [X8,#0x1AC]                                        ; +0x1c8, 0x1003fee90\nFDIV            S0, S8, S0                                             ; +0x1cc, 0x1003fee94\nLDR             X8, [X19]                                              ; +0x1d0, 0x1003fee98\nLDR             X8, [X8,#0x90]                                         ; +0x1d4, 0x1003fee9c\nMOV             X0, X19                                                ; +0x1d8, 0x1003feea0\nBLR             X8                                                     ; +0x1dc, 0x1003feea4\nLDR             X20, [X19,#0x548]                                      ; +0x1e0, 0x1003feea8\nCBZ             X20, loc_1003FEF04                                     ; +0x1e4, 0x1003feeac\nLDR             S10, [SP,#0x60+var_44]                                 ; +0x1e8, 0x1003feeb0\nBL              GameManager__sharedState                               ; +0x1ec, 0x1003feeb4\nLDR             X8, [X0,#0x1F8]                                        ; +0x1f0, 0x1003feeb8\nLDR             S0, [X8,#0x1AC]                                        ; +0x1f4, 0x1003feebc\nFDIV            S0, S10, S0                                            ; +0x1f8, 0x1003feec0\nFMOV            S1, #1.5                                               ; +0x1fc, 0x1003feec4\nFMUL            S0, S0, S1                                             ; +0x200, 0x1003feec8\nLDR             X8, [X19,#0x548]                                       ; +0x204, 0x1003feecc\nLDR             S1, [X8,#0x1B4]                                        ; +0x208, 0x1003feed0\nFDIV            S0, S0, S1                                             ; +0x20c, 0x1003feed4\nLDR             X8, [X20]                                              ; +0x210, 0x1003feed8\nLDR             X8, [X8,#0x90]                                         ; +0x214, 0x1003feedc\nMOV             X0, X20                                                ; +0x218, 0x1003feee0\nBLR             X8                                                     ; +0x21c, 0x1003feee4\nLDR             X0, [X19,#0x548]                                       ; +0x220, 0x1003feee8\nLDRB            W8, [X19,#0x550]                                       ; +0x224, 0x1003feeec\nCMP             W8, #0                                                 ; +0x228, 0x1003feef0\nFCSEL           S0, S9, S8, NE                                         ; +0x22c, 0x1003feef4\nLDR             X8, [X0]                                               ; +0x230, 0x1003feef8\nLDR             X8, [X8,#0x80]                                         ; +0x234, 0x1003feefc\nBLR             X8                                                     ; +0x238, 0x1003fef00\nLDR             X8, [X19]                                              ; +0x23c, 0x1003fef04\nLDR             X8, [X8,#0xC0]                                         ; +0x240, 0x1003fef08\nMOV             X0, X19                                                ; +0x244, 0x1003fef0c\nBLR             X8                                                     ; +0x248, 0x1003fef10\nMOV             X1, X0                                                 ; +0x24c, 0x1003fef14\nLDR             X8, [X19]                                              ; +0x250, 0x1003fef18\nLDR             X8, [X8,#0xB8]                                         ; +0x254, 0x1003fef1c\nMOV             X0, X19                                                ; +0x258, 0x1003fef20\nBLR             X8                                                     ; +0x25c, 0x1003fef24\nLDP             X29, X30, [SP,#0x60+var_s0]                            ; +0x260, 0x1003fef28\nLDP             X20, X19, [SP,#0x60+var_10]                            ; +0x264, 0x1003fef2c\nLDP             X22, X21, [SP,#0x60+var_20]                            ; +0x268, 0x1003fef30\nLDP             D9, D8, [SP,#0x60+var_30]                              ; +0x26c, 0x1003fef34\nLDP             D11, D10, [SP,#0x60+var_40]                            ; +0x270, 0x1003fef38\nADD             SP, SP, #0x70 ; 'p'                                    ; +0x274, 0x1003fef3c\nRET                                                                    ; +0x278, 0x1003fef40", "xrefs": ["PlayLayer::checkForEnd @ 0x10011f7d4", "EndPortalObject::setVisible @ 0x1003fecb4"], "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"}