//
// ASYNC_WAIT_CTX_clear_fd from 0xd71788 to 0xd717d4 (76 bytes)
//
// 1 xrefs:
// > ??> @ 0xa0470
//
// 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 ASYNC_WAIT_CTX_clear_fd(__int64 *a1, __int64 a2)
{
__int64 v2; // x2
__int64 v4; // x1
v2 = *a1;
if ( !*a1 )
return (unsigned int)v2;
while ( *(_DWORD *)(v2 + 36) || *(_QWORD *)v2 != a2 )
{
v2 = *(_QWORD *)(v2 + 40);
if ( !v2 )
return (unsigned int)v2;
}
v4 = a1[2];
*(_DWORD *)(v2 + 36) = 1;
a1[2] = v4 + 1;
return 1;
}