//
// sub_D16D7C from 0xd16d7c to 0xd16dc8 (76 bytes)
//
// 4 xrefs:
// > sub_CE2BCC @ 0xce3178
// > sub_CE3958 @ 0xce3f04
// > sub_D04EC0 @ 0xd054a4
// > sub_D05C8C @ 0xd06270
//
// 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
//
__int64 __fastcall sub_D16D7C(__int64 *a1, unsigned __int8 a2, unsigned __int64 a3)
{
__int64 v3; // x3
unsigned __int64 v4; // x4
int v5; // w5
v3 = *a1;
v4 = *(_QWORD *)(*a1 - 24);
if ( a3 >= v4 )
return -1;
v5 = *(unsigned __int8 *)(v3 + a3);
if ( v5 == a2 )
{
while ( ++a3 < v4 )
{
if ( *(unsigned __int8 *)(v3 + a3) != v5 )
return a3;
}
return -1;
}
return a3;
}