//
// sub_180054CE0 from 0x180054ce0 to 0x180054d58 (120 bytes)
//
// 2 xrefs:
// > ??> @ 0x180167190
// > ??> @ 0x1801f8c4c
//
// 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:53:18 +0000
//
__int64 __fastcall sub_180054CE0(__int64 a1)
{
__int64 v2; // rcx
void (__fastcall *v3)(__int64, _QWORD); // r8
__int64 v4; // rax
__int64 (__fastcall *v5)(__int64); // rdx
__int64 result; // rax
v2 = *(_QWORD *)(a1 + 800);
if ( !v2 )
return sub_1800985F0(a1);
v3 = *(void (__fastcall **)(__int64, _QWORD))(v2 + 264);
v4 = v2;
if ( v3 && (*(_DWORD *)(v2 + 44) & 0x200) != 0 )
{
v3(v2, *(_QWORD *)(*(_QWORD *)(a1 + 592) + 176LL));
*(_DWORD *)(*(_QWORD *)(a1 + 800) + 44LL) &= ~0x200u;
v4 = *(_QWORD *)(a1 + 800);
}
v5 = *(__int64 (__fastcall **)(__int64))(v4 + 88);
if ( !v5 )
return sub_1800985F0(a1);
result = v5(v4);
if ( !(_DWORD)result )
return sub_1800985F0(a1);
return result;
}