//
// sub_95D4B8 from 0x95d4b8 to 0x95d57e (198 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:35 +0000
//
int __fastcall sub_95D4B8(int a1, int a2)
{
int v3; // r10
FILE *v4; // r3
char *v5; // r0
char *p_ptr; // r6
int v7; // r4
int v8; // r6
char *v10; // [sp+14h] [bp-24h] BYREF
_BYTE *v11; // [sp+18h] [bp-20h] BYREF
char ptr; // [sp+1Fh] [bp-19h] BYREF
_BYTE v13[8]; // [sp+20h] [bp-18h] BYREF
int v14; // [sp+28h] [bp-10h] BYREF
v3 = a2;
if ( a2 != -1 )
{
ptr = a2;
if ( !*(_BYTE *)(a1 + 44) )
{
p_ptr = &ptr;
v11 = v13;
while ( 1 )
{
v7 = (*(int (__fastcall **)(_DWORD, _DWORD, char *, _BYTE *, char **, _BYTE *, int *, _BYTE **))(**(_DWORD **)(a1 + 36) + 12))(
*(_DWORD *)(a1 + 36),
*(_DWORD *)(a1 + 40),
p_ptr,
v13,
&v10,
v13,
&v14,
&v11);
if ( v10 == p_ptr )
return -1;
if ( v7 == 3 )
{
v4 = *(FILE **)(a1 + 32);
v5 = p_ptr;
goto LABEL_4;
}
if ( (v7 | 1) != 1 )
return -1;
v8 = v11 - v13;
if ( fwrite(v13, 1u, v11 - v13, *(FILE **)(a1 + 32)) != v8 )
return -1;
p_ptr = v10;
if ( v7 != 1 )
goto LABEL_12;
}
}
v4 = *(FILE **)(a1 + 32);
v5 = &ptr;
LABEL_4:
if ( fwrite(v5, 1u, 1u, v4) != 1 )
return -1;
}
LABEL_12:
if ( v3 == -1 )
return 0;
return v3;
}