//
// DS_Dictionary::getIndexOfKey from 0x18001a510 to 0x18001a5df (207 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801ae9e0
//
// 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
//
__int64 __fastcall DS_Dictionary::getIndexOfKey(DS_Dictionary *this, const char *a2)
{
const char *v4; // r8
unsigned int v5; // ebx
bool v6; // zf
std::_Vector_val>::pointer Mylast; // rcx
__int64 v8; // rax
const char *v9; // r8
int v10; // ecx
int v11; // edx
const char *v12; // r8
__int64 v14; // [rsp+40h] [rbp+8h] BYREF
char v15; // [rsp+50h] [rbp+18h] BYREF
v4 = "k";
v5 = 0;
v6 = !this->compatible;
Mylast = this->dictTree._Mypair._Myval2._Mylast;
if ( !v6 )
v4 = "key";
sub_18007FB10(&Mylast[-1], &v14, v4);
if ( !sub_18007F4E0(&v14) )
return 0;
while ( 1 )
{
v8 = sub_18007FB70(&v14);
v9 = &a2[-v8];
do
{
v10 = (unsigned __int8)v9[v8];
v11 = *(unsigned __int8 *)v8 - v10;
if ( v11 )
break;
++v8;
}
while ( v10 );
if ( !v11 )
break;
++v5;
v12 = "k";
if ( this->compatible )
v12 = "key";
v14 = *(_QWORD *)sub_180081A50(&v14, &v15, v12);
if ( !sub_18007F4E0(&v14) )
return 0;
}
return v5;
}