//
// sub_1004C3588 from 0x1004c3588 to 0x1004c37e4 (604 bytes)
//
// 2 xrefs:
// > sub_1004C323C @ 0x1004c3314
// > sub_1004C323C @ 0x1004c3450
//
// 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 11:06:21 +0000
//
void *__fastcall sub_1004C3588(__int64 a1, __int64 a2)
{
void *v4; // x19
float v5; // s8
float v6; // s9
const char *v7; // x0
void *v8; // x0
void *v9; // x22
float v10; // s0
float v11; // s10
float v12; // s0
const char *v13; // x8
__int64 v14; // x21
const char *v15; // t1
const char *v16; // x0
char *v17; // x8
__int64 v18; // x20
char *v19; // t1
void *v20; // x0
__int64 v21; // x21
float v23; // [xsp+8h] [xbp-58h] BYREF
v4 = cocos2d::CCSprite::create_1();
sub_1000262C4(&v23, *(float *)(a2 + 68) + -10.0, *(float *)(a2 + 72));
(*(void (__fastcall **)(void *, float *))(*(_QWORD *)v4 + 320LL))(v4, &v23);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v4 + 984LL))(v4, 1);
v5 = *(float *)((*(__int64 (__fastcall **)(void *))(*(_QWORD *)v4 + 328LL))(v4) + 4) * 0.5;
v6 = *(float *)(a2 + 68) + -10.0;
v7 = (const char *)(a1 + 32);
if ( *(char *)(a1 + 55) < 0 )
{
if ( !*(_QWORD *)(a1 + 40) )
{
LABEL_12:
v11 = 0.0;
goto LABEL_13;
}
v7 = *(const char **)v7;
}
else if ( !*(_BYTE *)(a1 + 55) )
{
goto LABEL_12;
}
if ( *(char *)(a2 + 55) >= 0 )
v8 = cocos2d::CCLabelBMFont::create_1(v7, (char *)(a2 + 32));
else
v8 = cocos2d::CCLabelBMFont::create_1(v7, *(char **)(a2 + 32));
v9 = v8;
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v8 + 1072LL))(v8, a2 + 63);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v9 + 160LL))(v9, *(float *)(a2 + 56));
sub_1000262BC(&v23, 0.0, 0.5);
(*(void (__fastcall **)(void *, float *))(*(_QWORD *)v9 + 296LL))(v9, &v23);
sub_1000262BC(&v23, 0.0, v5);
(*(void (__fastcall **)(void *, float *))(*(_QWORD *)v9 + 184LL))(v9, &v23);
(*(void (__fastcall **)(void *, void *))(*(_QWORD *)v4 + 456LL))(v4, v9);
v10 = (float)(*(float *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v9 + 328LL))(v9) * *(float *)(a2 + 56)) + 4.0;
v11 = v10 + 0.0;
v12 = v6 - v10;
if ( v12 >= 0.0 )
v6 = v12;
else
v6 = 0.0;
LABEL_13:
v15 = *(const char **)(a1 + 8);
v14 = a1 + 8;
v13 = v15;
if ( *(char *)(v14 + 23) >= 0 )
v16 = (const char *)v14;
else
v16 = v13;
v19 = *(char **)(a2 + 32);
v18 = a2 + 32;
v17 = v19;
if ( *(char *)(v18 + 23) >= 0 )
v20 = cocos2d::CCLabelBMFont::create_1(v16, (char *)v18);
else
v20 = cocos2d::CCLabelBMFont::create_1(v16, v17);
v21 = (__int64)v20;
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v20 + 1072LL))(v20, v18 + 28);
cocos2d::CCLabelBMFont::limitLabelWidth(v21, v6, *(float *)(v18 + 24), *(float *)(v18 + 24) * 0.2);
sub_1000262BC(&v23, 0.0, 0.5);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v21 + 296LL))(v21, &v23);
sub_1000262BC(&v23, v11, v5);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v21 + 184LL))(v21, &v23);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v4 + 456LL))(v4, v21);
return v4;
}