//
// GameLevelManager::appendModReason from 0x4bc734 to 0x4bc800 (204 bytes)
//
// 5 xrefs:
// > GameLevelManager::deleteServerLevel @ 0x4bc91a
// > GameLevelManager::deleteComments @ 0x4be302
// > GameLevelManager::sendAdminAction @ 0x4be530
// > GameLevelManager::deleteServerLevelList @ 0x4d078e
// > GameLevelManager::deleteServerEditorSound @ 0x4d0b8a
//
// 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:50:18 +0000
//
int __fastcall GameLevelManager::appendModReason(int a1, _DWORD *a2, unsigned __int8 *a3, _DWORD *a4)
{
int v7; // r3
int result; // r0
int v9; // r3
char *v10; // r1
size_t v11; // r2
char *v12; // r1
size_t v13; // r2
int v14[3]; // [sp+4h] [bp-1Ch] BYREF
int v15; // [sp+10h] [bp-10h] BYREF
size_t v16; // [sp+14h] [bp-Ch]
char *v17; // [sp+18h] [bp-8h]
v7 = *a3;
result = v7 << 31;
if ( (v7 & 1) != 0 )
v9 = *((_DWORD *)a3 + 1);
else
v9 = v7 >> 1;
if ( v9 )
{
std::string::append(a2, "&reason=");
std::string::basic_string(v14, (int)a3);
LevelTools::base64EncodeString(&v15, v14);
if ( (v15 & 1) != 0 )
{
v10 = v17;
v11 = v16;
}
else
{
v11 = (int)(unsigned __int8)v15 >> 1;
v10 = (char *)&v15 + 1;
}
std::string::append(a2, v10, v11);
std::string::~string((int)&v15);
result = std::string::~string((int)v14);
}
if ( *a4 != a4[1] )
{
std::string::append(a2, "&categories=");
sub_4B5994(&v15, a4);
if ( (v15 & 1) != 0 )
{
v12 = v17;
v13 = v16;
}
else
{
v13 = (int)(unsigned __int8)v15 >> 1;
v12 = (char *)&v15 + 1;
}
std::string::append(a2, v12, v13);
return std::string::~string((int)&v15);
}
return result;
}