//
// sub_1004FB1D8 from 0x1004fb1d8 to 0x1004fb274 (156 bytes)
//
// 1 xrefs:
// > sub_1005121E4 @ 0x10051245c
//
// This function is hookable on this platform (idp: arm, 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 11:06:50 +0000
//
__int64 __fastcall sub_1004FB1D8(__int64 result, __int64 a2)
{
__int64 v2; // x19
__int64 v4; // x8
__int64 v5; // x0
__int64 v6; // x0
if ( !*(_QWORD *)(result + 1040) )
{
v2 = result;
if ( (*(_BYTE *)(result + 790) & 1) == 0 )
{
v4 = *(unsigned __int8 *)(a2 + 23);
if ( (v4 & 0x80u) != 0LL )
v4 = *(_QWORD *)(a2 + 8);
if ( v4 )
{
v5 = GameLevelManager::sharedState();
result = sub_1000C5CF4(v5, *(_DWORD *)(*(_QWORD *)(v2 + 752) + 56LL), a2, 0);
if ( (_DWORD)result )
{
*(_QWORD *)(GameLevelManager::sharedState() + 1264) = v2 + 672;
v6 = GameLevelManager::sharedState();
sub_1000AD8CC(v6, "threadSearch");
std::string::operator=((std::string *)(v2 + 1112), (const std::string *)a2);
return sub_1004FA9F4(v2);
}
}
}
}
return result;
}