//
// sub_10090F780 from 0x10090f780 to 0x10090fa45 (709 bytes)
//
// 1 xrefs:
// > sub_10090E510 @ 0x10090e94e
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 12:38:09 +0000
//
void __fastcall sub_10090F780(__int64 a1, __int64 a2)
{
__int64 v2; // r15
__int64 v3; // rax
__int64 v4; // r14
int v5; // ebx
bool v6; // zf
int v7; // r12d
int v8; // ebx
__int64 v9; // r13
size_t v10; // r15
const void *v11; // rsi
size_t v12; // rdx
int v13; // eax
bool v14; // cl
size_t v15; // r14
char *v16; // rdi
unsigned int v17; // r15d
unsigned int v18; // r12d
size_t v19; // r12
const void *v20; // rdi
unsigned int v21; // r13d
size_t v22; // r13
const void *v23; // rsi
size_t v24; // r15
char *v25; // rdi
unsigned int v26; // eax
size_t v27; // rax
const void *v28; // rsi
size_t v29; // rdx
int v30; // eax
bool v31; // dl
size_t v32; // rdx
int v33; // eax
bool v34; // cl
__int64 v35; // [rsp+8h] [rbp-68h]
size_t v36; // [rsp+10h] [rbp-60h]
__int64 v37; // [rsp+18h] [rbp-58h]
int v39; // [rsp+28h] [rbp-48h]
__int128 v40; // [rsp+30h] [rbp-40h] BYREF
void *__s1; // [rsp+40h] [rbp-30h]
if ( a1 != a2 )
{
v2 = a1;
v3 = a1 + 32;
if ( a1 + 32 != a2 )
{
v37 = a1 - 24;
do
{
v4 = v2;
v2 = v3;
v5 = *(_DWORD *)(v4 + 32);
if ( v5 < *(_DWORD *)v4 )
goto LABEL_8;
if ( v5 > *(_DWORD *)v4 )
goto LABEL_6;
v18 = *(unsigned __int8 *)(v4 + 40);
if ( (v18 & 1) != 0 )
{
v19 = *(_QWORD *)(v4 + 48);
v20 = *(const void **)(v4 + 56);
v21 = *(unsigned __int8 *)(v4 + 8);
if ( (v21 & 1) == 0 )
goto LABEL_29;
}
else
{
v19 = v18 >> 1;
v20 = (const void *)(v4 + 41);
v21 = *(unsigned __int8 *)(v4 + 8);
if ( (v21 & 1) == 0 )
{
LABEL_29:
v22 = v21 >> 1;
v23 = (const void *)(v4 + 9);
goto LABEL_36;
}
}
v22 = *(_QWORD *)(v4 + 16);
v23 = *(const void **)(v4 + 24);
LABEL_36:
v29 = v19;
if ( v22 < v19 )
v29 = v22;
v30 = memcmp(v20, v23, v29);
v31 = v30 < 0;
if ( !v30 )
v31 = v19 < v22;
if ( !v31 )
goto LABEL_6;
LABEL_8:
v39 = v5;
__s1 = *(void **)(v4 + 56);
v40 = *(_OWORD *)(v4 + 40);
*(_OWORD *)(v4 + 40) = 0;
*(_QWORD *)(v4 + 56) = 0;
v6 = (*(_BYTE *)(v2 + 8) & 1) == 0;
*(_DWORD *)v2 = *(_DWORD *)v4;
if ( !v6 )
operator delete(*(void **)(v2 + 24));
v35 = v2;
*(_QWORD *)(v2 + 24) = *(_QWORD *)(v4 + 24);
*(_OWORD *)(v2 + 8) = *(_OWORD *)(v4 + 8);
*(_WORD *)(v4 + 8) = 0;
v7 = v5;
v8 = *(_DWORD *)(v4 - 32);
if ( v39 < v8 )
{
LABEL_11:
v9 = v37;
while ( 2 )
{
*(_DWORD *)(v9 + 24) = v8;
*(_QWORD *)(v9 + 48) = *(_QWORD *)(v9 + 16);
*(_OWORD *)(v9 + 32) = *(_OWORD *)v9;
*(_WORD *)v9 = 0;
v7 = v39;
v8 = *(_DWORD *)(v9 - 40);
if ( v39 < v8 )
goto LABEL_18;
if ( v39 > v8 )
goto LABEL_4;
if ( (v40 & 1) != 0 )
{
v15 = *((_QWORD *)&v40 + 1);
v16 = (char *)__s1;
v17 = *(unsigned __int8 *)(v9 - 32);
if ( (v17 & 1) == 0 )
{
LABEL_25:
v10 = v17 >> 1;
v11 = (const void *)(v9 - 31);
goto LABEL_13;
}
}
else
{
v15 = (unsigned __int8)v40 >> 1;
v16 = (char *)&v40 + 1;
v17 = *(unsigned __int8 *)(v9 - 32);
if ( (v17 & 1) == 0 )
goto LABEL_25;
}
v10 = *(_QWORD *)(v9 - 24);
v11 = *(const void **)(v9 - 16);
LABEL_13:
v12 = v15;
if ( v10 < v15 )
v12 = v10;
v13 = memcmp(v16, v11, v12);
v14 = v15 < v10;
if ( v13 )
v14 = v13 < 0;
if ( !v14 )
{
LABEL_4:
v4 = v9 - 8;
goto LABEL_5;
}
LABEL_18:
v9 -= 32;
continue;
}
}
v9 = v4 + 8;
if ( v8 < v39 )
goto LABEL_5;
if ( (v40 & 1) != 0 )
{
v24 = *((_QWORD *)&v40 + 1);
v25 = (char *)__s1;
v26 = *(unsigned __int8 *)(v4 - 24);
if ( (v26 & 1) == 0 )
goto LABEL_33;
}
else
{
v24 = (unsigned __int8)v40 >> 1;
v25 = (char *)&v40 + 1;
v26 = *(unsigned __int8 *)(v4 - 24);
if ( (v26 & 1) == 0 )
{
LABEL_33:
v27 = v26 >> 1;
v28 = (const void *)(v4 - 23);
goto LABEL_44;
}
}
v27 = *(_QWORD *)(v4 - 16);
v28 = *(const void **)(v4 - 8);
LABEL_44:
v36 = v27;
v32 = v24;
if ( v27 < v24 )
v32 = v27;
v33 = memcmp(v25, v28, v32);
v34 = v24 < v36;
if ( v33 )
v34 = v33 < 0;
if ( v34 )
goto LABEL_11;
LABEL_5:
*(_DWORD *)v4 = v7;
*(_QWORD *)(v9 + 16) = __s1;
*(_OWORD *)v9 = v40;
v2 = v35;
LABEL_6:
v3 = v2 + 32;
v37 += 32;
}
while ( v2 + 32 != a2 );
}
}
}