//
// sub_18007CE50 from 0x18007ce50 to 0x18007cf09 (185 bytes)
//
// 6 xrefs:
// > ??> @ 0x1801671a8
// > ??> @ 0x180168ec0
// > ??> @ 0x18018410c
// > ??> @ 0x180184120
// > ??> @ 0x180184134
// > ??> @ 0x1801f9f30
//
// 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_18007CE50(__int64 a1, char a2, char a3)
{
__int64 v5; // rdi
if ( !a2 )
{
*(_DWORD *)(a1 + 724) = -1;
return 0;
}
if ( a3 )
{
v5 = *(_QWORD *)(a1 + 168);
if ( v5 )
{
sub_1801021C0(*(_QWORD *)(a1 + 168), 3);
*(_DWORD *)(a1 + 724) = 0;
sub_180102300(v5, 3);
return 0;
}
goto LABEL_8;
}
if ( ((*(_DWORD *)(a1 + 724) + 1) & 0xFFFFFFFE) == 0 )
{
if ( (*(_DWORD *)(a1 + 100) & 0x100) != 0 )
{
LABEL_8:
*(_DWORD *)(a1 + 724) = 0;
return 0;
}
*(_DWORD *)(a1 + 724) = *(_DWORD *)(*(_QWORD *)(a1 + 168) + 69856LL) + 1;
}
return 0;
}