//
// sub_C27EAC from 0xc27eac to 0xc27f38 (140 bytes)
//
// 2 xrefs:
// > sub_C280C8 @ 0xc281b8
// > sub_C280C8 @ 0xc281c0
//
// 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_C27EAC(__int64 result, __int64 a2, __int64 a3, int a4)
{
__int64 v4; // x13
int v5; // w15
int v6; // w8
__int64 i; // x9
__int64 v8; // x7
_BYTE *v9; // x10
_BYTE *v10; // x11
char v11; // w4
__int64 v12; // x5
__int64 v13; // x6
v4 = 0;
v5 = *(_DWORD *)(result + 136);
v6 = *(_DWORD *)(result + 144);
for ( i = *(_QWORD *)(*(_QWORD *)(result + 656) + 48LL); a4 > (int)v4; ++v4 )
{
v8 = *(_QWORD *)(a2 + 8 * v4);
v9 = *(_BYTE **)(a3 + 8 * v4);
if ( v5 )
{
v10 = &v9[v5 - 1 + 1];
do
{
result = 0;
v11 = 0;
if ( v6 > 0 )
{
do
{
v12 = *(unsigned __int8 *)(v8 + result);
v13 = *(_QWORD *)(i + 8 * result++);
v11 += *(_BYTE *)(v13 + v12);
}
while ( v6 > (int)result );
v8 += (unsigned int)(v6 - 1) + 1LL;
}
*v9++ = v11;
}
while ( v9 != v10 );
}
}
return result;
}