//
// GJGameLevel::storeNewLocalScore from 0x3d8270 to 0x3d8368 (248 bytes)
//
// 1 xrefs:
// > GJGameLevel::saveNewScore @ 0x3d843c
//
// 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
//
void GJGameLevel::storeNewLocalScore(GJGameLevel *a1, int a2, int a3)
{
std::string *p_m_localBestPoints; // r7
int *v6; // r0
unsigned int v7; // r0
int v8; // r10
char *v9; // r4
int *m_finish; // r1
int *m_start; // r0
int *v12; // r11
int v13; // [sp+4h] [bp-20h] BYREF
_BYTE v14[4]; // [sp+Ch] [bp-18h] BYREF
std::vector p; // [sp+10h] [bp-14h] BYREF
if ( a3 == 1 )
p_m_localBestPoints = &a1->m_localBestPoints;
else
p_m_localBestPoints = &a1->m_localBestTimes;
v13 = a2;
memset(&p, 0, sizeof(p));
GJGameLevel::scoreStringToVector(a1, p_m_localBestPoints, &p);
v6 = std::__find_if<__gnu_cxx::__normal_iterator>,__gnu_cxx::__ops::_Iter_equals_val>(
p.m_start,
(int)p.m_finish,
&v13);
if ( v6 == p.m_finish )
{
if ( v6 == p.m_reserveEnd )
{
v7 = std::vector::_M_check_len(&p, 1u, (int)"vector::_M_emplace_back_aux");
v8 = 4 * v7;
if ( v7 )
{
if ( v7 >= 0x40000000 )
sub_772FB4(v7);
v7 = operator new(4 * v7);
}
v9 = (char *)v7;
m_finish = p.m_finish;
m_start = p.m_start;
if ( &v9[(char *)p.m_finish - (char *)p.m_start] )
*(_DWORD *)&v9[(char *)p.m_finish - (char *)p.m_start] = v13;
v12 = (int *)(std::__copy_move::__copy_m(
m_start,
(int)m_finish,
v9)
+ 4);
if ( p.m_start )
operator delete(p.m_start);
p.m_start = (int *)v9;
p.m_finish = v12;
p.m_reserveEnd = (int *)&v9[v8];
}
else
{
if ( v6 )
*v6 = v13;
p.m_finish = v6 + 1;
}
GJGameLevel::scoreVectorToString((int)v14, (std::vector *)a1, (char **)&p, a3);
sub_774794(p_m_localBestPoints, v14);
sub_774008(v14);
}
if ( p.m_start )
operator delete(p.m_start);
}