//
// lws_hdr_copy_fragment from 0xbbdea0 to 0xbbdf7c (220 bytes)
//
// 1 xrefs:
// > ??> @ 0xbe140
//
// 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 lws_hdr_copy_fragment(__int64 a1, void *a2, int a3, unsigned int a4, int a5)
{
__int64 v5; // x8
__int64 v6; // x5
int v7; // w6
__int64 v8; // x3
int v9; // w9
__int64 v10; // x20
int v11; // w2
v5 = *(_QWORD *)(a1 + 152);
v6 = *(unsigned __int8 *)(v5 + a4 + 4);
if ( a5 > 0 )
{
v7 = 0;
v6 = *(unsigned __int8 *)(v5 + 6 * v6 + 90);
if ( !(_DWORD)v6 )
return 0xFFFFFFFFLL;
while ( 1 )
{
++v7;
v8 = v5 + 6LL * (int)v6;
if ( v7 == a5 )
break;
v6 = *(unsigned __int8 *)(v8 + 90);
if ( !*(_BYTE *)(v8 + 90) )
return 0xFFFFFFFFLL;
}
}
v9 = a3 - 1;
v10 = 6 * v6;
v11 = *(unsigned __int16 *)(v5 + 6 * v6 + 88);
if ( v11 < v9 )
{
*((_BYTE *)memcpy(a2, (const void *)(v5 + *(unsigned __int16 *)(v5 + 6 * v6 + 86) + 1070), (unsigned __int16)v11)
+ *(unsigned __int16 *)(*(_QWORD *)(a1 + 152) + v10 + 88)) = 0;
return *(unsigned __int16 *)(*(_QWORD *)(a1 + 152) + v10 + 88);
}
return 0xFFFFFFFFLL;
}