//
// sub_825EA from 0x825ea to 0x82652 (104 bytes)
//
// 1 xrefs:
// > sub_82290 @ 0x822d4
//
// 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
//
int __fastcall sub_825EA(int a1, int a2, int a3, _DWORD *a4)
{
int result; // r0
int v9; // r4
int v10; // r2
int v11; // r3
int v12; // r1
bool v13; // zf
unsigned __int8 v14; // [sp+7h] [bp-19h] BYREF
result = sub_819EC(a1, nullptr);
if ( !result )
{
v9 = 0;
while ( 1 )
{
result = sub_BBA38(*(_DWORD *)(a1 + 220), &v14);
if ( result )
break;
v12 = v14;
v13 = v14 == 10;
if ( v14 != 10 )
v13 = v14 == 13;
if ( !v13 && v9 < a3 - 1 )
*(_BYTE *)(a2 + v9++) = v14;
if ( sub_82442(a1, v12, v10, v11) )
{
result = 0;
if ( a4 )
*a4 = v9;
*(_BYTE *)(a2 + v9) = 0;
return result;
}
}
}
return result;
}