//
// gzgets from 0x950e58 to 0x950f84 (300 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:05:24 +0000
//
_BYTE *__fastcall gzgets(int a1, _BYTE *a2, int a3)
{
bool v3; // cc
int v4; // r3
int v5; // r3
bool v6; // zf
_BOOL4 v7; // r3
size_t v11; // r6
size_t v12; // r3
_BYTE *v13; // r7
const void *v14; // r9
size_t v15; // r5
char *v16; // r0
const void *v17; // r1
char *v18; // r10
char *v19; // r9
int v20; // r1
_BOOL4 v21; // r0
signed int v23; // r5
signed int v24; // r3
int v25; // r0
int v26; // r7
unsigned int v27; // r1
int v28; // r2
unsigned int v29; // r3
v3 = (int)a2 <= 0;
if ( a2 )
v3 = a3 <= 0;
v4 = v3;
if ( !a1 )
v4 |= 1u;
if ( v4 )
return nullptr;
if ( *(_DWORD *)(a1 + 12) != 7247 )
return nullptr;
v5 = *(_DWORD *)(a1 + 76);
v6 = v5 == 0;
if ( v5 )
v6 = v5 == -5;
v7 = !v6;
if ( !v6 )
return nullptr;
if ( *(_DWORD *)(a1 + 72) )
{
v23 = *(_DWORD *)(a1 + 68);
for ( *(_DWORD *)(a1 + 72) = v7; v23; *(_DWORD *)(a1 + 8) = v27 + v28 )
{
while ( 1 )
{
v24 = *(_DWORD *)a1;
if ( *(_DWORD *)a1 )
break;
if ( *(_DWORD *)(a1 + 52) && !*(_DWORD *)(a1 + 88) )
goto LABEL_18;
if ( sub_950A98((unsigned int *)a1) == -1 )
return nullptr;
}
if ( v24 > v23 )
v25 = 1;
else
v25 = *(_DWORD *)a1 >> 31;
v26 = v24 - v23;
v27 = v23;
if ( v25 )
{
v23 = 0;
}
else
{
v23 -= v24;
v26 = 0;
v27 = *(_DWORD *)a1;
}
v28 = *(_DWORD *)(a1 + 8);
v29 = *(_DWORD *)(a1 + 4) + v27;
*(_DWORD *)a1 = v26;
*(_DWORD *)(a1 + 4) = v29;
}
}
LABEL_18:
v11 = a3 - 1;
if ( !v11 )
return nullptr;
v12 = *(_DWORD *)a1;
v13 = a2;
while ( 1 )
{
if ( !v12 )
{
if ( sub_950A98((unsigned int *)a1) == -1 )
return nullptr;
v12 = *(_DWORD *)a1;
if ( !*(_DWORD *)a1 )
break;
}
v14 = *(const void **)(a1 + 4);
if ( v12 >= v11 )
v12 = v11;
v15 = v12;
v16 = (char *)memchr(*(const void **)(a1 + 4), 10, v12);
v17 = v14;
v18 = v16;
v19 = (char *)(v16 - (_BYTE *)v14);
if ( v16 )
v15 = (size_t)(v19 + 1);
memcpy(v13, v17, v15);
v11 -= v15;
v13 += v15;
v20 = *(_DWORD *)(a1 + 8);
v12 = *(_DWORD *)a1 - v15;
*(_DWORD *)a1 = v12;
if ( v18 )
v21 = 0;
else
v21 = v11 != 0;
*(_DWORD *)(a1 + 4) += v15;
*(_DWORD *)(a1 + 8) = v15 + v20;
if ( !v21 )
goto LABEL_29;
}
*(_DWORD *)(a1 + 56) = 1;
LABEL_29:
if ( v13 == a2 )
return nullptr;
*v13 = 0;
return a2;
}