//
// base64Encode from 0x5ec128 to 0x5ec170 (72 bytes)
//
// 3 xrefs:
// > cocos2d::ZipUtils::base64EncodeEnc @ 0x5ef8be
// > cocos2d::ZipUtils::base64URLEncode @ 0x5efa00
// > cocos2d::ZipUtils::compressString @ 0x5f00f0
//
// 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
//
unsigned int __fastcall base64Encode(cocos2d *a1, const unsigned __int8 *a2, _DWORD *a3, char *a4)
{
int v8; // r0
unsigned int v9; // r4
void *v10; // r2
bool savedregs; // [sp+0h] [bp+0h]
if ( a2 == (const unsigned __int8 *)(3 * ((unsigned int)a2 / 3)) )
v8 = 0;
else
v8 = 4;
v9 = v8 + 4 * (int)a2 / 3u;
v10 = malloc(v9 + 1);
*a3 = v10;
if ( v10 )
cocos2d::_base64Encode(a1, a2, (unsigned int)v10, a4, savedregs);
return v9;
}