// // LevelEditorLayer::getNextFreeOrderChannel from 0x4796d8 to 0x479a0a (818 bytes) // // 2 xrefs: // > SetGroupIDLayer::onNextFreeOrderChannel @ 0x63b4e8 // > SetupRotateGameplayPopup::onPlusButton @ 0x67f89a // // 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::getNextFreeOrderChannel(LevelEditorLayer *a1, int a2) { int AllObjects; // r0 int NextHighestID; // r4 _DWORD *v6; // r3 _DWORD *v7; // r8 _DWORD *v8; // r9 _DWORD *v9; // t1 unsigned int v10; // r7 unsigned int v11; // r4 unsigned int v12; // r10 int v13; // r5 _DWORD *v14; // r3 unsigned int v15; // r0 int v16; // r1 float v17; // s15 bool v18; // r5 unsigned int v19; // r5 unsigned int v20; // r1 _DWORD *v21; // r3 unsigned int v22; // r0 int v23; // r1 unsigned int v24; // r7 unsigned int v25; // r4 unsigned int v26; // r9 int v27; // r5 _DWORD *v28; // r3 unsigned int v29; // r0 int v30; // r1 float v31; // s15 bool v32; // r5 unsigned int v33; // r5 unsigned int v34; // r1 _DWORD *v35; // r3 unsigned int v36; // r0 int v37; // r1 _DWORD *v38; // [sp+8h] [bp-44h] _DWORD v39[3]; // [sp+18h] [bp-34h] BYREF void *v40[3]; // [sp+24h] [bp-28h] BYREF int v41; // [sp+30h] [bp-1Ch] BYREF unsigned int v42; // [sp+34h] [bp-18h] void *v43; // [sp+38h] [bp-14h] BYREF int v44; // [sp+3Ch] [bp-10h] float v45; // [sp+40h] [bp-Ch] v41 = 0; v42 = 0; v43 = nullptr; v44 = 0; v45 = 1.0; LevelEditorLayer::addExclusionList((int)a1, a2, (int)&v41); AllObjects = LevelEditorLayer::getAllObjects(a1); if ( AllObjects ) { v6 = *(_DWORD **)(AllObjects + 52); if ( *v6 ) { v7 = (_DWORD *)v6[3]; v38 = &v7[*v6 - 1]; while ( 1 ) { do { LABEL_5: if ( v7 <= v38 ) { v9 = (_DWORD *)*v7++; v8 = v9; if ( v9 ) continue; } goto LABEL_2; } while ( v8[271] != 1 ); v10 = v8[398]; v11 = v42; v40[0] = (void *)v10; if ( v42 ) { v12 = v42 - 1; if ( ((v42 - 1) & v42) != 0 ) v13 = v10 % v42; else v13 = v10 & v12; v14 = *(_DWORD **)(v41 + 4 * v13); if ( v14 ) { while ( 1 ) { v14 = (_DWORD *)*v14; if ( !v14 ) break; v15 = v14[1]; v16 = ((v42 - 1) & v42) != 0 ? v15 % v42 : v12 & v15; if ( v16 != v13 ) break; if ( v14[2] == v10 ) goto LABEL_36; } } } else { v13 = 0; } std::__hash_table,std::equal_to,std::allocator>::__construct_node_hash( (int)v39, (int)&v41, v10, v40); v17 = (float)(unsigned int)(v44 + 1); if ( v17 > (float)((float)v11 * v45) ) { v18 = v11 > 2 && ((v11 - 1) & v11) == 0; } else { if ( v11 ) goto LABEL_28; v18 = 0; } v19 = 2 * v11 + !v18; v20 = (unsigned int)ceilf(v17 / v45); if ( v20 < v19 ) v20 = v19; std::__hash_table,std::equal_to,std::allocator>::rehash((int)&v41, v20); v11 = v42; if ( ((v42 - 1) & v42) != 0 ) v13 = v10 % v42; else v13 = (v42 - 1) & v10; LABEL_28: v21 = *(_DWORD **)(v41 + 4 * v13); if ( v21 ) { *(_DWORD *)v39[0] = *v21; *v21 = v39[0]; } else { *(_DWORD *)v39[0] = v43; v43 = (void *)v39[0]; *(_DWORD *)(v41 + 4 * v13) = &v43; if ( *(_DWORD *)v39[0] ) { v22 = *(_DWORD *)(*(_DWORD *)v39[0] + 4); if ( ((v11 - 1) & v11) != 0 ) v23 = v22 % v11; else v23 = (v11 - 1) & v22; *(_DWORD *)(v41 + 4 * v23) = v39[0]; } } ++v44; LABEL_36: if ( v8[223] == 2900 ) { v24 = v8[418]; v25 = v42; v39[0] = v24; if ( v42 ) { v26 = v42 - 1; if ( ((v42 - 1) & v42) != 0 ) v27 = v24 % v42; else v27 = v24 & v26; v28 = *(_DWORD **)(v41 + 4 * v27); if ( v28 ) { while ( 1 ) { v28 = (_DWORD *)*v28; if ( !v28 ) break; v29 = v28[1]; v30 = ((v42 - 1) & v42) != 0 ? v29 % v42 : v26 & v29; if ( v30 != v27 ) break; if ( v28[2] == v24 ) goto LABEL_5; } } } else { v27 = 0; } std::__hash_table,std::equal_to,std::allocator>::__construct_node_hash( (int)v40, (int)&v41, v24, v39); v31 = (float)(unsigned int)(v44 + 1); if ( v31 > (float)((float)v25 * v45) ) { v32 = v25 > 2 && ((v25 - 1) & v25) == 0; } else { if ( v25 ) goto LABEL_57; v32 = 0; } v33 = 2 * v25 + !v32; v34 = (unsigned int)ceilf(v31 / v45); if ( v34 < v33 ) v34 = v33; std::__hash_table,std::equal_to,std::allocator>::rehash((int)&v41, v34); v25 = v42; if ( ((v42 - 1) & v42) != 0 ) v27 = v24 % v42; else v27 = (v42 - 1) & v24; LABEL_57: v35 = *(_DWORD **)(v41 + 4 * v27); if ( v35 ) { *(_DWORD *)v40[0] = *v35; *v35 = v40[0]; } else { *(_DWORD *)v40[0] = v43; v43 = v40[0]; *(_DWORD *)(v41 + 4 * v27) = &v43; if ( *(_DWORD *)v40[0] ) { v36 = *(_DWORD *)(*(_DWORD *)v40[0] + 4); if ( ((v25 - 1) & v25) != 0 ) v37 = v36 % v25; else v37 = (v25 - 1) & v36; *(void **)(v41 + 4 * v37) = v40[0]; } } ++v44; } } } } LABEL_2: NextHighestID = findNextHighestID(1, 1000, &v41); std::__hash_table,std::equal_to,std::allocator>::~__hash_table((int)&v41); return NextHighestID; }
GD Web Decomp Icon

GD Web Decomp

Raw Source