//
// sub_180072680 from 0x180072680 to 0x1800727f4 (372 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801005c8
// > ??> @ 0x1801b4374
//
// 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
//
// Hidden C++ exception states: #wind=1
char __fastcall sub_180072680(__int64 a1, __int64 a2, _QWORD *a3)
{
_QWORD *v3; // rsi
const char **v6; // rdi
const char **i; // rbx
const char *Str; // rax
const char **v9; // rbx
const char *v10; // rax
const char *v11; // rax
char *v12; // rbx
char *v13; // rax
void *Block[2]; // [rsp+20h] [rbp-38h] BYREF
const char **v16; // [rsp+30h] [rbp-28h]
const char *v17; // [rsp+60h] [rbp+8h] BYREF
v3 = a3;
*(_OWORD *)Block = 0;
v6 = nullptr;
v16 = nullptr;
for ( i = nullptr; v3; v3 = (_QWORD *)v3[7] )
{
Str = tinyxml2::StrPair::GetStr((tinyxml2::StrPair *)(v3 + 1));
v17 = Str;
if ( i == v6 )
{
sub_180072350((const void **)Block, i, &v17);
v6 = v16;
v9 = (const char **)Block[1];
}
else
{
*i = Str;
v9 = i + 1;
Block[1] = v9;
}
v10 = tinyxml2::StrPair::GetStr((tinyxml2::StrPair *)(v3 + 4));
v17 = v10;
if ( v9 == v6 )
{
sub_180072350((const void **)Block, v9, &v17);
v6 = v16;
i = (const char **)Block[1];
}
else
{
*v9 = v10;
i = v9 + 1;
Block[1] = i;
}
}
v17 = nullptr;
if ( i == v6 )
{
sub_180072350((const void **)Block, i, &v17);
v6 = v16;
}
else
{
*i = nullptr;
Block[1] = i + 1;
}
v11 = tinyxml2::StrPair::GetStr((tinyxml2::StrPair *)(a2 + 24));
v12 = (char *)Block[0];
(****(void (__fastcall *****)(_QWORD, _QWORD, const char *, void *))(a1 + 8))(
**(_QWORD **)(a1 + 8),
*(_QWORD *)(a1 + 8),
v11,
Block[0]);
if ( v12 )
{
v13 = v12;
if ( (((char *)v6 - v12) & 0xFFFFFFFFFFFFFFF8uLL) >= 0x1000 )
{
v12 = *((char **)v12 - 1);
if ( (unsigned __int64)(v13 - v12 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v12);
}
return 1;
}