//
// sub_1005820C0 from 0x1005820c0 to 0x1005821bd (253 bytes)
//
// 2 xrefs:
// > LevelSearchLayer::toggleTime @ 0x100707eec
// > LevelSearchLayer::toggleTimeNum @ 0x1007083f1
//
// 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:32:20 +0000
//
void __fastcall sub_1005820C0(__int64 a1)
{
__int64 v1; // rbx
__int64 v2; // r14
__int64 v3; // rax
const char *CString; // r12
size_t v5; // rax
size_t v6; // r15
char *v7; // r13
__int64 v8; // r14
size_t v9; // rbx
char v10; // [rsp+0h] [rbp-50h]
char v11; // [rsp+0h] [rbp-50h]
__int64 v12; // [rsp+8h] [rbp-48h]
_QWORD __dst[2]; // [rsp+10h] [rbp-40h] BYREF
void *__p; // [rsp+20h] [rbp-30h]
v1 = *(_QWORD *)(a1 + 752);
v2 = sub_10088E820("%i", v10);
v3 = sub_10088E820("Len%i", v11);
CString = (const char *)cocos2d::CCString::getCString(v3);
v5 = strlen(CString);
if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v6 = v5;
if ( v5 >= 0x17 )
{
v12 = v2;
v8 = v1;
v9 = 26;
if ( (v5 | 7) != 0x17 )
v9 = (v5 | 7) + 1;
v7 = (char *)operator new(v9);
__p = v7;
__dst[0] = v9 + 1;
v1 = v8;
v2 = v12;
__dst[1] = v6;
goto LABEL_8;
}
LOBYTE(__dst[0]) = 2 * v5;
v7 = (char *)__dst + 1;
if ( v5 )
LABEL_8:
memmove(v7, CString, v6);
v7[v6] = 0;
cocos2d::CCDictionary::setObject(v1, v2, (char *)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
}