//
// GameManager::encodeDataTo from 0x1003ba3ec to 0x1003bae7c (2704 bytes)
//
// 1 xrefs:
// > ??> @ 0x1009472e8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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:03:59 +0000
//
__int64 __fastcall GameManager::encodeDataTo(__int64 a1, __int64 a2)
{
__int64 v4; // x0
__int64 v5; // x0
__int64 v6; // x0
__int64 v7; // x0
__int64 v8; // x0
__int64 v9; // x0
__int64 v10; // x0
__int64 v11; // x0
__int64 v12; // x0
__int64 v13; // x0
__int64 v14; // x0
__int64 v15; // x0
__n128 v16; // q0
__int64 v17; // x0
_QWORD *v18; // x24
__int64 v19; // x21
_QWORD *v20; // x9
_QWORD *v21; // x8
bool v22; // zf
char *v23; // x1
char *v24; // x1
char *v25; // x1
char *v26; // x1
char *v27; // x1
char *v28; // x1
char *v29; // x1
char __str[8]; // [xsp+8h] [xbp-78h] BYREF
char v32; // [xsp+1Fh] [xbp-61h]
if ( *(_QWORD *)(GameManager::sharedState() + 544) )
{
v4 = GameManager::sharedState();
PlayLayer::writePersistentSave(*(_QWORD *)(v4 + 544));
}
DS_Dictionary::setDictForKey(a2, "valueKeeper", *(_QWORD *)(a1 + 424));
if ( (*(_BYTE *)(a1 + 440) & 1) == 0 )
DS_Dictionary::setDictForKey(a2, "localKeeper", *(_QWORD *)(a1 + 432));
DS_Dictionary::setDictForKey(a2, "unlockValueKeeper", *(_QWORD *)(a1 + 448));
DS_Dictionary::setDictForKey(a2, "customObjectDict", *(_QWORD *)(a1 + 456));
v5 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::getBackgroundMusicVolume(v5);
DS_Dictionary::setFloatForKey_1(a2, (__int64)"bgVolume");
v6 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::getEffectsVolume(v6);
DS_Dictionary::setFloatForKey_1(a2, (__int64)"sfxVolume");
v7 = FMODAudioEngine::sharedEngine();
DS_Dictionary::setIntegerForKey_1(a2, (__int64)"timeOffset", *(unsigned int *)(v7 + 548));
sub_1001EB144(a2, (__int64)"playerUDID", a1 + 608);
sub_1001EB144(a2, (__int64)"playerName", a1 + 632);
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerUserID",
(unsigned int)(*(_DWORD *)(a1 + 660) - *(_DWORD *)(a1 + 664)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerFrame",
(unsigned int)(*(_DWORD *)(a1 + 716) - *(_DWORD *)(a1 + 720)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerShip",
(unsigned int)(*(_DWORD *)(a1 + 728) - *(_DWORD *)(a1 + 732)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerBall",
(unsigned int)(*(_DWORD *)(a1 + 740) - *(_DWORD *)(a1 + 744)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerBird",
(unsigned int)(*(_DWORD *)(a1 + 752) - *(_DWORD *)(a1 + 756)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerDart",
(unsigned int)(*(_DWORD *)(a1 + 764) - *(_DWORD *)(a1 + 768)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerRobot",
(unsigned int)(*(_DWORD *)(a1 + 776) - *(_DWORD *)(a1 + 780)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerSpider",
(unsigned int)(*(_DWORD *)(a1 + 788) - *(_DWORD *)(a1 + 792)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerSwing",
(unsigned int)(*(_DWORD *)(a1 + 800) - *(_DWORD *)(a1 + 804)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerColor",
(unsigned int)(*(_DWORD *)(a1 + 812) - *(_DWORD *)(a1 + 816)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerColor2",
(unsigned int)(*(_DWORD *)(a1 + 824) - *(_DWORD *)(a1 + 828)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerColor3",
(unsigned int)(*(_DWORD *)(a1 + 836) - *(_DWORD *)(a1 + 840)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerStreak",
(unsigned int)(*(_DWORD *)(a1 + 848) - *(_DWORD *)(a1 + 852)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerShipStreak",
(unsigned int)(*(_DWORD *)(a1 + 860) - *(_DWORD *)(a1 + 864)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerDeathEffect",
(unsigned int)(*(_DWORD *)(a1 + 872) - *(_DWORD *)(a1 + 876)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"playerJetpack",
(unsigned int)(*(_DWORD *)(a1 + 884) - *(_DWORD *)(a1 + 888)));
DS_Dictionary::setIntegerForKey_1(a2, (__int64)"playerIconType", *(unsigned int *)(a1 + 916));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"playerGlow", *(unsigned __int8 *)(a1 + 912));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"secretNumber",
(unsigned int)(*(_DWORD *)(a1 + 904) - *(_DWORD *)(a1 + 908)));
DS_Dictionary::setIntegerForKey_1(
a2,
(__int64)"hasRP",
(unsigned int)(*(_DWORD *)(a1 + 1032) - *(_DWORD *)(a1 + 1036)));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"hasDRP", *(unsigned __int8 *)(a1 + 1044));
DS_Dictionary::setIntegerForKey_1(a2, (__int64)"specialPermKey", *(unsigned int *)(a1 + 1048));
v8 = AchievementManager::sharedState();
AchievementManager::encodeDataTo(v8, a2);
v9 = GameLevelManager::sharedState();
v10 = GameLevelManager::encodeDataTo(v9, a2);
v11 = GameStatsManager::sharedState(v10);
GameStatsManager::encodeDataTo(v11, a2);
v12 = MusicDownloadManager::sharedState();
MusicDownloadManager::encodeDataTo(v12, a2);
v14 = GJAccountManager::sharedState(v13);
GJAccountManager::encodeDataTo(v14, a2);
GJMultiplayerManager::sharedState();
GJMultiplayerManager::encodeDataTo();
v15 = GJKeybindManager::sharedState();
GJKeybindManager::encodeDataTo(v15, a2);
v17 = EditorSFXManager::sharedState(v16);
EditorSFXManager::encodeDataTo(v17, a2);
DS_Dictionary::setBoolForKey_1(a2, (__int64)"showSongMarkers", *(unsigned __int8 *)(a1 + 921));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"showBPMMarkers", *(unsigned __int8 *)(a1 + 922));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"recordGameplay", *(unsigned __int8 *)(a1 + 923));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"showProgressBar", *(unsigned __int8 *)(a1 + 924));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"performanceMode", *(unsigned __int8 *)(a1 + 925));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"clickedGarage", *(unsigned __int8 *)(a1 + 927));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"clickedEditor", *(unsigned __int8 *)(a1 + 928));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"clickedName", *(unsigned __int8 *)(a1 + 929));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"clickedPractice", *(unsigned __int8 *)(a1 + 930));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"showedEditorGuide", *(unsigned __int8 *)(a1 + 931));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"showedRateDiffDialog", *(unsigned __int8 *)(a1 + 932));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"showedRateStarDialog", *(unsigned __int8 *)(a1 + 933));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"showedLowDetailDialog", *(unsigned __int8 *)(a1 + 934));
DS_Dictionary::setIntegerForKey_1(a2, (__int64)"bootups", *(unsigned int *)(a1 + 1020));
DS_Dictionary::setBoolForKey_1(a2, (__int64)"hasRatedGame", *(unsigned __int8 *)(a1 + 1024));
DS_Dictionary::setIntegerForKey_1(a2, (__int64)"binaryVersion", 51);
DS_Dictionary::setIntegerForKey_1(a2, (__int64)"resolution", *(unsigned int *)(a1 + 1056));
DS_Dictionary::setIntegerForKey_1(a2, (__int64)"texQuality", *(unsigned int *)(a1 + 1060));
DS_Dictionary::setFloatForKey_1(a2, (__int64)"customFPSTarget");
DS_Dictionary::setFloatForKey_1(a2, (__int64)"scrollSensitivity");
v18 = *(_QWORD **)(a1 + 1112);
if ( v18 == (_QWORD *)(a1 + 1120) )
{
v19 = 0;
}
else
{
v19 = 0;
do
{
if ( (*((_BYTE *)v18 + 60) & 1) == 0 )
{
snprintf(__str, 0x20u, "ws_%d_k", v19);
DS_Dictionary::setIntegerForKey_1(a2, (__int64)__str, *((unsigned int *)v18 + 7));
snprintf(__str, 0x20u, "ws_%d_cx", v19);
DS_Dictionary::setFloatForKey_1(a2, (__int64)__str);
snprintf(__str, 0x20u, "ws_%d_cy", v19);
DS_Dictionary::setFloatForKey_1(a2, (__int64)__str);
snprintf(__str, 0x20u, "ws_%d_w", v19);
DS_Dictionary::setFloatForKey_1(a2, (__int64)__str);
snprintf(__str, 0x20u, "ws_%d_h", v19);
DS_Dictionary::setFloatForKey_1(a2, (__int64)__str);
snprintf(__str, 0x20u, "ws_%d_s", v19);
DS_Dictionary::setFloatForKey_1(a2, (__int64)__str);
snprintf(__str, 0x20u, "ws_%d_so", v19);
DS_Dictionary::setFloatForKey_1(a2, (__int64)__str);
snprintf(__str, 0x20u, "ws_%d_v", v19);
DS_Dictionary::setIntegerForKey_1(a2, (__int64)__str, *((unsigned int *)v18 + 14));
v19 = (unsigned int)(v19 + 1);
}
v20 = (_QWORD *)v18[1];
if ( v20 )
{
do
{
v21 = v20;
v20 = (_QWORD *)*v20;
}
while ( v20 );
}
else
{
do
{
v21 = (_QWORD *)v18[2];
v22 = *v21 == (_QWORD)v18;
v18 = v21;
}
while ( !v22 );
}
v18 = v21;
}
while ( v21 != (_QWORD *)(a1 + 1120) );
}
DS_Dictionary::setIntegerForKey_1(a2, (__int64)"winStateCount", v19);
DS_Dictionary::setIntegerForKey_1(a2, (__int64)"customMenuSongID", *(unsigned int *)(a1 + 1140));
DS_Dictionary::setIntegerForKey_1(a2, (__int64)"customPracticeSongID", *(unsigned int *)(a1 + 1144));
DS_Dictionary::setIntegerForKey_1(a2, (__int64)"idNameSortMode", *(unsigned int *)(a1 + 1148));
DS_Dictionary::setIntegerForKey_1(a2, (__int64)"newsLastReadID", *(unsigned int *)(a1 + 1152));
sub_1003B7A34((float *)(a1 + 1316), __str);
sub_1001EB144(a2, (__int64)"dpad01", (__int64)__str);
if ( v32 < 0 )
operator delete(*(void **)__str);
sub_1003B7A34((float *)(a1 + 1356), __str);
sub_1001EB144(a2, (__int64)"dpad02", (__int64)__str);
if ( v32 < 0 )
operator delete(*(void **)__str);
sub_1003B7A34((float *)(a1 + 1396), __str);
sub_1001EB144(a2, (__int64)"dpad03", (__int64)__str);
if ( v32 < 0 )
operator delete(*(void **)__str);
sub_1003B7A34((float *)(a1 + 1436), __str);
sub_1001EB144(a2, (__int64)"dpad04", (__int64)__str);
if ( v32 < 0 )
operator delete(*(void **)__str);
sub_1003B7A34((float *)(a1 + 1476), __str);
sub_1001EB144(a2, (__int64)"dpad05", (__int64)__str);
if ( v32 < 0 )
operator delete(*(void **)__str);
v23 = (char *)(a1 + 1520);
if ( *(char *)(a1 + 1543) < 0 )
v23 = *(char **)v23;
sub_100009900(__str, v23);
sub_1001EB144(a2, (__int64)"dpadLayout01", (__int64)__str);
if ( v32 < 0 )
operator delete(*(void **)__str);
v24 = (char *)(a1 + 1544);
if ( *(char *)(a1 + 1567) < 0 )
v24 = *(char **)v24;
sub_100009900(__str, v24);
sub_1001EB144(a2, (__int64)"dpadLayout02", (__int64)__str);
if ( v32 < 0 )
operator delete(*(void **)__str);
v25 = (char *)(a1 + 1568);
if ( *(char *)(a1 + 1591) < 0 )
v25 = *(char **)v25;
sub_100009900(__str, v25);
sub_1001EB144(a2, (__int64)"dpadLayout03", (__int64)__str);
if ( v32 < 0 )
operator delete(*(void **)__str);
v26 = (char *)(a1 + 1592);
if ( *(char *)(a1 + 1615) < 0 )
v26 = *(char **)v26;
sub_100009900(__str, v26);
sub_1001EB144(a2, (__int64)"dpadLayoutDual01", (__int64)__str);
if ( v32 < 0 )
operator delete(*(void **)__str);
v27 = (char *)(a1 + 1616);
if ( *(char *)(a1 + 1639) < 0 )
v27 = *(char **)v27;
sub_100009900(__str, v27);
sub_1001EB144(a2, (__int64)"dpadLayoutDual02", (__int64)__str);
if ( v32 < 0 )
operator delete(*(void **)__str);
v28 = (char *)(a1 + 1640);
if ( *(char *)(a1 + 1663) < 0 )
v28 = *(char **)v28;
sub_100009900(__str, v28);
sub_1001EB144(a2, (__int64)"dpadLayoutDual03", (__int64)__str);
if ( v32 < 0 )
operator delete(*(void **)__str);
v29 = (char *)(a1 + 1664);
if ( *(char *)(a1 + 1687) < 0 )
v29 = *(char **)v29;
sub_100009900(__str, v29);
sub_1001EB144(a2, (__int64)"recentEmotes", (__int64)__str);
if ( v32 < 0 )
operator delete(*(void **)__str);
DS_Dictionary::setFloatForKey_1(a2, (__int64)"practiceOpacity");
DS_Dictionary::setFloatForKey_1(a2, (__int64)"practicePosX");
return DS_Dictionary::setFloatForKey_1(a2, (__int64)"practicePosY");
}