//
// sub_FF4288 from 0xff4288 to 0xff43e8 (352 bytes)
//
// 1 xrefs:
// > ??> @ 0x13ff930
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:15:47 +0000
//
__int64 __fastcall sub_FF4288(__int64 a1, _BYTE *a2, int a3)
{
unsigned int *v3; // x19
int v5; // w20
int v7; // w4
unsigned int v8; // w22
signed int v9; // w2
__int64 v10; // x6
_BYTE *v11; // x5
_BYTE *v12; // x1
int v13; // w3
int v14; // t1
int v15; // w3
unsigned int v16; // w1
__int64 result; // x0
int v18; // w0
unsigned int v19; // w24
v3 = *(unsigned int **)(a1 + 48);
v5 = a3 - 1;
BIO_clear_flags(a1, 15);
v7 = v3[4];
v8 = 0;
while ( 1 )
{
while ( v7 > 0 )
{
v9 = v3[5];
v10 = *((_QWORD *)v3 + 1);
if ( v5 <= 0 )
{
v13 = 0;
}
else
{
v11 = a2 + 1;
*a2 = *(_BYTE *)(v10 + v9);
v12 = (_BYTE *)(v10 + v9);
if ( *v12 == 10 )
{
v15 = 1;
LABEL_10:
v8 += v15;
v16 = v3[5];
v3[4] -= v15;
v3[5] = v16 + v15;
goto LABEL_11;
}
v13 = 0;
while ( 1 )
{
++v13;
v7 = v3[4];
if ( v5 <= v13 || v7 <= v13 )
break;
*v11++ = v12[1];
v14 = (unsigned __int8)*++v12;
if ( v14 == 10 )
{
v15 = v13 + 1;
goto LABEL_10;
}
}
v9 = v3[5];
a2 = v11;
}
v7 -= v13;
v3[4] = v7;
v5 -= v13;
v3[5] = v13 + v9;
v8 += v13;
if ( !v5 )
{
v11 = a2;
LABEL_11:
*v11 = 0;
return v8;
}
}
v18 = BIO_read(*(_QWORD *)(a1 + 56), *((_QWORD *)v3 + 1), *v3);
v19 = v18;
if ( v18 <= 0 )
break;
v3[4] = v18;
v7 = v18;
v3[5] = 0;
}
BIO_copy_next_retry(a1);
*a2 = 0;
result = v8;
if ( v19 )
{
if ( (int)v8 <= 0 )
return v19;
else
return v8;
}
return result;
}