//
// sub_1005ECB2C from 0x1005ecb2c to 0x1005ecbac (128 bytes)
//
// 3 xrefs:
// > sub_100520EC8 @ 0x100521184
// > sub_1005E92BC @ 0x1005e93f4
// > sub_1005ED32C @ 0x1005ed438
//
// 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_1005ECB2C(__int64 *a1)
{
__int64 v2; // x8
__int64 (__fastcall *v3)(__int64 *); // x8
__int64 result; // x0
if ( a1 && (v2 = *a1) != 0 && *(_QWORD *)(v2 + 88) )
{
*((_DWORD *)a1 + 8) = 16;
v3 = *(__int64 (__fastcall **)(__int64 *))(v2 + 80);
if ( v3 )
{
result = v3(a1);
if ( (int)result <= 0 )
*((_DWORD *)a1 + 8) = 0;
}
else
{
return 1;
}
}
else
{
sub_1005E0E48(6, 143, 150, (__int64)"pmeth_fn.c", 122);
return 4294967294LL;
}
return result;
}