//
// sub_10006CC90 from 0x10006cc90 to 0x10006cd82 (242 bytes)
//
// 2 xrefs:
// > sub_10006CE70 @ 0x10006ce82
// > CCTextInputMenu::init @ 0x100078683
//
// This function is hookable on this platform (idp: pc, 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 12:19:45 +0000
//
__int64 __fastcall sub_10006CC90(__int64 a1)
{
size_t v1; // rbx
const char *v2; // r14
size_t v3; // rax
char *v4; // r15
unsigned int v5; // eax
size_t v6; // r12
size_t __dst; // [rsp+8h] [rbp-38h] BYREF
size_t v9; // [rsp+10h] [rbp-30h]
void *__p; // [rsp+18h] [rbp-28h]
if ( !*(_BYTE *)(a1 + 609) )
{
v2 = (const char *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 576) + 1248LL))(*(_QWORD *)(a1 + 576));
v3 = strlen(v2);
if ( v3 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v1 = v3;
if ( v3 >= 0x17 )
{
v6 = 26;
if ( (v3 | 7) != 0x17 )
v6 = (v3 | 7) + 1;
v4 = (char *)operator new(v6);
__p = v4;
__dst = v6 + 1;
v9 = v1;
}
else
{
LOBYTE(__dst) = 2 * v3;
v4 = (char *)&__dst + 1;
if ( !v3 )
{
BYTE1(__dst) = 0;
v5 = (unsigned __int8)__dst;
if ( (__dst & 1) != 0 )
goto LABEL_7;
goto LABEL_13;
}
}
memmove(v4, v2, v1);
v4[v1] = 0;
v5 = (unsigned __int8)__dst;
if ( (__dst & 1) != 0 )
{
LABEL_7:
LOBYTE(v1) = v9 != 0;
if ( (v5 & 1) == 0 )
return (unsigned int)v1;
goto LABEL_14;
}
LABEL_13:
LOBYTE(v1) = v5 >> 1 != 0;
if ( (v5 & 1) == 0 )
return (unsigned int)v1;
LABEL_14:
operator delete(__p);
return (unsigned int)v1;
}
LODWORD(v1) = 0;
return (unsigned int)v1;
}