//
// sub_100652FE0 from 0x100652fe0 to 0x100653078 (152 bytes)
//
// 1 xrefs:
// > sub_1006513B0 @ 0x100651e32
//
// 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
//
unsigned __int64 __fastcall sub_100652FE0(int *a1)
{
unsigned __int64 *v1; // rbx
unsigned __int64 *v2; // r15
int v3; // eax
unsigned __int64 *v5; // r14
unsigned __int64 *v6; // rcx
bool v7; // al
v1 = *((unsigned __int64 **)a1 + 1);
v2 = *((unsigned __int64 **)a1 + 2);
if ( v1 == v2 )
return 0;
v3 = *a1;
if ( *a1 )
{
if ( v3 == 2 )
{
v1 = v2 - 2;
}
else if ( v3 != 1 )
{
sub_1007CE820(a1);
}
}
else
{
v5 = v1 + 2;
if ( v1 + 2 == v2 )
{
v6 = *((unsigned __int64 **)a1 + 1);
}
else
{
do
{
v7 = sub_10064C310(v5, v1);
v6 = v5;
if ( !v7 )
v6 = v1;
v5 += 2;
v1 = v6;
}
while ( v5 != v2 );
}
v1 = v6;
}
return *v1;
}