//
// GJBaseGameLayer::teleportPlayer from 0x10027e3d8 to 0x10027e92c (1364 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::collisionCheckObjects @ 0x100283f74
// > PlayerObject::ringJump @ 0x1002c4fa0
// > EffectGameObject::triggerObject @ 0x10042c184
//
// 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::teleportPlayer(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v3; // x20
int v6; // w23
__int64 v7; // x0
float v8; // s8
double *v9; // x0
double v10; // d0
_DWORD *PortalTarget; // x22
double *v12; // x0
double v13; // d0
__n128 v14; // q0
float32x2_t *v15; // x0
int v16; // w8
char v17; // w8
int v18; // w8
float v19; // s9
float v20; // s8
int v21; // w0
float v22; // s0
float v23; // s8
float v24; // s8
float v25; // s10
double *v26; // x0
float v27; // s8
__n128 v28; // q0
_DWORD *v29; // x0
double *v30; // x0
double *v31; // x0
__int64 v32; // x0
float v33; // s9
double *v34; // x0
__int64 v36; // [xsp+8h] [xbp-78h] BYREF
float32x2_t v37; // [xsp+10h] [xbp-70h] BYREF
float32x2_t v38; // [xsp+18h] [xbp-68h] BYREF
float32x2_t v39; // [xsp+20h] [xbp-60h] BYREF
__int64 v40; // [xsp+28h] [xbp-58h] BYREF
v3 = a3;
if ( !a3 )
v3 = *(_QWORD *)(a1 + 3256);
*(_BYTE *)(v3 + 1368) = 1;
v6 = *(_DWORD *)(a2 + 1028);
v7 = *(_QWORD *)(a2 + 1848);
if ( v7 )
{
(*(void (__fastcall **)(__int64 *__return_ptr))(*(_QWORD *)v7 + 1816LL))(&v40);
v8 = *((float *)&v40 + 1);
(*(void (__fastcall **)(float32x2_t *__return_ptr, __int64))(*(_QWORD *)a2 + 1816LL))(&v39, a2);
*(float *)(a2 + 1860) = v8 - v39.f32[1];
}
v9 = (double *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 192LL))(v3);
v10 = sub_1000262F4(&v40, v9);
PortalTarget = (_DWORD *)GJBaseGameLayer::getPortalTarget(a1, a2, v10);
if ( PortalTarget )
{
v12 = (double *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2);
sub_1000262F4(&v39, v12);
v13 = sub_10002630C((_QWORD *)(v3 + 2488), (double *)&v39);
*(_QWORD *)(v3 + 2592) = a2;
*(_DWORD *)(v3 + 3044) = 0;
GJBaseGameLayer::getPortalTargetPos(&v39, v13);
if ( *(_BYTE *)(a2 + 1888) == 1 )
{
(*(void (__fastcall **)(float32x2_t *__return_ptr, __int64))(*(_QWORD *)a2 + 1360LL))(&v37, a2);
v15 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 192LL))(v3);
sub_10002632C(&v37, v15, &v38);
sub_10002632C(&v39, &v38, &v37);
v14.n128_f64[0] = sub_10002630C(&v39, (double *)&v37);
}
if ( *(_BYTE *)(a2 + 1889) == 1 )
v39.i32[0] = *(_DWORD *)(*(__int64 (__fastcall **)(__int64, __n128))(*(_QWORD *)v3 + 192LL))(v3, v14);
if ( *(_BYTE *)(a2 + 1890) == 1 )
v39.i32[1] = *(_DWORD *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 192LL))(v3) + 4);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v3 + 184LL))(v3, &v39);
}
v16 = *(_DWORD *)(a2 + 1892);
if ( v16 >= 1 )
{
switch ( v16 )
{
case 1:
v17 = 0;
break;
case 3:
v17 = *(_BYTE *)(v3 + 2423) ^ 1;
break;
case 2:
v17 = 1;
break;
default:
goto LABEL_21;
}
PlayerObject::flipGravity(v3, v17 & 1, 1);
}
LABEL_21:
if ( v6 != 3022 )
{
GameObject::playShineEffect(a2);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a2 + 1536LL))(a2, v3);
}
if ( PortalTarget )
{
if ( (*(_BYTE *)(a2 + 1044) & 1) == 0 )
PlayerObject::spawnPortalCircle(v3, 16776960, 50.0);
v18 = PortalTarget[257];
v19 = 90.0;
if ( v18 <= 748 )
{
if ( v18 != 38 && v18 != 747 )
{
LABEL_37:
v24 = (*(float (__fastcall **)(_DWORD *))(*(_QWORD *)PortalTarget + 384LL))(PortalTarget);
if ( (*(unsigned int (__fastcall **)(_DWORD *))(*(_QWORD *)PortalTarget + 1424LL))(PortalTarget) )
v25 = 180.0;
else
v25 = 0.0;
v26 = (double *)(*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)PortalTarget + 192LL))(PortalTarget);
sub_1000262F4(&v39, v26);
sub_10002630C((_QWORD *)(v3 + 2488), (double *)&v39);
*(_QWORD *)(v3 + 2592) = PortalTarget;
GameObject::playShineEffect(PortalTarget);
if ( (*(_BYTE *)(a2 + 1044) & 1) == 0 )
PlayerObject::spawnPortalCircle(v3, 51455, 50.0);
v27 = v19 - v24;
PlayerObject::resetStreak(v3);
if ( *(_BYTE *)(v3 + 2420) == 1 )
PlayerObject::placeStreakPoint_1(v3);
v23 = v27 + v25;
if ( (*(_BYTE *)(a2 + 1044) & 1) == 0 )
{
if ( v6 == 3022 )
{
v28.n128_f64[0] = sub_1000262F4(&v39, (double *)&v40);
v29 = (_DWORD *)v3;
}
else
{
v30 = (double *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2);
v28.n128_f64[0] = sub_1000262F4(&v39, v30);
v29 = PortalTarget;
}
v31 = (double *)(*(__int64 (__fastcall **)(_DWORD *, __n128))(*(_QWORD *)v29 + 192LL))(v29, v28);
sub_1000262F4(&v38, v31);
sub_1000262F4(&v37, (double *)&v39);
sub_1000262F4(&v36, (double *)&v38);
GJBaseGameLayer::lightningFlash(
a1,
&v37,
&v36,
*(unsigned __int16 *)(v3 + 2602) | ((unsigned __int64)*(unsigned __int8 *)(v3 + 2604) << 16),
100,
1,
4.0,
0.2,
1.0);
}
goto LABEL_49;
}
}
else if ( v18 != 749 && v18 != 2902 && v18 != 2064 )
{
goto LABEL_37;
}
v19 = 180.0;
goto LABEL_37;
}
v20 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 384LL))(a2);
v21 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 1424LL))(a2);
v22 = 180.0;
if ( !v21 )
v22 = 0.0;
v23 = v22 - v20;
LABEL_49:
if ( *(_BYTE *)(a2 + 1864) == 1 )
*(_DWORD *)(a1 + 1192) = 1056964608;
v32 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v32, &v39);
if ( *(_BYTE *)(a2 + 1864) )
v33 = 180.0;
else
v33 = 60.0;
if ( PortalTarget )
sub_1002C620C(v3);
if ( *(_BYTE *)(a2 + 1872) == 1 )
{
sub_1002C9D20(v3, v23, *(float *)(a2 + 1876), *(float *)(a2 + 1880), *(float *)(a2 + 1884));
}
else if ( *(_BYTE *)(a2 + 1865) == 1 )
{
sub_1002C9BF8(v3, *(unsigned __int8 *)(a2 + 1896), v23, *(float *)(a2 + 1868));
}
if ( *(_BYTE *)(a2 + 1897) == 1 )
*(_WORD *)(a1 + 1720) = 257;
if ( *(_BYTE *)(a2 + 1898) == 1 )
{
v34 = (double *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 192LL))(v3);
sub_1000262F4(&v38, v34);
sub_10002630C((_QWORD *)(v3 + 2532), (double *)&v38);
}
if ( *(_BYTE *)(v3 + 2460) == 1 && *(_BYTE *)(a2 + 1899) == 1 )
sub_1002C2774(v3, v23);
if ( PortalTarget )
GJBaseGameLayer::checkCameraLimitAfterTeleport(a1, v3, v33);
return GJBaseGameLayer::gameEventTriggered(a1, 25, 0, 0);
}