//
// EmoteSprite::attachToLabel from 0x6e16a0 to 0x6e1984 (740 bytes)
//
// 7 xrefs:
// > CCTextInputNode::updateLabel @ 0x6c31b0
// > CommentCell::loadFromComment @ 0x74c190
// > NewsPopup::rebuildPage @ 0xb8b31c
// > InvitesPopup::buildRows @ 0xc82044
// > EditorSoundConfigUploadPopup::init @ 0xcd4e08
// > ReportPopup::init @ 0xd00c94
// > ??> @ 0x4ab00
//
// 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:51:39 +0000
//
__int64 __fastcall EmoteSprite::attachToLabel(__int64 a1, __int64 a2, __int64 *a3, float a4)
{
float v7; // s8
__int64 v8; // x20
unsigned __int64 v9; // x22
float v10; // s9
float v11; // s9
__int64 v12; // x0
const char *v13; // x0
size_t v14; // x0
__int64 v15; // x21
int v16; // w1
__int64 (__fastcall *v17)(__int64, _QWORD); // x21
unsigned int v18; // w0
__int64 v19; // x23
cocos2d::CCSprite *v20; // x21
__int64 v21; // x0
long double v22; // q0
__int64 v23; // x23
float v24; // s0
float v25; // s0
long double v26; // q1
void (__fastcall *v27)(__int64, cocos2d::CCSprite *, _QWORD); // x23
int v28; // w0
float *v30; // x0
float v31; // s8
void (__fastcall *v32)(cocos2d::CCSprite *, __int64 *); // [xsp+80h] [xbp+80h]
float v33; // [xsp+90h] [xbp+90h]
char *v34; // [xsp+90h] [xbp+90h]
_BYTE v35[8]; // [xsp+A0h] [xbp+A0h] BYREF
__int64 v36; // [xsp+A8h] [xbp+A8h] BYREF
__int64 v37; // [xsp+B8h] [xbp+B8h] BYREF
__int64 v38[2]; // [xsp+C0h] [xbp+C0h] BYREF
void *v39; // [xsp+D0h] [xbp+D0h]
v7 = a4;
if ( a1 && a2 )
{
if ( a4 <= 0.0 )
{
v30 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 328LL))(a1);
v31 = v30[1];
v7 = v31 * EmoteSprite::heightFactor((EmoteSprite *)v30);
}
v8 = 0;
v9 = 0;
v10 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 304LL))(a1);
v33 = v10 * *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 328LL))(a1);
v11 = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 304LL))(a1) + 4);
v12 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 328LL))(a1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v35, v33, v11 * *(float *)(v12 + 4));
v13 = (const char *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 944LL))(a1);
v38[0] = 0;
v34 = (char *)v13;
v38[1] = 0;
v39 = nullptr;
v14 = strlen(v13);
std::string::__init(v38, v34, v14);
v15 = *a3;
if ( 0xAAAAAAAAAAAAAAABLL * ((a3[1] - *a3) >> 3) )
{
do
{
v16 = *(_DWORD *)(v15 + v8);
v17 = *(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 480LL);
v18 = EmoteSprite::charIndexForByte((unsigned __int8 *)v38, v16);
v19 = v17(a1, v18);
if ( v19 )
{
v20 = EmoteSprite::createWithDef(*(_QWORD *)(*a3 + v8 + 16));
if ( v20 )
{
v21 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v19 + 192LL))(v19);
cocos2d::CCPoint::operator-(&v36, v21, v35, v22);
v32 = *(void (__fastcall **)(cocos2d::CCSprite *, __int64 *))(*(_QWORD *)v20 + 184LL);
v23 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 192LL))(a1);
v24 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a1 + 168LL))(a1);
cocos2d::CCPoint::operator*(&v36, v24);
cocos2d::CCPoint::operator+(&v37, v23);
v32(v20, &v37);
v25 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a1 + 168LL))(a1);
LODWORD(v26) = 0;
EmoteSprite::fitToHeight(v20, v7 * v25, v26);
v27 = *(void (__fastcall **)(__int64, cocos2d::CCSprite *, _QWORD))(*(_QWORD *)a2 + 464LL);
v28 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 104LL))(a1);
v27(a2, v20, (unsigned int)(v28 + 1));
}
}
v15 = *a3;
++v9;
v8 += 24;
}
while ( v9 < 0xAAAAAAAAAAAAAAABLL * ((a3[1] - *a3) >> 3) );
}
if ( (v38[0] & 1) != 0 )
operator delete(v39);
}
return _stack_chk_guard;
}