//
// std::vector>::operator= from 0x4a6418 to 0x4a651a (258 bytes)
//
// 1 xrefs:
// > GroupCommandObject2::operator= @ 0x4a675a
//
// 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
//
int __fastcall std::vector::operator=(int a1, int a2)
{
KeyframeObject *v4; // r5
__int64 *v5; // r8
int v6; // r9
int v7; // r7
unsigned int v8; // r4
int v9; // r5
int v10; // r5
int v11; // r10
int v12; // r5
unsigned int i; // r4
if ( a2 != a1 )
{
v4 = *(KeyframeObject **)(a2 + 4);
v5 = *(__int64 **)a2;
v6 = *(_DWORD *)a1;
v7 = (int)v4 - *(_DWORD *)a2;
v8 = 1022611261 * (v7 >> 4);
if ( v8 <= 1022611261 * ((*(_DWORD *)(a1 + 8) - *(_DWORD *)a1) >> 4) )
{
v9 = 1022611261 * ((*(_DWORD *)(a1 + 4) - v6) >> 4);
if ( v9 < v8 )
{
while ( v9 > 0 )
{
KeyframeObject::operator=(v6, v5);
v5 += 42;
v6 += 336;
--v9;
}
std::__uninitialized_copy::__uninit_copy(
(KeyframeObject *)(*(_DWORD *)(a1 + 4) - *(_DWORD *)a1 + *(_DWORD *)a2),
*(KeyframeObject **)(a2 + 4),
*(KeyframeObject **)(a1 + 4));
}
else
{
v10 = 1022611261 * (v7 >> 4);
v11 = *(_DWORD *)a1;
while ( v10 > 0 )
{
KeyframeObject::operator=(v11, v5);
v5 += 42;
v11 += 336;
--v10;
}
v12 = *(_DWORD *)(a1 + 4);
for ( i = v6 + 336 * (v8 & ~((int)v8 >> 31)); i != v12; i += 336 )
{
tk::spline::~spline((void **)(i + 144));
tk::spline::~spline((void **)(i + 32));
}
}
}
else
{
if ( v8 )
{
if ( v8 > 0xC30C30 )
sub_772FB4(a1);
v8 = operator new((unsigned int)v4 - *(_DWORD *)a2);
}
std::__uninitialized_copy::__uninit_copy<__gnu_cxx::__normal_iterator>,KeyframeObject*>(
(KeyframeObject *)v5,
v4,
(KeyframeObject *)v8);
std::_Destroy_aux::__destroy(*(_DWORD *)a1, *(_DWORD *)(a1 + 4));
sub_498906(*(void **)a1);
*(_DWORD *)a1 = v8;
*(_DWORD *)(a1 + 8) = v8 + v7;
}
*(_DWORD *)(a1 + 4) = v7 + *(_DWORD *)a1;
}
return a1;
}