//
// sub_951E40 from 0x951e40 to 0x951e8e (78 bytes)
//
// 3 xrefs:
// > sub_9520B0 @ 0x9520fa
// > sub_9520B0 @ 0x952116
// > sub_9520B0 @ 0x952132
//
// 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
//
int __fastcall sub_951E40(const char *a1, int a2, int a3)
{
int v5; // r5
int v6; // r4
ssize_t v7; // r0
v5 = open(a1, 0);
if ( v5 < 0 )
return -1;
v6 = 0;
while ( v6 < a3 )
{
v7 = read(v5, (void *)(a2 + v6), a3 - v6);
if ( v7 >= 0 )
{
if ( !v7 )
break;
v6 += v7;
}
else if ( *(_DWORD *)_errno() != 4 )
{
if ( !v6 )
v6 = -1;
break;
}
}
close(v5);
return v6;
}