//
// sub_1800CA470 from 0x1800ca470 to 0x1800ca51c (172 bytes)
//
// 5 xrefs:
// > ??> @ 0x18016c5e0
// > ??> @ 0x18018b1c0
// > ??> @ 0x18018b1d8
// > ??> @ 0x18018b1e8
// > ??> @ 0x1801fe460
//
// 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:07 +0000
//
__int64 __fastcall sub_1800CA470(__int64 a1)
{
__int64 v2; // rcx
__int64 result; // rax
__int64 v4; // rbx
char v5; // si
unsigned int v6; // edi
v2 = *(_QWORD *)(a1 + 192);
if ( !v2 )
return 30;
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 48LL))(v2);
if ( !(_DWORD)result )
{
v4 = *(_QWORD *)(a1 + 8);
v5 = 0;
if ( v4 )
{
sub_1801021C0(v4, 8);
v5 = 1;
}
v6 = sub_1800C7D30(a1);
if ( v6 )
{
if ( v5 )
{
if ( v4 )
sub_180102300(v4, 8);
}
return v6;
}
else
{
if ( v5 && v4 )
sub_180102300(v4, 8);
return 0;
}
}
return result;
}