//
// sub_1004E8358 from 0x1004e8358 to 0x1004e8420 (200 bytes)
//
// 2 xrefs:
// > sub_100462294 @ 0x100462358
// > sub_1004EA5F8 @ 0x1004ea9b4
//
// 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_1004E8358(__int64 a1, _DWORD **a2)
{
__int64 result; // x0
int v5; // [xsp+Ch] [xbp-24h] BYREF
while ( 2 )
{
result = 1;
switch ( **a2 )
{
case 0:
result = sub_1004E8420(a1, a2);
if ( (_DWORD)result )
continue;
return result;
case 1:
return (unsigned int)sub_1004E8694(a1, a2) != 0;
case 2:
if ( (unsigned int)sub_1004E8ECC(a1, a2) )
continue;
return 1;
case 3:
result = sub_1004E90CC(a1, a2, &v5, 1);
if ( !(_DWORD)result )
return result;
if ( !v5 )
continue;
return 1;
case 4:
case 7:
return result;
default:
return 0;
}
}
}