//
// CreateGuidelinesLayer::getMergedRecordString from 0x1401346b0 to 0x140134922 (626 bytes)
//
// 2 xrefs:
// > CreateGuidelinesLayer::recordingDidStop @ 0x1401345c7
// > ??> @ 0x140917018
//
// This function is hookable on this platform (idp: pc, 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 11:27:04 +0000
//
// Hidden C++ exception states: #wind=3
_QWORD *__fastcall CreateGuidelinesLayer::getMergedRecordString(__int64 a1, _QWORD *a2, __int64 *a3, __int64 *a4)
{
unsigned int v6; // esi
cocos2d::CCArray *v7; // rbp
cocos2d::CCArray *v8; // r14
__int64 v9; // rcx
cocos2d::CCArray *v10; // r12
int v11; // r13d
char v12; // di
float v13; // xmm7_4
float v14; // xmm6_4
cocos2d::CCString *v15; // rax
cocos2d::CCString *v16; // rax
float v17; // xmm1_4
cocos2d::CCArray *v18; // rbx
struct cocos2d::CCObject *v19; // rax
struct cocos2d::CCObject *v20; // rax
cocos2d::CCString *v21; // rax
float v22; // xmm0_4
cocos2d::CCString *v23; // rax
char *CString; // rax
size_t v25; // r8
v6 = 0;
v7 = sub_14009A1D0(a3);
v8 = sub_14009A1D0(a4);
v10 = (cocos2d::CCArray *)cocos2d::CCArray::create(v9);
v11 = 0;
v12 = 1;
while ( 1 )
{
v13 = 9999999.0;
v14 = 9999999.0;
if ( cocos2d::CCArray::count(v7) > 1 )
{
v15 = cocos2d::CCArray::stringAtIndex(v7, 0);
v14 = cocos2d::CCString::floatValue(v15);
}
if ( cocos2d::CCArray::count(v8) > 1 )
{
v16 = cocos2d::CCArray::stringAtIndex(v8, 0);
v13 = cocos2d::CCString::floatValue(v16);
}
v17 = fminf(v14, v13);
if ( v17 != 9999999.0 )
{
if ( v17 == v14 )
{
v18 = v7;
LABEL_11:
v19 = cocos2d::CCArray::objectAtIndex(v18, 0);
cocos2d::CCArray::addObject(v10, v19);
v20 = cocos2d::CCArray::objectAtIndex(v18, 1u);
cocos2d::CCArray::addObject(v10, v20);
cocos2d::CCArray::removeObjectAtIndex(v18, 0, 1);
cocos2d::CCArray::removeObjectAtIndex(v18, 0, 1);
++v11;
goto LABEL_13;
}
if ( v17 == v13 )
{
v18 = v8;
goto LABEL_11;
}
}
v12 = 0;
LABEL_13:
if ( v11 > 1000 )
break;
if ( !v12 )
goto LABEL_17;
}
(**(void (__fastcall ***)(__int64, const char *))(*(_QWORD *)(a1 + 704) + 360LL))(
*(_QWORD *)(a1 + 704) + 360LL,
"Maximum limit exceeded");
LABEL_17:
*(_OWORD *)a2 = 0;
a2[2] = 0;
a2[3] = 15;
*(_BYTE *)a2 = 0;
if ( cocos2d::CCArray::count(v10) )
{
do
{
v21 = cocos2d::CCArray::stringAtIndex(v10, v6);
v22 = cocos2d::CCString::floatValue(v21);
v23 = cocos2d::CCString::createWithFormat("%0.2f~0~", v22);
CString = (char *)cocos2d::CCString::getCString(v23);
v25 = -1;
do
++v25;
while ( CString[v25] );
sub_140044D80(a2, CString, v25);
v6 += 2;
}
while ( v6 < cocos2d::CCArray::count(v10) );
}
sub_14003D310((__int64)a3);
sub_14003D310((__int64)a4);
return a2;
}