{"type": "func", "start": 8927216, "end": 8927892, "name": "GJBaseGameLayer::getSavedPosition", "pseudocode": "// \n// GJBaseGameLayer::getSavedPosition from 0x8837f0 to 0x883a94 (676 bytes)\n// \n// 2 xrefs:\n// > GJBaseGameLayer::processAdvancedFollowAction @ 0x883c04\n// > <???> @ 0x4f158\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\ncocos2d::CCPoint GJBaseGameLayer::getSavedPosition(GJBaseGameLayer *a1, int a2, float a3)\n{\n  cocos2d::CCPoint *v3; // x8\n  cocos2d::CCPoint *v4; // x20\n  double v6; // d0\n  float v7; // s8\n  int v8; // w24\n  GameObject *v9; // x0\n  int m_unk52C; // w22\n  int v11; // w3\n  float v12; // s8\n  int v13; // w2\n  int v14; // w1\n  int v15; // w2\n  int v16; // w1\n  int v17; // w22\n  GameObject *MainObject; // x0\n  PlayerObject *m_player1; // x1\n  const cocos2d::CCPoint *v22; // x0\n  int m_uniqueID; // [xsp+8Ch] [xbp+8Ch] BYREF\n  cocos2d::CCPoint v24; // [xsp+90h] [xbp+90h] BYREF\n  cocos2d::CCPoint v25; // [xsp+98h] [xbp+98h] BYREF\n  __int64 v26; // [xsp+A0h] [xbp+A0h] BYREF\n  cocos2d::CCPoint v27; // [xsp+A8h] [xbp+A8h] BYREF\n  char v28[8]; // [xsp+B0h] [xbp+B0h] BYREF\n  cocos2d::CCPoint result; // 0:s0.4,4:s1.4\n\n  v4 = v3;\n  if ( a3 <= 0.0 )\n  {\n    switch ( a2 )\n    {\n      case -1:\n        m_player1 = a1->m_player1;\n        break;\n      case -2:\n        m_player1 = a1->m_player2;\n        break;\n      case -3:\n        cocos2d::CCPoint::CCPoint(v3, &a1->m_gameState.m_cameraPosition);\n        return result;\n      default:\n        MainObject = GJBaseGameLayer::tryGetMainObject(a1, a2);\n        if ( MainObject )\n        {\n          MainObject->getRealPosition(MainObject);\n          return result;\n        }\n        goto LABEL_17;\n    }\n    v22 = m_player1->getPosition(m_player1);\n    cocos2d::CCPoint::CCPoint(v4, v22);\n    return result;\n  }\n  v6 = a3 / 0.00416666667\n     - (float)((float)(unsigned int)(a1->m_gameState.m_unkUint6 - a1->m_gameState.m_unkUint5) / 1000.0);\n  if ( v6 <= 0.0 )\n  {\n    v7 = 0.0;\n    v8 = 0;\n  }\n  else\n  {\n    v7 = v6;\n    v8 = vcvtps_s32_f32(v7);\n  }\n  if ( a1->m_gameState.m_unkUint11 <= v8 )\n    goto LABEL_17;\n  m_uniqueID = a2;\n  switch ( a2 )\n  {\n    case -1:\n      m_unk52C = a1->m_player1->m_unk52C;\n      goto LABEL_10;\n    case -2:\n      m_unk52C = a1->m_player2->m_unk52C;\n      goto LABEL_10;\n    case -3:\n      m_unk52C = a1->m_gameState.m_unkUint12;\n      goto LABEL_10;\n  }\n  v9 = GJBaseGameLayer::tryGetMainObject(a1, a2);\n  if ( !v9 )\n  {\nLABEL_17:\n    cocos2d::CCPoint::CCPoint(v4, &stru_1242DA8);\n    return result;\n  }\n  m_unk52C = v9->m_unk52C;\n  m_uniqueID = v9->m_uniqueID;\nLABEL_10:\n  if ( m_unk52C < 0 || !sub_855C48(&a1->m_savePositionValues._M_h._M_buckets, m_uniqueID) )\n    goto LABEL_17;\n  v11 = *(_DWORD *)std::__detail::_Map_base<int,std::pair<int const,int>,std::allocator<std::pair<int const,int>>,std::__detail::_Select1st,std::equal_to<int>,std::hash<int>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<false,false,true>,true>::operator[](\n                     &a1->m_savePositionValues._M_h._M_buckets,\n                     &m_uniqueID);\n  v12 = (float)v8 - v7;\n  v13 = a1->m_gameState.m_unkUint11 % v11 - v8;\n  if ( v13 < 0 )\n    v13 += v11;\n  v14 = v13 + m_unk52C;\n  v15 = v13 + 1;\n  v16 = 2 * v14;\n  if ( v11 <= v15 )\n    v15 = 0;\n  v17 = 2 * (v15 + m_unk52C);\n  cocos2d::CCPoint::CCPoint(\n    &v24,\n    a1->m_gameState.m_unkVecFloat1.m_start[v16],\n    a1->m_gameState.m_unkVecFloat1.m_start[v16 + 1]);\n  cocos2d::CCPoint::CCPoint(\n    &v25,\n    a1->m_gameState.m_unkVecFloat1.m_start[v17],\n    a1->m_gameState.m_unkVecFloat1.m_start[v17 + 1]);\n  cocos2d::CCPoint::operator-(&v26, &v25, &v24);\n  cocos2d::CCPoint::operator*(&v26, v12);\n  cocos2d::CCPoint::operator+(&v27, &v24, v28);\n  cocos2d::CCPoint::CCPoint(v4, &v27);\n  return result;\n}", "assembly": "; \n; GJBaseGameLayer::getSavedPosition from 0x8837f0 to 0x883a94 (676 bytes)\n; \n; 2 xrefs:\n; > GJBaseGameLayer::processAdvancedFollowAction @ 0x883c04\n; > <???> @ 0x4f158\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\nSTP             X29, X30, [SP,#var_C0]!                                ; +0x0, 0x8837f0\nFCMPE           S0, #0.0                                               ; +0x4, 0x8837f4\nMOV             W2, W1                                                 ; +0x8, 0x8837f8\nMOV             X29, SP                                                ; +0xc, 0x8837fc\nSTP             X19, X20, [SP,#0xC0+var_B0]                            ; +0x10, 0x883800\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0x14, 0x883804\nMOV             X20, X8                                                ; +0x18, 0x883808\nSTP             X21, X22, [SP,#0xC0+var_A0]                            ; +0x1c, 0x88380c\nSTP             X23, X24, [SP,#0xC0+var_90]                            ; +0x20, 0x883810\nLDR             X3, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x24, 0x883814\nMOV             X21, X0                                                ; +0x28, 0x883818\nSTP             X25, X26, [SP,#0xC0+var_80]                            ; +0x2c, 0x88381c\nSTP             X27, X28, [SP,#0xC0+var_70]                            ; +0x30, 0x883820\nLDR             X3, [X3]                                               ; +0x34, 0x883824\nSTR             X3, [X29,#0xC0+var_8]                                  ; +0x38, 0x883828\nSTR             D8, [SP,#0xC0+var_60]                                  ; +0x3c, 0x88382c\nB.LS            loc_8839F4                                             ; +0x40, 0x883830\nFCVT            D0, S0                                                 ; +0x44, 0x883834\nLDR             W0, [X0,#0x3E4]                                        ; +0x48, 0x883838\nLDR             D1, =0x3F71111111111111                                ; +0x4c, 0x88383c\nLDR             W1, [X21,#0x3E0]                                       ; +0x50, 0x883840\nSUB             W0, W0, W1                                             ; +0x54, 0x883844\nFDIV            D1, D0, D1                                             ; +0x58, 0x883848\nUCVTF           S2, W0                                                 ; +0x5c, 0x88384c\nLDR             S0, =0x447A0000                                        ; +0x60, 0x883850\nFDIV            S0, S2, S0                                             ; +0x64, 0x883854\nFCVT            D0, S0                                                 ; +0x68, 0x883858\nFSUB            D0, D1, D0                                             ; +0x6c, 0x88385c\nFCMPE           D0, #0.0                                               ; +0x70, 0x883860\nB.LE            loc_883A3C                                             ; +0x74, 0x883864\nFCVT            S8, D0                                                 ; +0x78, 0x883868\nFCVTPS          W24, S8                                                ; +0x7c, 0x88386c\nLDR             W0, [X21,#0x4B4]                                       ; +0x80, 0x883870\nCMP             W0, W24                                                ; +0x84, 0x883874\nB.LE            loc_8839A8                                             ; +0x88, 0x883878\nSTR             W2, [X29,#0xC0+var_34]                                 ; +0x8c, 0x88387c\nCMN             W2, #1                                                 ; +0x90, 0x883880\nB.EQ            loc_883A28                                             ; +0x94, 0x883884\nCMN             W2, #2                                                 ; +0x98, 0x883888\nB.EQ            loc_883A48                                             ; +0x9c, 0x88388c\nCMN             W2, #3                                                 ; +0xa0, 0x883890\nB.EQ            loc_883A34                                             ; +0xa4, 0x883894\nMOV             X0, X21; this                                          ; +0xa8, 0x883898\nMOV             W1, W2; int                                            ; +0xac, 0x88389c\nBL              _ZN15GJBaseGameLayer16tryGetMainObjectEi; GJBaseGameLayer::tryGetMainObject(int) ; +0xb0, 0x8838a0\nCBZ             X0, loc_8839A8                                         ; +0xb4, 0x8838a4\nLDR             W1, [X0,#0x384]                                        ; +0xb8, 0x8838a8\nLDR             W22, [X0,#0x52C]                                       ; +0xbc, 0x8838ac\nSTR             W1, [X29,#0xC0+var_34]                                 ; +0xc0, 0x8838b0\nTBNZ            W22, #0x1F, loc_8839A8                                 ; +0xc4, 0x8838b4\nADD             X23, X21, #3,LSL#12                                    ; +0xc8, 0x8838b8\nLDR             W1, [X29,#0xC0+var_34]                                 ; +0xcc, 0x8838bc\nADD             X23, X23, #0x4F0                                       ; +0xd0, 0x8838c0\nMOV             X0, X23                                                ; +0xd4, 0x8838c4\nBL              sub_855C48                                             ; +0xd8, 0x8838c8\nCBZ             X0, loc_8839A8                                         ; +0xdc, 0x8838cc\nADD             X1, X29, #0xC0+var_34                                  ; +0xe0, 0x8838d0\nMOV             X0, X23                                                ; +0xe4, 0x8838d4\nADD             X23, X29, #0xC0+var_30                                 ; +0xe8, 0x8838d8\nADD             X28, X29, #0xC0+var_28                                 ; +0xec, 0x8838dc\nBL              _ZNSt8__detail9_Map_baseIiSt4pairIKiiESaIS3_ENS_10_Select1stESt8equal_toIiESt4hashIiENS_18_Mod_range_hashingENS_20_Default_ranged_hashENS_20_Prime_rehash_policyENS_17_Hashtable_traitsILb0ELb0ELb1EEELb1EEixERS2_; std::__detail::_Map_base<int,std::pair<int const,int>,std::allocator<std::pair<int const,int>>,std::__detail::_Select1st,std::equal_to<int>,std::hash<int>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<false,false,true>,true>::operator[](int const&) ; +0xf0, 0x8838e0\nLDR             W3, [X0]                                               ; +0xf4, 0x8838e4\nLDR             W1, [X21,#0x4B4]                                       ; +0xf8, 0x8838e8\nMOV             X0, X23; this                                          ; +0xfc, 0x8838ec\nSCVTF           S1, W24                                                ; +0x100, 0x8838f0\nLDR             X4, [X21,#0x498]                                       ; +0x104, 0x8838f4\nADD             X27, X29, #0xC0+var_20                                 ; +0x108, 0x8838f8\nADD             X26, X29, #0xC0+var_10                                 ; +0x10c, 0x8838fc\nSDIV            W2, W1, W3                                             ; +0x110, 0x883900\nADD             X25, X29, #0xC0+var_18                                 ; +0x114, 0x883904\nFSUB            S8, S1, S8                                             ; +0x118, 0x883908\nMSUB            W2, W2, W3, W1                                         ; +0x11c, 0x88390c\nSUB             W2, W2, W24                                            ; +0x120, 0x883910\nADD             W1, W2, W3                                             ; +0x124, 0x883914\nCMP             W2, WZR                                                ; +0x128, 0x883918\nCSEL            W2, W1, W2, LT                                         ; +0x12c, 0x88391c\nADD             W1, W2, W22                                            ; +0x130, 0x883920\nADD             W2, W2, #1                                             ; +0x134, 0x883924\nLSL             W1, W1, #1                                             ; +0x138, 0x883928\nCMP             W3, W2                                                 ; +0x13c, 0x88392c\nADD             W3, W1, #1                                             ; +0x140, 0x883930\nCSEL            W2, W2, WZR, GT                                        ; +0x144, 0x883934\nLDR             S0, [X4,W1,SXTW#2]; float                              ; +0x148, 0x883938\nADD             W2, W2, W22                                            ; +0x14c, 0x88393c\nLDR             S1, [X4,W3,SXTW#2]; float                              ; +0x150, 0x883940\nLSL             W22, W2, #1                                            ; +0x154, 0x883944\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x158, 0x883948\nLDR             X1, [X21,#0x498]                                       ; +0x15c, 0x88394c\nADD             W3, W22, #1                                            ; +0x160, 0x883950\nMOV             X0, X28; this                                          ; +0x164, 0x883954\nLDR             S1, [X1,W3,SXTW#2]; float                              ; +0x168, 0x883958\nLDR             S0, [X1,W22,SXTW#2]; float                             ; +0x16c, 0x88395c\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x170, 0x883960\nMOV             X1, X23                                                ; +0x174, 0x883964\nMOV             X8, X27                                                ; +0x178, 0x883968\nMOV             X0, X28                                                ; +0x17c, 0x88396c\nBL              _ZNK7cocos2d7CCPointmiERKS0_; cocos2d::CCPoint::operator-(cocos2d::CCPoint const&) ; +0x180, 0x883970\nSTR             X26, [X29,#0xC0+var_48]                                ; +0x184, 0x883974\nFMOV            S0, S8                                                 ; +0x188, 0x883978\nMOV             X8, X26                                                ; +0x18c, 0x88397c\nMOV             X0, X27                                                ; +0x190, 0x883980\nBL              _ZNK7cocos2d7CCPointmlEf; cocos2d::CCPoint::operator*(float) ; +0x194, 0x883984\nLDR             X1, [X29,#0xC0+var_48]                                 ; +0x198, 0x883988\nMOV             X0, X23                                                ; +0x19c, 0x88398c\nMOV             X8, X25                                                ; +0x1a0, 0x883990\nBL              _ZNK7cocos2d7CCPointplERKS0_; cocos2d::CCPoint::operator+(cocos2d::CCPoint const&) ; +0x1a4, 0x883994\nMOV             X0, X20; this                                          ; +0x1a8, 0x883998\nMOV             X1, X25; cocos2d::CCPoint *                            ; +0x1ac, 0x88399c\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x1b0, 0x8839a0\nB               loc_8839BC                                             ; +0x1b4, 0x8839a4\nADRP            X1, #qword_1242DA0@PAGE                                ; +0x1b8, 0x8839a8\nMOV             X0, X20; this                                          ; +0x1bc, 0x8839ac\nADD             X1, X1, #qword_1242DA0@PAGEOFF                         ; +0x1c0, 0x8839b0\nADD             X1, X1, #8; cocos2d::CCPoint *                         ; +0x1c4, 0x8839b4\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x1c8, 0x8839b8\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1cc, 0x8839bc\nMOV             X0, X20; this                                          ; +0x1d0, 0x8839c0\nLDR             X2, [X29,#0xC0+var_8]                                  ; +0x1d4, 0x8839c4\nLDR             X1, [X19]; int                                         ; +0x1d8, 0x8839c8\nCMP             X2, X1                                                 ; +0x1dc, 0x8839cc\nB.NE            loc_883A90                                             ; +0x1e0, 0x8839d0\nLDP             X19, X20, [SP,#0xC0+var_B0]                            ; +0x1e4, 0x8839d4\nLDP             X21, X22, [SP,#0xC0+var_A0]                            ; +0x1e8, 0x8839d8\nLDP             X23, X24, [SP,#0xC0+var_90]                            ; +0x1ec, 0x8839dc\nLDP             X25, X26, [SP,#0xC0+var_80]                            ; +0x1f0, 0x8839e0\nLDP             X27, X28, [SP,#0xC0+var_70]                            ; +0x1f4, 0x8839e4\nLDR             D8, [SP,#0xC0+var_60]                                  ; +0x1f8, 0x8839e8\nLDP             X29, X30, [SP+0xC0+var_C0],#0xC0                       ; +0x1fc, 0x8839ec\nRET                                                                    ; +0x200, 0x8839f0\nCMN             W1, #1                                                 ; +0x204, 0x8839f4\nB.EQ            loc_883A64                                             ; +0x208, 0x8839f8\nCMN             W1, #2                                                 ; +0x20c, 0x8839fc\nB.EQ            loc_883A88                                             ; +0x210, 0x883a00\nCMN             W1, #3                                                 ; +0x214, 0x883a04\nB.EQ            loc_883A54                                             ; +0x218, 0x883a08\nBL              _ZN15GJBaseGameLayer16tryGetMainObjectEi; GJBaseGameLayer::tryGetMainObject(int) ; +0x21c, 0x883a0c\nCBZ             X0, loc_8839A8                                         ; +0x220, 0x883a10\nLDR             X1, [X0]                                               ; +0x224, 0x883a14\nMOV             X8, X20                                                ; +0x228, 0x883a18\nLDR             X1, [X1,#0x540]                                        ; +0x22c, 0x883a1c\nBLR             X1                                                     ; +0x230, 0x883a20\nB               loc_8839BC                                             ; +0x234, 0x883a24\nLDR             X0, [X21,#0xDF8]                                       ; +0x238, 0x883a28\nLDR             W22, [X0,#0x52C]                                       ; +0x23c, 0x883a2c\nB               loc_8838B4                                             ; +0x240, 0x883a30\nLDR             W22, [X21,#0x4B8]                                      ; +0x244, 0x883a34\nB               loc_8838B4                                             ; +0x248, 0x883a38\nFMOV            S8, WZR                                                ; +0x24c, 0x883a3c\nMOV             W24, #0                                                ; +0x250, 0x883a40\nB               loc_883870                                             ; +0x254, 0x883a44\nLDR             X0, [X21,#0xE00]                                       ; +0x258, 0x883a48\nLDR             W22, [X0,#0x52C]                                       ; +0x25c, 0x883a4c\nB               loc_8838B4                                             ; +0x260, 0x883a50\nMOV             X0, X8; this                                           ; +0x264, 0x883a54\nADD             X1, X21, #0x400; cocos2d::CCPoint *                    ; +0x268, 0x883a58\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x26c, 0x883a5c\nB               loc_8839BC                                             ; +0x270, 0x883a60\nLDR             X1, [X0,#0xDF8]                                        ; +0x274, 0x883a64\nMOV             X0, X1                                                 ; +0x278, 0x883a68\nLDR             X1, [X1]                                               ; +0x27c, 0x883a6c\nLDR             X1, [X1,#0xC0]                                         ; +0x280, 0x883a70\nBLR             X1                                                     ; +0x284, 0x883a74\nMOV             X1, X0; cocos2d::CCPoint *                             ; +0x288, 0x883a78\nMOV             X0, X20; this                                          ; +0x28c, 0x883a7c\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x290, 0x883a80\nB               loc_8839BC                                             ; +0x294, 0x883a84\nLDR             X1, [X0,#0xE00]                                        ; +0x298, 0x883a88\nB               loc_883A68                                             ; +0x29c, 0x883a8c\nBL              .__stack_chk_fail                                      ; +0x2a0, 0x883a90", "xrefs": ["GJBaseGameLayer::processAdvancedFollowAction @ 0x883c04", "<???> @ 0x4f158"], "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"}