//
// IDNameInput::collectMatches from 0x796494 to 0x796928 (1172 bytes)
//
// 2 xrefs:
// > IDNameInput::updateAutocomplete @ 0x7969be
// > IDNameInput::commitTypedName @ 0x796c90
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:59:45 +0000
//
int *__fastcall IDNameInput::collectMatches(int a1, unsigned __int8 *a2, int **a3)
{
int *v5; // r4
int *result; // r0
DropdownListRow *v8; // r0
int v9; // r3
unsigned __int8 *v10; // r1
int v11; // r2
unsigned __int8 *v12; // r2
unsigned __int8 *v13; // r6
unsigned __int8 *v14; // r4
int v15; // lr
unsigned int v16; // r4
size_t v17; // r2
unsigned __int8 *v18; // r1
unsigned __int8 *v19; // r1
int v20; // r2
unsigned __int8 *v21; // r2
int v22; // t1
int v23; // r2
unsigned int v24; // r3
std::logic_error *exception; // r4
unsigned __int8 *v26; // r1
size_t v27; // r3
int v28; // lr
int v29; // r2
char *v30; // r1
unsigned int i; // r2
bool v32; // cf
GameManager *v33; // r0
int v34; // r0
unsigned int v35; // r2
int *IDNames; // r0
int j; // r3
char *v38; // r1
int k; // r4
unsigned __int8 *v40; // r6
int v41; // r12
unsigned __int8 *v42; // r0
int v43; // r2
int v44; // r6
char *v45; // lr
unsigned __int8 *v46; // r12
char *v47; // r2
int v48; // r9
unsigned __int8 *v49; // r8
char *v50; // r9
int v51; // t1
int v52; // r2
int v53; // r6
int v54; // r1
size_t v55; // r0
void **v56; // r2
DropdownListRow *v57; // r0
GameManager *v58; // r0
int v59; // r8
_DWORD *m; // r0
_DWORD *v61; // r6
_DWORD *v62; // r3
void *v63; // r3
void *v64; // r0
unsigned int v65; // r1
unsigned int v66; // r0
int v67; // r1
int n; // r4
int *v69; // r1
int *v70; // r0
int *v71; // r0
unsigned __int8 *v72; // [sp+8h] [bp-BCh]
unsigned __int8 *v73; // [sp+18h] [bp-ACh]
char v74[4]; // [sp+20h] [bp-A4h] BYREF
char v75[4]; // [sp+24h] [bp-A0h] BYREF
void **v76; // [sp+28h] [bp-9Ch] BYREF
int v77; // [sp+2Ch] [bp-98h] BYREF
unsigned int v78; // [sp+30h] [bp-94h]
char *v79; // [sp+34h] [bp-90h]
int v80; // [sp+38h] [bp-8Ch] BYREF
int v81; // [sp+3Ch] [bp-88h]
char *v82; // [sp+40h] [bp-84h]
void *v83; // [sp+44h] [bp-80h] BYREF
_DWORD *v84; // [sp+48h] [bp-7Ch]
void *v85; // [sp+4Ch] [bp-78h] BYREF
int v86; // [sp+50h] [bp-74h]
int v87; // [sp+54h] [bp-70h]
void *v88; // [sp+58h] [bp-6Ch] BYREF
unsigned int v89; // [sp+5Ch] [bp-68h]
_DWORD *v90; // [sp+60h] [bp-64h]
int v91; // [sp+64h] [bp-60h]
int v92; // [sp+68h] [bp-5Ch]
int v93; // [sp+6Ch] [bp-58h] BYREF
_DWORD v94[3]; // [sp+70h] [bp-54h] BYREF
_DWORD v95[3]; // [sp+7Ch] [bp-48h] BYREF
void *v96; // [sp+88h] [bp-3Ch] BYREF
int v97; // [sp+8Ch] [bp-38h]
int v98; // [sp+90h] [bp-34h]
void *v99; // [sp+94h] [bp-30h] BYREF
void *v100; // [sp+A0h] [bp-24h] BYREF
char v101[24]; // [sp+ACh] [bp-18h] BYREF
v5 = *a3;
while ( 1 )
{
result = a3[1];
if ( v5 == result )
break;
v8 = (DropdownListRow *)(result - 7);
a3[1] = (int *)v8;
DropdownListRow::~DropdownListRow(v8);
}
if ( !*(_DWORD *)(a1 + 292) )
return result;
result = (int *)GameManager::sharedState((GameManager *)result);
if ( !result[102] )
return result;
result = (int *)GameManager::sharedState((GameManager *)result);
if ( !*(_DWORD *)(result[102] + 2084) )
return result;
v9 = *a2;
if ( (v9 & 1) != 0 )
{
v10 = *((unsigned __int8 **)a2 + 2);
v11 = *((_DWORD *)a2 + 1);
}
else
{
v10 = a2 + 1;
v11 = v9 >> 1;
}
if ( v11 )
{
v12 = &v10[v11];
v13 = v10;
do
{
v14 = v13;
if ( v13 == v12 )
goto LABEL_15;
v15 = *v13++;
}
while ( v15 == 32 );
v16 = v14 - v10;
if ( v16 != -1 )
{
if ( (v9 & 1) != 0 )
{
v19 = *((unsigned __int8 **)a2 + 2);
v20 = *((_DWORD *)a2 + 1);
}
else
{
v19 = a2 + 1;
v20 = v9 >> 1;
}
v21 = &v19[v20];
while ( v21 != v19 )
{
v22 = *--v21;
if ( v22 != 32 )
{
v23 = v21 - v19;
goto LABEL_24;
}
}
v23 = -1;
LABEL_24:
v17 = v23 + 1 - v16;
v96 = nullptr;
v97 = 0;
v98 = 0;
if ( (v9 & 1) != 0 )
{
v24 = *((_DWORD *)a2 + 1);
if ( v16 > v24 )
{
LABEL_28:
exception = (std::logic_error *)_cxa_allocate_exception(8u);
std::logic_error::logic_error(exception, "basic_string");
*(_DWORD *)exception = &off_D1548C;
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'std::out_of_range,
(void (*)(void *))std::length_error::~length_error);
}
v26 = *((unsigned __int8 **)a2 + 2);
}
else
{
v24 = v9 >> 1;
if ( v16 > v24 )
goto LABEL_28;
v26 = a2 + 1;
}
v27 = v24 - v16;
v18 = &v26[v16];
if ( v17 >= v27 )
v17 = v27;
goto LABEL_33;
}
}
LABEL_15:
v17 = 0;
v96 = nullptr;
v97 = 0;
v18 = (unsigned __int8 *)&unk_B6B226;
v98 = 0;
LABEL_33:
std::string::__init((int *)&v96, v18, v17);
GameToolbox::lowercaseASCII(&v77, (int)&v96);
std::string::~string((int)&v96);
v28 = v77 & 1;
if ( v28 )
v29 = v78;
else
v29 = (int)(unsigned __int8)v77 >> 1;
if ( !v29 )
return (int *)std::string::~string((int)&v77);
v30 = (char *)&v77 + 1;
if ( v28 )
v30 = v79;
for ( i = 0; ; ++i )
{
if ( v28 )
v32 = i >= v78;
else
v32 = i >= (int)(unsigned __int8)v77 >> 1;
if ( v32 )
return (int *)std::string::~string((int)&v77);
v33 = (GameManager *)((unsigned __int8)v30[i] - 97);
if ( (unsigned int)v33 <= 0x19 )
break;
}
v34 = GameManager::sharedState(v33);
IDNames = LevelSettingsObject::getIDNames(
*(LevelSettingsObject **)(*(_DWORD *)(v34 + 408) + 2084),
*(_DWORD *)(a1 + 292),
v35);
if ( !IDNames[3] )
return (int *)std::string::~string((int)&v77);
for ( j = 0; j != 36; j += 12 )
{
*(void **)((char *)&v96 + j) = nullptr;
v38 = (char *)&v96 + j;
*((_DWORD *)v38 + 1) = 0;
*((_DWORD *)v38 + 2) = 0;
}
for ( k = IDNames[2]; k; k = *(_DWORD *)k )
{
GameToolbox::lowercaseASCII(&v80, k + 12);
if ( (v80 & 1) != 0 )
{
v40 = (unsigned __int8 *)v82;
v41 = v81;
}
else
{
v40 = (unsigned __int8 *)&v80 + 1;
v41 = (int)(unsigned __int8)v80 >> 1;
}
if ( (v77 & 1) != 0 )
{
v42 = (unsigned __int8 *)v79;
v43 = v78;
}
else
{
v43 = (int)(unsigned __int8)v77 >> 1;
v42 = (unsigned __int8 *)&v77 + 1;
}
if ( v41 < (unsigned int)v43 )
goto LABEL_84;
if ( !v43 )
goto LABEL_58;
v45 = (char *)&v40[v41];
if ( v41 >= v43 )
{
v46 = v40;
v72 = (unsigned __int8 *)&v45[1 - v43];
v73 = &v42[v43];
LABEL_62:
while ( 1 )
{
v47 = (char *)v46;
if ( v46 == v72 )
break;
v48 = *v46++;
if ( v48 == *v42 )
{
v49 = v42;
v50 = v47;
while ( ++v49 != v73 )
{
v51 = (unsigned __int8)*++v50;
if ( v51 != *v49 )
goto LABEL_62;
}
goto LABEL_69;
}
}
}
v47 = v45;
LABEL_69:
if ( v47 != v45 )
{
v52 = v47 - (char *)v40;
if ( v52 != -1 )
{
if ( v52 )
{
v53 = 2;
}
else
{
LABEL_58:
if ( (v80 & 1) != 0 )
v44 = v81;
else
v44 = (int)(unsigned __int8)v80 >> 1;
if ( (v77 & 1) != 0 )
v54 = v78;
else
v54 = (int)(unsigned __int8)v77 >> 1;
v53 = v44 != v54;
}
memset(v94, 0, sizeof(v94));
memset(v95, 0, sizeof(v95));
v93 = *(_DWORD *)(k + 8);
sub_993B88(v101, 16, "%d:");
v55 = strlen(v101);
std::string::assign(v95, v101, v55);
std::string::operator=((unsigned __int8 *)v94, (unsigned __int8 *)(k + 12));
v56 = &v96 + 3 * v53;
v57 = *(DropdownListRow **)&v101[12 * v53 - 32];
if ( v57 == v56[2] )
{
std::vector::__push_back_slow_path(
(int **)v56,
(const DropdownListRow *)&v93);
}
else
{
if ( v57 )
DropdownListRow::DropdownListRow(v57, (const DropdownListRow *)&v93);
*(&v97 + 3 * v53) += 28;
}
DropdownListRow::~DropdownListRow((DropdownListRow *)&v93);
}
}
LABEL_84:
IDNames = (int *)std::string::~string((int)&v80);
}
v58 = (GameManager *)GameManager::sharedState((GameManager *)IDNames);
if ( v58 )
v59 = *(_DWORD *)(GameManager::sharedState(v58) + 916);
else
v59 = 0;
v83 = nullptr;
v84 = nullptr;
v85 = nullptr;
v86 = 0;
v87 = 1065353216;
if ( !v59 )
{
IDNameInput::useRank((IDNameInput *)&v88, *(_DWORD *)(a1 + 292));
if ( v86 )
{
for ( m = v85; m; m = v61 )
{
v61 = (_DWORD *)*m;
operator delete(m);
}
v62 = v84;
v85 = nullptr;
while ( m != v62 )
{
*((_DWORD *)v83 + (_DWORD)m) = 0;
m = (_DWORD *)((char *)m + 1);
}
v86 = 0;
}
v63 = v88;
v64 = v83;
v88 = nullptr;
v83 = v63;
if ( v64 )
operator delete(v64);
v65 = v89;
v89 = 0;
v84 = (_DWORD *)v65;
v87 = v92;
v86 = v91;
v85 = v90;
if ( v91 )
{
v66 = v90[1];
if ( ((v65 - 1) & v65) != 0 )
v67 = v66 % v65;
else
v67 = (v65 - 1) & v66;
*((_DWORD *)v83 + v67) = &v85;
v90 = nullptr;
v91 = 0;
}
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::~__hash_table((int)&v88);
}
for ( n = 0; n != 36; n += 12 )
{
v69 = *(int **)((char *)&v96 + n + 4);
if ( v59 == 2 )
{
v70 = *(int **)((char *)&v96 + n);
v74[0] = 0;
std::__sort(v70, v69, (int)v74);
}
else
{
v71 = *(int **)((char *)&v96 + n);
if ( v59 == 1 )
{
v75[0] = 0;
std::__sort(v71, v69, (int)v75);
}
else
{
v76 = &v83;
std::__sort((unsigned int *)v71, (unsigned int *)v69, &v76);
}
}
std::vector::insert>(
a3,
a3[1],
*(const DropdownListRow **)((char *)&v96 + n),
*(const DropdownListRow **)((char *)&v96 + n + 4));
}
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::~__hash_table((int)&v83);
std::__vector_base::~__vector_base(&v100);
std::__vector_base::~__vector_base(&v99);
std::__vector_base::~__vector_base(&v96);
return (int *)std::string::~string((int)&v77);
}