//
// SetupTriggerPopup::createCustomButton from 0x1002207b0 to 0x100220af1 (833 bytes)
//
// 4 xrefs:
// > SetupKeyframePopup::init @ 0x1001e3262
// > SetupKeyframePopup::init @ 0x1001e331c
// > SetupKeyframePopup::init @ 0x1001e33cd
// > SetupKeyframePopup::init @ 0x1001e348f
//
// 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:27:03 +0000
//
__int64 __fastcall SetupTriggerPopup::createCustomButton(
__int64 a1,
unsigned int a2,
_BYTE *a3,
std::string *a4,
__int64 a5,
int a6,
float a7,
float a8,
unsigned int a9,
int a10)
{
__int64 i; // rdi
__int64 v13; // r13
__int64 v14; // rax
__int64 j; // rdi
__int64 v16; // rbx
__int64 v17; // rax
std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v18; // al
std::string::pointer data; // r14
__int64 v20; // r14
__int64 v21; // rbx
_BYTE *v22; // rdi
_BYTE *v23; // rdi
__int64 v24; // r13
__int64 v25; // rax
float v26; // xmm1_4
float v27; // xmm0_4
float *v28; // rax
char v30[8]; // [rsp+8h] [rbp-78h] BYREF
_BYTE *v31; // [rsp+10h] [rbp-70h]
__int64 v32; // [rsp+18h] [rbp-68h]
char v33[8]; // [rsp+24h] [rbp-5Ch] BYREF
float v34; // [rsp+2Ch] [rbp-54h]
int v35; // [rsp+30h] [rbp-50h]
unsigned int v36; // [rsp+34h] [rbp-4Ch]
__int64 v37; // [rsp+38h] [rbp-48h]
__int64 v38; // [rsp+40h] [rbp-40h]
float v39; // [rsp+4Ch] [rbp-34h] BYREF
float v40; // [rsp+50h] [rbp-30h]
float v41; // [rsp+54h] [rbp-2Ch]
v35 = a6;
v34 = a8;
v41 = a7;
v37 = a5;
v31 = a3;
v36 = a2;
for ( i = *(_QWORD *)(a1 + 912); (unsigned int)sub_1007FEF90(i) <= a9; i = *(_QWORD *)(a1 + 912) )
{
v13 = *(_QWORD *)(a1 + 912);
v14 = sub_1007FE900(i);
sub_1007FEBF0(v13, v14);
}
v38 = sub_1007FEFE0(*(_QWORD *)(a1 + 912), a9);
for ( j = *(_QWORD *)(a1 + 928); (unsigned int)sub_1007FEF90(j) <= a10; j = *(_QWORD *)(a1 + 928) )
{
v16 = *(_QWORD *)(a1 + 928);
v17 = sub_1007FE900(j);
sub_1007FEBF0(v16, v17);
}
v32 = sub_1007FEFE0(*(_QWORD *)(a1 + 928), (unsigned int)a10);
v18 = a4->__r_.__value_.__s.0;
if ( (*(_BYTE *)&a4->__r_.__value_.__s.0 & 1) != 0 )
{
if ( !a4->__r_.__value_.__l.__size_ )
goto LABEL_11;
}
else if ( !(*(unsigned __int8 *)&v18 >> 1) )
{
LABEL_11:
std::string::assign(a4, "GJ_plus2Btn_001.png");
if ( (*(_BYTE *)&a4->__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_12;
LABEL_10:
data = a4->__r_.__value_.__s.__data_;
goto LABEL_13;
}
if ( (*(_BYTE *)&v18 & 1) == 0 )
goto LABEL_10;
LABEL_12:
data = a4->__r_.__value_.__l.__data_;
LABEL_13:
v20 = cocos2d::CCSprite::createWithSpriteFrameName(data);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v20 + 160LL))(v20, v41);
v21 = CCMenuItemSpriteExtra::create(v20, 0, a1, 1425, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v21 + 72LL))(v21, v36);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v21);
cocos2d::CCNode::convertToNodeSpace(&v39, *(_QWORD *)(a1 + 552), v37);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v21 + 184LL))(v21, &v39);
sub_1007FEBF0(v38, v21);
if ( a10 > 0 )
sub_1007FEBF0(v32, v21);
if ( (_BYTE)v35 )
{
sub_100278250(&v39, 0.0, 4.0);
v22 = v31;
if ( (*v31 & 1) != 0 )
{
LABEL_17:
v23 = *((_BYTE **)v22 + 2);
goto LABEL_20;
}
}
else
{
sub_100278250(&v39, 8.0, 0.0);
v22 = v31;
if ( (*v31 & 1) != 0 )
goto LABEL_17;
}
v23 = v22 + 1;
LABEL_20:
v24 = cocos2d::CCLabelBMFont::create_3(v23, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v24);
sub_1007FEBF0(v38, v24);
if ( a10 > 0 )
sub_1007FEBF0(v32, v24);
if ( (_BYTE)v35 )
{
sub_100278250(v33, 0.5, 0.0);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v24 + 296LL))(v24, v33);
*(float *)&v38 = v39;
v25 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 328LL))(v20);
v26 = (float)((float)(0.5 * *(float *)(v25 + 4)) * v41) + v40;
v27 = *(float *)&v38;
}
else
{
sub_100278250(v33, 0.0, 0.5);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v24 + 296LL))(v24, v33);
v28 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 328LL))(v20);
v27 = (float)((float)(0.5 * *v28) * v41) + v39;
v26 = v40;
}
sub_100278250(v30, v27, v26);
sub_100278350(v33, v37, v30);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v24 + 184LL))(v24, v33);
return (*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v24 + 160LL))(v24, v34);
}