//
// StartPosLayer::onClose from 0x6ad688 to 0x6ad864 (476 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:56:37 +0000
//
int __fastcall StartPosLayer::onClose(cocos2d::CCDictionary **this, cocos2d::CCObject *a2)
{
int v4; // r1
char *v5; // r1
bool v6; // zf
int v7; // r3
int v8; // r0
unsigned int v9; // r3
unsigned int v10; // r0
int v11; // r0
unsigned int v12; // r1
void *v13; // r2
int v14; // r10
char *v15; // r1
size_t v16; // r2
int v18; // r9
char *v19; // r10
char *v20; // r0
int v21; // r2
size_t v22; // r2
int v23; // [sp+0h] [bp-40h] BYREF
unsigned int v24; // [sp+4h] [bp-3Ch]
void *v25; // [sp+8h] [bp-38h]
int v26; // [sp+Ch] [bp-34h] BYREF
int v27; // [sp+10h] [bp-30h]
int v28; // [sp+14h] [bp-2Ch]
_DWORD v29[3]; // [sp+18h] [bp-28h] BYREF
int v30[3]; // [sp+24h] [bp-1Ch] BYREF
int v31[3]; // [sp+30h] [bp-10h] BYREF
v4 = cocos2d::CCDictionary::objectForKey(*(this + 144), -16);
if ( !v4 )
return SetupTriggerPopup::onClose((SetupTriggerPopup *)this, a2);
CCTextInputNode::getString((CCTextInputNode *)&v23, v4);
if ( (v23 & 1) != 0 )
{
if ( v24 <= 0x14 )
goto LABEL_17;
v5 = (char *)v25;
v26 = 0;
v27 = 0;
v28 = 0;
}
else
{
if ( (unsigned __int8)v23 <= 0x29u )
goto LABEL_17;
v26 = v23 & 1;
v5 = (char *)&v23 + 1;
v27 = v26;
v28 = v26;
}
std::string::__init(&v26, v5, 0x14u);
v7 = v23 & 1;
v6 = v7 == 0;
if ( (v23 & 1) != 0 )
{
v7 = 0;
*(_BYTE *)v25 = 0;
}
else
{
LOBYTE(v23) = v7;
BYTE1(v23) = v7;
}
if ( !v6 )
v24 = v7;
if ( (v23 & 1) != 0 )
{
v8 = v24;
v9 = (v23 & 0xFFFFFFFE) - 1;
if ( v24 <= 0xA )
{
if ( (v23 & 0xFFFFFFFE) == 0xB )
goto LABEL_16;
goto LABEL_25;
}
}
else
{
v8 = (int)(unsigned __int8)v23 >> 1;
if ( v8 <= 10 )
goto LABEL_16;
v9 = 10;
}
v10 = (v8 + 16) & 0xFFFFFFF0;
if ( v10 - 1 != v9 )
{
if ( v10 != 11 )
{
v20 = (char *)operator new(v10);
v18 = v23 & 1;
if ( (v23 & 1) != 0 )
v19 = (char *)v25;
else
v19 = (char *)&v23 + 1;
LABEL_29:
if ( (v23 & 1) != 0 )
v21 = v24;
else
v21 = (int)(unsigned __int8)v23 >> 1;
v22 = v21 + 1;
if ( v22 )
memcpy(v20, v19, v22);
if ( v18 )
operator delete(v19);
goto LABEL_16;
}
LABEL_25:
v18 = 1;
v19 = (char *)v25;
v20 = (char *)&v23 + 1;
goto LABEL_29;
}
LABEL_16:
v11 = v26;
v12 = v27;
v13 = (void *)v28;
v26 = 0;
v27 = 0;
v28 = 0;
v23 = v11;
v24 = v12;
v25 = v13;
std::string::~string((int)&v26);
LABEL_17:
std::string::basic_string(v30, (int)&v23);
LevelTools::base64EncodeString(v29, v30);
std::string::~string((int)v30);
v14 = *((_DWORD *)*(this + 178) + 412);
std::string::basic_string(v31, (int)v29);
if ( (int *)(v14 + 400) != v31 )
{
if ( (v31[0] & 1) != 0 )
{
v15 = (char *)v31[2];
v16 = v31[1];
}
else
{
v16 = (int)LOBYTE(v31[0]) >> 1;
v15 = (char *)v31 + 1;
}
std::string::assign((_DWORD *)(v14 + 400), v15, v16);
}
std::string::~string((int)v31);
std::string::~string((int)v29);
std::string::~string((int)&v23);
return SetupTriggerPopup::onClose((SetupTriggerPopup *)this, a2);
}