//
// GJGameLevel::dtAppendOrder from 0x832ba8 to 0x832d30 (392 bytes)
//
// 5 xrefs:
// > PlayLayer::levelComplete @ 0x703f84
// > GJGameLevel::recordDeath @ 0x854268
// > GJGameLevel::recordDeath @ 0x8542a8
// > GJGameLevel::recordDeath @ 0x8542c8
// > ??> @ 0x5e7e0
//
// 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 12:55:09 +0000
//
__int64 __fastcall GJGameLevel::dtAppendOrder(int a1, unsigned __int8 *a2, int a3, char a4)
{
unsigned int v5; // w20
int v6; // w0
__int64 v7; // x19
__int64 v8; // x0
unsigned __int8 *v9; // x23
unsigned __int64 v10; // x22
__int64 v11; // x0
cocos2d::CCString *v12; // x0
size_t v13; // x0
int v15; // w19
__int64 v16; // x0
unsigned int v17; // w19
__int64 v18; // x0
cocos2d::CCString *v19; // x0
char *v20; // x0
char *CString; // [xsp+48h] [xbp+48h]
if ( a3 > 100 )
a3 = 100;
if ( a3 < 0 )
v5 = 0;
else
v5 = a3;
v6 = *a2;
if ( !a4 )
{
v15 = v6 >> 1;
if ( (v6 & 1) != 0 )
{
v11 = *((_QWORD *)a2 + 1);
LABEL_14:
if ( !v11 )
{
LABEL_15:
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)v5);
CString = (char *)cocos2d::CCString::getCString(v12);
v13 = strlen(CString);
return std::string::append((__int64)a2, CString, v13);
}
LABEL_18:
std::string::append((__int64)a2, &byte_1169BE0);
goto LABEL_15;
}
goto LABEL_17;
}
if ( (v6 & 1) == 0 )
{
v15 = v6 >> 1;
if ( v6 >> 1 )
{
v9 = a2 + 1;
v16 = std::string::rfind((__int64)a2, 0x2Cu, 0xFFFFFFFFFFFFFFFFLL);
v10 = v16 == -1 ? 0LL : v16 + 1;
if ( atoi((const char *)&v9[v10]) == v5 )
goto LABEL_25;
}
LABEL_17:
if ( !v15 )
goto LABEL_15;
goto LABEL_18;
}
v7 = *((_QWORD *)a2 + 1);
if ( !v7
|| ((v8 = std::string::rfind((__int64)a2, 0x2Cu, 0xFFFFFFFFFFFFFFFFLL), v9 = *((unsigned __int8 **)a2 + 2), v8 != -1)
? (v10 = v8 + 1)
: (v10 = 0),
atoi((const char *)&v9[v10]) != v5) )
{
v11 = v7;
goto LABEL_14;
}
LABEL_25:
v17 = 2;
v18 = std::string::find((__int64)a2, 0x78u, v10);
if ( v18 != -1 )
v17 = atoi((const char *)&v9[v18 + 1]) + 1;
std::string::erase((char *)a2, v10, 0xFFFFFFFFFFFFFFFFLL);
v19 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%ix%i", (const char *)v5, v17);
v20 = (char *)cocos2d::CCString::getCString(v19);
return std::string::append((__int64)a2, v20);
}