//
// ButtonSprite::init from 0x68b4f8 to 0x68b7ac (692 bytes)
//
// 2 xrefs:
// > ButtonSprite::create @ 0x68b89c
// > ??> @ 0x6e470
//
// 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 12:50:33 +0000
//
__int64 __fastcall ButtonSprite::init(
ButtonSprite *this,
cocos2d::CCSprite *a2,
int a3,
int a4,
float a5,
float a6,
char a7,
cocos2d::CCSprite *a8,
unsigned __int8 a9,
float a10)
{
int v14; // w22
unsigned __int8 v15; // w0
unsigned int v16; // w21
__int64 v18; // x4
const char *v19; // x1
__int64 v20; // x0
__int64 v21; // x3
long double v22; // q0
_DWORD *v23; // x0
float v24; // s9
__int64 v25; // x22
void (__fastcall *v26)(__int64, float); // x23
float *v27; // x0
float v28; // s9
__int64 v29; // x22
void (__fastcall *v30)(__int64, float); // x23
float v31; // s0
float v32; // s1
__int64 v33; // x23
void (__fastcall *v34)(__int64, _BYTE *); // x24
__int64 v35; // x22
void (__fastcall *v36)(__int64, float); // x23
__int64 v37; // x0
_BYTE v43[16]; // [xsp+98h] [xbp+98h] BYREF
v14 = a9;
v15 = cocos2d::CCSprite::init(this);
v16 = v15;
if ( v15 )
{
v18 = *(_QWORD *)this;
*((_DWORD *)this + 149) = 0;
*((_BYTE *)this + 620) = a7;
*((_QWORD *)this + 79) = a2;
*((float *)this + 150) = (float)a3;
*((float *)this + 151) = (float)a4;
*((float *)this + 152) = a6;
*((float *)this + 153) = a10;
(*(void (__fastcall **)(ButtonSprite *))(v18 + 464))(this);
if ( v14 )
{
v20 = cocos2d::CCSprite::create(a8, v19);
v21 = *(_QWORD *)this;
*((_QWORD *)this + 80) = v20;
(*(void (__fastcall **)(ButtonSprite *))(v21 + 464))(this);
}
else
{
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v43, 0.0, 0.0, 40.0, 40.0);
v33 = cocos2d::extension::CCScale9Sprite::create(a8, v43);
*((_QWORD *)this + 81) = v33;
v34 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v33 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v43, 16.0, 16.0);
v34(v33, v43);
(*(void (__fastcall **)(ButtonSprite *, _QWORD, _QWORD))(*(_QWORD *)this + 464LL))(
this,
*((_QWORD *)this + 81),
0);
}
LODWORD(v22) = *((_DWORD *)this + 150);
if ( *(float *)&v22 > 0.0 )
{
v23 = (_DWORD *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 79) + 328LL))(*((_QWORD *)this + 79));
v24 = *((float *)this + 150);
LODWORD(v22) = *v23;
if ( *(float *)v23 > v24 )
{
v25 = *((_QWORD *)this + 79);
v26 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)v25 + 160LL);
v27 = (float *)(*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v25 + 328LL))(v25, *(float *)&v22);
v26(v25, v24 / *v27);
}
}
if ( a5 > 0.0
&& a5 < *(float *)((*(__int64 (__fastcall **)(_QWORD, long double))(**((_QWORD **)this + 79) + 328LL))(
*((_QWORD *)this + 79),
v22)
+ 4) )
{
v28 = a5
/ *(float *)((*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 79) + 328LL))(*((_QWORD *)this + 79)) + 4);
if ( v28 < (*(float (__fastcall **)(_QWORD))(**((_QWORD **)this + 79) + 168LL))(*((_QWORD *)this + 79)) )
{
v35 = *((_QWORD *)this + 79);
v36 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)v35 + 160LL);
v37 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v35 + 328LL))(v35);
v36(v35, a5 / *(float *)(v37 + 4));
}
}
v29 = *((_QWORD *)this + 79);
v30 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)v29 + 160LL);
v31 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v29 + 168LL))(v29);
v32 = *((float *)this + 152);
if ( v31 <= v32 )
{
v29 = *((_QWORD *)this + 79);
v32 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v29 + 168LL))(v29);
}
v30(v29, v32);
ButtonSprite::updateSpriteBGSize(this);
}
return v16;
}