//
// GJGameLevel::getListSnapshot from 0x1000ada58 to 0x1000adce0 (648 bytes)
//
// 2 xrefs:
// > GJLevelList::getListLevelsArray @ 0x1000b12c8
// > GJLevelList::addLevelToList @ 0x1000b14d0
//
// 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)
{
GJGameLevel *v2; // x19
int v3; // w21
float v4; // s0
int v5; // w21
float v6; // s0
int v7; // w21
float v8; // s0
int v9; // w21
float v10; // s0
int v11; // w21
float v12; // s0
int random; // w21
int seed; // w22
int v15; // w8
int v16; // w20
float v17; // s0
std::string __p; // [xsp+0h] [xbp-70h] BYREF
std::string __str; // [xsp+20h] [xbp-50h] BYREF
v2 = GJGameLevel::create_1();
v3 = a1->m_levelID.random - a1->m_levelID.seed;
v2->m_levelID.value = v3;
v4 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;
v2->m_levelID.seed = (int)v4;
v2->m_levelID.random = v3 + (int)v4;
if ( a1->m_levelName.m_data.m_short.shortStorage.__elems_[22] < 0 )
sub_1000097D0(&__str, (void *)a1->m_levelName.m_data.m_long.capacitym1, a1->m_levelName.m_data.m_long.size);
else
__str = (std::string)a1->m_levelName;
std::string::operator=((std::string *)&v2->m_levelName, &__str);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
v2->m_levelLength = a1->m_levelLength;
v2->m_timestamp = a1->m_timestamp;
v5 = a1->m_accountID.random - a1->m_accountID.seed;
v2->m_accountID.value = v5;
v6 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;
v2->m_accountID.seed = (int)v6;
v2->m_accountID.random = v5 + (int)v6;
if ( a1->m_creatorName.m_data.m_short.shortStorage.__elems_[22] < 0 )
sub_1000097D0(&__p, (void *)a1->m_creatorName.m_data.m_long.capacitym1, a1->m_creatorName.m_data.m_long.size);
else
__p = a1->m_creatorName;
std::string::operator=((std::string *)&v2->m_creatorName, (const std::string *)&__p);
if ( __p.m_data.m_short.shortStorage.__elems_[22] < 0 )
operator delete((void *)__p.m_data.m_long.capacitym1);
v2->m_likes = a1->m_likes;
v2->m_audioTrack = a1->m_audioTrack;
v2->m_songID = a1->m_songID;
v2->m_levelType = a1->m_levelType;
v2->m_ratings = a1->m_ratings;
*(_QWORD *)&v2->m_ratingsSum = *(_QWORD *)&a1->m_ratingsSum;
v7 = a1->m_demon.random - a1->m_demon.seed;
v2->m_demon.value = v7;
v8 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;
v2->m_demon.seed = (int)v8;
v2->m_demon.random = v7 + (int)v8;
v2->m_demonDifficulty = a1->m_demonDifficulty;
v2->m_autoLevel = a1->m_autoLevel;
v2->m_featured = a1->m_featured;
v2->m_isEpic = a1->m_isEpic;
v9 = a1->m_stars.random - a1->m_stars.seed;
v2->m_stars.value = v9;
v10 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;
v2->m_stars.seed = (int)v10;
v2->m_stars.random = v9 + (int)v10;
v2->m_coins = a1->m_coins;
v11 = a1->m_coinsVerified.random - a1->m_coinsVerified.seed;
v2->m_coinsVerified.value = v11;
v12 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;
v2->m_coinsVerified.seed = (int)v12;
v2->m_coinsVerified.random = v11 + (int)v12;
random = a1->m_originalLevel.random;
seed = a1->m_originalLevel.seed;
v2->m_originalLevel.value = random != seed;
v15 = (int)(float)(vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0);
v2->m_originalLevel.seed = v15;
if ( random != seed )
++v15;
v2->m_originalLevel.random = v15;
v16 = a1->m_objectCount.random - a1->m_objectCount.seed;
v2->m_objectCount.value = v16;
v17 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;
v2->m_objectCount.seed = (int)v17;
v2->m_objectCount.random = v16 + (int)v17;
return v2;
}