//
// SearchButton::init from 0x140312950 to 0x140312bc4 (628 bytes)
//
// 4 xrefs:
// > SearchButton::create @ 0x140312907
// > ??> @ 0x140692700
// > ??> @ 0x140692710
// > ??> @ 0x1406d4898
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
bool SearchButton::init(SearchButton *a1, const char *a2, const char *a3, float a4, const char *a5)
{
float v5; // xmm0_4
bool result; // al
const struct cocos2d::CCSize *v9; // rax
cocos2d::CCLabelBMFont *v10; // rax
SearchButton_vtbl *v11; // r9
float v12; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v13; // rbx
const cocos2d::CCPoint *v14; // rax
cocos2d::CCSprite *v15; // rax
SearchButton_vtbl *v16; // r9
cocos2d::CCSprite *m_icon; // rbx
double v18; // xmm0_8
float v19; // xmm7_4
const cocos2d::CCSize *v20; // rbx
cocos2d::CCLabelBMFont_vtbl *v21; // rbx
float v22; // xmm7_4
float v23; // xmm6_4
__int64 v24; // rax
float v25; // xmm0_4
cocos2d::CCSprite_vtbl *v26; // rbx
const cocos2d::CCPoint *v27; // rax
float v28; // [rsp+20h] [rbp-48h]
const char *v29; // [rsp+78h] [rbp+10h] BYREF
v29 = a2;
result = cocos2d::CCSprite::initWithSpriteFrameName(a1, "GJ_longBtn04_001.png");
if ( result )
{
cocos2d::CCPoint::CCPoint(v5, -1.0);
v9 = a1->getContentSize(a1);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v29, v9);
v10 = cocos2d::CCLabelBMFont::create(a3, (const char *)&qword_14052A4D8);
v11 = a1->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_label = v10;
v12 = ((float (__fastcall *)(SearchButton *, cocos2d::CCLabelBMFont *, __int64))v11->addChild_0)(a1, v10, 1);
v13 = a1->m_label->__vftable;
cocos2d::CCPoint::CCPoint(v12, (float)(*(float *)&v29 * 0.5) + v28);
v13->setPosition_0(a1->m_label, v14);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_label->setScale_0)(a1->m_label);
if ( a5 )
{
v15 = cocos2d::CCSprite::createWithSpriteFrameName(a5);
v16 = a1->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_icon = v15;
v16->addChild_0(a1, v15, 1);
((void (__fastcall *)(cocos2d::CCSprite *))a1->m_icon->setScale_0)(a1->m_icon);
m_icon = a1->m_icon;
v18 = ((double (__fastcall *)(cocos2d::CCSprite *))m_icon->getScale)(m_icon);
v19 = *(float *)&v18 * m_icon->m_obRect.size.width;
v20 = a1->m_label->getContentSize(a1->m_label);
*(float *)&v18 = (float)(a1->m_label->getScale(a1->m_label) * v20->width) + 5.0;
v21 = a1->m_label->__vftable;
v22 = v19 * 0.5;
v23 = (float)((float)(v22 + *(float *)&v18) + 10.0) * 0.5;
cocos2d::CCPoint::CCPoint(
*(float *)&v18 * 0.5,
(float)((float)((float)(*(float *)&v29 * 0.5) - v23) + (float)(*(float *)&v18 * 0.5)) + v28);
v25 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *, __int64))v21->setPosition_0)(a1->m_label, v24);
v26 = a1->m_icon->__vftable;
cocos2d::CCPoint::CCPoint(v25, (float)((float)(*(float *)&v29 * 0.5) + v23) - v22);
v26->setPosition_0(a1->m_icon, v27);
}
return 1;
}
return result;
}