//
// sub_89C34 from 0x89c34 to 0x89d04 (208 bytes)
//
// 1 xrefs:
// > sub_89024 @ 0x89024
//
// 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_89C34(__int64 a1, __int64 a2, unsigned int a3, unsigned int *a4)
{
unsigned int v7; // w21
__int64 v8; // x8
__int64 i; // x8
unsigned int v10; // w0
unsigned int v12; // [xsp+8h] [xbp-28h] BYREF
unsigned int v13; // [xsp+Ch] [xbp-24h] BYREF
sub_5C280(a3, &v13, *(_DWORD *)(*(_QWORD *)(a1 + 8) + 12LL), *(_DWORD *)(*(_QWORD *)(a1 + 8) + 8LL));
v7 = sub_E03B0(*(_QWORD *)(a1 + 368), a2, 1, v13, &v12);
if ( (v7 & 0xFFFFFFEF) == 0 )
{
v8 = *(_QWORD *)(a1 + 8);
if ( *(_DWORD *)(v8 + 56LL * *(int *)(a1 + 408) + 8) == 1 )
{
for ( i = 0; ; ++i )
{
v10 = v12;
if ( (unsigned int)i >= v12 )
break;
*(_BYTE *)(a2 + i) ^= 0x80u;
}
v8 = *(_QWORD *)(a1 + 8);
}
else
{
v10 = v12;
}
sub_5C214(v10, a4, *(_DWORD *)(v8 + 12), *(_DWORD *)(v8 + 8));
}
return v7;
}