//
// PlayLayer::addLiveStartPosObject from 0x10008c1a0 to 0x10008c38b (491 bytes)
//
// 1 xrefs:
// > CreateStartPosPopup::onCreate @ 0x1003c4dae
//
// 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:20:06 +0000
//
void __fastcall PlayLayer::addLiveStartPosObject(__int64 a1, __int64 a2)
{
__int64 v2; // r14
__int64 v3; // rax
__int64 v4; // rax
const char *v5; // r15
size_t v6; // rax
size_t v7; // r12
char *v8; // r13
size_t v9; // r14
const std::string::value_type *v10; // rsi
std::string::size_type v11; // rdx
__int64 v12; // rbx
std::string __str; // [rsp+8h] [rbp-98h] BYREF
__int64 v14; // [rsp+20h] [rbp-80h]
std::string v15; // [rsp+28h] [rbp-78h] BYREF
char __s[16]; // [rsp+40h] [rbp-60h] BYREF
void *v17; // [rsp+50h] [rbp-50h]
__int64 __dst; // [rsp+60h] [rbp-40h] BYREF
size_t v19; // [rsp+68h] [rbp-38h]
void *__p; // [rsp+70h] [rbp-30h]
v2 = a2;
PlayLayer::addObject((float *)a1, a2);
GJBaseGameLayer::sortStartPosObjects(a1);
v3 = *(_QWORD *)(a1 + 1936);
if ( (*(_BYTE *)(v3 + 392) & 1) != 0 )
{
sub_10001AD30(__s, *(const void **)(v3 + 408), *(_QWORD *)(v3 + 400));
if ( (__s[0] & 1) == 0 )
goto LABEL_3;
}
else
{
v4 = v3 + 392;
v17 = *(void **)(v4 + 16);
*(_OWORD *)__s = *(_OWORD *)v4;
if ( (__s[0] & 1) == 0 )
{
LABEL_3:
v5 = &__s[1];
goto LABEL_6;
}
}
v5 = (const char *)v17;
LABEL_6:
v6 = strlen(v5);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v7 = v6;
if ( v6 >= 0x17 )
{
v14 = a2;
v9 = 26;
if ( (v6 | 7) != 0x17 )
v9 = (v6 | 7) + 1;
v8 = (char *)operator new(v9);
__p = v8;
__dst = v9 | 1;
v19 = v7;
v2 = v14;
goto LABEL_13;
}
LOBYTE(__dst) = 2 * v6;
v8 = (char *)&__dst + 1;
if ( v6 )
LABEL_13:
memmove(v8, v5, v7);
v8[v7] = 0;
cocos2d::ZipUtils::decompressString(&v15);
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( (__s[0] & 1) != 0 )
operator delete(v17);
(*(void (__fastcall **)(__int64 *, __int64, __int64))(*(_QWORD *)v2 + 1392LL))(&__dst, v2, a1);
if ( (__dst & 1) != 0 )
{
v10 = (const std::string::value_type *)__p;
v11 = v19;
}
else
{
v10 = (char *)&__dst + 1;
v11 = (unsigned __int8)__dst >> 1;
}
std::string::append(&v15, v10, v11);
if ( (__dst & 1) != 0 )
operator delete(__p);
std::string::append(&v15, ";");
v12 = *(_QWORD *)(a1 + 1936);
cocos2d::ZipUtils::compressString(&__str);
std::string::operator=((std::string *)(v12 + 392), &__str);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v15.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v15.__r_.__value_.__l.__data_);
}