//
// sub_D0BD84 from 0xd0bd84 to 0xd0be34 (176 bytes)
//
// 2 xrefs:
// > ??> @ 0x121e4b8
// > ??> @ 0x121f048
//
// 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_D0BD84(__int64 a1)
{
FILE **v1; // x21
__int64 v3; // x2
__int64 v4; // x0
__int64 v5; // x1
__int64 v6; // x20
__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 + 200);
v5 = *(_QWORD *)(a1 + 24);
v6 = v5 - *(_QWORD *)(a1 + 16);
if ( !v4 )
sub_D13870(0, v5, v3);
if ( ((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 40LL))(v4) & 0x80000000) == 0 )
{
v7 = sub_CCE6A8(v1);
v6 += v7 / (*(int (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 200) + 64LL))(*(_QWORD *)(a1 + 200));
}
return v6;
}