//
// sub_D0BE34 from 0xd0be34 to 0xd0bee8 (180 bytes)
//
// 2 xrefs:
// > ??> @ 0x121e6f8
// > ??> @ 0x121f0c8
//
// 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
//
__int64 __fastcall sub_D0BE34(__int64 a1)
{
FILE **v1; // x21
__int64 v3; // x2
__int64 v4; // x1
__int64 v5; // x0
__int64 v6; // x19
__off_t v7; // x21
if ( (*(_DWORD *)(a1 + 120) & 8) == 0 )
return -1;
v1 = (FILE **)(a1 + 104);
if ( !sub_CCE3F8((_QWORD *)(a1 + 104)) )
return -1;
v4 = *(_QWORD *)(a1 + 16);
v5 = *(_QWORD *)(a1 + 200);
v6 = (*(_QWORD *)(a1 + 24) - v4) >> 2;
if ( !v5 )
sub_D13870(0, v4, v3);
if ( ((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 40LL))(v5) & 0x80000000) == 0 )
{
v7 = sub_CCE6A8(v1);
v6 += v7 / (*(int (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 200) + 64LL))(*(_QWORD *)(a1 + 200));
}
return v6;
}