//
// CreateGuidelinesLayer::getMergedRecordString from 0x3f9010 to 0x3f9180 (368 bytes)
//
// 1 xrefs:
// > CreateGuidelinesLayer::recordingDidStop @ 0x3f9250
//
// 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:47:19 +0000
//
int *__fastcall CreateGuidelinesLayer::getMergedRecordString(
int *a1,
int a2,
cocos2d::CCArray *a3,
cocos2d::CCArray *a4)
{
int v7; // r9
cocos2d::CCArray *v8; // r7
cocos2d::CCArray *v9; // r8
cocos2d::CCArray *v10; // r6
cocos2d::CCString *v11; // r0
float v12; // s16
cocos2d::CCString *v13; // r0
float v14; // r0
float v15; // s15
float v16; // s14
cocos2d::CCArray *v17; // r4
cocos2d::CCObject *v18; // r0
cocos2d::CCObject *v19; // r0
unsigned int v20; // r4
cocos2d::CCString *v21; // r0
float v22; // r0
const char *v23; // r1
cocos2d::CCString *v24; // r0
const char *CString; // r8
size_t v26; // r0
v7 = 0;
v8 = sub_3F7FF0(a3);
v9 = sub_3F7FF0(a4);
v10 = (cocos2d::CCArray *)cocos2d::CCArray::create(v9);
do
{
if ( cocos2d::CCArray::count(v8) <= 1u )
{
v12 = 10000000.0;
}
else
{
v11 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v8, 0);
v12 = COERCE_FLOAT(cocos2d::CCString::floatValue(v11));
}
if ( cocos2d::CCArray::count(v9) <= 1u )
{
if ( v12 > 10000000.0 )
goto LABEL_19;
v15 = 10000000.0;
LABEL_10:
v16 = v15;
v15 = v12;
goto LABEL_12;
}
v13 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v9, 0);
v14 = COERCE_FLOAT(cocos2d::CCString::floatValue(v13));
v15 = v14;
if ( v12 <= v14 )
goto LABEL_10;
v16 = v14;
LABEL_12:
if ( v15 == 10000000.0 )
goto LABEL_19;
if ( v15 == v12 )
{
v17 = v8;
}
else
{
if ( v15 != v16 )
goto LABEL_19;
v17 = v9;
}
v18 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(v17, 0);
++v7;
cocos2d::CCArray::addObject(v10, v18);
v19 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(v17, 1u);
cocos2d::CCArray::addObject(v10, v19);
cocos2d::CCArray::removeObjectAtIndex(v17, 0, 1);
cocos2d::CCArray::removeObjectAtIndex(v17, 0, 1);
}
while ( v7 != 1001 );
(*(void (__fastcall **)(_DWORD, const char *))(**(_DWORD **)(a2 + 540) + 464))(
*(_DWORD *)(a2 + 540),
"Maximum limit exceeded");
LABEL_19:
v20 = 0;
*a1 = 0;
a1[1] = 0;
a1[2] = 0;
std::string::__init(a1, &unk_B6B226, 0);
while ( v20 < cocos2d::CCArray::count(v10) )
{
v21 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v10, v20);
v22 = COERCE_FLOAT(cocos2d::CCString::floatValue(v21));
v24 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%0.2f~0~", v23, v22);
CString = (const char *)cocos2d::CCString::getCString(v24);
v26 = strlen(CString);
std::string::append(a1, CString, v26);
v20 += 2;
}
return a1;
}