//
// GJBaseGameLayer::findStartPosWinnerInArray from 0x1403191c0 to 0x1403192a4 (228 bytes)
//
// 8 xrefs:
// > GJBaseGameLayer::sortStartPosObjects @ 0x140319306
// > GJBaseGameLayer::sortStartPosObjects @ 0x140319331
// > LevelEditorLayer::onPlaytest @ 0x1403fecbe
// > ??> @ 0x1408b4fec
// > ??> @ 0x1408b504c
// > ??> @ 0x1408b5060
// > ??> @ 0x1408b5070
// > ??> @ 0x14091eae8
//
// 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 11:30:19 +0000
//
_QWORD *__fastcall GJBaseGameLayer::findStartPosWinnerInArray(__int64 a1)
{
_QWORD *v1; // rbp
float v2; // xmm6_4
int v3; // esi
unsigned int *v4; // rbx
__int64 v5; // rax
_QWORD *v6; // rbx
_QWORD *v7; // r14
_QWORD *v8; // rdi
float *v9; // rax
__int64 v10; // rcx
float v11; // xmm0_4
int v12; // eax
bool v13; // cc
v1 = nullptr;
v2 = 0.0;
v3 = -1;
if ( !a1 )
return nullptr;
v4 = *(unsigned int **)(a1 + 56);
v5 = *v4;
if ( !(_DWORD)v5 )
return nullptr;
v6 = *((_QWORD **)v4 + 2);
v7 = &v6[v5 - 1];
if ( v6 > v7 )
return nullptr;
do
{
v8 = (_QWORD *)*v6;
if ( !*v6 )
break;
v9 = (float *)(*(__int64 (__fastcall **)(_QWORD))(*v8 + 200LL))(*v6);
v10 = v8[232];
v11 = *v9;
v12 = *(_DWORD *)(v10 + 372);
if ( v12 > v3 )
goto LABEL_12;
if ( *(_BYTE *)(v10 + 370) )
{
if ( v12 < v3 )
goto LABEL_13;
v13 = v2 <= v11;
}
else
{
if ( v12 < v3 )
goto LABEL_13;
v13 = v11 <= v2;
}
if ( !v13 )
{
LABEL_12:
v2 = v11;
v3 = *(_DWORD *)(v10 + 372);
v1 = v8;
}
LABEL_13:
++v6;
}
while ( v6 <= v7 );
return v1;
}