//
// sub_646660 from 0x646660 to 0x6466d2 (114 bytes)
//
// 6 xrefs:
// > sub_6470B0 @ 0x647170
// > lws_serve_http_file_fragment @ 0x6480aa
// > sub_648E28 @ 0x64924a
// > sub_648E28 @ 0x6492ca
// > sub_649A5C @ 0x649dd4
// > sub_64AD70 @ 0x64b18e
//
// 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_646660(int (__fastcall *a1)(int, int, int, int, int), int a2, int a3, int a4, int a5, int a6)
{
int v7; // r4
unsigned int v9; // r2
v7 = a1(a2, a3, a4, a5, a6);
if ( v7 )
return v7;
v9 = *(unsigned __int8 *)(a2 + 260);
if ( ((v9 >> 3) & 2) == 0 )
return v7;
if ( !*(_DWORD *)(a2 + 196) )
{
*(_BYTE *)(a2 + 260) = v9 & 0xE7 | (8 * ((v9 & 8) != 0));
if ( ((v9 >> 3) & 1) != 0 )
return -(sub_647814(a2, 0, 1) != 0);
else
return -(sub_647814(a2, 1, 0) != 0);
}
lws_callback_on_writable(a2);
return 0;
}