//
// sub_1007C5E20 from 0x1007c5e20 to 0x1007c5edc (188 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_1007C5E20(__int64 a1, __int64 a2, unsigned int a3)
{
__int64 result; // rax
__int64 v4; // r15
unsigned __int64 v5; // r14
__int64 v6; // rcx
bool v7; // zf
result = 4294967194LL;
if ( a1 )
{
v4 = *(_QWORD *)(a1 + 320);
if ( v4 )
{
v5 = *(unsigned int *)(v4 + 144) - *(_QWORD *)(v4 + 152);
if ( a2 )
{
if ( v5 >= a3 )
LODWORD(v5) = a3;
if ( (_DWORD)v5 )
{
v6 = sub_100179330(v4 + 200);
result = 0xFFFFFFFFLL;
if ( !v6 )
{
v7 = (*(__int64 (__fastcall **)(_QWORD, _QWORD, __int64, _QWORD))(v4 + 208))(
*(_QWORD *)(v4 + 256),
*(_QWORD *)(v4 + 288),
a2,
(unsigned int)v5) == (unsigned int)v5;
result = 0xFFFFFFFFLL;
if ( v7 )
return (unsigned int)v5;
}
}
else
{
return 0;
}
}
else
{
return (unsigned int)v5;
}
}
}
return result;
}