//
// GJBaseGameLayer::getPortalTarget from 0x9a067c to 0x9a072c (176 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::teleportPlayer @ 0x9e5a3c
// > ??> @ 0x86ba8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:58:06 +0000
//
__int64 __fastcall GJBaseGameLayer::getPortalTarget(GJBaseGameLayer *this, TeleportPortalObject *a2)
{
__int64 v2; // x2
int v4; // w1
cocos2d::CCObject *Group; // x19
int v6; // w0
float v7; // s0
v2 = *((_QWORD *)a2 + 231);
if ( v2 )
return v2;
v4 = *((_DWORD *)a2 + 366);
if ( v4 <= 0 )
return 0;
Group = GJBaseGameLayer::getGroup(this, v4);
v6 = cocos2d::CCArray::count(Group);
if ( v6 <= 0 )
return 0;
if ( v6 == 1
|| (qword_155D2C0 = 214013 * qword_155D2C0 + 2531011,
v7 = (float)(((unsigned __int64)qword_155D2C0 >> 16) & 0x7FFF) / 32767.0,
v7 == 1.0) )
{
v7 = 0.0;
}
return cocos2d::CCArray::objectAtIndex(Group, (int)(float)((float)v6 * v7));
}