//
// sub_10064E6AC from 0x10064e6ac to 0x10064e890 (484 bytes)
//
// 1 xrefs:
// > sub_100645938 @ 0x100645990
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:10:48 +0000
//
__int64 __fastcall sub_10064E6AC(__int64 a1, char *__dst)
{
__int64 v4; // x8
const void *v5; // x1
__int64 result; // x0
unsigned __int64 v7; // x0
_BOOL4 v8; // w9
int v9; // w8
int v10; // w11
int v11; // w10
unsigned __int64 v12; // x12
__int64 v13; // x13
__int64 v14; // x15
int v15; // w16
int v16; // w17
int v17; // w1
__int64 v18; // x12
__int64 v20; // [xsp+8h] [xbp-18h] BYREF
v4 = *(_QWORD *)(a1 + 256);
v5 = *(const void **)(v4 + 560);
if ( v5 )
{
memcpy(__dst, v5, *(_QWORD *)(v4 + 568));
return *(unsigned int *)(*(_QWORD *)(a1 + 256) + 568LL);
}
else
{
v7 = sub_10065702C(a1, &v20);
v8 = (*(_DWORD *)(*(_QWORD *)(a1 + 256) + 108LL) & 0x30001) == 0;
v9 = 0;
v10 = 0;
v11 = 0;
if ( v7 )
{
v12 = 0;
v13 = v20;
do
{
v14 = v13 + v12;
v15 = *(unsigned __int8 *)(v13 + v12 + 1);
if ( v15 == 1 )
v16 = 1;
else
v16 = v11;
v17 = v10;
if ( v15 == 2 )
{
v16 = v11;
v17 = 1;
}
if ( v15 == 3 )
{
v9 = 1;
}
else
{
v11 = v16;
v10 = v17;
}
v12 += 2LL;
v20 = v14 + 2;
}
while ( v12 < v7 );
}
v18 = *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 128) + 936LL) + 24LL);
if ( *(int *)a1 < 769 || (*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 128) + 936LL) + 24LL) & 0x200LL) == 0 )
{
if ( (v18 & 0xA) != 0 )
{
if ( v11 | v8 )
{
*__dst = 3;
result = 1;
}
else
{
result = 0;
}
if ( v10 | v8 )
{
__dst[(unsigned int)result] = 4;
result = (unsigned int)(result + 1);
}
}
else
{
result = 0;
}
if ( (v18 & 0xE) != 0 && *(_DWORD *)a1 == 768 )
{
*(_WORD *)&__dst[(int)result] = 1541;
result = (unsigned int)(result + 2);
}
if ( v11 )
{
__dst[(int)result] = 1;
result = (unsigned int)(result + 1);
}
if ( v10 )
{
__dst[(int)result] = 2;
result = (unsigned int)(result + 1);
}
if ( (v18 & 0x60) != 0 && *(int *)a1 >= 769 )
{
if ( v11 | v8 )
{
__dst[(int)result] = 65;
result = (unsigned int)(result + 1);
}
if ( v9 | v8 )
{
__dst[(int)result] = 66;
result = (unsigned int)(result + 1);
}
}
if ( v9 )
{
if ( *(int *)a1 >= 769 )
{
__dst[(int)result] = 64;
return (unsigned int)(result + 1);
}
}
}
else
{
*(_WORD *)__dst = 5653;
return 2;
}
}
return result;
}