//
// cocos2d::CCLabelTTF::_prepareTextDefinition from 0xd5aa68 to 0xd5ad64 (764 bytes)
//
// 3 xrefs:
// > cocos2d::CCLabelTTF::updateTexture @ 0xd5adac
// > cocos2d::CCLabelTTF::getTextDefinition @ 0xd5b4b4
// > ??> @ 0xeca10
//
// 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 13:07:46 +0000
//
__int64 __usercall cocos2d::CCLabelTTF::_prepareTextDefinition@(
cocos2d::CCLabelTTF *this@,
unsigned __int8 a2@,
__int64 a3@)
{
float *v3; // x23
int v4; // w24
__int64 v7; // x1
cocos2d::CCSize *v8; // x25
float *v9; // x0
__int64 v10; // x0
cocos2d::CCDirector *v11; // x0
float v12; // s9
cocos2d::CCDirector *v13; // x0
float v14; // s0
float v15; // s8
float v16; // s9
cocos2d::CCDirector *v17; // x0
cocos2d::CCDirector *v18; // x0
float v19; // s0
cocos2d::CCDirector *v20; // x0
float v21; // s8
cocos2d::CCDirector *v22; // x0
cocos2d::CCDirector *v24; // x0
float v25; // s9
cocos2d::CCDirector *v26; // x0
float ContentScaleFactor; // s0
float v28; // s8
float v29; // s9
cocos2d::CCDirector *v30; // x0
cocos2d::CCDirector *v31; // x0
float v32; // s0
float v33; // s8
cocos2d::CCDirector *v34; // x0
float v35; // [xsp+60h] [xbp+60h] BYREF
__int64 v36; // [xsp+68h] [xbp+68h]
v3 = (float *)(a3 + 36);
v4 = a2;
*(_QWORD *)(a3 + 8) = 0;
v7 = _stack_chk_guard;
*(_QWORD *)(a3 + 16) = 0;
*(_DWORD *)(a3 + 28) = 1;
v8 = (cocos2d::CCSize *)(a3 + 52);
*(_QWORD *)a3 = 0;
*(_DWORD *)(a3 + 32) = 0;
v36 = v7;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)(a3 + 36));
*(_BYTE *)(a3 + 48) = 0;
*(_BYTE *)(a3 + 44) = -1;
*(_BYTE *)(a3 + 45) = -1;
*(_BYTE *)(a3 + 46) = -1;
cocos2d::CCSize::CCSize(v8);
*(_BYTE *)(a3 + 68) = 0;
cocos2d::CCSize::CCSize(&v35, 0.0, 0.0);
v9 = cocos2d::CCSize::operator=(v3, &v35);
if ( v4 )
{
v33 = *((float *)this + 158);
v34 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v9);
*(_DWORD *)(a3 + 24) = (int)(float)(v33 * cocos2d::CCDirector::getContentScaleFactor(v34));
v10 = *((_QWORD *)this + 78);
if ( a3 == v10 )
{
*(_DWORD *)(a3 + 28) = *((_DWORD *)this + 154);
v11 = (cocos2d::CCDirector *)*((unsigned int *)this + 155);
*(_DWORD *)(a3 + 32) = (_DWORD)v11;
goto LABEL_5;
}
}
else
{
*(_DWORD *)(a3 + 24) = (int)*((float *)this + 158);
v10 = *((_QWORD *)this + 78);
if ( a3 == v10 )
{
*(_DWORD *)(a3 + 28) = *((_DWORD *)this + 154);
*(_DWORD *)(a3 + 32) = *((_DWORD *)this + 155);
goto LABEL_10;
}
}
if ( (*(_BYTE *)v10 & 1) == 0 )
{
std::string::assign((__int64 *)a3, (const void *)(v10 + 1), *(_BYTE *)v10 >> 1);
*(_DWORD *)(a3 + 28) = *((_DWORD *)this + 154);
v11 = (cocos2d::CCDirector *)*((unsigned int *)this + 155);
*(_DWORD *)(a3 + 32) = (_DWORD)v11;
if ( v4 )
goto LABEL_5;
LABEL_10:
cocos2d::CCSize::operator=(v3, (float *)this + 152);
if ( *((_BYTE *)this + 684) )
{
*(_BYTE *)(a3 + 68) = 1;
*(_WORD *)(a3 + 69) = *(_WORD *)((char *)this + 685);
*(_BYTE *)(a3 + 71) = *((_BYTE *)this + 687);
*(_DWORD *)(a3 + 72) = *((_DWORD *)this + 172);
if ( !*((_BYTE *)this + 664) )
goto LABEL_7;
*(_BYTE *)(a3 + 48) = 1;
*(_DWORD *)(a3 + 60) = *((_DWORD *)this + 170);
*(_DWORD *)(a3 + 64) = *((_DWORD *)this + 169);
goto LABEL_13;
}
LABEL_14:
*(_BYTE *)(a3 + 68) = 0;
if ( !*((_BYTE *)this + 664) )
goto LABEL_7;
*(_BYTE *)(a3 + 48) = 1;
*(_DWORD *)(a3 + 60) = *((_DWORD *)this + 170);
v24 = (cocos2d::CCDirector *)*((unsigned int *)this + 169);
*(_DWORD *)(a3 + 64) = (_DWORD)v24;
if ( v4 )
{
LABEL_16:
v25 = *((float *)this + 167);
v26 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v24);
ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v26);
v28 = *((float *)this + 168);
v29 = v25 * ContentScaleFactor;
v31 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v30);
v32 = cocos2d::CCDirector::getContentScaleFactor(v31);
cocos2d::CCSize::CCSize(&v35, v29, v28 * v32);
cocos2d::CCSize::operator=((float *)v8, &v35);
goto LABEL_8;
}
LABEL_13:
cocos2d::CCSize::operator=((float *)v8, (float *)this + 167);
goto LABEL_8;
}
std::string::assign((__int64 *)a3, *(const void **)(v10 + 16), *(_QWORD *)(v10 + 8));
*(_DWORD *)(a3 + 28) = *((_DWORD *)this + 154);
v11 = (cocos2d::CCDirector *)*((unsigned int *)this + 155);
*(_DWORD *)(a3 + 32) = (_DWORD)v11;
if ( !v4 )
goto LABEL_10;
LABEL_5:
v12 = *((float *)this + 152);
v13 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v11);
v14 = cocos2d::CCDirector::getContentScaleFactor(v13);
v15 = *((float *)this + 153);
v16 = v12 * v14;
v18 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v17);
v19 = cocos2d::CCDirector::getContentScaleFactor(v18);
cocos2d::CCSize::CCSize(&v35, v16, v15 * v19);
cocos2d::CCSize::operator=(v3, &v35);
if ( !*((_BYTE *)this + 684) )
goto LABEL_14;
*(_BYTE *)(a3 + 68) = 1;
*(_WORD *)(a3 + 69) = *(_WORD *)((char *)this + 685);
v20 = (cocos2d::CCDirector *)*((unsigned __int8 *)this + 687);
*(_BYTE *)(a3 + 71) = (_BYTE)v20;
v21 = *((float *)this + 172);
v22 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v20);
*(float *)(a3 + 72) = v21 * cocos2d::CCDirector::getContentScaleFactor(v22);
if ( *((_BYTE *)this + 664) )
{
*(_BYTE *)(a3 + 48) = 1;
*(_DWORD *)(a3 + 60) = *((_DWORD *)this + 170);
v24 = (cocos2d::CCDirector *)*((unsigned int *)this + 169);
*(_DWORD *)(a3 + 64) = (_DWORD)v24;
goto LABEL_16;
}
LABEL_7:
*(_BYTE *)(a3 + 48) = 0;
LABEL_8:
*(_WORD *)(a3 + 44) = *((_WORD *)this + 346);
*(_BYTE *)(a3 + 46) = *((_BYTE *)this + 694);
return a3;
}