//
// sub_76F930 from 0x76f930 to 0x76fa08 (216 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall sub_76F930(int a1, int a2, __off_t a3, int a4, _BOOL4 a5)
{
int v5; // r6
__off_t v8; // r8
int v9; // r9
_BOOL4 v10; // r7
_BOOL4 v11; // r0
int v12; // r1
int v13; // r2
int v14; // r3
int v16; // r0
int v17; // r1
bool v18; // zf
int v19; // lr
int v20; // r0
int v21; // r1
int v22; // r0
int v23; // r2
int v24; // r3
int v25; // r3
v5 = a2 + 36;
*(_QWORD *)a1 = -1;
*(_DWORD *)(a1 + 8) = 0;
if ( sub_77A088(a2 + 36) )
{
if ( *(_BYTE *)(a2 + 84) )
{
v21 = *(_DWORD *)(a2 + 80);
v22 = *(_DWORD *)(a2 + 8) - *(_DWORD *)(a2 + 4);
v23 = *(_DWORD *)(a2 + 60);
v24 = *(_DWORD *)(a2 + 76);
*(_BYTE *)(a2 + 84) = 0;
v25 = v24 + 4 * (v22 != 0);
*(_DWORD *)(a2 + 12) = v21;
*(_DWORD *)(a2 + 76) = v25;
*(_DWORD *)(a2 + 8) = v25;
*(_DWORD *)(a2 + 4) = v23;
v8 = a3;
v9 = a4;
v10 = a5;
v11 = sub_76F558(a2);
if ( !v11 )
goto LABEL_4;
}
else
{
v8 = a3;
v9 = a4;
v10 = a5;
v11 = sub_76F558(a2);
if ( !v11 )
{
LABEL_4:
v13 = -1;
v10 = v11;
v14 = -1;
LABEL_5:
*(_DWORD *)a1 = v13;
*(_DWORD *)(a1 + 4) = v14;
*(_DWORD *)(a1 + 8) = v10;
return a1;
}
}
v16 = sub_77A18C(v5, v12, v8, v9, 0);
v18 = v17 == -1;
if ( v17 == -1 )
v18 = v16 == -1;
if ( v18 )
{
v10 = 0;
v13 = v16;
v14 = v17;
}
else
{
v19 = *(_DWORD *)(a2 + 92);
v13 = v16;
v20 = *(_DWORD *)(a2 + 60);
v14 = v17;
*(_BYTE *)(a2 + 69) = 0;
*(_BYTE *)(a2 + 70) = 0;
*(_DWORD *)(a2 + 20) = 0;
*(_DWORD *)(a2 + 16) = 0;
*(_DWORD *)(a2 + 24) = 0;
*(_DWORD *)(a2 + 52) = v10;
*(_DWORD *)(a2 + 104) = v19;
*(_DWORD *)(a2 + 100) = v19;
*(_DWORD *)(a2 + 4) = v20;
*(_DWORD *)(a2 + 8) = v20;
*(_DWORD *)(a2 + 12) = v20;
}
goto LABEL_5;
}
return a1;
}