//
// FriendRequestPopup::onBlock from 0x1002a6030 to 0x1002a6244 (532 bytes)
//
// 1 xrefs:
// > FriendRequestPopup::loadFromGJFriendRequest @ 0x1002a5d1c
//
// 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
//
void __fastcall FriendRequestPopup::onBlock(FriendRequestPopup *a1, cocos2d::CCObject *a2)
{
double v2; // xmm0_8
cocos2d::CCString *v3; // rax
const char *CString; // r14
size_t v5; // rax
size_t v6; // r15
char *v7; // r12
char *v8; // r14
size_t v9; // r13
size_t v10; // rax
size_t v11; // r15
char *v12; // r12
size_t v13; // r13
ButtonSprite **v14; // rbx
std::string v15; // [rsp+0h] [rbp-70h] BYREF
_QWORD v16[2]; // [rsp+18h] [rbp-58h] BYREF
void *__p; // [rsp+28h] [rbp-48h]
_QWORD __dst[2]; // [rsp+30h] [rbp-40h] BYREF
char *__s; // [rsp+40h] [rbp-30h]
GameLevelManager::sharedState();
GameLevelManager::tryGetUsername(&v15);
v3 = (cocos2d::CCString *)sub_1007AB580(
"Are you sure you want to block %s?\n"
"They will no longer be able to:\n"
"-View your profile.\n"
"-Send you a friend request.\n"
"-Send you messages, and all older messages from them will be deleted.",
*(_BYTE *)&v15.__r_.__value_.__l.0);
CString = cocos2d::CCString::getCString(v3);
v5 = strlen(CString);
if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v2);
v6 = v5;
if ( v5 >= 0x17 )
{
v9 = 26;
if ( (v5 | 7) != 0x17 )
v9 = (v5 | 7) + 1;
v7 = (char *)operator new(v9);
__s = v7;
__dst[0] = v9 | 1;
__dst[1] = v6;
LABEL_9:
memmove(v7, CString, v6);
v7[v6] = 0;
if ( (__dst[0] & 1) != 0 )
goto LABEL_5;
goto LABEL_10;
}
LOBYTE(__dst[0]) = 2 * v5;
v7 = (char *)__dst + 1;
if ( v5 )
goto LABEL_9;
BYTE1(__dst[0]) = 0;
if ( (__dst[0] & 1) != 0 )
{
LABEL_5:
v8 = __s;
goto LABEL_11;
}
LABEL_10:
v8 = (char *)__dst + 1;
LABEL_11:
v10 = strlen(v8);
if ( v10 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v2);
v11 = v10;
if ( v10 >= 0x17 )
{
v13 = 26;
if ( (v10 | 7) != 0x17 )
v13 = (v10 | 7) + 1;
v12 = (char *)operator new(v13);
__p = v12;
v16[0] = v13 | 1;
v16[1] = v11;
goto LABEL_18;
}
LOBYTE(v16[0]) = 2 * v10;
v12 = (char *)v16 + 1;
if ( v10 )
LABEL_18:
memmove(v12, v8, v11);
v12[v11] = 0;
v14 = (ButtonSprite **)FLAlertLayer::create(
&a1->FLAlertLayerProtocol,
"Confirm Block",
v16,
"Back",
"Block",
0,
380.0,
0.0,
1.0);
if ( (v16[0] & 1) != 0 )
operator delete(__p);
ButtonSprite::updateBGImage(v14[75], "GJ_button_06.png");
(*(void (__fastcall **)(ButtonSprite **, __int64))&(*v14)->m_fVertexZ)(v14, 1);
(*(void (__fastcall **)(ButtonSprite **))&(*v14)[1].m_fTextureTop)(v14);
if ( (__dst[0] & 1) != 0 )
operator delete(__s);
if ( (*(_BYTE *)&v15.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v15.__r_.__value_.__l.__data_);
}