//
// sub_1800DEFE0 from 0x1800defe0 to 0x1800df059 (121 bytes)
//
// 4 xrefs:
// > ??> @ 0x18016d178
// > ??> @ 0x18016d368
// > ??> @ 0x18016d500
// > ??> @ 0x18016d6d0
//
// 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 10:54:15 +0000
//
__int64 __fastcall sub_1800DEFE0(__int64 a1, _DWORD *a2)
{
__int64 v4; // rcx
__int64 **v5; // rcx
__int64 *v6; // rcx
if ( !a2 )
return 31;
if ( !*(_QWORD *)(a1 + 168) )
{
*a2 = *(_DWORD *)(a1 + 228);
return 0;
}
v4 = *(_QWORD *)(a1 + 232);
if ( v4 )
{
*a2 = *(_DWORD *)(v4 + 4LL * *(int *)(a1 + 192));
return 0;
}
*a2 = 0;
v5 = *(__int64 ***)(a1 + 240);
if ( !v5 )
return 0;
v6 = *v5;
if ( v6 == *(__int64 **)(a1 + 248) )
return 0;
do
{
if ( *((unsigned __int16 *)v6 + 26) == *(_DWORD *)(a1 + 192) )
++*a2;
v6 = (__int64 *)*v6;
}
while ( v6 != *(__int64 **)(a1 + 248) );
return 0;
}