{"type": "func", "start": 8770368, "end": 8770544, "name": "GJBaseGameLayer::getPortalTarget", "pseudocode": "// \n// GJBaseGameLayer::getPortalTarget from 0x85d340 to 0x85d3f0 (176 bytes)\n// \n// 2 xrefs:\n// > GJBaseGameLayer::teleportPlayer @ 0x889c24\n// > <???> @ 0x62da8\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\nTeleportPortalObject *GJBaseGameLayer::getPortalTarget(GJBaseGameLayer *a1, TeleportPortalObject *a2)\n{\n  TeleportPortalObject *m_orangePortal; // x2\n  int m_targetGroupID; // w1\n  cocos2d::CCArray *Group; // x19\n  int v6; // w0\n  float v7; // s0\n\n  m_orangePortal = a2->m_orangePortal;\n  if ( m_orangePortal )\n    return m_orangePortal;\n  m_targetGroupID = a2->m_targetGroupID;\n  if ( m_targetGroupID <= 0 )\n    return nullptr;\n  Group = GJBaseGameLayer::getGroup(a1, m_targetGroupID);\n  v6 = cocos2d::CCArray::count(Group);\n  if ( v6 <= 0 )\n    return nullptr;\n  if ( v6 == 1\n    || (qword_1242DA0 = 214013 * qword_1242DA0 + 2531011,\n        v7 = (float)(((unsigned __int64)qword_1242DA0 >> 16) & 0x7FFF) / 32767.0,\n        v7 == 1.0) )\n  {\n    v7 = 0.0;\n  }\n  return (TeleportPortalObject *)cocos2d::CCArray::objectAtIndex(Group, (int)(float)((float)v6 * v7));\n}", "assembly": "; \n; GJBaseGameLayer::getPortalTarget from 0x85d340 to 0x85d3f0 (176 bytes)\n; \n; 2 xrefs:\n; > GJBaseGameLayer::teleportPlayer @ 0x889c24\n; > <???> @ 0x62da8\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_20]!                                ; +0x0, 0x85d340\nMOV             X29, SP                                                ; +0x4, 0x85d344\nLDR             X2, [X1,#0x720]                                        ; +0x8, 0x85d348\nSTR             X19, [SP,#0x20+var_10]                                 ; +0xc, 0x85d34c\nCBZ             X2, loc_85D364                                         ; +0x10, 0x85d350\nMOV             X0, X2; this                                           ; +0x14, 0x85d354\nLDR             X19, [SP,#0x20+var_10]                                 ; +0x18, 0x85d358\nLDP             X29, X30, [SP+0x20+var_20],#0x20                       ; +0x1c, 0x85d35c\nRET                                                                    ; +0x20, 0x85d360\nLDR             W1, [X1,#0x5A8]; int                                   ; +0x24, 0x85d364\nCMP             W1, WZR                                                ; +0x28, 0x85d368\nB.LE            loc_85D3E8                                             ; +0x2c, 0x85d36c\nBL              _ZN15GJBaseGameLayer8getGroupEi; GJBaseGameLayer::getGroup(int) ; +0x30, 0x85d370\nMOV             X19, X0                                                ; +0x34, 0x85d374\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x38, 0x85d378\nCMP             W0, WZR                                                ; +0x3c, 0x85d37c\nB.LE            loc_85D3E8                                             ; +0x40, 0x85d380\nCMP             W0, #1                                                 ; +0x44, 0x85d384\nB.EQ            loc_85D3C8                                             ; +0x48, 0x85d388\nADRP            X1, #qword_1242DA0@PAGE                                ; +0x4c, 0x85d38c\nMOV             X3, #0x343FD                                           ; +0x50, 0x85d390\nLDR             S1, =0x46FFFE00                                        ; +0x58, 0x85d398\nLDR             X2, [X1,#qword_1242DA0@PAGEOFF]                        ; +0x5c, 0x85d39c\nMUL             X2, X2, X3                                             ; +0x60, 0x85d3a0\nADD             X2, X2, #0x269,LSL#12                                  ; +0x64, 0x85d3a4\nADD             X2, X2, #0xEC3                                         ; +0x68, 0x85d3a8\nSTR             X2, [X1,#qword_1242DA0@PAGEOFF]                        ; +0x6c, 0x85d3ac\nUBFX            X2, X2, #0x10, #0xF                                    ; +0x70, 0x85d3b0\nSCVTF           S0, X2                                                 ; +0x74, 0x85d3b4\nFDIV            S0, S0, S1                                             ; +0x78, 0x85d3b8\nFMOV            S1, #1.0                                               ; +0x7c, 0x85d3bc\nFCMP            S0, S1                                                 ; +0x80, 0x85d3c0\nB.NE            loc_85D3CC                                             ; +0x84, 0x85d3c4\nFMOV            S0, WZR                                                ; +0x88, 0x85d3c8\nSCVTF           S1, W0                                                 ; +0x8c, 0x85d3cc\nMOV             X0, X19; this                                          ; +0x90, 0x85d3d0\nLDR             X19, [SP,#0x20+var_10]                                 ; +0x94, 0x85d3d4\nLDP             X29, X30, [SP+0x20+var_20],#0x20                       ; +0x98, 0x85d3d8\nFMUL            S0, S1, S0                                             ; +0x9c, 0x85d3dc\nFCVTZS          W1, S0; unsigned int                                   ; +0xa0, 0x85d3e0\nB               _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0xa4, 0x85d3e4\nMOV             X2, #0                                                 ; +0xa8, 0x85d3e8\nB               loc_85D354                                             ; +0xac, 0x85d3ec", "xrefs": ["GJBaseGameLayer::teleportPlayer @ 0x889c24", "<???> @ 0x62da8"], "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"}