//
// ReportPopup::createForComment from 0xd01f20 to 0xd02314 (1012 bytes)
//
// 2 xrefs:
// > CommentOptionsPopup::onReport @ 0xd02328
// > ??> @ 0xb3140
//
// This function is hookable on this platform (idp: arm, 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 13:06:54 +0000
//
__int64 __fastcall ReportPopup::createForComment(ReportPopup *this, GJComment *a2)
{
int v3; // w0
__int64 v4; // x22
char v6; // w0
char *v7; // x2
GameLevelManager *v8; // x0
size_t v9; // x1
size_t v10; // x2
char *v11; // x1
unsigned __int8 v12; // w2
size_t v13; // x2
char *v14; // x1
char v15; // w0
char *v16; // x19
__int64 v17; // x0
__int64 v18; // x1
const ReportPopupConfig *v19; // x1
char v20; // w0
cocos2d::CCDictionary **v21; // x0
GameLevelManager *v22; // [xsp+40h] [xbp+40h] BYREF
size_t v23; // [xsp+48h] [xbp+48h]
void *v24; // [xsp+50h] [xbp+50h]
__int64 v25[3]; // [xsp+58h] [xbp+58h] BYREF
__int64 v26; // [xsp+70h] [xbp+70h] BYREF
__int64 v27; // [xsp+78h] [xbp+78h]
int v28[2]; // [xsp+80h] [xbp+80h]
void *v29; // [xsp+88h] [xbp+88h] BYREF
char *v30; // [xsp+90h] [xbp+90h]
ReportPopup *v31; // [xsp+A0h] [xbp+A0h] BYREF
int v32; // [xsp+A8h] [xbp+A8h]
__int64 v33[2]; // [xsp+B0h] [xbp+B0h] BYREF
void *v34; // [xsp+C0h] [xbp+C0h]
__int64 v35; // [xsp+C8h] [xbp+C8h] BYREF
__int64 v36; // [xsp+D0h] [xbp+D0h]
void *v37; // [xsp+D8h] [xbp+D8h]
__int64 v38; // [xsp+E0h] [xbp+E0h]
__int64 v39[2]; // [xsp+E8h] [xbp+E8h] BYREF
void *v40; // [xsp+F8h] [xbp+F8h]
void *v41; // [xsp+100h] [xbp+100h] BYREF
char *v42; // [xsp+108h] [xbp+108h]
__int64 v43; // [xsp+110h] [xbp+110h]
if ( !this )
return 0;
v3 = *((_DWORD *)this + 109);
if ( (unsigned int)(v3 - 4) <= 1 )
return 0;
v31 = nullptr;
v32 = 0;
v33[0] = 0;
v33[1] = 0;
v34 = nullptr;
v35 = 0;
v36 = 0;
v37 = nullptr;
v38 = 0;
v39[0] = 0;
v39[1] = 0;
v40 = nullptr;
v41 = nullptr;
v42 = nullptr;
v43 = 0;
if ( v3 == 3 )
{
v32 = *((_DWORD *)this + 95);
LODWORD(v31) = 7;
v7 = (char *)this + 344;
v20 = *((_BYTE *)this + 344);
v22 = nullptr;
v23 = 0;
v24 = nullptr;
if ( (v20 & 1) == 0 )
{
LABEL_13:
v8 = *(GameLevelManager **)v7;
v9 = *((_QWORD *)v7 + 1);
v24 = *((void **)v7 + 2);
v22 = v8;
v23 = v9;
goto LABEL_14;
}
}
else
{
if ( *((_DWORD *)this + 95) )
{
v32 = *((_DWORD *)this + 95);
LODWORD(v31) = 3;
}
else
{
v4 = 0;
if ( v3 != 1 || *((int *)this + 97) <= 0 )
goto LABEL_6;
v32 = *((_DWORD *)this + 97);
LODWORD(v31) = 4;
}
v6 = *((_BYTE *)this + 344);
v22 = nullptr;
v7 = (char *)this + 344;
v23 = 0;
v24 = nullptr;
if ( (v6 & 1) == 0 )
goto LABEL_13;
}
v8 = (GameLevelManager *)std::string::__init((__int64 *)&v22, *((void **)v7 + 2), *((_QWORD *)v7 + 1));
LABEL_14:
if ( ((unsigned __int8)v22 & 1) != 0 )
{
v10 = v23;
if ( v23 )
{
LABEL_16:
v11 = (char *)v24;
goto LABEL_17;
}
}
else
{
LODWORD(v10) = (int)(unsigned __int8)v22 >> 1;
if ( (_DWORD)v10 )
goto LABEL_39;
}
v21 = (cocos2d::CCDictionary **)GameLevelManager::sharedState(v8);
GameLevelManager::tryGetUsername(v25, v21, *((_DWORD *)this + 97));
if ( ((unsigned __int8)v22 & 1) != 0 )
{
*(_BYTE *)v24 = 0;
v23 = 0;
}
else
{
LOWORD(v22) = 0;
}
std::string::reserve((__int64 *)&v22, 0);
v23 = v25[1];
v22 = (GameLevelManager *)v25[0];
v24 = (void *)v25[2];
if ( (v25[0] & 1) != 0 )
{
v10 = v23;
goto LABEL_16;
}
LODWORD(v10) = (int)LOBYTE(v25[0]) >> 1;
LABEL_39:
v10 = (int)v10;
v11 = (char *)&v22 + 1;
LABEL_17:
std::string::assign(v39, v11, v10);
v12 = (unsigned __int8)v22;
if ( ((unsigned __int8)v22 & 1) != 0 )
{
v13 = v23;
if ( v23 )
{
HIDWORD(v31) = *((_DWORD *)this + 92);
LABEL_20:
v14 = (char *)v24;
goto LABEL_21;
}
}
else if ( (int)(unsigned __int8)v22 >> 1 )
{
HIDWORD(v31) = *((_DWORD *)this + 92);
goto LABEL_43;
}
std::string::assign((__int64 *)&v22, "Comment", 7u);
v12 = (unsigned __int8)v22;
HIDWORD(v31) = *((_DWORD *)this + 92);
if ( ((unsigned __int8)v22 & 1) != 0 )
{
v13 = v23;
goto LABEL_20;
}
LABEL_43:
v13 = v12 >> 1;
v14 = (char *)&v22 + 1;
LABEL_21:
std::string::assign(v33, v14, v13);
v15 = *((_BYTE *)this + 320);
v16 = (char *)this + 320;
v26 = 0;
v27 = 0;
*(_QWORD *)v28 = 0;
if ( (v15 & 1) != 0 )
{
std::string::__init(&v26, *((void **)v16 + 2), *((_QWORD *)v16 + 1));
}
else
{
v17 = *(_QWORD *)v16;
v18 = *((_QWORD *)v16 + 1);
*(_QWORD *)v28 = *((_QWORD *)v16 + 2);
v26 = v17;
v27 = v18;
}
if ( (v35 & 1) != 0 )
{
*(_BYTE *)v37 = 0;
v36 = 0;
}
else
{
LOWORD(v35) = 0;
}
std::string::reserve(&v35, 0);
v37 = *(void **)v28;
v35 = v26;
v36 = v27;
ReportPopup::reasonIndicesForType((__int64 *)&v29, (ReportPopup *)(unsigned int)v31);
sub_CFDC50((__int64)&v41, &v29);
if ( v29 )
{
if ( v30 != v29 )
v30 += 4 * ~((unsigned __int64)(v30 - 4 - (_BYTE *)v29) >> 2);
operator delete(v29);
}
v4 = ReportPopup::create((ReportPopup *)&v31, v19);
if ( ((unsigned __int8)v22 & 1) != 0 )
operator delete(v24);
if ( !v41 )
{
LABEL_6:
if ( (v39[0] & 1) != 0 )
goto LABEL_35;
goto LABEL_7;
}
if ( v41 != v42 )
v42 += 4 * ~((unsigned __int64)(v42 - 4 - (_BYTE *)v41) >> 2);
operator delete(v41);
if ( (v39[0] & 1) != 0 )
{
LABEL_35:
operator delete(v40);
if ( (v35 & 1) == 0 )
goto LABEL_8;
goto LABEL_36;
}
LABEL_7:
if ( (v35 & 1) == 0 )
goto LABEL_8;
LABEL_36:
operator delete(v37);
LABEL_8:
if ( (v33[0] & 1) != 0 )
operator delete(v34);
return v4;
}