//
// ThreadViewPopup::buildMemberButton from 0x1400e34b0 to 0x1400e37be (782 bytes)
//
// 8 xrefs:
// > ThreadViewPopup::init @ 0x1400d9bbf
// > ThreadViewPopup::threadUpdateFinished @ 0x1400dd4de
// > ThreadViewPopup::threadMessagesFinished @ 0x1400dee37
// > ThreadViewPopup::threadMessagesFinished @ 0x1400def97
// > MemberListPopup::threadUpdateFinished @ 0x1400eebcf
// > ??> @ 0x140892f38
// > ??> @ 0x140892f48
// > ??> @ 0x140914b10
//
// 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 11:26:32 +0000
//
__int64 __fastcall ThreadViewPopup::buildMemberButton(__int64 a1)
{
__int64 result; // rax
__int64 v3; // rcx
__int64 v4; // rdx
__int64 v5; // rdx
char *v6; // r8
cocos2d::CCString *v7; // rax
const char *CString; // rax
cocos2d::CCLabelBMFont *v9; // r14
__int64 v10; // rbx
__int64 v11; // rax
float v12; // xmm6_4
double v13; // xmm0_8
float v14; // xmm8_4
struct cocos2d::CCSprite *v15; // rsi
__int64 v16; // rdx
void (__fastcall *v17)(char *, __int64); // rax
float v18; // xmm8_4
float v19; // xmm6_4
double v20; // xmm0_8
float v21; // xmm7_4
__int64 v22; // rdi
__int64 v23; // rbx
__int64 v24; // rax
__int64 v25; // rbx
__int64 v26; // rax
__int64 v27; // rbx
__int64 v28; // rax
cocos2d::CCObject *v29; // rax
__int64 *v30; // rdi
__int64 v31; // rbx
__int64 v32; // rax
char v33; // [rsp+70h] [rbp+8h] BYREF
result = *(_QWORD *)(a1 + 744);
if ( !*(_BYTE *)(result + 320) && *(_QWORD *)(a1 + 552) )
{
v3 = *(_QWORD *)(a1 + 864);
if ( v3 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v3 + 512LL))(v3);
result = 0;
*(_QWORD *)(a1 + 864) = 0;
*(_QWORD *)(a1 + 856) = 0;
}
v4 = *(_QWORD *)(a1 + 744);
if ( *(_BYTE *)(v4 + 320) || *(_DWORD *)(v4 + 324) != 8 )
{
v5 = *(unsigned int *)(v4 + 200);
v6 = (char *)&unk_14070D03C;
if ( (_DWORD)v5 == 1 )
v6 = &byte_1406ED6E0;
v7 = cocos2d::CCString::createWithFormat("%i member%s", v5, v6);
CString = cocos2d::CCString::getCString(v7);
v9 = cocos2d::CCLabelBMFont::create(CString, "goldFont.fnt");
cocos2d::CCLabelBMFont::limitLabelWidth(v9, 70.0, 0.40000001, 0.2);
v10 = *(_QWORD *)v9;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v33, 0.0, 0.5);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, __int64))(v10 + 288))(v9, v11);
v12 = *(float *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v9 + 320LL))(v9);
v13 = (*(double (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v9 + 168LL))(v9);
v14 = *(float *)&v13 * v12;
v15 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v15 + 160LL))(v15);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v15 + 352LL))(v15);
v16 = *((_QWORD *)v15 + 40);
v17 = *(void (__fastcall **)(char *, __int64))(v16 + 40);
LOBYTE(v16) = -106;
v17((char *)v15 + 320, v16);
v18 = v14 + 10.0;
v19 = *(float *)((*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v15 + 320LL))(v15) + 4);
v20 = (*(double (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v15 + 168LL))(v15);
v21 = (float)((float)(*(float *)&v20 * v19) * 0.5) + v18;
v22 = cocos2d::CCNode::create();
v23 = *(_QWORD *)v22;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v33, v21, 28.0);
(*(void (__fastcall **)(__int64, __int64))(v23 + 312))(v22, v24);
v25 = *(_QWORD *)v9;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v33, 0.0, 14.0);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, __int64))(v25 + 184))(v9, v26);
(*(void (__fastcall **)(__int64, cocos2d::CCLabelBMFont *))(*(_QWORD *)v22 + 464LL))(v22, v9);
v27 = *(_QWORD *)v15;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v33, v18, 14.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v27 + 184))(v15, v28);
(*(void (__fastcall **)(__int64, struct cocos2d::CCSprite *))(*(_QWORD *)v22 + 464LL))(v22, v15);
*(_QWORD *)(a1 + 856) = v9;
v29 = CCMenuItemSpriteExtra::create(v22, 0, a1, (__int64)ThreadViewPopup::onShowMembers);
*(_QWORD *)(a1 + 864) = v29;
*((_DWORD *)v29 + 93) = 1067869798;
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
*(_QWORD *)(a1 + 864));
v30 = *(__int64 **)(a1 + 864);
v31 = *v30;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v33,
(float)(v21 * 0.5) + *(float *)(a1 + 872),
*(float *)(a1 + 876));
return (*(__int64 (__fastcall **)(__int64 *, __int64))(v31 + 184))(v30, v32);
}
}
return result;
}