//
// ButtonSprite::init from 0x100067980 to 0x100067be4 (612 bytes)
//
// 1 xrefs:
// > ButtonSprite::create @ 0x100067920
//
// 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:56 +0000
//
__int64 __fastcall ButtonSprite::init(
__int64 a1,
__int64 a2,
int a3,
int a4,
char a5,
__int64 a6,
char a7,
float a8,
float a9,
float a10)
{
__int64 v20; // x20
__int64 v21; // x1
__int64 v22; // x21
__n128 v23; // q0
float v24; // s9
__int64 v25; // x21
float *v26; // x0
float v27; // s9
__int64 v28; // x21
__int64 v29; // x0
__int64 v30; // x21
float v32[4]; // [xsp+0h] [xbp-70h] BYREF
v20 = cocos2d::CCSprite::init(a1);
if ( (_DWORD)v20 )
{
*(_DWORD *)(a1 + 596) = 0;
*(float *)(a1 + 600) = (float)a3;
*(float *)(a1 + 604) = (float)a4;
*(float *)(a1 + 608) = a9;
*(_BYTE *)(a1 + 620) = a5;
*(float *)(a1 + 612) = a10;
*(_QWORD *)(a1 + 632) = a2;
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, a2, 1);
if ( (a7 & 1) != 0 )
{
v21 = cocos2d::CCSprite::create(a6);
*(_QWORD *)(a1 + 640) = v21;
}
else
{
sub_1000262CC(v32, 0.0, 0.0, 40.0, 40.0);
v22 = cocos2d::extension::CCScale9Sprite::create(a6, v32);
*(_QWORD *)(a1 + 648) = v22;
sub_1000262C4(v32, 16.0, 16.0);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v22 + 320LL))(v22, v32);
v21 = *(_QWORD *)(a1 + 648);
}
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, v21, 0);
v23.n128_u32[0] = *(_DWORD *)(a1 + 600);
if ( v23.n128_f32[0] > 0.0 )
{
v23.n128_u32[0] = *(_DWORD *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 632) + 328LL))(*(_QWORD *)(a1 + 632));
v24 = *(float *)(a1 + 600);
if ( v23.n128_f32[0] > v24 )
{
v25 = *(_QWORD *)(a1 + 632);
v26 = (float *)(*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v25 + 328LL))(v25, v23.n128_f32[0]);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v25 + 160LL))(v25, v24 / *v26);
}
}
if ( a8 > 0.0
&& *(float *)((*(__int64 (__fastcall **)(_QWORD, __n128))(**(_QWORD **)(a1 + 632) + 328LL))(
*(_QWORD *)(a1 + 632),
v23)
+ 4) > a8 )
{
v27 = a8
/ *(float *)((*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 632) + 328LL))(*(_QWORD *)(a1 + 632)) + 4);
if ( v27 < (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 632) + 168LL))(*(_QWORD *)(a1 + 632)) )
{
v28 = *(_QWORD *)(a1 + 632);
v29 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v28 + 328LL))(v28);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v28 + 160LL))(v28, a8 / *(float *)(v29 + 4));
}
}
v30 = *(_QWORD *)(a1 + 632);
if ( (*(float (__fastcall **)(__int64))(*(_QWORD *)v30 + 168LL))(v30) <= *(float *)(a1 + 608) )
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 632) + 168LL))(*(_QWORD *)(a1 + 632));
(*(void (__fastcall **)(__int64))(*(_QWORD *)v30 + 160LL))(v30);
ButtonSprite::updateSpriteBGSize(a1);
}
return v20;
}