//
// sub_1004D877C from 0x1004d877c to 0x1004d87c8 (76 bytes)
//
// 0 xrefs:
//
// 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_1004D877C(unsigned int *a1)
{
__int64 v1; // x9
unsigned __int64 *v2; // x8
unsigned __int64 *v3; // x8
unsigned __int64 v4; // x10
unsigned __int64 v5; // t1
__int64 v6; // x9
unsigned __int64 v7; // x11
bool v8; // cf
bool v9; // zf
v1 = *a1;
if ( (unsigned int)v1 < 2 )
return 1;
v2 = *((unsigned __int64 **)a1 + 1);
v5 = *v2;
v3 = v2 + 3;
v4 = v5;
v6 = v1 - 1;
while ( 1 )
{
v7 = *v3;
if ( *v3 == -1 )
{
v8 = 1;
v9 = 0;
}
else
{
v8 = v7 >= v4;
v9 = v7 == v4;
}
if ( v9 || !v8 )
break;
v3 += 3;
v4 = v7;
if ( !--v6 )
return 1;
}
return 0;
}