//
// sub_1005266C4 from 0x1005266c4 to 0x10052677c (184 bytes)
//
// 1 xrefs:
// > sub_100521AE0 @ 0x100521d80
//
// 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_1005266C4(__int64 a1)
{
size_t v2; // x20
unsigned int v3; // w21
_BYTE *v4; // x23
if ( *(_DWORD *)(a1 + 72) == 4608 )
{
v2 = *(unsigned __int8 *)(a1 + 640);
v3 = 32 - (((_WORD)v2 + 2) & 0x1F);
v4 = *(_BYTE **)(*(_QWORD *)(a1 + 80) + 8LL);
v4[4] = v2;
memcpy(v4 + 5, *(const void **)(a1 + 632), v2);
v4[v2 + 5] = 32 - ((v2 + 2) & 0x1F);
bzero(&v4[v2 + 6], v3);
v4[1] = 0;
*v4 = 67;
v4[3] = v3 + v2 + 2;
v4[2] = (unsigned __int16)(v3 + v2 + 2) >> 8;
*(_DWORD *)(a1 + 72) = 4609;
*(_QWORD *)(a1 + 96) = (unsigned int)v2 + v3 + 6;
}
return sub_10052C304(a1, 22);
}