//
// sub_1008AD6B0 from 0x1008ad6b0 to 0x1008ad76c (188 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:37:19 +0000
//
__int64 __fastcall sub_1008AD6B0(__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_1001586E0(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;
}