//
// sub_100508CEC from 0x100508cec to 0x100508d8c (160 bytes)
//
// 3 xrefs:
// > ??> @ 0x100827a28
// > ??> @ 0x100827c50
// > ??> @ 0x10082a508
//
// 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_100508CEC(__int64 a1, unsigned __int64 a2, unsigned __int64 a3, int a4)
{
__int64 result; // x0
__int64 v8; // [xsp+8h] [xbp-28h] BYREF
if ( *(_QWORD *)(a1 + 296) == a2 && *(_QWORD *)(a1 + 304) == a3 && *(unsigned __int8 *)(a1 + 312) == a4 )
return 0;
*(_QWORD *)(a1 + 296) = a2;
*(_QWORD *)(a1 + 304) = a3;
*(_BYTE *)(a1 + 312) = a4;
result = (*(__int64 (__fastcall **)(__int64, _QWORD, __int64 *))(*(_QWORD *)a1 + 288LL))(a1, 0, &v8);
if ( !(_DWORD)result )
{
if ( v8 )
return sub_1004A17AC(v8, a2, a3, a4);
else
return 9;
}
return result;
}