//
// CreateGuidelinesLayer::getMergedRecordString from 0x5bfef4 to 0x5c0174 (640 bytes)
//
// 2 xrefs:
// > CreateGuidelinesLayer::recordingDidStop @ 0x5c02a4
// > ??> @ 0xc26b8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __usercall CreateGuidelinesLayer::getMergedRecordString@(
__int64 a1@,
_QWORD *a2@,
_QWORD *a3@,
__int64 a4@)
{
int v5; // w24
cocos2d::CCArray *v7; // x22
cocos2d::CCArray *v8; // x19
cocos2d::CCArray *v9; // x20
unsigned int v10; // w19
cocos2d::CCString *v11; // x0
float v12; // s0
const char *v13; // x1
cocos2d::CCString *v14; // x0
size_t v15; // x0
cocos2d::CCString *v17; // x0
float v18; // s8
cocos2d::CCString *v19; // x0
float v20; // s0
float v21; // s1
cocos2d::CCArray *v22; // x26
cocos2d::CCObject *v23; // x0
cocos2d::CCObject *v24; // x0
const char *CString; // [xsp+88h] [xbp+88h]
v5 = 0;
v7 = sub_5BFAA8(a2);
v8 = sub_5BFAA8(a3);
v9 = (cocos2d::CCArray *)cocos2d::CCArray::create(v8);
do
{
if ( (unsigned int)cocos2d::CCArray::count(v7) <= 1 )
{
if ( (unsigned int)cocos2d::CCArray::count(v8) <= 1 )
goto LABEL_4;
v18 = 10000000.0;
LABEL_9:
v19 = cocos2d::CCArray::stringAtIndex(v8, 0);
v20 = cocos2d::CCString::floatValue(v19);
v21 = v20;
if ( v20 < v18 )
goto LABEL_11;
goto LABEL_10;
}
v17 = cocos2d::CCArray::stringAtIndex(v7, 0);
v18 = cocos2d::CCString::floatValue(v17);
if ( (unsigned int)cocos2d::CCArray::count(v8) > 1 )
goto LABEL_9;
if ( v18 > 10000000.0 )
goto LABEL_4;
v20 = 10000000.0;
LABEL_10:
v21 = v20;
v20 = v18;
LABEL_11:
if ( v20 == 10000000.0 )
goto LABEL_4;
if ( v18 == v20 )
{
v22 = v7;
}
else
{
if ( v21 != v20 )
goto LABEL_4;
v22 = v8;
}
++v5;
v23 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(v22, 0);
cocos2d::CCArray::addObject(v9, v23);
v24 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(v22, 1u);
cocos2d::CCArray::addObject(v9, v24);
cocos2d::CCArray::removeObjectAtIndex(v22, 0, 1);
cocos2d::CCArray::removeObjectAtIndex(v22, 0, 1);
}
while ( v5 != 1001 );
(*(void (__fastcall **)(_QWORD, const char *))(**(_QWORD **)(a1 + 672) + 912LL))(
*(_QWORD *)(a1 + 672),
"Maximum limit exceeded");
LABEL_4:
v10 = 0;
sub_D153B8(a4, &byte_F288A0);
while ( v10 < (unsigned int)cocos2d::CCArray::count(v9) )
{
v11 = cocos2d::CCArray::stringAtIndex(v9, v10);
v12 = cocos2d::CCString::floatValue(v11);
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%0.2f~0~", v13, v12);
CString = cocos2d::CCString::getCString(v14);
v15 = strlen(CString);
sub_D15FD4(a4, CString, v15);
v10 += 2;
}
return a4;
}