//
// sub_1005E5DC4 from 0x1005e5dc4 to 0x1005e5ea8 (228 bytes)
//
// 1 xrefs:
// > ??> @ 0x10083c028
//
// 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_1005E5DC4(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
unsigned __int64 i; // x24
char v10; // [xsp+Eh] [xbp-52h] BYREF
char v11; // [xsp+Fh] [xbp-51h] BYREF
if ( a4 )
{
for ( i = 0; i != a4; ++i )
{
v11 = ((*(unsigned __int8 *)(a3 + (i >> 3)) & (1 << (i & 7 ^ 7))) != 0) << 7;
sub_100596B98(
(__int64)&v11,
&v10,
1,
1u,
*(_QWORD *)(a1 + 120),
*(_QWORD *)(a1 + 120) + 128LL,
*(_QWORD *)(a1 + 120) + 256LL,
(unsigned __int8 *)(a1 + 40),
*(_DWORD *)(a1 + 16),
*(_DWORD *)(a1 + 16));
*(_BYTE *)(a2 + (i >> 3)) = ((unsigned __int8)(v10 & 0x80) >> (i & 7))
| *(_BYTE *)(a2 + (i >> 3)) & ~(0x80u >> (i & 7));
}
}
return 1;
}