// // sub_940B58 from 0x940b58 to 0x940d88 (560 bytes) // // 2 xrefs: // > sub_94114C @ 0x94126a // > sub_941580 @ 0x9422c6 // // 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 12:05:06 +0000 // bool __fastcall sub_940B58(int a1, int a2, int a3, int a4, unsigned __int16 *a5, int a6) { int v8; // r5 int v9; // r4 _DWORD *v10; // r6 int v11; // r10 int v12; // r3 _DWORD *v13; // r11 int v14; // r4 int *v15; // r10 int v16; // t1 int v17; // r0 unsigned int v19; // r1 int v20; // r11 signed int v21; // r1 unsigned int v22; // r0 unsigned int v23; // r2 int v24; // lr int v25; // r1 int v26; // lr int v27; // r12 signed int v28; // r11 unsigned int v29; // r1 unsigned int v30; // r3 int v31; // lr int v32; // r11 int v33; // [sp+4h] [bp-38h] int v34; // [sp+8h] [bp-34h] int v35; // [sp+Ch] [bp-30h] char v36; // [sp+10h] [bp-2Ch] unsigned int v37; // [sp+14h] [bp-28h] int v38; // [sp+18h] [bp-24h] unsigned int v39; // [sp+18h] [bp-24h] _DWORD v40[4]; // [sp+2Ch] [bp-10h] BYREF v36 = a3; if ( a3 ) { v34 = -(1 << a3); v37 = (unsigned int)(a2 - 1 + (1 << a3)) >> a3; } else { v37 = 1; v34 = 0; } v35 = 0; v8 = 0; v9 = 0; v10 = (_DWORD *)(a6 + 60 * *a5); sub_92E7C8(v40, a4); v11 = v40[0]; v12 = 0; while ( v11 ) { v33 = v9 & v34; if ( (v9 & v34) == v12 ) { if ( (v8 & v34) == v35 ) goto LABEL_7; v35 = v8 & v34; } else { v35 = v8 & v34; } v10 = (_DWORD *)(a6 + 60 * a5[(v9 >> v36) + (v8 >> v36) * v37]); LABEL_7: if ( *(_BYTE *)v11 ) { if ( *(_BYTE *)v11 == 1 ) { sub_94405C( a1, *(unsigned __int16 *)(v10[2] + 2 * (*(_DWORD *)(v11 + 4) + 280)), *(unsigned __int8 *)(v10[1] + *(_DWORD *)(v11 + 4) + 280)); } else { v19 = *(unsigned __int16 *)(v11 + 2); v20 = *(_DWORD *)(v11 + 4); if ( v19 < 0x200 ) { v24 = byte_C45D48[2 * v19]; v23 = byte_C45D48[2 * v19 + 1]; v25 = byte_C45B48[v19]; } else { v21 = v19 - 1; v22 = __clz(v21) ^ 0x1F; v23 = v22 - 1; v24 = ((v21 >> (v22 - 1)) & 1) + 2 * v22; v25 = v21 & ((1 << (v22 - 1)) - 1); } v26 = v24 + 256; v27 = *(unsigned __int8 *)(v10[1] + v26); sub_94405C(a1, (v25 << v27) | *(unsigned __int16 *)(v10[2] + 2 * v26), v23 + v27); if ( v20 < 512 ) { v31 = byte_C45D48[2 * v20]; v30 = byte_C45D48[2 * v20 + 1]; v32 = byte_C45B48[v20]; } else { v28 = v20 - 1; v29 = __clz(v28) ^ 0x1F; v30 = v29 - 1; v31 = ((v28 >> (v29 - 1)) & 1) + 2 * v29; v32 = ((1 << (v29 - 1)) - 1) & v28; } v39 = v30; sub_94405C(a1, *(unsigned __int16 *)(v10[14] + 2 * v31), *(unsigned __int8 *)(v10[13] + v31)); sub_94405C(a1, v32, v39); } } else { v38 = v9; v13 = v10; v14 = v11; v15 = (int *)&unk_C48CB0; do { v16 = *v15++; v13 += 3; sub_94405C( a1, *(unsigned __int16 *)(*(v13 - 1) + 2 * (unsigned __int8)(*(_DWORD *)(v14 + 4) >> (8 * v16))), *(unsigned __int8 *)(*(v13 - 2) + (unsigned __int8)(*(_DWORD *)(v14 + 4) >> (8 * v16)))); } while ( v13 != v10 + 12 ); v11 = v14; v9 = v38; } for ( v9 += *(unsigned __int16 *)(v11 + 2); a2 <= v9; ++v8 ) v9 -= a2; v17 = v40[0] + 8; v40[0] = v17; if ( v17 == v40[2] ) { sub_92E7E8((int)v40); v11 = v40[0]; } else { v11 = v17; } v12 = v33; } return *(_DWORD *)(a1 + 20) != 0; }
GD Web Decomp Icon

GD Web Decomp

Raw Source