//
// GJBaseGameLayer::getPortalTarget from 0x10027e92c to 0x10027e9dc (176 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::teleportPlayer @ 0x10027e478
//
// 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 11:01:54 +0000
//
__int64 __fastcall GJBaseGameLayer::getPortalTarget(__int64 a1, __int64 a2)
{
__int64 v2; // x8
int v3; // w1
__int64 Group; // x19
int v5; // w0
float v6; // s0
float v7; // s1
v2 = *(_QWORD *)(a2 + 1848);
if ( v2 )
return v2;
v3 = *(_DWORD *)(a2 + 1464);
if ( v3 < 1 )
return 0;
Group = GJBaseGameLayer::getGroup(a1, v3);
v5 = sub_1002E757C(Group);
if ( v5 < 1 )
return 0;
v6 = 0.0;
v7 = 0.0;
if ( v5 != 1 )
{
qword_1009F5858 = 214013 * qword_1009F5858 + 2531011;
v7 = (float)(((unsigned __int64)qword_1009F5858 >> 16) & 0x7FFF) / 32767.0;
}
if ( v7 != 1.0 )
v6 = v7;
return sub_1002E75A0(Group, (unsigned int)(int)(float)(v6 * (float)(unsigned int)v5));
}