//
// ReportPopup::init from 0x7a0620 to 0x7a0ce4 (1732 bytes)
//
// 1 xrefs:
// > ReportPopup::create @ 0x7a0dd8
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:59:53 +0000
//
GameManager *__fastcall ReportPopup::init(ReportPopup *this, const ReportPopupConfig *a2)
{
int v4; // r7
int v5; // r3
int v6; // r7
int v7; // r2
float v8; // s20
float v9; // s18
int v10; // r2
char *v11; // r5
cocos2d::CCDirector *v12; // r0
float v13; // s21
float v14; // s16
float v15; // s17
float v16; // s21
float v17; // s17
float v18; // s19
const char *v19; // r1
int v20; // r6
int v21; // r6
const char *v22; // r2
int v23; // r3
cocos2d::CCLabelBMFont *v25; // r0
cocos2d::CCLabelBMFont *v26; // r6
void (__fastcall *v27)(cocos2d::CCLabelBMFont *, void **); // r9
EmoteSprite *v28; // r0
const char *v29; // r2
int v30; // r0
int v31; // r9
unsigned int v32; // lr
int v33; // r11
int v34; // r3
int v35; // r0
unsigned int v36; // r3
size_t v37; // r5
size_t v38; // r2
unsigned int i; // r1
unsigned int v40; // r6
_DWORD *v41; // r12
char *v42; // r6
char *v43; // r1
int v44; // r2
size_t v45; // r2
int *v46; // r0
int v47; // r1
int v48; // r2
int v49; // r3
unsigned int v50; // r3
char *v51; // r1
int *v52; // r0
int v53; // r1
cocos2d::CCLabelBMFont *v54; // r2
const char *v55; // r2
cocos2d::CCLabelBMFont *v56; // r2
int v57; // r3
int v58; // r0
int v59; // r1
cocos2d::CCLabelBMFont *v60; // r2
cocos2d::CCLabelBMFont *v61; // r0
cocos2d::CCLabelBMFont *v62; // r6
void (__fastcall *v63)(cocos2d::CCLabelBMFont *, _DWORD *); // r9
int v64; // r5
void (__fastcall *v65)(int, void **); // r7
float v66; // s19
int v67; // s14
float v68; // s15
float v69; // s18
ButtonSprite *v70; // r0
int v71; // r5
const cocos2d::CCPoint *v72; // r9
void (__fastcall *v73)(int, _BYTE *); // r7
float v75; // [sp+10h] [bp-A4h]
GameManager *v76; // [sp+34h] [bp-80h]
_BOOL4 v77; // [sp+38h] [bp-7Ch]
void (__fastcall *v78)(int, void **); // [sp+3Ch] [bp-78h]
cocos2d::CCPoint *v79; // [sp+44h] [bp-70h]
float v80[2]; // [sp+48h] [bp-6Ch] BYREF
char v81[8]; // [sp+50h] [bp-64h] BYREF
_BYTE v82[8]; // [sp+58h] [bp-5Ch] BYREF
int v83; // [sp+60h] [bp-54h]
int v84; // [sp+64h] [bp-50h]
_DWORD v85[2]; // [sp+68h] [bp-4Ch] BYREF
void *v86; // [sp+70h] [bp-44h] BYREF
_BYTE *v87; // [sp+74h] [bp-40h]
int v88; // [sp+78h] [bp-3Ch]
int v89; // [sp+7Ch] [bp-38h] BYREF
int v90; // [sp+80h] [bp-34h]
cocos2d::CCLabelBMFont *v91; // [sp+84h] [bp-30h]
int v92[3]; // [sp+88h] [bp-2Ch] BYREF
_DWORD v93[3]; // [sp+94h] [bp-20h] BYREF
int v94; // [sp+A0h] [bp-14h] BYREF
int v95; // [sp+A4h] [bp-10h]
cocos2d::CCLabelBMFont *v96; // [sp+A8h] [bp-Ch]
v4 = *((_DWORD *)a2 + 16);
v5 = *((_DWORD *)a2 + 15);
if ( v5 == v4 )
return nullptr;
v6 = v4 - v5;
v77 = v6 >> 2 > 6;
v7 = *((unsigned __int8 *)a2 + 24);
v8 = 24.0;
v9 = 16.0;
if ( v6 >> 2 <= 6 )
v8 = 28.0;
if ( (v7 & 1) != 0 )
v10 = *((_DWORD *)a2 + 7);
else
v10 = v7 >> 1;
if ( !v10 )
v9 = 0.0;
v76 = SetupTriggerPopup::init(
this,
nullptr,
nullptr,
320.0,
(float)(v9 + 162.0) + (float)((float)((v6 >> 2) - 1) * v8),
(_BYTE *)&dword_0 + 1,
0.0);
if ( !v76 )
return nullptr;
v11 = (char *)this + 732;
*((_DWORD *)this + 180) = *(_DWORD *)a2;
*((_DWORD *)this + 181) = *((_DWORD *)a2 + 1);
*((_DWORD *)this + 182) = *((_DWORD *)a2 + 2);
std::string::operator=((unsigned __int8 *)this + 732, (unsigned __int8 *)a2 + 12);
std::string::operator=((unsigned __int8 *)this + 744, (unsigned __int8 *)a2 + 24);
*((_QWORD *)this + 95) = *((_QWORD *)a2 + 5);
v12 = (cocos2d::CCDirector *)std::string::operator=((unsigned __int8 *)this + 768, (unsigned __int8 *)a2 + 48);
if ( (char *)this + 780 != (char *)a2 + 60 )
v12 = (cocos2d::CCDirector *)std::vector::assign(
(_DWORD *)this + 195,
*((char **)a2 + 15),
*((char **)a2 + 16));
cocos2d::CCDirector::sharedDirector(v12);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v80);
v13 = v80[1];
v14 = (float)((float)(v9 + 162.0) + (float)((float)((v6 >> 2) - 1) * v8)) * 0.5;
v15 = v80[0];
v94 = 0;
v95 = 0;
v96 = nullptr;
std::string::__init(&v94, "Report", 6u);
v16 = v13 * 0.5;
v17 = v15 * 0.5;
v18 = v16 + v14;
SetupTriggerPopup::addTitle((int)this, (unsigned __int8 *)&v94);
std::string::~string((int)&v94);
v20 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v19);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v20 + 80))(v20, 1061997773);
v83 = 684;
v84 = 1;
v21 = CCMenuItemSpriteExtra::create(v20, 0, (int)this, 684, 1);
CCMenuItemSpriteExtra::setSizeMult(v21, 1.5);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v21);
v78 = *(void (__fastcall **)(int, void **))(*(_DWORD *)v21 + 92);
v79 = *((cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v85, (float)(v17 - 160.0) + 8.0, (float)(v16 + v14) - 12.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v86, v79);
v78(v21, &v86);
if ( v9 > 0.0 )
{
v23 = *((unsigned __int8 *)this + 768);
if ( (v23 & 1) != 0 ? *((_DWORD *)this + 193) : v23 >> 1 )
v11 = (char *)this + 768;
}
if ( (*v11 & 1) != 0 )
v25 = *((cocos2d::CCLabelBMFont **)v11 + 2);
else
v25 = (cocos2d::CCLabelBMFont *)(v11 + 1);
v26 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(v25, "bigFont.fnt", v22);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, int))(*(_DWORD *)v26 + 80))(v26, 1058642330);
cocos2d::CCLabelBMFont::limitLabelWidth(v26, 280.0, 0.6, 0.2);
v27 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, void **))(*(_DWORD *)v26 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v86, v17, (float)((float)(v16 + v14) - 42.0) + 6.0);
v27(v26, &v86);
v28 = (EmoteSprite *)(*(int (__fastcall **)(_DWORD, cocos2d::CCLabelBMFont *, int))(**((_DWORD **)this + 115) + 232))(
*((_DWORD *)this + 115),
v26,
1);
if ( v9 > 0.0 )
{
if ( *((_DWORD *)this + 180) == 8 )
v30 = EmoteSprite::maxEmotesMessage(v28);
else
v30 = EmoteSprite::maxEmotesComment(v28);
v31 = v30;
v86 = nullptr;
v87 = nullptr;
v88 = 0;
EmoteSprite::parseTokens((unsigned __int8 *)this + 744, (int)&v86, v30);
v33 = 61;
v34 = *((unsigned __int8 *)this + 744);
v35 = v34 & 1;
v36 = v34 >> 1;
if ( v35 )
v32 = *((_DWORD *)this + 187);
v37 = 0;
if ( !v35 )
v32 = v36;
v38 = v36;
for ( i = 0; ; ++i )
{
LABEL_31:
if ( v35 )
v40 = *((_DWORD *)this + 187);
else
LABEL_33:
v40 = v36;
if ( v37 >= v40 )
break;
if ( !--v33 )
goto LABEL_46;
if ( i >= -1431655765 * ((v87 - (_BYTE *)v86) >> 2) || (v41 = (char *)v86 + 12 * i, *v41 != v37) )
{
while ( 1 )
{
++v37;
if ( v35 )
{
if ( v37 >= *((_DWORD *)this + 187) )
goto LABEL_31;
v42 = *((char **)this + 188);
}
else
{
if ( v37 >= v36 )
goto LABEL_33;
v42 = (char *)this + 745;
}
if ( (v42[v37] & 0xC0) != 0x80 )
goto LABEL_31;
}
}
v37 += v41[1];
}
v37 = v32;
LABEL_46:
memset(v92, 0, sizeof(v92));
if ( v35 )
{
v38 = *((_DWORD *)this + 187);
v43 = *((char **)this + 188);
}
else
{
v43 = (char *)this + 745;
}
if ( v38 >= v37 )
v38 = v37;
std::string::__init(v92, v43, v38);
v44 = *((unsigned __int8 *)this + 744);
if ( (v44 & 1) != 0 )
v45 = *((_DWORD *)this + 187);
else
v45 = v44 >> 1;
GameToolbox::singleLineSnippet((unsigned __int8 *)v93, (int)v92, v45);
v46 = std::string::insert(v93, 0, "\"");
v47 = v46[1];
v48 = v46[2];
v94 = *v46;
v95 = v47;
v96 = (cocos2d::CCLabelBMFont *)v48;
*v46 = 0;
v46[1] = 0;
v46[2] = 0;
v49 = *((unsigned __int8 *)this + 744);
if ( (v49 & 1) != 0 )
v50 = *((_DWORD *)this + 187);
else
v50 = v49 >> 1;
if ( v37 < v50 )
v51 = "...\"";
else
v51 = "\"";
v52 = std::string::append(&v94, v51);
v53 = v52[1];
v54 = (cocos2d::CCLabelBMFont *)v52[2];
v89 = *v52;
v90 = v53;
v91 = v54;
*v52 = 0;
v52[1] = 0;
v52[2] = 0;
std::string::~string((int)&v94);
std::string::~string((int)v93);
std::string::~string((int)v92);
v87 -= 12 * ((715827883 * ((unsigned int)(v87 - (_BYTE *)v86) >> 2)) & 0x3FFFFFFF);
EmoteSprite::parseTokens((unsigned __int8 *)&v89, (int)&v86, v31);
v55 = (const char *)v86;
if ( v86 != v87 )
{
EmoteSprite::replaceTokens(&v94, (unsigned __int8 *)&v89, &v86, 0.0);
v57 = v89 & 1;
if ( (v89 & 1) != 0 )
{
v56 = v91;
v57 = 0;
}
else
{
BYTE1(v89) = v89 & 1;
}
if ( (v89 & 1) != 0 )
{
*(_BYTE *)v56 = v57;
v90 = v57;
}
else
{
LOBYTE(v89) = v57;
}
std::string::reserve(&v89, 0);
v58 = v94;
v59 = v95;
v60 = v96;
v94 = 0;
v95 = 0;
v96 = nullptr;
v89 = v58;
v90 = v59;
v91 = v60;
std::string::~string((int)&v94);
}
if ( (v89 & 1) != 0 )
v61 = v91;
else
v61 = (cocos2d::CCLabelBMFont *)((char *)&v89 + 1);
v62 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(v61, "chatFont.fnt", v55);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, int))(*(_DWORD *)v62 + 80))(v62, 1057803469);
cocos2d::CCLabelBMFont::limitLabelWidth(v62, 280.0, 0.55, 0.3);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, int))(*(_DWORD *)v62 + 512))(v62, 170);
v63 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, _DWORD *))(*(_DWORD *)v62 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v85, v17, v18 - 60.0);
v63(v62, v85);
(*(void (__fastcall **)(_DWORD, cocos2d::CCLabelBMFont *, int))(**((_DWORD **)this + 115) + 232))(
*((_DWORD *)this + 115),
v62,
1);
EmoteSprite::attachToLabel((int)v62, *((_DWORD *)this + 115), &v86, 0.0);
std::string::~string((int)&v89);
if ( v86 )
{
v87 -= 12 * ((715827883 * ((unsigned int)(v87 - (_BYTE *)v86) >> 2)) & 0x3FFFFFFF);
operator delete(v86);
}
}
v64 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Select one or more reasons:", "goldFont.fnt", v29);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v64 + 80))(v64, 1056964608);
v65 = *(void (__fastcall **)(int, void **))(*(_DWORD *)v64 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v86, v17, (float)(v18 - 66.0) - v9);
v65(v64, &v86);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v64, 1);
v85[1] = 0;
v85[0] = ReportPopup::onReasonToggle;
v66 = v18 - 96.0;
v67 = 1058642330;
v68 = 0.5;
if ( !v77 )
v67 = 1060320051;
v69 = v66 - v9;
if ( v77 )
v68 = 0.45;
ReportPopup::buildReasonRows(
(_DWORD *)this + 195,
*((_DWORD *)this + 111),
*((_DWORD *)this + 115),
(int)this,
(int)ReportPopup::onReasonToggle,
0,
v17 - 110.0,
v69,
v8,
v67,
v68,
230.0,
(int)this + 792,
0,
0.0);
v70 = ButtonSprite::create(
(ButtonSprite *)"Report",
(const char *)&dword_64,
0,
0.7,
1,
"bigFont.fnt",
"GJ_button_06.png",
(const char *)0x41F00000,
v75);
v86 = ReportPopup::onSubmit;
v87 = nullptr;
v71 = CCMenuItemSpriteExtra::create((int)v70, 0, (int)this, (int)ReportPopup::onSubmit, 0);
CCMenuItemSpriteExtra::setSizeMult(v71, 1.1);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v71);
v72 = *((const cocos2d::CCPoint **)this + 111);
v73 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v71 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v81, v17, (float)(v16 - v14) + 24.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v82, v72);
v73(v71, v82);
return v76;
}