//
// sub_B4C750 from 0xb4c750 to 0xb4c840 (240 bytes)
//
// 2 xrefs:
// > sub_B63D0C @ 0xb64e2c
// > sub_B63D0C @ 0xb651e0
//
// 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_B4C750(__int64 a1, char a2, char a3, __int64 a4, __int64 *a5)
{
__int64 *v6; // x19
__int64 v7; // x0
__int64 v8; // x6
__int64 result; // x0
__int64 v10; // x4
__int64 *v11; // x0
__int64 *v12; // x5
__int64 *v13; // [xsp+20h] [xbp+20h]
__int64 v14; // [xsp+28h] [xbp+28h]
char v15; // [xsp+30h] [xbp+30h]
char v16; // [xsp+38h] [xbp+38h]
if ( a4 == 1 && *(_BYTE *)(*a5 + 1) != 1 )
sub_B4AD00(a1, (__int64)"Function has to be applied to node set");
v6 = *(__int64 **)a1;
v7 = *(_QWORD *)(*(_QWORD *)a1 + 8LL);
if ( (unsigned __int64)(v7 + 40) <= 0x1000 )
{
v8 = *v6;
v6[1] = v7 + 40;
result = v8 + v7 + 8;
if ( result )
goto LABEL_4;
LABEL_11:
sub_4DDE68(a1);
}
v13 = a5;
v14 = a4;
v15 = a3;
v16 = a2;
v11 = (__int64 *)off_1230F88(0x1008u);
v12 = v11;
if ( !v11 )
goto LABEL_11;
*v11 = *v6;
result = (__int64)(v11 + 1);
*v6 = (__int64)v12;
a2 = v16;
v6[1] = 40;
a3 = v15;
a4 = v14;
a5 = v13;
LABEL_4:
v10 = *a5;
if ( a4 )
a2 = a3;
*(_BYTE *)(result + 2) = 0;
*(_BYTE *)result = a2;
*(_BYTE *)(result + 3) = 0;
*(_BYTE *)(result + 1) = 3;
*(_QWORD *)(result + 8) = v10;
*(_QWORD *)(result + 16) = 0;
*(_QWORD *)(result + 24) = 0;
return result;
}