//
// sub_10063C2A0 from 0x10063c2a0 to 0x10063c3c0 (288 bytes)
//
// 2 xrefs:
// > sub_10063CEE0 @ 0x10063cef8
// > sub_10063CEE0 @ 0x10063cf24
//
// 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_10063C2A0(__int64 **a1, unsigned int a2)
{
__int64 v3; // rax
unsigned int v4; // ecx
__int64 *v5; // rcx
__int64 v6; // rax
__int64 v7; // rsi
__int64 result; // rax
__int64 v9; // rdx
__int64 v10; // rcx
__int64 *v11; // rdx
__int64 v12; // rsi
__int64 *v13; // rdi
unsigned int v14; // ecx
int v15; // edx
__int64 v16; // rbx
__int64 v17; // [rsp-20h] [rbp-20h] BYREF
if ( !*a1 )
return 0;
v3 = **a1;
v4 = v3 & 7;
if ( v4 >= 2 || a2 < 2 || v4 != 0 && a2 - 9 >= 0xFFFFFFFE )
return 0;
v5 = *(__int64 **)(v3 & 0xFFFFFFFFFFFFFFE0LL);
v6 = v5[1];
v7 = v6 + 64;
if ( (unsigned __int64)(v6 + 64) < 0x8001 )
{
v9 = *v5;
result = *v5 + v6 + 48;
v5[1] = v7;
}
else
{
result = sub_100647FA0(v5, 64, &v17);
v9 = v17;
}
v10 = v9 | (int)(a2 - 1);
*(_QWORD *)result = v10;
*(_OWORD *)(result + 8) = 0;
*(_OWORD *)(result + 24) = 0;
*(_OWORD *)(result + 40) = 0;
*(_QWORD *)(result + 56) = 0;
v11 = *a1;
*(_QWORD *)(result + 8) = *a1;
v12 = v11[4];
if ( v12 )
{
v13 = (__int64 *)(v12 + 40);
*(_QWORD *)(result + 40) = *(_QWORD *)(v12 + 40);
}
else
{
v13 = (__int64 *)(result + 40);
}
*v13 = result;
*(_QWORD *)(result + 48) = v12;
v11[4] = result;
if ( a2 == 7 )
{
v14 = v10 & 7;
if ( v14 <= 6 )
{
v15 = 98;
if ( _bittest(&v15, v14) )
{
v16 = result;
sub_10063B180((const char **)(result + 16), (__int64 *)result, 16, "xml");
return v16;
}
}
}
return result;
}