// // sub_87BCD4 from 0x87bcd4 to 0x87c01c (840 bytes) // // 8 xrefs: // > sub_87C01C @ 0x87c024 // > sub_87C5E4 @ 0x87ca1e // > sub_87C5E4 @ 0x87ca50 // > sub_87CA58 @ 0x87cb6e // > sub_87CC58 @ 0x87cd12 // > sub_87CD3C @ 0x87ce48 // > sub_87CD3C @ 0x87d090 // > sub_87CD3C @ 0x87d0ce // // 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:03:06 +0000 // int __fastcall sub_87BCD4(int result) { int v1; // r3 int v2; // r3 _DWORD *v3; // r4 int v4; // r5 int v5; // r2 _DWORD *v6; // r1 int v7; // r7 int v8; // r6 int v9; // r1 int v10; // r6 int v11; // r7 int v12; // r1 int v13; // r7 int v14; // r6 int v15; // r10 _BYTE *v16; // r3 int v17; // r11 int v18; // r3 int v19; // r9 _BYTE *v20; // r3 int v21; // r3 int v22; // r11 int v23; // r3 int v24; // r5 int v25; // r7 int v26; // r8 _BYTE *v27; // r3 int v28; // r10 int v29; // r6 int v30; // r6 _BYTE *v31; // r3 int v32; // r3 int v33; // r6 int i; // r3 int v35; // r5 int v36; // r11 int v37; // r10 _BYTE *v38; // r3 int v39; // r9 int v40; // r3 int v41; // r7 _BYTE *v42; // r3 int v43; // r3 int v44; // r9 int v45; // [sp+4h] [bp-2Ch] int v46; // [sp+4h] [bp-2Ch] v1 = *(_DWORD *)(result + 128); if ( v1 ) { v2 = v1 >> 1; v3 = (_DWORD *)result; if ( v2 ) { v4 = 0; do { v2 >>= 1; ++v4; } while ( v2 ); if ( v4 > 14 ) { *(_DWORD *)(**(_DWORD **)(result + 120) + 20) = 41; result = (***(int (__fastcall ****)(_DWORD))(result + 120))(*(_DWORD *)(result + 120)); } v2 = 16 * v4; } else { v4 = 0; } v5 = v3[27]; v6 = &v3[v3[31]]; if ( v5 ) { ++*(_DWORD *)(v6[23] + 4 * v2); v5 = v3[27]; if ( !v4 ) goto LABEL_10; LABEL_27: if ( !v5 ) { v23 = (1 << v4) - 1; v24 = v4 + v3[4]; v25 = v3[3] | ((v23 & v3[32]) << (24 - v24)); if ( v24 <= 7 ) goto LABEL_63; v26 = v24; while ( 1 ) { v27 = (_BYTE *)v3[28]; v28 = BYTE2(v25); v26 -= 8; v25 <<= 8; v3[28] = v27 + 1; *v27 = v28; v29 = v3[29] - 1; v3[29] = v29; if ( !v29 ) break; if ( v28 == 255 ) goto LABEL_36; LABEL_31: if ( v26 <= 7 ) { v5 = v3[27]; v24 &= 7u; LABEL_63: v3[3] = v25; v3[4] = v24; LABEL_10: v7 = v3[34]; v3[32] = 0; v8 = v3[33]; if ( v5 || !v8 ) goto LABEL_11; for ( i = v7 - 1; ; i = v46 ) { v46 = i + 1; if ( v5 ) goto LABEL_60; v35 = v3[4]; v36 = v35 + 1; v37 = ((*(_BYTE *)(i + 1) & 1) << (23 - v35)) | v3[3]; if ( v35 + 1 > 7 ) break; LABEL_59: v3[3] = v37; v3[4] = v36; LABEL_60: if ( !--v8 ) { LABEL_11: v3[33] = 0; return result; } v5 = v3[27]; } while ( 1 ) { v38 = (_BYTE *)v3[28]; v39 = BYTE2(v37); v36 -= 8; v37 <<= 8; v3[28] = v38 + 1; *v38 = v39; v40 = v3[29] - 1; v3[29] = v40; if ( v40 ) { if ( v39 != 255 ) goto LABEL_49; } else { v41 = *(_DWORD *)(v3[30] + 24); result = (*(int (**)(void))(v41 + 12))(); if ( !result ) { *(_DWORD *)(*(_DWORD *)v3[30] + 20) = 25; result = (**(int (__fastcall ***)(_DWORD))v3[30])(v3[30]); } v3[28] = *(_DWORD *)v41; v3[29] = *(_DWORD *)(v41 + 4); if ( v39 != 255 ) { LABEL_49: if ( v36 <= 7 ) goto LABEL_58; continue; } } v42 = (_BYTE *)v3[28]; v3[28] = v42 + 1; *v42 = 0; v43 = v3[29] - 1; v3[29] = v43; if ( v43 ) goto LABEL_49; v44 = *(_DWORD *)(v3[30] + 24); result = (*(int (**)(void))(v44 + 12))(); if ( !result ) { *(_DWORD *)(*(_DWORD *)v3[30] + 20) = 25; result = (**(int (__fastcall ***)(_DWORD))v3[30])(v3[30]); } v3[28] = *(_DWORD *)v44; v3[29] = *(_DWORD *)(v44 + 4); if ( v36 <= 7 ) { LABEL_58: v36 = ((_BYTE)v35 - 7) & 7; goto LABEL_59; } } } } v30 = *(_DWORD *)(v3[30] + 24); result = (*(int (**)(void))(v30 + 12))(); if ( !result ) { *(_DWORD *)(*(_DWORD *)v3[30] + 20) = 25; result = (**(int (__fastcall ***)(_DWORD))v3[30])(v3[30]); } v3[28] = *(_DWORD *)v30; v3[29] = *(_DWORD *)(v30 + 4); if ( v28 != 255 ) goto LABEL_31; LABEL_36: v31 = (_BYTE *)v3[28]; v3[28] = v31 + 1; *v31 = 0; v32 = v3[29] - 1; v3[29] = v32; if ( !v32 ) { v33 = *(_DWORD *)(v3[30] + 24); result = (*(int (**)(void))(v33 + 12))(); if ( !result ) { *(_DWORD *)(*(_DWORD *)v3[30] + 20) = 25; result = (**(int (__fastcall ***)(_DWORD))v3[30])(v3[30]); } v3[28] = *(_DWORD *)v33; v3[29] = *(_DWORD *)(v33 + 4); } goto LABEL_31; } goto LABEL_42; } v9 = v6[15]; v10 = *(_DWORD *)(v9 + 4 * v2); v11 = *(unsigned __int8 *)(v9 + v2 + 1024); if ( !*(_BYTE *)(v9 + v2 + 1024) ) { v45 = v3[27]; *(_DWORD *)(*(_DWORD *)v3[30] + 20) = 41; result = (**(int (__fastcall ***)(_DWORD))v3[30])(v3[30]); v5 = v45; if ( v3[27] ) { LABEL_42: v3[32] = 0; v3[33] = 0; return result; } } result = v3[4]; v12 = (1 << v11) - 1; v13 = v11 + result; v14 = ((v10 & v12) << (24 - v13)) | v3[3]; if ( v13 <= 7 ) { LABEL_26: v3[3] = v14; v3[4] = v13; if ( !v4 ) goto LABEL_10; goto LABEL_27; } v15 = v13; while ( 1 ) { v16 = (_BYTE *)v3[28]; v17 = BYTE2(v14); v15 -= 8; v14 <<= 8; v3[28] = v16 + 1; *v16 = v17; v18 = v3[29] - 1; v3[29] = v18; if ( v18 ) { if ( v17 == 255 ) goto LABEL_21; LABEL_16: if ( v15 <= 7 ) goto LABEL_25; } else { v19 = *(_DWORD *)(v3[30] + 24); result = (*(int (**)(void))(v19 + 12))(); if ( !result ) { *(_DWORD *)(*(_DWORD *)v3[30] + 20) = 25; result = (**(int (__fastcall ***)(_DWORD))v3[30])(v3[30]); } v3[28] = *(_DWORD *)v19; v3[29] = *(_DWORD *)(v19 + 4); if ( v17 != 255 ) goto LABEL_16; LABEL_21: v20 = (_BYTE *)v3[28]; v3[28] = v20 + 1; *v20 = 0; v21 = v3[29] - 1; v3[29] = v21; if ( v21 ) goto LABEL_16; v22 = *(_DWORD *)(v3[30] + 24); result = (*(int (**)(void))(v22 + 12))(); if ( !result ) { *(_DWORD *)(*(_DWORD *)v3[30] + 20) = 25; result = (**(int (__fastcall ***)(_DWORD))v3[30])(v3[30]); } v3[28] = *(_DWORD *)v22; v3[29] = *(_DWORD *)(v22 + 4); if ( v15 <= 7 ) { LABEL_25: v5 = v3[27]; v13 &= 7u; goto LABEL_26; } } } } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source