//
// gzgets from 0xf3fb44 to 0xf3fd34 (496 bytes)
//
// 1 xrefs:
// > ??> @ 0xe9ab8
//
// 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:13:06 +0000
//
_BYTE *__fastcall gzgets(unsigned int *a1, _BYTE *a2, int a3)
{
unsigned int v4; // w0
unsigned int *v5; // x19
unsigned int v8; // w22
unsigned int v10; // w3
_BYTE *v11; // x24
const void *v12; // x23
unsigned int v13; // w21
size_t v14; // x20
void *v15; // x26
const void *v16; // x1
void *v17; // x0
int v18; // w23
__int64 v19; // x1
size_t v20; // x0
__int64 v21; // x23
int v22; // w3
__int64 v23; // x0
unsigned int v24; // w4
__int64 v25; // x20
__int64 v26; // x21
__int64 v27; // x1
__int64 v28; // x0
if ( a2 == nullptr || a3 <= 0 )
return nullptr;
if ( !a1 )
return nullptr;
if ( a1[6] != 7247 )
return nullptr;
v4 = a1[27];
if ( v4 != -5 )
{
if ( v4 )
return nullptr;
}
v5 = a1;
if ( a1[26] )
{
v21 = *((_QWORD *)a1 + 12);
a1[26] = 0;
if ( v21 )
{
while ( 1 )
{
v22 = *v5;
v23 = (__int64)v5;
v24 = 0;
v25 = *v5;
if ( *v5 )
break;
LABEL_29:
if ( v5[20] && !v5[32] )
goto LABEL_7;
if ( (unsigned int)sub_F3F4E4(v23) == -1 )
return nullptr;
}
while ( 1 )
{
v26 = v25;
if ( v25 > v21 )
{
v24 = v22 - v21;
v26 = (unsigned int)v21;
v25 = (unsigned int)v21;
}
v27 = *((_QWORD *)v5 + 1);
v21 -= v26;
v28 = *((_QWORD *)v5 + 2);
*v5 = v24;
*((_QWORD *)v5 + 1) = v27 + v25;
*((_QWORD *)v5 + 2) = v28 + v26;
if ( !v21 )
break;
v22 = *v5;
v23 = (__int64)v5;
v24 = 0;
v25 = *v5;
if ( !*v5 )
goto LABEL_29;
}
}
}
LABEL_7:
v8 = a3 - 1;
if ( !v8 )
return nullptr;
v10 = *v5;
v11 = a2;
while ( 1 )
{
if ( !v10 )
{
if ( (unsigned int)sub_F3F4E4((__int64)v5) == -1 )
return nullptr;
v10 = *v5;
if ( !*v5 )
break;
}
v12 = *((const void **)v5 + 1);
if ( v10 > v8 )
v13 = v8;
else
v13 = v10;
v14 = v13;
v15 = memchr(*((const void **)v5 + 1), 10, v13);
v16 = v12;
v17 = v11;
v18 = (_DWORD)v15 - (_DWORD)v12;
if ( v15 )
{
v14 = (unsigned int)(v18 + 1);
v13 = v18 + 1;
}
v11 += v14;
memcpy(v17, v16, v14);
v8 -= v13;
v19 = *((_QWORD *)v5 + 2);
v10 = *v5 - v13;
v20 = *((_QWORD *)v5 + 1) + v14;
*v5 = v10;
*((_QWORD *)v5 + 1) = v20;
*((_QWORD *)v5 + 2) = v19 + v14;
if ( !v8 || v15 )
goto LABEL_18;
}
v5[21] = 1;
LABEL_18:
if ( v11 == a2 )
return nullptr;
*v11 = 0;
return a2;
}