//
// ScrollViewPopup::addVersionHeader from 0xb992d4 to 0xb996cc (1016 bytes)
//
// 3 xrefs:
// > MusicChangelogPopup::buildContent @ 0xb89660
// > SFXChangelogPopup::buildContent @ 0xb988e8
// > ??> @ 0x4d638
//
// 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:02:42 +0000
//
__int64 __fastcall ScrollViewPopup::addVersionHeader(
ScrollViewPopup *this,
cocos2d::CCNode *a2,
char *a3,
int a4,
float a5,
float a6)
{
unsigned int v7; // w20
struct tm *v10; // x3
unsigned __int64 v11; // x19
unsigned __int64 v12; // x26
char *v13; // x27
unsigned __int64 v14; // x0
__int64 v15; // x24
void *v16; // x0
void *v17; // x28
int v18; // w19
int v19; // w0
char *v20; // x3
char *v21; // x2
cocos2d::CCString *v22; // x0
const char *CString; // x24
size_t v24; // x0
const char *v25; // x2
size_t v26; // x19
cocos2d::CCLabelBMFont *v27; // x3
cocos2d::CCLabelBMFont *v28; // x0
cocos2d::CCLabelBMFont *v29; // x19
void (__fastcall *v30)(cocos2d::CCLabelBMFont *, time_t *); // x23
void (__fastcall *v31)(cocos2d::CCLabelBMFont *, time_t *); // x23
unsigned __int64 v33; // x23
char *v34; // x3
time_t v35; // [xsp+80h] [xbp+80h] BYREF
__int64 v36; // [xsp+88h] [xbp+88h] BYREF
unsigned __int64 v37; // [xsp+90h] [xbp+90h]
void *v38; // [xsp+98h] [xbp+98h]
__int64 v39; // [xsp+A0h] [xbp+A0h] BYREF
size_t v40; // [xsp+A8h] [xbp+A8h]
cocos2d::CCLabelBMFont *v41; // [xsp+B0h] [xbp+B0h]
char s[32]; // [xsp+B8h] [xbp+B8h] BYREF
v7 = (unsigned int)a3;
v36 = 0;
v37 = 0;
v38 = nullptr;
if ( a4 <= 0 )
{
LABEL_16:
v18 = (unsigned __int8)v36;
v19 = v36 & 1;
goto LABEL_17;
}
v35 = a4;
v10 = gmtime(&v35);
if ( v10 )
{
strftime(s, 0x20u, "%b %d, %Y", v10);
v11 = strlen(s);
if ( (v36 & 1) != 0 )
{
v12 = (v36 & 0xFFFFFFFFFFFFFFFELL) - 1;
if ( v11 > v12 )
{
v15 = -17;
if ( v11 - v12 <= -17LL - (v36 & 0xFFFFFFFFFFFFFFFELL) )
{
v13 = (char *)v38;
if ( v12 > 0x7FFFFFFFFFFFFFE6LL )
{
LABEL_11:
v16 = (void *)operator new(v15);
v17 = v16;
if ( v11 )
memcpy(v16, s, v11);
if ( v12 != 22 )
operator delete(v13);
v38 = v17;
v37 = v11;
v36 = v15 | 1;
*((_BYTE *)v17 + v11) = 0;
goto LABEL_16;
}
LABEL_7:
v14 = 2 * v12;
v15 = 23;
if ( 2 * v12 < v11 )
v14 = v11;
if ( v14 > 0x16 )
v15 = (v14 + 16) & 0xFFFFFFFFFFFFFFF0LL;
goto LABEL_11;
}
LABEL_49:
sub_62F6DC();
}
v34 = (char *)v38;
}
else
{
if ( v11 > 0x16 )
{
if ( v11 - 22 <= 0xFFFFFFFFFFFFFFD8LL )
{
v12 = 22;
v13 = (char *)&v36 + 1;
goto LABEL_7;
}
goto LABEL_49;
}
v34 = (char *)&v36 + 1;
}
if ( v11 )
v34 = (char *)memmove(v34, s, v11);
v34[v11] = 0;
if ( (v36 & 1) != 0 )
{
v37 = v11;
LABEL_18:
v20 = (char *)v38;
if ( v37 )
v21 = " - ";
else
v21 = &byte_11B8890;
goto LABEL_22;
}
v19 = 0;
LOBYTE(v36) = 2 * v11;
v18 = (unsigned __int8)(2 * v11);
}
else
{
v18 = (unsigned __int8)v36;
v19 = v36 & 1;
}
LABEL_17:
if ( v19 )
goto LABEL_18;
v20 = (char *)&v36 + 1;
if ( v18 >> 1 )
v21 = " - ";
else
v21 = &byte_11B8890;
LABEL_22:
v22 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Version %i%s%s",
(const char *)v7,
v21,
v20);
CString = (const char *)cocos2d::CCString::getCString(v22);
v39 = 0;
v40 = 0;
v41 = nullptr;
v24 = strlen(CString);
v26 = v24;
if ( v24 > 0xFFFFFFFFFFFFFFEFLL )
sub_62F6DC();
if ( v24 > 0x16 )
{
v33 = (v24 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v27 = (cocos2d::CCLabelBMFont *)operator new(v33);
v41 = v27;
v40 = v26;
v39 = v33 | 1;
}
else
{
LOBYTE(v39) = 2 * v24;
v27 = (cocos2d::CCLabelBMFont *)((char *)&v39 + 1);
if ( !v24 )
goto LABEL_25;
}
v27 = (cocos2d::CCLabelBMFont *)memcpy(v27, CString, v26);
LABEL_25:
*((_BYTE *)v27 + v26) = 0;
v28 = (cocos2d::CCLabelBMFont *)((char *)&v39 + 1);
if ( (v39 & 1) != 0 )
v28 = v41;
v29 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(v28, "goldFont.fnt", v25);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, float))(*(_QWORD *)v29 + 160LL))(v29, 0.55);
cocos2d::CCLabelBMFont::limitLabelWidth(v29, a6 - 30.0, 0.55, 0.3);
v30 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, time_t *))(*(_QWORD *)v29 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v35, 0.0, 0.5);
v30(v29, &v35);
v31 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, time_t *))(*(_QWORD *)v29 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v35, 15.0, (float)(a5 - 4.0) - 11.0);
v31(v29, &v35);
(*(void (__fastcall **)(cocos2d::CCNode *, cocos2d::CCLabelBMFont *))(*(_QWORD *)a2 + 456LL))(a2, v29);
if ( (v39 & 1) != 0 )
operator delete(v41);
if ( (v36 & 1) != 0 )
operator delete(v38);
return _stack_chk_guard;
}