//
// cocos2d::extension::CCControlButton::setBackgroundSpriteForState from 0x180006620 to 0x180006795 (373 bytes)
//
// 4 xrefs:
// > ??> @ 0x180026748
// > ??> @ 0x18002a6c0
// > ??> @ 0x180032408
// > ??> @ 0x18004b618
//
// This function is hookable on this platform (idp: pc, 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:15:36 +0000
//
void __fastcall cocos2d::extension::CCControlButton::setBackgroundSpriteForState(
cocos2d::CCDictionary **this,
struct cocos2d::extension::CCScale9Sprite *a2,
unsigned int a3)
{
struct cocos2d::CCObject *v6; // rax
__int64 v7; // r8
__int64 v8; // rbx
__int64 v9; // rax
__int64 v10; // rbx
__int64 v11; // rax
__int64 v12; // rbx
__int64 v13; // rax
float v14; // [rsp+40h] [rbp+8h] BYREF
float v15; // [rsp+44h] [rbp+Ch]
char v16; // [rsp+48h] [rbp+10h] BYREF
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v14, (const struct cocos2d::CCSize *)(this + 63));
v6 = cocos2d::CCDictionary::objectForKey(*(this + 69), a3);
if ( v6 )
{
LOBYTE(v7) = 1;
(*((void (__fastcall **)(cocos2d::CCDictionary **, struct cocos2d::CCObject *, __int64))*this + 67))(this, v6, v7);
cocos2d::CCDictionary::removeObjectForKey(*(this + 69), a3);
}
cocos2d::CCDictionary::setObject(*(this + 69), a2, a3);
(*(void (__fastcall **)(struct cocos2d::extension::CCScale9Sprite *, _QWORD))(*(_QWORD *)a2 + 336LL))(a2, 0);
v8 = *(_QWORD *)a2;
v9 = cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v16, 0.5, 0.5);
(*(void (__fastcall **)(struct cocos2d::extension::CCScale9Sprite *, __int64))(v8 + 288))(a2, v9);
(*((void (__fastcall **)(cocos2d::CCDictionary **, struct cocos2d::extension::CCScale9Sprite *))*this + 58))(this, a2);
if ( *((float *)this + 126) != 0.0 || *((float *)this + 127) != 0.0 )
{
if ( cocos2d::CCSize::equals((cocos2d::CCSize *)&v14, (const struct cocos2d::CCSize *)(this + 63)) )
{
v10 = *(_QWORD *)a2;
v11 = cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v16, v14 + 1.0, v15 + 1.0);
(*(void (__fastcall **)(struct cocos2d::extension::CCScale9Sprite *, __int64))(v10 + 896))(a2, v11);
}
v12 = *(_QWORD *)a2;
v13 = cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v16, (const struct cocos2d::CCSize *)(this + 63));
(*(void (__fastcall **)(struct cocos2d::extension::CCScale9Sprite *, __int64))(v12 + 896))(a2, v13);
}
if ( *((_DWORD *)this + 109) == a3 )
(*((void (__fastcall **)(cocos2d::CCDictionary **))*this + 135))(this);
}