//
// sub_B8216C from 0xb8216c to 0xb8226c (256 bytes)
//
// 0 xrefs:
//
// 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_B8216C(__int64 a1, char *a2)
{
unsigned int v3; // w21
size_t v4; // x0
__int64 v6; // x19
char *v7; // x22
size_t v8; // [xsp+40h] [xbp+40h] BYREF
char v9[1024]; // [xsp+48h] [xbp+48h] BYREF
v3 = 43;
v4 = strlen(a2);
if ( v4 <= 0x3FD )
{
v6 = v4 + 2;
v7 = v9;
v8 = 0;
strcpy(&v9[v4], "\r\n");
while ( 1 )
{
v3 = sub_B7BAC4(a1, *(_DWORD *)(a1 + 608), (__int64)v7, v6, (__int64 *)&v8);
if ( v3 )
break;
if ( *(_BYTE *)(*(_QWORD *)a1 + 1576LL) )
sub_B7C5B8(*(_QWORD *)a1, 2u, v7, v8, a1);
if ( v6 == v8 )
break;
v6 -= v8;
v7 += v8;
}
}
return v3;
}