//
// std::vector>::resize from 0x595118 to 0x5951b4 (156 bytes)
//
// 20 xrefs:
// > tk::spline::set_coeffs_from_b @ 0x5951d4
// > tk::spline::set_coeffs_from_b @ 0x5951ea
// > internal::band_matrix::resize @ 0x59551c
// > internal::band_matrix::resize @ 0x59553e
// > internal::solve_linear @ 0x5955aa
// > internal::solve_linear @ 0x5955bc
// > internal::solve_quadratic @ 0x59567a
// > internal::solve_quadratic @ 0x5956a2
// > tk::spline::set_points @ 0x5958a2
// > tk::spline::set_points @ 0x5958b0
// > tk::spline::set_points @ 0x5958bc
// > tk::spline::set_points @ 0x595cfa
// > tk::spline::set_points @ 0x595d04
// > tk::spline::set_points @ 0x595e2c
// > tk::spline::set_points @ 0x595e36
// > tk::spline::set_points @ 0x595e40
// > internal::solve_cubic @ 0x5964b0
// > internal::solve_cubic @ 0x5964c2
// > internal::solve_cubic @ 0x59650a
// > internal::solve_cubic @ 0x59659c
//
// 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 __fastcall std::vector::resize(const void **a1, unsigned int a2)
{
_BYTE *v2; // r3
unsigned int v4; // r5
unsigned int v5; // r5
unsigned int v6; // r2
_QWORD *v7; // r1
unsigned int v8; // r0
unsigned int v9; // r8
char *v10; // r7
size_t v11; // r6
char *v12; // r6
unsigned int v13; // r3
char *v14; // r2
char *v15; // r6
v2 = a1[1];
v4 = (v2 - (_BYTE *)*a1) >> 3;
if ( a2 <= v4 )
{
if ( a2 < v4 )
a1[1] = (char *)*a1 + 8 * a2;
}
else
{
v5 = a2 - v4;
if ( v5 )
{
if ( v5 > ((_BYTE *)a1[2] - v2) >> 3 )
{
v8 = std::vector::_M_check_len(a1, v5, (int)"vector::_M_default_append");
v9 = v8;
if ( v8 )
v10 = (char *)sub_594790(v8);
else
v10 = nullptr;
v11 = (_BYTE *)a1[1] - (_BYTE *)*a1;
if ( v11 >> 3 )
memmove(v10, *a1, v11);
v12 = &v10[v11];
v13 = v5;
v14 = v12;
do
{
--v13;
*(_QWORD *)v14 = 0;
v14 += 8;
}
while ( v13 );
v15 = &v12[8 * v5];
if ( *a1 )
operator delete((void *)*a1);
*a1 = v10;
a1[1] = v15;
a1[2] = &v10[8 * v9];
}
else
{
v6 = v5;
v7 = a1[1];
do
{
--v6;
*v7++ = 0;
}
while ( v6 );
a1[1] = &v2[8 * v5];
}
}
}
}