//
// cocos2d::ZipUtils::base64DecodeEnc from 0x100205880 to 0x100205a66 (486 bytes)
//
// 7 xrefs:
// > GameLevelManager::onGetGJRewardsCompleted @ 0x100526fb8
// > GameLevelManager::onGetGJChallengesCompleted @ 0x100527c13
// > GameLevelManager::onGetGJDailyLevelStateCompleted @ 0x100528ce1
// > GameLevelManager::onGetGJSecretRewardCompleted @ 0x10052b463
// > GJGameLevel::create @ 0x10052fa05
// > GJUserMessage::create @ 0x10054dbfc
// > MusicDownloadManager::generateCustomContentURL @ 0x10059108c
//
// 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
//
std::string *__fastcall cocos2d::ZipUtils::base64DecodeEnc(
std::string *this,
unsigned __int8 *a2,
__int128 *a3,
double a4)
{
std::string *v6; // rbx
__int64 v7; // rsi
unsigned __int8 *v8; // rdi
__int64 v9; // rsi
int v10; // eax
unsigned __int64 size; // r14
char v12; // al
unsigned int v13; // esi
__int64 v14; // rcx
std::string::pointer data; // r10
char *v16; // rax
char v17; // al
std::string::pointer v18; // rdx
const void *v19; // rsi
unsigned __int64 v20; // rdx
std::string v22; // [rsp+0h] [rbp-60h] BYREF
__int128 v23; // [rsp+20h] [rbp-40h] BYREF
void *__p; // [rsp+30h] [rbp-30h]
std::string::value_type *__s; // [rsp+40h] [rbp-20h] BYREF
v6 = this;
v7 = *a2;
if ( (v7 & 1) != 0 )
{
v9 = *((_QWORD *)a2 + 1);
if ( !v9 )
{
v19 = *((const void **)a2 + 2);
v20 = 0;
goto LABEL_38;
}
__s = nullptr;
v8 = *((unsigned __int8 **)a2 + 2);
}
else
{
if ( !v7 )
{
LABEL_12:
v6->__r_.__value_.__r.__words[2] = *((_QWORD *)a2 + 2);
*(_OWORD *)&v6->__r_.__value_.__l.0 = *(_OWORD *)a2;
return v6;
}
__s = nullptr;
v8 = a2 + 1;
v9 = (unsigned int)v7 >> 1;
}
v10 = sub_1003292A0(v8, v9, &__s, 1);
if ( v10 <= 0 )
{
if ( __s )
{
operator delete[](__s);
__s = nullptr;
}
if ( (*a2 & 1) == 0 )
goto LABEL_12;
v20 = *((_QWORD *)a2 + 1);
v19 = *((const void **)a2 + 2);
this = v6;
LABEL_38:
sub_100006B70(this, v19, v20, a4);
return v6;
}
memset(&v22, 0, sizeof(v22));
std::string::append(&v22, __s, (unsigned int)v10);
if ( (*(_BYTE *)a3 & 1) != 0 )
{
sub_100006B70(&v23, *((const void **)a3 + 2), *((_QWORD *)a3 + 1), 0.0);
}
else
{
__p = *((void **)a3 + 2);
v23 = *a3;
}
*(_OWORD *)&v6->__r_.__value_.__l.0 = 0;
v6->__r_.__value_.__r.__words[2] = 0;
if ( (*(_BYTE *)&v22.__r_.__value_.__s.0 & 1) != 0 )
size = v22.__r_.__value_.__l.__size_;
else
size = *(_BYTE *)&v22.__r_.__value_.__l.0 >> 1;
std::string::resize(v6, size, 0);
v12 = v23 & 1;
if ( (v23 & 1) != 0 )
{
v13 = DWORD2(v23);
if ( !size )
goto LABEL_30;
LABEL_21:
v14 = 0;
do
{
data = v22.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v22.__r_.__value_.__s.0 & 1) != 0 )
data = v22.__r_.__value_.__l.__data_;
v16 = (char *)&v23 + 1;
if ( (v23 & 1) != 0 )
v16 = (char *)__p;
v17 = data[v14] ^ v16[(unsigned int)v14 % v13];
v18 = v6->__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v6->__r_.__value_.__s.0 & 1) != 0 )
v18 = v6->__r_.__value_.__l.__data_;
v18[v14++] = v17;
}
while ( size > (unsigned int)v14 );
v12 = v23 & 1;
goto LABEL_30;
}
v13 = (unsigned __int8)v23 >> 1;
if ( size )
goto LABEL_21;
LABEL_30:
if ( v12 )
operator delete(__p);
if ( __s )
{
operator delete[](__s);
__s = nullptr;
}
if ( (*(_BYTE *)&v22.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v22.__r_.__value_.__l.__data_);
return v6;
}