//
// LevelControlConfig::createFromGlobal from 0x14044b6d0 to 0x14044ba41 (881 bytes)
//
// 5 xrefs:
// > TouchControlEditLayer::onReset @ 0x140455534
// > TouchControlEditLayer::onCopy @ 0x140455af8
// > TouchControlEditLayer::onApplyGlobal @ 0x1404565b2
// > ??> @ 0x140927434
// > ??> @ 0x140927440
//
// 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 11:32:25 +0000
//
// Hidden C++ exception states: #wind=5
_QWORD *__fastcall LevelControlConfig::createFromGlobal(char a1)
{
_QWORD *v2; // rsi
__int64 v3; // rcx
__int64 v4; // rax
__int64 v5; // rcx
__int64 v6; // rax
__int64 v7; // r8
_DWORD *v8; // r8
_BYTE *v9; // rdx
__int64 v10; // rbx
__int64 v11; // rbx
__int64 v12; // rcx
__int64 v13; // r8
__int64 v14; // rax
__int64 v15; // rcx
__int64 v16; // rax
__int64 v17; // rcx
__int64 v18; // r8
__int64 v19; // rax
__int64 v20; // rax
_DWORD v22[6]; // [rsp+40h] [rbp-C0h] BYREF
char v23; // [rsp+58h] [rbp-A8h]
char v24; // [rsp+59h] [rbp-A7h]
float v25[2]; // [rsp+5Ch] [rbp-A4h] BYREF
char v26; // [rsp+64h] [rbp-9Ch]
char v27; // [rsp+65h] [rbp-9Bh]
char v28; // [rsp+66h] [rbp-9Ah]
_DWORD v29[6]; // [rsp+68h] [rbp-98h] BYREF
char v30; // [rsp+80h] [rbp-80h]
char v31; // [rsp+81h] [rbp-7Fh]
float v32[2]; // [rsp+84h] [rbp-7Ch] BYREF
char v33; // [rsp+8Ch] [rbp-74h]
char v34; // [rsp+8Dh] [rbp-73h]
char v35; // [rsp+8Eh] [rbp-72h]
_BYTE v36[60]; // [rsp+A8h] [rbp-58h] BYREF
_BYTE v37[76]; // [rsp+E4h] [rbp-1Ch] BYREF
float v38; // [rsp+148h] [rbp+48h] BYREF
void *v39; // [rsp+150h] [rbp+50h]
v2 = LevelControlConfig::create();
LevelControlConfig::seedBase(v2);
v4 = cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize(v4, &v38);
v6 = v2[17];
if ( v6 != v2[18] )
v2[18] = v6;
if ( a1 )
{
v10 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v39 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v39);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v10 = qword_14090BFD0;
}
v22[0] = *(_DWORD *)(v10 + 1388);
v22[1] = *(_DWORD *)(v10 + 1392);
v22[2] = *(_DWORD *)(v10 + 1396);
v22[3] = *(_DWORD *)(v10 + 1400);
v22[4] = *(_DWORD *)(v10 + 1404);
v22[5] = *(_DWORD *)(v10 + 1408);
v23 = *(_BYTE *)(v10 + 1412);
v24 = *(_BYTE *)(v10 + 1413);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, (const struct cocos2d::CCPoint *)(v10 + 1416));
v26 = *(_BYTE *)(v10 + 1424);
v27 = *(_BYTE *)(v10 + 1425);
v28 = *(_BYTE *)(v10 + 1426);
v25[0] = v38 - v25[0];
v11 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v39 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v39);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v11 = qword_14090BFD0;
}
v29[0] = *(_DWORD *)(v11 + 1468);
v29[1] = *(_DWORD *)(v11 + 1472);
v29[2] = *(_DWORD *)(v11 + 1476);
v29[3] = *(_DWORD *)(v11 + 1480);
v29[4] = *(_DWORD *)(v11 + 1484);
v29[5] = *(_DWORD *)(v11 + 1488);
v30 = *(_BYTE *)(v11 + 1492);
v31 = *(_BYTE *)(v11 + 1493);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32, (const struct cocos2d::CCPoint *)(v11 + 1496));
v33 = *(_BYTE *)(v11 + 1504);
v34 = *(_BYTE *)(v11 + 1505);
v35 = *(_BYTE *)(v11 + 1506);
v32[0] = v38 - v32[0];
v13 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v39 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v39);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v13 = qword_14090BFD0;
}
v14 = sub_14044BC00(v12, v36, v13 + 1348, &v38);
sub_14044BD90(v2 + 17, v14);
v16 = sub_14044BC00(v15, v36, v22, &v38);
sub_14044BD90(v2 + 17, v16);
v18 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v39 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v39);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v18 = qword_14090BFD0;
}
v19 = sub_14044BC00(v17, v37, v18 + 1428, &v38);
sub_14044BD90(v2 + 17, v19);
v8 = v29;
v9 = v37;
}
else
{
v7 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v39 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v39);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v7 = qword_14090BFD0;
}
v8 = (_DWORD *)(v7 + 1308);
v9 = v29;
}
v20 = sub_14044BC00(v5, v9, v8, &v38);
sub_14044BD90(v2 + 17, v20);
LevelControlConfig::bindGlobalBinds((__int64)(v2 + 9), 0);
LevelControlConfig::bindGlobalBinds((__int64)(v2 + 13), 1);
return v2;
}