//
// sub_623FB4 from 0x623fb4 to 0x62401c (104 bytes)
//
// 0 xrefs:
//
// 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 sub_623FB4(unsigned __int8 a1, int a2)
{
void *v3; // r6
int v4; // r5
int v5; // r3
unsigned int v6; // r2
int v7; // r7
void *v9; // r0
void *v10; // r0
v3 = *(void **)a2;
v4 = a1;
if ( !*(_DWORD *)a2 )
{
v10 = off_ABAEAC(0x20u);
*(_DWORD *)a2 = v10;
if ( v10 )
{
*(_DWORD *)(a2 + 4) = 0;
*(_DWORD *)(a2 + 8) = 32;
v3 = v10;
v5 = 0;
goto LABEL_7;
}
goto LABEL_4;
}
v5 = *(_DWORD *)(a2 + 4);
v6 = *(_DWORD *)(a2 + 8);
if ( v5 + 1 >= v6 )
{
v7 = 2 * v6;
if ( v6 < 2 * v6 )
{
v9 = off_ABAEB4(v3, 2 * v6);
if ( v9 )
{
v5 = *(_DWORD *)(a2 + 4);
v3 = v9;
*(_DWORD *)a2 = v9;
*(_DWORD *)(a2 + 8) = v7;
goto LABEL_7;
}
}
LABEL_4:
*(_DWORD *)(a2 + 12) = 1;
return -1;
}
LABEL_7:
*((_BYTE *)v3 + v5) = v4;
++*(_DWORD *)(a2 + 4);
return v4;
}