//
// sub_78DD8 from 0x78dd8 to 0x78e12 (58 bytes)
//
// 4 xrefs:
// > sub_78E14 @ 0x78e50
// > sub_78E14 @ 0x78e9c
// > sub_78EB8 @ 0x79074
// > sub_78EB8 @ 0x79236
//
// 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_78DD8(int a1, void *a2, size_t a3)
{
unsigned int v5; // r0
unsigned int v6; // r2
v5 = *(_DWORD *)(a1 + 8);
v6 = *(_DWORD *)(a1 + 12);
if ( v6 <= v5 )
{
*(_BYTE *)(a1 + 28) = 1;
return 16;
}
else
{
if ( v5 + a3 > v6 )
a3 = v6 - v5;
if ( a2 )
{
qmemcpy(a2, (const void *)(*(_DWORD *)(a1 + 4) + v5), a3);
v5 = *(_DWORD *)(a1 + 8);
}
*(_DWORD *)(a1 + 8) = v5 + a3;
return 0;
}
}