//
// sub_1002525FC from 0x1002525fc to 0x100252658 (92 bytes)
//
// 1 xrefs:
// > sub_100252658 @ 0x100252678
//
// 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_1002525FC(double **a1, double a2)
{
double *v2; // x9
unsigned __int64 v3; // x11
unsigned __int64 v4; // x12
double *v5; // x13
double *v6; // x13
double v7; // t1
v2 = a1[1];
if ( v2 != *a1 )
{
v3 = v2 - *a1;
v2 = *a1;
do
{
v4 = v3 >> 1;
v5 = &v2[v3 >> 1];
v7 = *v5;
v6 = v5 + 1;
v3 += ~(v3 >> 1);
if ( v7 > a2 )
v3 = v4;
else
v2 = v6;
}
while ( v3 );
}
return (unsigned __int64)fmax((double)(int)(((unsigned __int64)((char *)v2 - (char *)*a1) >> 3) - 1), 0.0);
}