//
// sub_CF61C4 from 0xcf61c4 to 0xcf6378 (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_CF61C4@(_QWORD *a1@, _QWORD *a2@)
{
char *v3; // x2
unsigned __int64 v4; // x1
unsigned __int64 v5; // x4
const wchar_t *v6; // x0
char *v7; // x2
char *v8; // x0
unsigned int *v10; // x2
int v11; // w1
unsigned int *v12; // x2
char *v13; // [xsp+48h] [xbp+48h] BYREF
v3 = (char *)&unk_124B6E8;
*a2 = &unk_124B6E8;
v4 = a1[5];
if ( !v4 )
{
sub_D1DC60(a2, a1 + 9);
return a2;
}
v5 = a1[3];
v6 = (const wchar_t *)a1[4];
if ( v4 > v5 )
{
if ( (const wchar_t *)v4 != v6 )
{
if ( !v6 )
sub_D138D8("basic_string::_S_construct null not valid");
v3 = (char *)sub_CF3034(v6, v4);
}
v13 = v3;
sub_D1DC60(a2, &v13);
v7 = v13;
v8 = v13 - 24;
if ( v13 - 24 == (char *)&qword_124B6D0 )
return a2;
if ( &pthread_create )
{
v12 = (unsigned int *)(v13 - 8);
do
v11 = __ldaxr(v12);
while ( __stlxr(v11 - 1, v12) );
goto LABEL_18;
}
goto LABEL_25;
}
if ( (const wchar_t *)v5 != v6 )
{
if ( !v6 && v5 )
sub_D138D8("basic_string::_S_construct null not valid");
v3 = (char *)sub_CF3034(v6, v5);
}
v13 = v3;
sub_D1DC60(a2, &v13);
v7 = v13;
v8 = v13 - 24;
if ( v13 - 24 != (char *)&qword_124B6D0 )
{
if ( &pthread_create )
{
v10 = (unsigned int *)(v13 - 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;
}