//
// sub_100619DB0 from 0x100619db0 to 0x100619ec8 (280 bytes)
//
// 1 xrefs:
// > sub_10061A4B4 @ 0x10061a4c4
//
// 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_100619DB0(__int64 a1, char *a2, size_t a3)
{
size_t v3; // x19
int v6; // w0
size_t v7; // x22
__int64 v8; // x8
size_t v9; // x23
int v10; // w24
v3 = a3;
if ( *(_DWORD *)(a1 + 296) == -1 )
return 0;
if ( !a3 )
return 1;
v6 = sub_1005EB254(a1);
v7 = v6;
v8 = *(int *)(a1 + 296);
if ( (int)v8 >= 1 )
{
if ( v6 - v8 <= v3 )
v9 = v6 - v8;
else
v9 = v3;
if ( v6 - v8 <= v3 )
v10 = v6 - v8;
else
v10 = v3;
memcpy((void *)(a1 + v8 + 264), a2, v9);
*(_DWORD *)(a1 + 296) += v10;
if ( v9 == v3 )
return 1;
if ( !(unsigned int)sub_1005EB260(a1, a1 + 232, a1 + 264, v7) )
return 0;
v3 -= v9;
a2 += v9;
}
if ( v3 <= v7 )
{
LABEL_16:
memcpy((void *)(a1 + 264), a2, v3);
*(_DWORD *)(a1 + 296) = v3;
return 1;
}
while ( (unsigned int)sub_1005EB260(a1, a1 + 232, (__int64)a2, v7) )
{
v3 -= v7;
a2 += v7;
if ( v3 <= v7 )
goto LABEL_16;
}
return 0;
}