//
// sub_10046AF9C from 0x10046af9c to 0x10046b00c (112 bytes)
//
// 0 xrefs:
//
// 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_10046AF9C(__int64 a1, void *__dst, int a3)
{
__int64 v4; // x8
unsigned int v5; // w9
int v6; // w20
v4 = *(unsigned int *)(a1 + 16);
v5 = *(_DWORD *)(a1 + 20);
if ( v5 <= (unsigned int)v4 )
{
*(_BYTE *)(a1 + 36) = 1;
return 16;
}
else
{
if ( (int)v4 + a3 <= v5 )
v6 = a3;
else
v6 = v5 - v4;
if ( __dst )
{
memcpy(__dst, (const void *)(*(_QWORD *)(a1 + 8) + v4), v6);
LODWORD(v4) = *(_DWORD *)(a1 + 16);
}
*(_DWORD *)(a1 + 16) = v4 + v6;
return 0;
}
}