//
// sub_8E2648 from 0x8e2648 to 0x8e26ec (164 bytes)
//
// 1 xrefs:
// > sub_8E273C @ 0x8e27a0
//
// 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
//
int *__fastcall sub_8E2648(int a1, int *a2, unsigned int a3)
{
int *v3; // r5
char *v4; // r8
int v7; // r11
int v8; // r9
int v9; // r4
char *v10; // r0
char *v11; // r0
char *v13; // [sp+4h] [bp-8h]
v3 = a2;
if ( a2 )
{
v4 = (char *)a2 - 1;
v7 = 0;
v8 = (int)a2 - 1;
while ( 1 )
{
v9 = (v7 + v8) / 2;
v3 = (int *)(a1 + 8 * v9);
v10 = sub_8E2630(v3);
if ( (char *)v9 == v4 )
{
if ( a3 >= (unsigned int)v10 )
return v3;
LABEL_5:
if ( v9 == v7 )
return nullptr;
v8 = v9 - 1;
}
else
{
v13 = v10;
v11 = sub_8E2630((int *)(a1 + 8 * v9 + 8));
if ( a3 < (unsigned int)v13 )
goto LABEL_5;
if ( a3 <= (unsigned int)(v11 - 1) )
return v3;
v7 = v9 + 1;
}
}
}
return v3;
}