//
// GJBaseGameLayer::findStartPosWinnerInArray from 0x1001009f0 to 0x100100ac1 (209 bytes)
//
// 2 xrefs:
// > LevelEditorLayer::findStartPosObject @ 0x1000c5691
// > LevelEditorLayer::onPlaytest @ 0x1000c5de7
//
// This function is hookable on this platform (idp: pc, 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:21:20 +0000
//
_QWORD *__fastcall GJBaseGameLayer::findStartPosWinnerInArray(__int64 a1)
{
unsigned int *v1; // rax
_QWORD *v2; // r15
unsigned __int64 v3; // r12
int v4; // r13d
_QWORD *v5; // rbx
_QWORD *v6; // r14
float v7; // xmm0_4
__int64 v8; // rcx
int v9; // eax
float v11; // [rsp+0h] [rbp-2Ch]
if ( a1 )
{
v1 = *(unsigned int **)(a1 + 56);
if ( *v1 )
{
v2 = *((_QWORD **)v1 + 2);
v3 = (unsigned __int64)&v2[*v1 - 1];
v4 = -1;
v11 = 0.0;
v5 = nullptr;
while ( 1 )
{
v6 = (_QWORD *)*v2;
if ( !*v2 )
return v5;
v7 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(*v6 + 192LL))(*v2);
v8 = v6[230];
v9 = *(_DWORD *)(v8 + 372);
if ( v9 <= v4 )
{
if ( *(_BYTE *)(v8 + 370) == 1 )
{
if ( v9 < v4 || v11 <= v7 )
goto LABEL_5;
}
else if ( v9 < v4 || v7 <= v11 )
{
goto LABEL_5;
}
}
v4 = *(_DWORD *)(v8 + 372);
v11 = v7;
v5 = v6;
LABEL_5:
if ( (unsigned __int64)++v2 > v3 )
return v5;
}
}
}
return nullptr;
}