//
// cocos2d::CCLabelAtlas::updateAtlasValues from 0xd5424c to 0xd544e8 (668 bytes)
//
// 2 xrefs:
// > ??> @ 0x6bd70
// > ??> @ 0x1517640
//
// 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:42 +0000
//
__int64 __fastcall cocos2d::CCLabelAtlas::updateAtlasValues(cocos2d::CCLabelAtlas *this)
{
int v2; // w21
int v3; // w21
char *v4; // x23
__int64 v5; // x20
float v6; // s11
cocos2d::CCDirector *v7; // x0
unsigned int v8; // w22
float v9; // s10
cocos2d::CCDirector *v10; // x0
float ContentScaleFactor; // s0
unsigned int v12; // w20
float v13; // s9
cocos2d::CCDirector *v14; // x0
cocos2d::CCDirector *v15; // x0
float v16; // s0
float v17; // s9
float v18; // s8
__int64 result; // x0
float v20; // s5
char *v21; // x1
unsigned int v22; // w20
char v23; // t1
unsigned int v24; // w2
bool v25; // zf
unsigned int v26; // w5
float v27; // s2
float v28; // s1
float v29; // s4
int v30; // w2
int v31; // w2
unsigned int v32; // w2
unsigned int v33; // w2
unsigned int v34; // w2
char v35; // w4
char v36; // w3
v2 = *((unsigned __int8 *)this + 416);
if ( (v2 & 1) != 0 )
{
v3 = *((_DWORD *)this + 106);
v4 = *((char **)this + 54);
}
else
{
v3 = v2 >> 1;
v4 = (char *)this + 417;
}
v5 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 47) + 96LL))(*((_QWORD *)this + 47));
v6 = (float)(*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v5 + 88LL))(v5);
v7 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 96LL))(v5);
v8 = *((_DWORD *)this + 90);
v9 = (float)(unsigned int)v7;
v10 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v7);
ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v10);
v12 = *((_DWORD *)this + 91);
v13 = ContentScaleFactor;
v15 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v14);
v16 = cocos2d::CCDirector::getContentScaleFactor(v15);
if ( *((_BYTE *)this + 404) )
{
v17 = (float)*((unsigned int *)this + 90);
v18 = (float)*((unsigned int *)this + 91);
}
else
{
v17 = (float)v8 * v13;
v18 = (float)v12 * v16;
}
(*(void (__fastcall **)(_QWORD))(**((_QWORD **)this + 47) + 88LL))(*((_QWORD *)this + 47));
result = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 47) + 112LL))(*((_QWORD *)this + 47));
if ( v3 )
{
v20 = v17 / v6;
v21 = v4;
v22 = 0;
do
{
v23 = *v21++;
result += 96;
v24 = *((_DWORD *)this + 88);
v25 = v22 + 1 == v3;
v26 = (unsigned __int8)(v23 - *((_DWORD *)this + 110));
v27 = (float)((float)(int)(v26 / v24) * v18) / v9;
v28 = (float)((float)(v26 % v24) * v17) / v6;
*(float *)(result - 76) = v27;
*(float *)(result - 28) = v27;
v29 = v27 + (float)(v18 / v9);
*(float *)(result - 80) = v28;
*(float *)(result - 56) = v28;
*(float *)(result - 52) = v29;
*(float *)(result - 4) = v29;
*(float *)(result - 32) = v28 + v20;
*(float *)(result - 8) = v28 + v20;
v30 = *((_DWORD *)this + 90);
*(_DWORD *)(result - 68) = 0;
*(_DWORD *)(result - 64) = 0;
*(float *)(result - 72) = (float)(v22 * v30);
v31 = *((_DWORD *)this + 90);
*(_DWORD *)(result - 20) = 0;
*(_DWORD *)(result - 16) = 0;
*(float *)(result - 24) = (float)((v22 + 1) * v31);
v32 = v22 * *((_DWORD *)this + 90);
++v22;
*(float *)(result - 96) = (float)v32;
v33 = *((_DWORD *)this + 91);
*(_DWORD *)(result - 88) = 0;
*(float *)(result - 92) = (float)v33;
*(float *)(result - 48) = (float)(v22 * *((_DWORD *)this + 90));
v34 = *((_DWORD *)this + 91);
*(_DWORD *)(result - 40) = 0;
*(float *)(result - 44) = (float)v34;
v35 = *((_BYTE *)this + 331);
v36 = *((_BYTE *)this + 332);
LOBYTE(v34) = *((_BYTE *)this + 328);
LOBYTE(v26) = *((_BYTE *)this + 330);
*(_BYTE *)(result - 84) = v26;
*(_BYTE *)(result - 83) = v35;
*(_BYTE *)(result - 82) = v36;
*(_BYTE *)(result - 81) = v34;
*(_BYTE *)(result - 36) = v26;
*(_BYTE *)(result - 35) = v35;
*(_BYTE *)(result - 34) = v36;
*(_BYTE *)(result - 33) = v34;
*(_BYTE *)(result - 60) = v26;
*(_BYTE *)(result - 59) = v35;
*(_BYTE *)(result - 58) = v36;
*(_BYTE *)(result - 57) = v34;
*(_BYTE *)(result - 12) = v26;
*(_BYTE *)(result - 11) = v35;
*(_BYTE *)(result - 10) = v36;
*(_BYTE *)(result - 9) = v34;
}
while ( !v25 );
*(_BYTE *)(*((_QWORD *)this + 47) + 72LL) = 1;
result = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 47) + 80LL))(*((_QWORD *)this + 47));
if ( (unsigned int)result < v22 )
return cocos2d::CCTextureAtlas::increaseTotalQuadsWith(
*((cocos2d::CCTextureAtlas **)this + 47),
v22 - (unsigned int)result);
}
return result;
}