//
// sub_100910D40 from 0x100910d40 to 0x100910ea0 (352 bytes)
//
// 1 xrefs:
// > sub_100910BC0 @ 0x100910c2c
//
// 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
//
__int64 __fastcall sub_100910D40(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v4; // r13
__int64 v5; // r14
__int64 v6; // r15
__int64 v7; // rbx
__int64 v8; // r12
__int64 v9; // r15
int v10; // eax
int v11; // ecx
unsigned int v12; // eax
size_t v13; // rax
const void *v14; // rdi
unsigned int v15; // ecx
size_t v16; // rcx
const void *v17; // rsi
size_t v18; // rdx
int v19; // eax
bool v20; // dl
__int64 v23; // [rsp+10h] [rbp-40h]
size_t v24; // [rsp+18h] [rbp-38h]
size_t v25; // [rsp+20h] [rbp-30h]
v23 = (__int64)(a3 + ((unsigned __int64)(a3 - 2) >> 63) - 2) >> 1;
v4 = 0;
do
{
v6 = 32 * v4;
v7 = a1 + 32 * v4 + 32;
v8 = 2 * v4 + 2;
v4 = 2 * v4 + 1;
if ( v8 >= a3 )
goto LABEL_17;
v9 = a1 + v6;
v10 = *(_DWORD *)(v9 + 32);
v11 = *(_DWORD *)(v9 + 64);
if ( v10 < v11 )
{
LABEL_5:
v7 = v9 + 64;
v4 = v8;
goto LABEL_17;
}
if ( v10 <= v11 )
{
v12 = *(unsigned __int8 *)(v9 + 40);
if ( (v12 & 1) != 0 )
{
v13 = *(_QWORD *)(v9 + 48);
v14 = *(const void **)(v9 + 56);
v15 = *(unsigned __int8 *)(v9 + 72);
if ( (v15 & 1) == 0 )
{
LABEL_9:
v16 = v15 >> 1;
v17 = (const void *)(v9 + 73);
goto LABEL_12;
}
}
else
{
v13 = v12 >> 1;
v14 = (const void *)(v9 + 41);
v15 = *(unsigned __int8 *)(v9 + 72);
if ( (v15 & 1) == 0 )
goto LABEL_9;
}
v16 = *(_QWORD *)(v9 + 80);
v17 = *(const void **)(v9 + 88);
LABEL_12:
v25 = v16;
v18 = v13;
v24 = v13;
if ( v16 < v13 )
v18 = v16;
v19 = memcmp(v14, v17, v18);
v20 = v19 < 0;
if ( !v19 )
v20 = v24 < v25;
if ( v20 )
goto LABEL_5;
}
LABEL_17:
*(_DWORD *)a1 = *(_DWORD *)v7;
if ( (*(_BYTE *)(a1 + 8) & 1) != 0 )
operator delete(*(void **)(a1 + 24));
v5 = a1 + 8;
*(_QWORD *)(v5 + 16) = *(_QWORD *)(v7 + 24);
*(_OWORD *)v5 = *(_OWORD *)(v7 + 8);
*(_WORD *)(v7 + 8) = 0;
a1 = v7;
}
while ( v4 <= v23 );
return v7;
}