//
// PlatformerControlsPopup::commitCustomDraft from 0xcfbf30 to 0xcfc114 (484 bytes)
//
// 3 xrefs:
// > PlatformerControlsPopup::onUpload @ 0xcfc158
// > PlatformerControlsPopup::onClose @ 0xcfc49c
// > ??> @ 0xf0f10
//
// 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:51 +0000
//
__int64 __fastcall PlatformerControlsPopup::commitCustomDraft(PlatformerControlsPopup *this)
{
LevelControlConfig *v2; // x0
unsigned __int8 v3; // w3
int v4; // w4
size_t v5; // x2
unsigned __int8 v6; // w0
__int64 *v7; // x22
int v8; // w5
__int64 v9; // x1
__int64 *v10; // x0
char *v11; // x1
size_t v12; // x2
size_t v13; // x2
char *v14; // x1
unsigned __int8 *v16; // x0
unsigned __int8 *v17; // x1
unsigned __int8 *v18; // x4
unsigned __int8 *v19; // x2
int v20; // t1
__int64 v21; // x1
__int64 v22; // x1
__int64 v23; // [xsp+30h] [xbp+30h] BYREF
size_t v24; // [xsp+38h] [xbp+38h]
void *v25; // [xsp+40h] [xbp+40h]
v2 = *((LevelControlConfig **)this + 133);
if ( v2 )
{
LevelControlConfig::encodeB64(&v23, v2);
v3 = v23;
v4 = v23 & 1;
v5 = (unsigned __int8)v23 >> 1;
if ( v4 )
v5 = v24;
v6 = *((_BYTE *)this + 1072);
v7 = (__int64 *)((char *)this + 1072);
v8 = v6 & 1;
if ( (v6 & 1) != 0 )
{
if ( v5 != *((_QWORD *)this + 135) )
{
LABEL_6:
v9 = *((_QWORD *)this + 131);
v10 = (__int64 *)(v9 + 1816);
if ( (__int64 *)(v9 + 1816) == &v23 )
goto LABEL_10;
if ( v4 )
goto LABEL_8;
LABEL_31:
v12 = (unsigned __int8)v23 >> 1;
v11 = (char *)&v23 + 1;
goto LABEL_9;
}
}
else if ( v5 != v6 >> 1 )
{
goto LABEL_6;
}
v16 = (unsigned __int8 *)&v23 + 1;
if ( v4 )
v16 = (unsigned __int8 *)v25;
v17 = (unsigned __int8 *)this + 1073;
if ( v8 )
v17 = *((unsigned __int8 **)this + 136);
if ( v4 )
{
if ( !v5 || !memcmp(v16, v17, v5) )
goto LABEL_30;
v21 = *((_QWORD *)this + 131);
v10 = (__int64 *)(v21 + 1816);
if ( (__int64 *)(v21 + 1816) == &v23 )
{
*(_BYTE *)(v21 + 1844) = 1;
if ( v7 == &v23 )
goto LABEL_30;
goto LABEL_34;
}
LABEL_8:
v11 = (char *)v25;
v12 = v24;
LABEL_9:
std::string::assign(v10, v11, v12);
v3 = v23;
v9 = *((_QWORD *)this + 131);
v4 = v23 & 1;
LABEL_10:
*(_BYTE *)(v9 + 1844) = 1;
if ( v7 == &v23 )
goto LABEL_14;
if ( !v4 )
goto LABEL_12;
LABEL_34:
v14 = (char *)v25;
v13 = v24;
goto LABEL_13;
}
if ( !v5 )
return _stack_chk_guard;
if ( *v16 != *v17 )
{
LABEL_35:
v22 = *((_QWORD *)this + 131);
v10 = (__int64 *)(v22 + 1816);
if ( (__int64 *)(v22 + 1816) == &v23 )
{
*(_BYTE *)(v22 + 1844) = 1;
if ( v7 == &v23 )
return _stack_chk_guard;
LABEL_12:
v13 = v3 >> 1;
v14 = (char *)&v23 + 1;
LABEL_13:
std::string::assign((__int64 *)this + 134, v14, v13);
v4 = v23 & 1;
LABEL_14:
if ( !v4 )
return _stack_chk_guard;
LABEL_30:
operator delete(v25);
return _stack_chk_guard;
}
goto LABEL_31;
}
v18 = v16 + 1;
v19 = &v16[v5];
while ( 1 )
{
++v17;
if ( v18 == v19 )
break;
v20 = *v18++;
if ( *v17 != v20 )
goto LABEL_35;
}
}
return _stack_chk_guard;
}