// // LevelEditorLayer::getNextFreeEnterChannel from 0x479d40 to 0x47a1d2 (1170 bytes) // // 3 xrefs: // > SetupObjectOptions2Popup::onPlusButton @ 0x63ac74 // > IDNameBrowserPopup::onFormNextFree @ 0x78ff08 // > IDNameInput::onNextFree @ 0x793c42 // // This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False! // // 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:49:13 +0000 // int __fastcall LevelEditorLayer::getNextFreeEnterChannel(LevelEditorLayer *a1, int a2) { unsigned int v3; // r2 LevelSettingsObject *v4; // r0 int AllObjects; // r0 _DWORD *i; // r8 unsigned int v7; // r4 unsigned int v8; // r7 unsigned int v9; // r11 int v10; // r5 _DWORD *v11; // r3 unsigned int v12; // r0 int v13; // r1 float v14; // s15 bool v15; // r5 unsigned int v16; // r5 unsigned int v17; // r1 _DWORD *v18; // r3 unsigned int v19; // r0 int v20; // r1 _DWORD *v21; // r3 int *v22; // r8 int NextHighestID; // r4 int v25; // r9 int v26; // t1 unsigned int v27; // r7 unsigned int v28; // r4 unsigned int v29; // r11 int v30; // r5 _DWORD *v31; // r3 unsigned int v32; // r0 int v33; // r1 float v34; // s15 bool v35; // r5 unsigned int v36; // r5 unsigned int v37; // r1 _DWORD *v38; // r3 unsigned int v39; // r0 int v40; // r1 unsigned int v41; // r7 unsigned int v42; // r4 unsigned int v43; // r9 int v44; // r5 _DWORD *v45; // r2 _DWORD *j; // r11 unsigned int v47; // r0 int v48; // r1 float v49; // s15 bool v50; // r5 unsigned int v51; // r5 unsigned int v52; // r1 _DWORD *v53; // r3 unsigned int v54; // r0 int v55; // r1 int *v56; // [sp+8h] [bp-54h] void *v57; // [sp+1Ch] [bp-40h] BYREF void *v58[3]; // [sp+28h] [bp-34h] BYREF _DWORD v59[3]; // [sp+34h] [bp-28h] BYREF int v60; // [sp+40h] [bp-1Ch] BYREF unsigned int v61; // [sp+44h] [bp-18h] void *v62; // [sp+48h] [bp-14h] BYREF int v63; // [sp+4Ch] [bp-10h] float v64; // [sp+50h] [bp-Ch] v60 = 0; v61 = 0; v62 = nullptr; v63 = 0; v64 = 1.0; LevelEditorLayer::addExclusionList((int)a1, a2, (int)&v60); v4 = *((LevelSettingsObject **)a1 + 521); if ( v4 ) { for ( i = (_DWORD *)LevelSettingsObject::getIDNames(v4, 8u, v3)[2]; ; i = (_DWORD *)*i ) { if ( !i ) goto LABEL_2; v7 = v61; v8 = i[2]; if ( v61 ) { v9 = v61 - 1; if ( ((v61 - 1) & v61) != 0 ) v10 = v8 % v61; else v10 = v8 & v9; v11 = *(_DWORD **)(v60 + 4 * v10); if ( v11 ) { while ( 1 ) { v11 = (_DWORD *)*v11; if ( !v11 ) break; v12 = v11[1]; v13 = ((v61 - 1) & v61) != 0 ? v12 % v61 : v9 & v12; if ( v13 != v10 ) break; if ( v11[2] == v8 ) goto LABEL_34; } } } else { v10 = 0; } std::__hash_table,std::equal_to,std::allocator>::__construct_node_hash( (int)&v57, (int)&v60, v8, i + 2); v14 = (float)(unsigned int)(v63 + 1); if ( v14 > (float)((float)v7 * v64) ) break; if ( !v7 ) { v15 = 0; LABEL_21: v16 = 2 * v7 + !v15; v17 = (unsigned int)ceilf(v14 / v64); if ( v17 < v16 ) v17 = v16; std::__hash_table,std::equal_to,std::allocator>::rehash((int)&v60, v17); v7 = v61; if ( ((v61 - 1) & v61) != 0 ) v10 = v8 % v61; else v10 = (v61 - 1) & v8; } v18 = *(_DWORD **)(v60 + 4 * v10); if ( v18 ) { *(_DWORD *)v57 = *v18; *v18 = v57; } else { *(_DWORD *)v57 = v62; v62 = v57; *(_DWORD *)(v60 + 4 * v10) = &v62; if ( *(_DWORD *)v57 ) { v19 = *(_DWORD *)(*(_DWORD *)v57 + 4); if ( ((v7 - 1) & v7) != 0 ) v20 = v19 % v7; else v20 = (v7 - 1) & v19; *(_DWORD *)(v60 + 4 * v20) = v57; } } ++v63; LABEL_34: ; } v15 = v7 > 2 && ((v7 - 1) & v7) == 0; goto LABEL_21; } LABEL_2: AllObjects = LevelEditorLayer::getAllObjects(a1); if ( AllObjects ) { v21 = *(_DWORD **)(AllObjects + 52); if ( *v21 ) { v22 = (int *)v21[3]; v56 = &v22[*v21 - 1]; while ( 1 ) { LABEL_37: if ( v22 > v56 ) break; v26 = *v22++; v25 = v26; if ( !v26 ) break; v27 = *(__int16 *)(v25 + 876); v28 = v61; v59[0] = v27; if ( v61 ) { v29 = v61 - 1; if ( ((v61 - 1) & v61) != 0 ) v30 = v27 % v61; else v30 = v27 & v29; v31 = *(_DWORD **)(v60 + 4 * v30); if ( v31 ) { while ( 1 ) { v31 = (_DWORD *)*v31; if ( !v31 ) break; v32 = v31[1]; v33 = ((v61 - 1) & v61) != 0 ? v32 % v61 : v29 & v32; if ( v33 != v30 ) break; if ( v31[2] == v27 ) goto LABEL_72; } } } else { v30 = 0; } std::__hash_table,std::equal_to,std::allocator>::__construct_node_hash( (int)v58, (int)&v60, v27, v59); v34 = (float)(unsigned int)(v63 + 1); if ( v34 > (float)((float)v28 * v64) ) { v35 = v28 > 2 && ((v28 - 1) & v28) == 0; } else { if ( v28 ) goto LABEL_64; v35 = 0; } v36 = 2 * v28 + !v35; v37 = (unsigned int)ceilf(v34 / v64); if ( v37 < v36 ) v37 = v36; std::__hash_table,std::equal_to,std::allocator>::rehash((int)&v60, v37); v28 = v61; if ( ((v61 - 1) & v61) != 0 ) v30 = v27 % v61; else v30 = (v61 - 1) & v27; LABEL_64: v38 = *(_DWORD **)(v60 + 4 * v30); if ( v38 ) { *(_DWORD *)v58[0] = *v38; *v38 = v58[0]; } else { *(_DWORD *)v58[0] = v62; v62 = v58[0]; *(_DWORD *)(v60 + 4 * v30) = &v62; if ( *(_DWORD *)v58[0] ) { v39 = *(_DWORD *)(*(_DWORD *)v58[0] + 4); if ( ((v28 - 1) & v28) != 0 ) v40 = v39 % v28; else v40 = (v28 - 1) & v39; *(void **)(v60 + 4 * v40) = v58[0]; } } ++v63; LABEL_72: if ( *(_DWORD *)(v25 + 792) == 45 ) { v41 = *(_DWORD *)(v25 + 1840); v42 = v61; v58[0] = (void *)v41; if ( v61 ) { v43 = v61 - 1; if ( ((v61 - 1) & v61) != 0 ) v44 = v41 % v61; else v44 = v41 & v43; v45 = *(_DWORD **)(v60 + 4 * v44); if ( v45 ) { for ( j = (_DWORD *)*v45; j; j = (_DWORD *)*j ) { v47 = j[1]; v48 = ((v61 - 1) & v61) != 0 ? v47 % v61 : v43 & v47; if ( v48 != v44 ) break; if ( j[2] == v41 ) goto LABEL_37; } } } else { v44 = 0; } std::__hash_table,std::equal_to,std::allocator>::__construct_node_hash( (int)v59, (int)&v60, v41, v58); v49 = (float)(unsigned int)(v63 + 1); if ( v49 > (float)((float)v42 * v64) ) { v50 = v42 > 2 && ((v42 - 1) & v42) == 0; } else { if ( v42 ) goto LABEL_94; v50 = 0; } v51 = 2 * v42 + !v50; v52 = (unsigned int)ceilf(v49 / v64); if ( v52 < v51 ) v52 = v51; std::__hash_table,std::equal_to,std::allocator>::rehash((int)&v60, v52); v42 = v61; if ( ((v61 - 1) & v61) != 0 ) v44 = v41 % v61; else v44 = (v61 - 1) & v41; LABEL_94: v53 = *(_DWORD **)(v60 + 4 * v44); if ( v53 ) { *(_DWORD *)v59[0] = *v53; *v53 = v59[0]; } else { *(_DWORD *)v59[0] = v62; v62 = (void *)v59[0]; *(_DWORD *)(v60 + 4 * v44) = &v62; if ( *(_DWORD *)v59[0] ) { v54 = *(_DWORD *)(*(_DWORD *)v59[0] + 4); if ( ((v42 - 1) & v42) != 0 ) v55 = v54 % v42; else v55 = (v42 - 1) & v54; *(_DWORD *)(v60 + 4 * v55) = v59[0]; } } ++v63; } } } } NextHighestID = findNextHighestID(1, 100, &v60); std::__hash_table,std::equal_to,std::allocator>::~__hash_table((int)&v60); return NextHighestID; }
GD Web Decomp Icon

GD Web Decomp

Raw Source