//
// sub_10005E890 from 0x10005e890 to 0x10005ea0d (381 bytes)
//
// 1 xrefs:
// > sub_10005F0A0 @ 0x10005f1e3
//
// 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:19:41 +0000
//
__int64 __fastcall sub_10005E890(__int64 a1, const char *a2)
{
__int64 v2; // rax
__int64 v3; // r14
__int64 v4; // r12
__int64 *v5; // rax
size_t v6; // r14
char *v7; // r15
const char *v9; // rax
char v10; // dl
const char *v11; // rcx
__int64 v12; // rcx
__int64 v13; // [rsp+8h] [rbp-38h]
v2 = *(_QWORD *)(a1 + 96);
if ( v2 )
{
while ( 1 )
{
v3 = v2;
v9 = (const char *)sub_10005AD20((int *)(v2 + 8));
if ( v9 == a2 )
break;
v10 = *v9;
v11 = a2;
if ( *v9 )
{
v12 = 0;
while ( v10 == a2[v12] && (_DWORD)v12 != 0x7FFFFFFF )
{
v10 = v9[++v12];
if ( !v10 )
{
if ( (_DWORD)v12 == 0x7FFFFFFF )
return v3;
v11 = &a2[v12];
goto LABEL_7;
}
}
if ( (_DWORD)v12 != 0x7FFFFFFF )
goto LABEL_8;
return v3;
}
LABEL_7:
if ( !*v11 )
return v3;
LABEL_8:
v2 = *(_QWORD *)(v3 + 56);
if ( !v2 )
goto LABEL_3;
}
}
else
{
v3 = 0;
LABEL_3:
v4 = sub_10005EA10(*(_QWORD *)(a1 + 8) + 256LL);
*(_QWORD *)v4 = &off_100AB7F58;
*(_OWORD *)(v4 + 16) = 0;
*(_DWORD *)(v4 + 32) = 0;
*(_OWORD *)(v4 + 40) = 0;
*(_QWORD *)(v4 + 56) = 0;
v13 = *(_QWORD *)(a1 + 8);
v5 = (__int64 *)(v3 + 56);
if ( !v3 )
v5 = (__int64 *)(a1 + 96);
*(_QWORD *)(v4 + 64) = v13 + 256;
*v5 = v4;
*(_DWORD *)(v4 + 8) = 0;
*(_OWORD *)(v4 + 16) = 0;
v6 = strlen(a2);
v7 = (char *)operator new[](v6 + 1);
*(_QWORD *)(v4 + 16) = v7;
memcpy(v7, a2, v6 + 1);
*(_QWORD *)(v4 + 24) = &v7[v6];
*(_DWORD *)(v4 + 8) = 512;
(*(void (__fastcall **)(__int64))(*(_QWORD *)(v13 + 256) + 40LL))(v13 + 256);
return v4;
}
return v3;
}