//
// GJGameLevel::getListSnapshot from 0x10055d4d0 to 0x10055d84e (894 bytes)
//
// 2 xrefs:
// > GJLevelList::getListLevelsArray @ 0x10056225f
// > GJLevelList::addLevelToList @ 0x1005627b5
//
// 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
//
GJGameLevel *__fastcall GJGameLevel::getListSnapshot(GJGameLevel *a1)
{
double v1; // xmm0_8
char *v2; // rbx
int v3; // r15d
int v4; // r15d
double v5; // xmm0_8
int v6; // r15d
float v7; // xmm0_4
int v8; // r15d
float v9; // xmm0_4
int v10; // r15d
float v11; // xmm0_4
__int64 v12; // r15
float v13; // xmm0_4
float v14; // xmm0_4
std::string __str; // [rsp+0h] [rbp-50h] BYREF
std::string m_creatorName; // [rsp+20h] [rbp-30h] BYREF
v2 = (char *)operator new(0x530u);
GJGameLevel::GJGameLevel((GJGameLevel *)v2);
if ( (*(unsigned __int8 (__fastcall **)(char *))(*(_QWORD *)v2 + 80LL))(v2) )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v2);
}
else
{
(*(void (__fastcall **)(char *))(*(_QWORD *)v2 + 16LL))(v2);
v2 = nullptr;
}
v3 = a1->m_levelID.random - a1->m_levelID.seed;
*((_DWORD *)v2 + 84) = v3;
*(float *)&v1 = (float)((float)rand() * 4.6566129e-10) * 1000.0;
*((_DWORD *)v2 + 83) = (int)*(float *)&v1;
*((_DWORD *)v2 + 82) = (int)*(float *)&v1 + v3;
if ( (a1->m_levelName.m_data.m_short.sizex2 & 1) != 0 )
sub_100006B70(&__str, a1->m_levelName.m_data.m_long.longStorage, a1->m_levelName.m_data.m_long.size, v1);
else
__str = (std::string)a1->m_levelName;
std::string::operator=((std::string *)(v2 + 344), &__str);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
*((_DWORD *)v2 + 196) = a1->m_levelLength;
*((_DWORD *)v2 + 280) = a1->m_timestamp;
v4 = a1->m_accountID.random - a1->m_accountID.seed;
*((_DWORD *)v2 + 147) = v4;
HIDWORD(v5) = 0;
*(float *)&v5 = (float)((float)rand() * 4.6566129e-10) * 1000.0;
*((_DWORD *)v2 + 146) = (int)*(float *)&v5;
*((_DWORD *)v2 + 145) = (int)*(float *)&v5 + v4;
if ( (a1->m_creatorName.m_data.m_short.sizex2 & 1) != 0 )
sub_100006B70(&m_creatorName, a1->m_creatorName.m_data.m_long.longStorage, a1->m_creatorName.m_data.m_long.size, v5);
else
m_creatorName = (std::string)a1->m_creatorName;
std::string::operator=((std::string *)(v2 + 416), &m_creatorName);
if ( (*(_BYTE *)&m_creatorName.__r_.__value_.__s.0 & 1) != 0 )
operator delete(m_creatorName.__r_.__value_.__l.__data_);
*((_DWORD *)v2 + 194) = a1->m_likes;
*((_DWORD *)v2 + 159) = a1->m_downloads;
*(_QWORD *)(v2 + 596) = *(_QWORD *)&a1->m_audioTrack;
*((_DWORD *)v2 + 257) = a1->m_levelType;
*(_QWORD *)(v2 + 628) = *(_QWORD *)&a1->m_ratings;
v6 = a1->m_demon.random - a1->m_demon.seed;
*((_DWORD *)v2 + 206) = v6;
v7 = (float)((float)rand() * 4.6566129e-10) * 1000.0;
*((_DWORD *)v2 + 205) = (int)v7;
*((_DWORD *)v2 + 204) = (int)v7 + v6;
*((_DWORD *)v2 + 207) = a1->m_demonDifficulty;
v2[844] = a1->m_autoLevel;
*(_QWORD *)(v2 + 788) = *(_QWORD *)&a1->m_featured;
v8 = a1->m_stars.random - a1->m_stars.seed;
*((_DWORD *)v2 + 210) = v8;
v9 = (float)((float)rand() * 4.6566129e-10) * 1000.0;
*((_DWORD *)v2 + 209) = (int)v9;
*((_DWORD *)v2 + 208) = (int)v9 + v8;
*((_DWORD *)v2 + 212) = a1->m_coins;
v10 = a1->m_coinsVerified.random - a1->m_coinsVerified.seed;
*((_DWORD *)v2 + 215) = v10;
v11 = (float)((float)rand() * 4.6566129e-10) * 1000.0;
*((_DWORD *)v2 + 214) = (int)v11;
*((_DWORD *)v2 + 213) = (int)v11 + v10;
v12 = a1->m_originalLevel.random != a1->m_originalLevel.seed;
*((_DWORD *)v2 + 220) = v12;
v13 = (float)((float)rand() * 4.6566129e-10) * 1000.0;
*((_DWORD *)v2 + 219) = (int)v13;
*((_DWORD *)v2 + 218) = v12 + (int)v13;
LODWORD(v12) = a1->m_objectCount.random - a1->m_objectCount.seed;
*((_DWORD *)v2 + 155) = v12;
v14 = (float)((float)rand() * 4.6566129e-10) * 1000.0;
*((_DWORD *)v2 + 154) = (int)v14;
*((_DWORD *)v2 + 153) = (int)v14 + v12;
return (GJGameLevel *)v2;
}