//
// sub_CF2E7C from 0xcf2e7c to 0xcf2fd8 (348 bytes)
//
// 7 xrefs:
// > LevelControlConfig::decode @ 0xcf6000
// > LevelControlConfig::decode @ 0xcf601c
// > LevelControlConfig::decode @ 0xcf6248
// > LevelControlConfig::decode @ 0xcf6260
// > LevelControlConfig::decode @ 0xcf631c
// > LevelControlConfig::decode @ 0xcf634c
// > LevelControlConfig::decode @ 0xcf6364
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:06:46 +0000
//
__int64 __fastcall sub_CF2E7C(__int64 a1, char *a2)
{
size_t v3; // x0
size_t v4; // x19
char *v5; // x1
unsigned __int64 v6; // x0
__int64 v7; // x23
char *v8; // x0
char *v9; // x3
__int64 *v10; // x19
const char *v11; // x0
__int64 v14; // [xsp+50h] [xbp+50h] BYREF
size_t v15; // [xsp+58h] [xbp+58h]
void *v16; // [xsp+60h] [xbp+60h]
v14 = 0;
v15 = 0;
v16 = nullptr;
v3 = strlen(a2);
v4 = v3;
v5 = a2;
if ( v3 > 0xFFFFFFFFFFFFFFEFLL )
sub_631538();
if ( v3 > 0x16 )
{
v6 = (v3 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v7 = v6 | 1;
v8 = (char *)operator new(v6);
v14 = v7;
v5 = a2;
v9 = v8;
v16 = v8;
v15 = v4;
goto LABEL_4;
}
LOBYTE(v14) = 2 * v3;
v9 = (char *)&v14 + 1;
if ( v3 )
{
LABEL_4:
*((_BYTE *)memcpy(v9, v5, v4) + v4) = 0;
v10 = std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::find(
a1,
(__int64)&v14);
if ( (v14 & 1) == 0 )
goto LABEL_5;
goto LABEL_12;
}
BYTE1(v14) = 0;
v10 = std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::find(
a1,
(__int64)&v14);
if ( (v14 & 1) == 0 )
{
LABEL_5:
if ( v10 == (__int64 *)(a1 + 8) )
return _stack_chk_guard;
goto LABEL_6;
}
LABEL_12:
operator delete(v16);
if ( v10 == (__int64 *)(a1 + 8) )
return _stack_chk_guard;
LABEL_6:
v11 = (char *)v10 + 57;
if ( (v10[7] & 1) != 0 )
v11 = (const char *)v10[9];
atof(v11);
return _stack_chk_guard;
}