//
// sub_CCE6A8 from 0xcce6a8 to 0xcce770 (200 bytes)
//
// 2 xrefs:
// > sub_D0BD84 @ 0xd0bddc
// > sub_D0BE34 @ 0xd0be90
//
// 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
//
__off_t __fastcall sub_CCE6A8(FILE **a1)
{
FILE *v2; // x0
int v3; // w0
int v5; // w0
FILE **v6; // x0
__int64 v7; // x19
int v8; // w0
int v9; // [xsp+24h] [xbp+24h] BYREF
struct pollfd fds; // [xsp+28h] [xbp+28h] BYREF
_BYTE v11[16]; // [xsp+30h] [xbp+30h] BYREF
int v12; // [xsp+40h] [xbp+40h]
__int64 v13; // [xsp+60h] [xbp+60h]
v2 = *a1;
v9 = 0;
v3 = fileno(v2);
if ( !ioctl(v3, 0x541Bu, &v9) && (v9 & 0x80000000) == 0 )
return v9;
fds.fd = sub_CCE408(a1);
fds.events = 1;
if ( poll(&fds, 1u, 0) <= 0 )
return 0;
v5 = sub_CCE408(a1);
if ( fstat(v5, (struct stat *)v11) || (v12 & 0xF000) != 0x8000 )
return 0;
v6 = a1;
v7 = v13;
v8 = sub_CCE408(v6);
return v7 - lseek(v8, 0, 1);
}