//
// PlayLayer::checkForEnd from 0x3ff588 to 0x3ff666 (222 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:47:23 +0000
//
int __fastcall PlayLayer::checkForEnd(int this)
{
int v1; // r4
int v2; // r1
float v3; // s16
float v4; // s16
float v5[2]; // [sp+4h] [bp-14h] BYREF
float v6[2]; // [sp+Ch] [bp-Ch] BYREF
v1 = this;
v2 = *(_DWORD *)(this + 10832);
if ( v2 && !*(_BYTE *)(this + 11836) )
{
if ( !*(_BYTE *)(v2 + 1172)
&& (EndPortalObject::getSpawnPos((EndPortalObject *)v5),
v3 = v5[0],
this = (*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v1 + 2076) + 96))(*(_DWORD *)(v1 + 2076)),
v3 <= *(float *)this)
|| *(_BYTE *)(*(_DWORD *)(v1 + 10832) + 1172)
&& (EndPortalObject::getSpawnPos((EndPortalObject *)v6),
v4 = v6[0],
this = (*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v1 + 2076) + 96))(*(_DWORD *)(v1 + 2076)),
v4 >= *(float *)this) )
{
*(_BYTE *)(v1 + 11836) = 1;
if ( *(float *)(v1 + 11428) != 0.0 )
{
EndPortalObject::updateEndPos(*(EndPortalObject **)(v1 + 10832), 0);
GJBaseGameLayer::reorderObjectSection((GJBaseGameLayer *)v1, *(GameObject **)(v1 + 10832));
}
return EndPortalObject::triggerObject(*(EndPortalObject **)(v1 + 10832), (GJBaseGameLayer *)v1);
}
}
return this;
}