//
// cocos2d::CCLabelAtlas::updateAtlasValues from 0x180047fc0 to 0x18004829c (732 bytes)
//
// 3 xrefs:
// > ??> @ 0x1800f1818
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bb9ec
//
// 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:21:41 +0000
//
void __fastcall cocos2d::CCLabelAtlas::updateAtlasValues(cocos2d::CCLabelAtlas *this)
{
unsigned int v1; // esi
char *v2; // r14
__int64 v4; // rbx
float v5; // xmm8_4
float v6; // xmm9_4
cocos2d::CCDirector *v7; // rax
float v8; // xmm6_4
cocos2d::CCDirector *v9; // rax
float v10; // xmm7_4
__int64 v11; // rax
__int64 v12; // r9
__int64 v13; // r8
float v14; // xmm4_4
unsigned int v15; // eax
unsigned int v16; // edx
int v17; // ecx
__int64 v18; // rdx
float v19; // xmm3_4
unsigned int v20; // ecx
float v21; // xmm3_4
float v22; // xmm1_4
float v23; // xmm0_4
int v24; // eax
int v25; // eax
int v26; // eax
int v27; // eax
int v28; // eax
unsigned int v29; // eax
int v30; // [rsp+70h] [rbp+8h]
v1 = *((_DWORD *)this + 108);
v2 = (char *)this + 416;
if ( *((_QWORD *)this + 55) > 0xFu )
v2 = *(char **)v2;
v4 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 47) + 88LL))(*((_QWORD *)this + 47));
v5 = (float)(*(int (__fastcall **)(__int64))(*(_QWORD *)v4 + 80LL))(v4);
v6 = (float)(*(int (__fastcall **)(__int64))(*(_QWORD *)v4 + 88LL))(v4);
v7 = cocos2d::CCDirector::sharedDirector();
v8 = (float)*((int *)this + 90) * cocos2d::CCDirector::getContentScaleFactor(v7);
v9 = cocos2d::CCDirector::sharedDirector();
v10 = (float)*((int *)this + 91) * cocos2d::CCDirector::getContentScaleFactor(v9);
if ( *((_BYTE *)this + 404) )
{
v10 = (float)*((int *)this + 91);
v8 = (float)*((int *)this + 90);
}
(*(void (__fastcall **)(_QWORD))(**((_QWORD **)this + 47) + 80LL))(*((_QWORD *)this + 47));
v11 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 47) + 104LL))(*((_QWORD *)this + 47));
LODWORD(v12) = 0;
if ( v1 )
{
v13 = v11 + 20;
v14 = v8 / v5;
do
{
v15 = (unsigned int)(unsigned __int8)(*v2 - *((_BYTE *)this + 448)) / *((_DWORD *)this + 88);
v16 = (unsigned int)(unsigned __int8)(*v2++ - *((_BYTE *)this + 448)) % *((_DWORD *)this + 88);
v17 = v16;
v18 = v15;
v19 = (float)v17;
v20 = v12 + 1;
v21 = (float)(v19 * v8) / v5;
v22 = (float)((float)(int)v15 * v10) / v6;
*(float *)(v13 - 4) = v21;
*(float *)v13 = v22;
*(float *)(v13 + 48) = v22;
*(float *)(v13 + 20) = v21;
v23 = v22 + (float)(v10 / v6);
*(float *)(v13 + 44) = v21 + v14;
*(float *)(v13 + 68) = v21 + v14;
*(float *)(v13 + 24) = v23;
*(float *)(v13 + 72) = v23;
v24 = *((_DWORD *)this + 90) * v12;
*(_QWORD *)(v13 + 8) = 0;
*(float *)(v13 + 4) = (float)v24;
v25 = *((_DWORD *)this + 90) * (v12 + 1);
*(_QWORD *)(v13 + 56) = 0;
*(float *)(v13 + 52) = (float)v25;
v26 = *((_DWORD *)this + 90) * v12;
v12 = (unsigned int)(v12 + 1);
*(float *)(v13 - 20) = (float)v26;
v27 = *((_DWORD *)this + 91);
*(_DWORD *)(v13 - 12) = 0;
*(float *)(v13 - 16) = (float)v27;
*(float *)(v13 + 28) = (float)(int)(*((_DWORD *)this + 90) * v20);
v28 = *((_DWORD *)this + 91);
*(_DWORD *)(v13 + 36) = 0;
*(float *)(v13 + 32) = (float)v28;
LOWORD(v30) = *((_WORD *)this + 165);
BYTE2(v30) = *((_BYTE *)this + 332);
HIBYTE(v30) = *((_BYTE *)this + 328);
*(_DWORD *)(v13 - 8) = v30;
*(_DWORD *)(v13 + 40) = v30;
*(_DWORD *)(v13 + 16) = v30;
*(_DWORD *)(v13 + 64) = v30;
v13 += 96;
}
while ( v20 < v1 );
*(_BYTE *)(*((_QWORD *)this + 47) + 72LL) = 1;
v29 = (*(__int64 (__fastcall **)(_QWORD, __int64, __int64, __int64))(**((_QWORD **)this + 47) + 72LL))(
*((_QWORD *)this + 47),
v18,
v13,
v12);
if ( v1 > v29 )
cocos2d::CCTextureAtlas::increaseTotalQuadsWith(*((cocos2d::CCTextureAtlas **)this + 47), v1 - v29);
}
}