//
// sub_180114930 from 0x180114930 to 0x180114a80 (336 bytes)
//
// 5 xrefs:
// > sub_180114120 @ 0x180114257
// > ??> @ 0x18019103c
// > ??> @ 0x18019104c
// > ??> @ 0x180191060
// > ??> @ 0x180201e80
//
// 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 sub_180114930(__int64 a1, _DWORD *a2, _QWORD *a3)
{
__int64 result; // rax
int v7; // eax
int *v8; // rbx
int v9; // eax
__int64 v10; // rcx
__int64 v11; // rax
__int64 v12; // rbp
int v13; // ecx
signed int v14; // eax
__m128i v15; // xmm0
int v16; // eax
__int64 v17; // rdx
__int64 v18; // rcx
__int128 v19; // [rsp+20h] [rbp-28h]
result = sub_180113B70(a1);
if ( !(_DWORD)result )
{
v7 = *(_DWORD *)(a1 + 8);
if ( !v7 )
return 28;
v8 = (int *)(*(_QWORD *)a1 + 4LL * (*a2 & (v7 - 1)));
v9 = *v8;
if ( *v8 != -1 )
{
v10 = *(_QWORD *)(a1 + 16);
do
{
v11 = 2LL * v9;
if ( *(_DWORD *)(v10 + 8 * v11) == *a2 )
return 28;
v8 = (int *)(v10 + 4 + 8 * v11);
v9 = *v8;
}
while ( *v8 != -1 );
}
v12 = *(int *)(a1 + 32);
if ( (_DWORD)v12 != -1 )
{
v18 = *(_QWORD *)(a1 + 16) + 16 * v12;
*(_DWORD *)(a1 + 32) = *(_DWORD *)(v18 + 4);
*(_DWORD *)(v18 + 4) = -1;
*(_DWORD *)v18 = *a2;
*(_QWORD *)(v18 + 8) = *a3;
goto LABEL_18;
}
LODWORD(v12) = *(_DWORD *)(a1 + 24);
*((_QWORD *)&v19 + 1) = *a3;
v13 = v12 + 1;
LODWORD(v19) = *a2;
DWORD1(v19) = -1;
v14 = abs32(*(_DWORD *)(a1 + 28));
if ( (int)v12 + 1 <= v14 )
goto LABEL_16;
v15 = _mm_cvtsi32_si128(v14);
v16 = *(_DWORD *)(a1 + 24) + 1;
v17 = (unsigned int)(int)(float)(_mm_cvtepi32_ps(v15).m128_f32[0] * 1.5);
if ( v13 <= (int)v17 )
v16 = v17;
if ( v16 >= 4 )
{
if ( v13 > (int)v17 )
v17 = (unsigned int)v13;
}
else
{
v17 = 4;
}
result = sub_180114DD0(a1 + 16, v17);
if ( !(_DWORD)result )
{
LABEL_16:
*(_OWORD *)(*(_QWORD *)(a1 + 16) + 16LL * (int)(*(_DWORD *)(a1 + 24))++) = v19;
LABEL_18:
*v8 = v12;
++*(_DWORD *)(a1 + 36);
return 0;
}
}
return result;
}