//
// GJGameLevel::dtAppendOrder from 0x4b61dc to 0x4b62a0 (196 bytes)
//
// 4 xrefs:
// > PlayLayer::levelComplete @ 0x40815e
// > GJGameLevel::recordDeath @ 0x4ddb22
// > GJGameLevel::recordDeath @ 0x4ddb32
// > GJGameLevel::recordDeath @ 0x4ddb48
//
// 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:50:08 +0000
//
_DWORD *__fastcall GJGameLevel::dtAppendOrder(int a1, unsigned __int8 *a2, int a3, int a4)
{
const char *v5; // r7
int v6; // r5
int v7; // r0
unsigned int v8; // r6
unsigned __int8 *v9; // r0
const char *v10; // r9
int v11; // r5
cocos2d::CCString *v12; // r0
char *CString; // r1
int v15; // r0
unsigned __int8 *v16; // r3
int v17; // r5
if ( a3 >= 100 )
a3 = 100;
v5 = (const char *)(a3 & ~(a3 >> 31));
v6 = *a2;
if ( !a4 )
goto LABEL_13;
if ( (v6 & 1) != 0 )
{
if ( !*((_DWORD *)a2 + 1) )
goto LABEL_14;
}
else if ( !((unsigned int)v6 >> 1) )
{
goto LABEL_15;
}
v7 = std::string::rfind(a2, 44, 0xFFFFFFFF);
v8 = v7 == -1 ? 0 : v7 + 1;
v9 = (v6 & 1) != 0 ? *((unsigned __int8 **)a2 + 2) : a2 + 1;
v10 = (const char *)atoi((const char *)&v9[v8]);
if ( v10 != v5 )
{
LABEL_13:
if ( (v6 & 1) != 0 )
{
LABEL_14:
v11 = *((_DWORD *)a2 + 1);
LABEL_16:
if ( v11 )
std::string::append(a2, ",");
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v5);
goto LABEL_19;
}
LABEL_15:
v11 = v6 >> 1;
goto LABEL_16;
}
v15 = std::string::find(a2, 120, v8);
if ( v15 == -1 )
{
v17 = 2;
}
else
{
if ( (v6 & 1) != 0 )
v16 = *((unsigned __int8 **)a2 + 2);
else
v16 = a2 + 1;
v17 = atoi((const char *)&v16[v15 + 1]) + 1;
}
std::string::erase(a2, v8, 0xFFFFFFFF);
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%ix%i", v10, v17);
LABEL_19:
CString = (char *)cocos2d::CCString::getCString(v12);
return std::string::append(a2, CString);
}