//
// sub_100100AD0 from 0x100100ad0 to 0x100100c06 (310 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::processStartPosObjects @ 0x100100c36
// > GJBaseGameLayer::sortStartPosObjects @ 0x100100d46
//
// 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
//
__int64 __fastcall sub_100100AD0(__int64 a1)
{
__int64 v2; // rdi
unsigned int *v3; // rax
unsigned int v4; // ecx
_QWORD *v5; // r13
_QWORD *v6; // r14
int v7; // ebx
_QWORD *v8; // r15
_QWORD *v9; // r12
float v10; // xmm0_4
__int64 v11; // rcx
int v12; // eax
__int64 v14; // [rsp+0h] [rbp-40h]
float v15; // [rsp+14h] [rbp-2Ch]
v2 = sub_1007FE900(a1);
sub_1007FEF70(v2, a1);
v14 = sub_1007FE900(v2);
if ( v2 )
{
v3 = *(unsigned int **)(v2 + 56);
v4 = *v3;
if ( *v3 )
{
while ( 1 )
{
v5 = *((_QWORD **)v3 + 2);
v6 = &v5[v4 - 1];
v7 = -1;
v15 = 0.0;
v8 = nullptr;
do
{
v9 = (_QWORD *)*v5;
if ( !*v5 )
break;
v10 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(*v9 + 192LL))(*v5);
v11 = v9[230];
v12 = *(_DWORD *)(v11 + 372);
if ( v12 <= v7 )
{
if ( *(_BYTE *)(v11 + 370) == 1 )
{
if ( v12 < v7 || v15 <= v10 )
goto LABEL_5;
}
else if ( v12 < v7 || v10 <= v15 )
{
goto LABEL_5;
}
}
v7 = *(_DWORD *)(v11 + 372);
v15 = v10;
v8 = v9;
LABEL_5:
++v5;
}
while ( v5 <= v6 );
if ( v8 )
{
sub_1007FEBF0(v14, v8);
sub_1007FF140(v2, v8, 1);
v3 = *(unsigned int **)(v2 + 56);
v4 = *v3;
if ( *v3 )
continue;
}
return v14;
}
}
}
return v14;
}