//
// sub_CF3EAC from 0xcf3eac to 0xcf4060 (436 bytes)
//
// 0 xrefs:
//
// 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
//
_QWORD *__usercall sub_CF3EAC@(_QWORD *a1@, _QWORD *a2@)
{
char *v3; // x2
unsigned __int64 v4; // x1
unsigned __int64 v5; // x4
_BYTE *v6; // x0
char *v7; // x2
char *v8; // x0
unsigned int *v10; // x2
int v11; // w1
unsigned int *v12; // x2
char v13[8]; // [xsp+38h] [xbp+38h] BYREF
char *v14; // [xsp+48h] [xbp+48h] BYREF
v3 = &byte_124B6C8;
*a2 = &byte_124B6C8;
v4 = a1[5];
if ( !v4 )
{
sub_D18EA8(a2, a1 + 9);
return a2;
}
v5 = a1[3];
v6 = (_BYTE *)a1[4];
if ( v4 > v5 )
{
if ( (_BYTE *)v4 != v6 )
{
if ( !v6 )
sub_D138D8("basic_string::_S_construct null not valid");
v3 = (char *)sub_CF2F8C(v6, v4, (__int64)v13);
}
v14 = v3;
sub_D18EA8(a2, &v14);
v7 = v14;
v8 = v14 - 24;
if ( v14 - 24 == (char *)&qword_124B6B0 )
return a2;
if ( &pthread_create )
{
v12 = (unsigned int *)(v14 - 8);
do
v11 = __ldaxr(v12);
while ( __stlxr(v11 - 1, v12) );
goto LABEL_18;
}
goto LABEL_25;
}
if ( (_BYTE *)v5 != v6 )
{
if ( !v6 && v5 )
sub_D138D8("basic_string::_S_construct null not valid");
v3 = (char *)sub_CF2F8C(v6, v5, (__int64)v13);
}
v14 = v3;
sub_D18EA8(a2, &v14);
v7 = v14;
v8 = v14 - 24;
if ( v14 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v10 = (unsigned int *)(v14 - 8);
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
LABEL_18:
if ( v11 <= 0 )
operator delete(v8);
return a2;
}
LABEL_25:
v11 = *((_DWORD *)v7 - 2);
*((_DWORD *)v7 - 2) = v11 - 1;
goto LABEL_18;
}
return a2;
}