//
// ButtonSprite::init_1 from 0x1000680c0 to 0x1000682e0 (544 bytes)
//
// 1 xrefs:
// > ButtonSprite::create_1 @ 0x10006805c
//
// 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 10:57:57 +0000
//
__int64 __fastcall ButtonSprite::init_1(
__int64 a1,
__int64 a2,
int a3,
int a4,
char a5,
char *a6,
__int64 a7,
float a8,
float a9)
{
__int64 v18; // x20
__int64 v19; // x28
size_t v20; // x8
void *v21; // x24
size_t v22; // x9
unsigned __int8 v23; // w25
void **v24; // x0
_QWORD *v25; // x1
size_t v26; // x2
_BOOL4 v27; // w26
__int64 v28; // x0
__int64 v29; // x22
_QWORD v31[2]; // [xsp+0h] [xbp-90h] BYREF
char v32; // [xsp+17h] [xbp-79h]
void *__p[2]; // [xsp+18h] [xbp-78h] BYREF
unsigned __int8 v34; // [xsp+2Fh] [xbp-61h]
v18 = cocos2d::CCSprite::init(a1);
if ( (_DWORD)v18 )
{
*(_DWORD *)(a1 + 596) = 1;
*(float *)(a1 + 600) = (float)a3;
*(float *)(a1 + 604) = (float)a4;
*(float *)(a1 + 608) = a8;
*(_BYTE *)(a1 + 620) = a5;
*(float *)(a1 + 612) = a9;
sub_1000262BC((float *)__p, 0.0, 2.0);
sub_10002630C((_QWORD *)(a1 + 656), (double *)__p);
sub_100009900(__p, a6);
sub_100009900(v31, "bigFont.fnt");
v19 = v32;
v21 = (void *)v31[0];
v20 = v31[1];
v22 = v34;
v23 = v34;
if ( (v34 & 0x80u) == 0 )
{
v24 = __p;
}
else
{
v22 = (size_t)__p[1];
v24 = (void **)__p[0];
}
if ( v32 < 0 )
{
v25 = (_QWORD *)v31[0];
}
else
{
v20 = v32;
v25 = v31;
}
if ( v20 >= v22 )
v26 = v22;
else
v26 = v20;
v27 = v20 == v22;
if ( memcmp(v24, v25, v26) )
v27 = 0;
if ( v19 < 0 )
{
operator delete(v21);
if ( (v34 & 0x80) == 0 )
{
LABEL_15:
if ( !v27 )
{
LABEL_17:
v28 = cocos2d::CCLabelBMFont::create_1("", a6);
*(_QWORD *)(a1 + 624) = v28;
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v28, 1);
sub_1000262CC((float *)__p, 0.0, 0.0, 40.0, 40.0);
v29 = cocos2d::extension::CCScale9Sprite::create(a7, __p);
*(_QWORD *)(a1 + 648) = v29;
sub_1000262C4((float *)__p, 16.0, 16.0);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v29 + 320LL))(v29, __p);
(*(void (__fastcall **)(__int64, _QWORD, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, *(_QWORD *)(a1 + 648), 0);
ButtonSprite::setString(a1, a2);
return v18;
}
LABEL_16:
sub_1000262BC((float *)v31, 0.0, 2.0);
sub_1000262BC((float *)__p, -1.0, *((float *)v31 + 1));
sub_10002630C((_QWORD *)(a1 + 656), (double *)__p);
goto LABEL_17;
}
}
else if ( (v23 & 0x80) == 0 )
{
goto LABEL_15;
}
operator delete(__p[0]);
if ( !v27 )
goto LABEL_17;
goto LABEL_16;
}
return v18;
}