//
// sub_CB6408 from 0xcb6408 to 0xcb6504 (252 bytes)
//
// 2 xrefs:
// > std::__ndk1::vector,std::__ndk1::allocator>,std::__ndk1::allocator,std::__ndk1::allocator>>>::assign,std::__ndk1::allocator>*> @ 0xcb6a70
// > std::__ndk1::vector,std::__ndk1::allocator>,std::__ndk1::allocator,std::__ndk1::allocator>>>::assign,std::__ndk1::allocator>*> @ 0xcb6aec
//
// 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 13:06:12 +0000
//
unsigned __int64 __fastcall sub_CB6408(unsigned __int64 result, __int64 a2, __int64 a3)
{
__int64 v3; // x20
unsigned __int64 v5; // x21
__int64 *v6; // x19
__int64 v7; // x1
size_t v8; // x22
const void *v9; // x25
_BYTE *v10; // x3
unsigned __int64 v11; // x0
__int64 v12; // x24
__int64 v13; // x0
v3 = a2;
v5 = result;
if ( a3 != a2 )
{
v6 = *(__int64 **)(result + 8);
do
{
if ( v6 )
{
*v6 = 0;
v6[1] = 0;
v6[2] = 0;
if ( (*(_BYTE *)v3 & 1) != 0 )
{
v8 = *(_QWORD *)(v3 + 8);
v9 = *(const void **)(v3 + 16);
if ( v8 > 0xFFFFFFFFFFFFFFEFLL )
sub_630BD8();
if ( v8 > 0x16 )
{
v11 = (v8 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v12 = v11 | 1;
v13 = operator new(v11);
*v6 = v12;
v10 = (_BYTE *)v13;
v6[2] = v13;
v6[1] = v8;
}
else
{
result = (unsigned int)(2 * v8);
*(_BYTE *)v6 = 2 * v8;
v10 = (char *)v6 + 1;
if ( !v8 )
{
LABEL_11:
v10[v8] = 0;
v6 = *(__int64 **)(v5 + 8);
goto LABEL_6;
}
}
result = (unsigned __int64)memcpy(v10, v9, v8);
v10 = (_BYTE *)result;
goto LABEL_11;
}
v7 = *(_QWORD *)(v3 + 8);
*v6 = *(_QWORD *)v3;
v6[1] = v7;
result = *(_QWORD *)(v3 + 16);
v6[2] = result;
v6 = *(__int64 **)(v5 + 8);
}
LABEL_6:
v3 += 24;
v6 += 3;
*(_QWORD *)(v5 + 8) = v6;
}
while ( v3 != a3 );
}
return result;
}