//
// sub_BA4688 from 0xba4688 to 0xba47dc (340 bytes)
//
// 1 xrefs:
// > sub_BA47DC @ 0xba4914
//
// 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
//
void **__fastcall sub_BA4688(int a1, __int64 a2, const char *a3, unsigned __int16 a4)
{
void **result; // x0
void **v8; // x19
char *v9; // x0
char *v10; // x21
void *v11; // x5
char *v12; // x3
int v13; // w0
void **v14; // x20
result = (void **)off_1231000(0x40u);
v8 = result;
if ( result )
{
v9 = off_1231018(a3);
v10 = v9;
if ( v9 )
{
if ( a1 == 2 )
{
v12 = (char *)(v8 + 4);
*((_DWORD *)v8 + 8) = *(_DWORD *)a2;
v13 = 4;
goto LABEL_6;
}
if ( a1 == 10 )
{
v11 = *(void **)(a2 + 8);
v12 = (char *)(v8 + 4);
v13 = 16;
v8[4] = *(void **)a2;
v8[5] = v11;
LABEL_6:
v8[6] = v12;
v8[3] = v8 + 6;
*v8 = v10;
*((_DWORD *)v8 + 5) = v13;
*((_DWORD *)v8 + 4) = (__int16)a1;
v8[1] = nullptr;
v8[7] = nullptr;
v14 = sub_BA445C((__int64)v8, a4);
off_1231008(v10);
off_1231008(v8);
return v14;
}
off_1231008(v9);
off_1231008(v8);
return nullptr;
}
else
{
off_1231008(v8);
return nullptr;
}
}
return result;
}