//
// sub_1001EB95C from 0x1001eb95c to 0x1001ebad8 (380 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::prepareSavePositionObjects @ 0x1001e032c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
_QWORD *__fastcall sub_1001EB95C(AdvancedFollowTriggerObject *a1, __int64 a2, unsigned __int64 a3)
{
float v6; // s0
int v7; // w23
unsigned __int64 v8; // x8
__int64 v9; // x21
int v10; // w22
_QWORD *result; // x0
int GroupID; // [xsp+Ch] [xbp-34h] BYREF
v6 = (float)(a1->m_delay + a1->m_delayVariance) / 0.00416666667;
v7 = (int)(float)(ceilf(v6) + 1.0);
v8 = *(_QWORD *)(a2 + 8);
if ( v8 >= *(_QWORD *)(a2 + 16) )
{
v9 = sub_10020BEE0(a2);
}
else
{
*(_OWORD *)(v8 + 32) = 0u;
*(_OWORD *)(v8 + 48) = 0u;
*(_OWORD *)(v8 + 96) = 0u;
*(_OWORD *)(v8 + 112) = 0u;
*(_OWORD *)(v8 + 64) = 0u;
*(_OWORD *)(v8 + 80) = 0u;
*(_OWORD *)v8 = 0u;
*(_OWORD *)(v8 + 16) = 0u;
*(_DWORD *)(v8 + 32) = 1065353216;
*(_OWORD *)(v8 + 40) = 0u;
*(_DWORD *)(v8 + 72) = 1065353216;
*(_DWORD *)(v8 + 112) = 1065353216;
v9 = v8 + 128;
*(_OWORD *)(v8 + 56) = 0u;
}
*(_QWORD *)(a2 + 8) = v9;
*(_DWORD *)(v9 - 8) = v7;
if ( a1->m_groupCount >= 1 )
{
v10 = 0;
do
{
GroupID = GameObject::getGroupID(a1, v10);
sub_10001C1B0(v9 - 88, &GroupID, &GroupID);
sub_10001C1B0(a3, &GroupID, &GroupID);
++v10;
}
while ( v10 < a1->m_groupCount );
}
if ( a1->m_controlID > 0 )
{
GroupID = a1->m_controlID;
sub_10001C1B0(v9 - 48, &GroupID, &GroupID);
GroupID = a1->m_controlID;
sub_10001C1B0(a3, &GroupID, &GroupID);
}
result = (_QWORD *)AdvancedFollowTriggerObject::getAdvancedFollowID(a1);
GroupID = (int)result;
if ( (_DWORD)result )
{
sub_10001C1B0(v9 - 128, &GroupID, &GroupID);
return sub_10001C1B0(a3, &GroupID, &GroupID);
}
return result;
}