//
// sub_ECED0 from 0xeced0 to 0xecf60 (144 bytes)
//
// 7 xrefs:
// > sub_ECD60 @ 0xece68
// > sub_ECD60 @ 0xeceb4
// > sub_ED2CC @ 0xed330
// > sub_ED2CC @ 0xed448
// > sub_ED4FC @ 0xed580
// > sub_ED4FC @ 0xed638
// > sub_ED4FC @ 0xed71c
//
// 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_ECED0(__int64 result, unsigned int a2)
{
unsigned __int64 v2; // t2
unsigned int v3; // w8
HIDWORD(v2) = *(_DWORD *)(result + 32);
LODWORD(v2) = HIDWORD(v2);
v3 = *(_DWORD *)(result + 28);
switch ( (unsigned int)(v2 >> 3) )
{
case 0u:
v3 = dword_11AA88[(*(_DWORD *)(result + 28) >> 8) ^ HIBYTE(a2)] ^ ((unsigned __int8)*(_DWORD *)(result + 28) << 8);
goto LABEL_3;
case 1u:
LABEL_3:
v3 = ((unsigned __int8)v3 << 8) ^ dword_11AA88[BYTE2(a2) ^ (v3 >> 8)];
goto LABEL_4;
case 2u:
LABEL_4:
v3 = ((unsigned __int8)v3 << 8) ^ dword_11AA88[BYTE1(a2) ^ (v3 >> 8)];
goto LABEL_5;
case 3u:
LABEL_5:
*(_DWORD *)(result + 28) = ((unsigned __int8)v3 << 8) ^ dword_11AA88[(unsigned __int8)a2 ^ (v3 >> 8)];
break;
default:
break;
}
*(_DWORD *)(result + 32) = 0;
return result;
}