//
// GJBaseGameLayer::updateMaxGameplayY from 0x9a8f5c to 0x9a9058 (252 bytes)
//
// 3 xrefs:
// > PlayLayer::createObjectsFromSetupFinished @ 0x6fdcd4
// > LevelEditorLayer::onPlaytest @ 0x796344
// > ??> @ 0xa98a0
//
// 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:11 +0000
//
__int64 __fastcall GJBaseGameLayer::updateMaxGameplayY(GJBaseGameLayer *this)
{
LevelSettingsObject *v2; // x0
__int64 result; // x0
unsigned int *v4; // x1
__int64 *v5; // x19
char *v6; // x22
__int64 v7; // x20
float v8; // s8
v2 = *((LevelSettingsObject **)this + 409);
if ( v2 && (unsigned __int8)LevelSettingsObject::shouldUseYSection(v2) )
{
result = *((_QWORD *)this + 410);
if ( result
&& (v4 = *(unsigned int **)(result + 56), result = *v4, (_DWORD)result)
&& (v5 = *((__int64 **)v4 + 2),
result = 8LL * (unsigned int)result - 8,
v6 = (char *)v5 + result,
v5 <= (__int64 *)((char *)v5 + result))
&& (v7 = *v5) != 0 )
{
v8 = 1200.0;
do
{
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 192LL))(v7);
if ( *(float *)(result + 4) > v8 )
{
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 192LL))(v7);
v8 = *(float *)(result + 4);
}
if ( v6 < (char *)++v5 )
break;
v7 = *v5;
}
while ( *v5 );
*((float *)this + 3410) = (float)(v8 + 90.0) + 300.0;
}
else
{
*((_DWORD *)this + 3410) = 1153875968;
}
}
else
{
*((_DWORD *)this + 3410) = 1160667136;
return 1160667136;
}
return result;
}