//
// sub_6537C from 0x6537c to 0x6540c (144 bytes)
//
// 3 xrefs:
// > sub_64B98 @ 0x64bc8
// > sub_6534C @ 0x65368
// > sub_65508 @ 0x65538
//
// 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_6537C(__int64 a1, unsigned int a2)
{
__int64 result; // x0
__int64 v5; // x8
void *v6; // x8
void *dest; // [xsp+8h] [xbp-18h] BYREF
if ( *(_DWORD *)(a1 + 8) > (signed int)a2 )
return 28;
dest = nullptr;
if ( a2 )
{
result = sub_6540C(a2, &dest);
if ( (_DWORD)result )
return result;
v5 = *(int *)(a1 + 8);
if ( (_DWORD)v5 )
memcpy(dest, *(const void **)a1, 16 * v5);
}
if ( *(int *)(a1 + 12) >= 1 )
sub_65158(*(_QWORD *)a1);
v6 = dest;
*(_DWORD *)(a1 + 12) = a2;
*(_QWORD *)a1 = v6;
return 0;
}