//
// sub_10095E5D0 from 0x10095e5d0 to 0x10095e8af (735 bytes)
//
// 1 xrefs:
// > PlatformerControlsPopup::init @ 0x10095dba8
//
// This function is hookable on this platform (idp: pc, 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 12:38:44 +0000
//
void __fastcall sub_10095E5D0(__int64 *a1)
{
__int64 v1; // rax
__int64 v2; // r14
int v3; // r15d
__int64 v4; // rcx
unsigned int v5; // eax
__int64 v6; // rax
void **v7; // rax
bool v8; // r14
__int64 v9; // rax
char *v10; // rax
char *v11; // rax
__int128 v12; // [rsp+8h] [rbp-A8h] BYREF
void *v13; // [rsp+18h] [rbp-98h]
__int128 v14; // [rsp+20h] [rbp-90h] BYREF
char *v15; // [rsp+30h] [rbp-80h] BYREF
_BYTE v16[24]; // [rsp+38h] [rbp-78h] BYREF
__int128 v17; // [rsp+50h] [rbp-60h] BYREF
void *__p; // [rsp+60h] [rbp-50h]
_BYTE v19[24]; // [rsp+68h] [rbp-48h] BYREF
__int128 v20; // [rsp+80h] [rbp-30h] BYREF
void *v21; // [rsp+90h] [rbp-20h]
v1 = a1[131];
if ( v1 && *(_DWORD *)(v1 + 328) > *(_DWORD *)(v1 + 332) )
{
sub_10095F600();
sub_10095F7F0(a1);
sub_100556DE0(&v20, a1[131]);
if ( (v20 & 1) != 0 )
{
if ( *((_QWORD *)&v20 + 1) )
{
LABEL_5:
*(_QWORD *)(GameLevelManager::sharedState() + 1360) = a1 + 127;
v2 = GameLevelManager::sharedState();
v3 = *(_DWORD *)(a1[131] + 328) - *(_DWORD *)(a1[131] + 332);
if ( (v20 & 1) != 0 )
{
sub_10001AD30(&v17, v21, *((unsigned __int64 *)&v20 + 1));
}
else
{
__p = v21;
v17 = v20;
}
v8 = sub_100556E80(v2, v3, (__int64)&v17);
if ( (v17 & 1) != 0 )
operator delete(__p);
if ( v8 )
{
v9 = a1[149];
if ( v9 )
{
*(_QWORD *)(v9 + 664) = 0;
a1[149] = 0;
}
strcpy(v19, "*Uploading controls...");
v10 = UploadActionPopup::create((__int64)(a1 + 128), (__int128 *)v19);
a1[149] = (__int64)v10;
if ( (v19[0] & 1) != 0 )
{
operator delete(*(void **)&v19[16]);
v10 = (char *)a1[149];
}
(*(void (__fastcall **)(char *))(*(_QWORD *)v10 + 1312LL))(v10);
}
goto LABEL_27;
}
}
else if ( (unsigned __int8)v20 >> 1 )
{
goto LABEL_5;
}
v4 = a1[131];
v5 = *(unsigned __int8 *)(v4 + 1784);
if ( (v5 & 1) != 0 )
{
if ( *(_QWORD *)(v4 + 1792) )
goto LABEL_10;
}
else if ( v5 >> 1 )
{
LABEL_10:
v15 = (char *)operator new(0x40u);
*(_QWORD *)&v14 = 65;
*((_QWORD *)&v14 + 1) = 63;
strcpy(v15, "Nothing selected. Remove the uploaded controls from this level?");
v6 = sub_100493AB0((__int64)(a1 + 130), (__int64)"Remove Controls", &v14, (__int64)"Cancel", (__int64)"Remove");
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 1312LL))(v6);
if ( (v14 & 1) == 0 )
goto LABEL_27;
v7 = (void **)&v15;
LABEL_26:
operator delete(*v7);
LABEL_27:
if ( (v20 & 1) != 0 )
operator delete(v21);
return;
}
strcpy(v16, " Nothing selected");
LOWORD(v12) = 0;
v11 = TextAlertPopup::create((__int128 *)v16, 0x96u, &v12, 0.5, 0.60000002);
(*(void (__fastcall **)(__int64 *, char *, __int64))(*a1 + 464))(a1, v11, 100);
if ( (v12 & 1) != 0 )
operator delete(v13);
if ( (v16[0] & 1) == 0 )
goto LABEL_27;
v7 = (void **)&v16[16];
goto LABEL_26;
}
}