//
// SetTextPopup::addPathLabel from 0xa20364 to 0xa20564 (512 bytes)
//
// 2 xrefs:
// > SFXBrowser::cellPerformedAction @ 0xb97fd4
// > ??> @ 0xc3700
//
// 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:59:39 +0000
//
__int64 __fastcall SetTextPopup::addPathLabel(__int64 a1, __int64 a2)
{
cocos2d::CCDirector *v4; // x0
const char *v5; // x2
cocos2d::CCLabelBMFont *v6; // x0
cocos2d::CCLabelBMFont *v7; // x19
int v8; // w21
void (__fastcall *v9)(cocos2d::CCLabelBMFont *, _BYTE *); // x20
void (__fastcall *v11)(cocos2d::CCLabelBMFont *, char *); // x24
char *v12; // x1
__int64 v13; // [xsp+70h] [xbp+70h] BYREF
_BYTE v14[8]; // [xsp+78h] [xbp+78h] BYREF
__int64 v15[2]; // [xsp+80h] [xbp+80h] BYREF
void *v16; // [xsp+90h] [xbp+90h]
v4 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(_stack_chk_guard);
cocos2d::CCDirector::getWinSize(&v13, v4);
v6 = (cocos2d::CCLabelBMFont *)(a2 + 1);
if ( (*(_BYTE *)a2 & 1) != 0 )
v6 = *(cocos2d::CCLabelBMFont **)(a2 + 16);
v7 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(v6, "chatFont.fnt", v5);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, __int64))(*(_QWORD *)v7 + 1024LL))(v7, 4294967240LL);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, void *))(*(_QWORD *)v7 + 1072LL))(v7, &unk_116D890);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, float))(*(_QWORD *)v7 + 160LL))(v7, 0.6);
v8 = GameToolbox::pathSegmentCount((unsigned __int8 *)a2, " / ") - 1;
if ( v8 > 0 )
{
do
{
if ( (float)(*(float *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v7 + 328LL))(v7) * 0.6) <= 280.0 )
break;
v11 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, char *))(*(_QWORD *)v7 + 928LL);
GameToolbox::keepLastPathSegments(" / ", a2, v8, v15);
v12 = (char *)v15 + 1;
if ( (v15[0] & 1) != 0 )
v12 = (char *)v16;
v11(v7, v12);
if ( (v15[0] & 1) != 0 )
operator delete(v16);
--v8;
}
while ( v8 );
}
cocos2d::CCLabelBMFont::limitLabelWidth(v7, 280.0, 0.6, 0.3);
v9 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, _BYTE *))(*(_QWORD *)v7 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v14,
*(float *)&v13 * 0.5,
(float)((float)(*((float *)&v13 + 1) * 0.5) + -22.0) + *(float *)(a1 + 684));
v9(v7, v14);
(*(void (__fastcall **)(_QWORD, cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v7);
return _stack_chk_guard;
}