// // sub_6076AC from 0x6076ac to 0x6078d2 (550 bytes) // // 3 xrefs: // > sub_6076AC @ 0x607854 // > sub_6076AC @ 0x60787c // > sub_6078F4 @ 0x607910 // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // int __fastcall sub_6076AC(int result, int *a2, int a3) { int *v3; // r6 int v5; // r11 int *j; // r3 int *v7; // r7 int v8; // r5 int *v9; // r4 int *v10; // r0 int *v11; // r1 int *v12; // r2 int v13; // r5 void (*v14)(); // r3 void (*v15)(); // r3 int v16; // r2 void (*v17)(); // r3 int *v18; // r5 int *i; // r5 int v20; // r1 int *k; // r7 int v22; // r1 int v23; // r1 int v24; // r1 int v25; // r1 int *v26; // r9 int *v27; // r7 int *v28; // r3 int *v29; // r1 int *v30; // r0 int v31; // [sp+Ch] [bp-10h] BYREF int v32; // [sp+10h] [bp-Ch] v3 = (int *)result; v5 = a3; j = (int *)_stack_chk_guard; while ( (char *)a2 - (char *)v3 >= 264 ) { v7 = a2 - 2; v8 = (char *)(a2 - 2) - (char *)v3; v9 = &v3[2 * (((char *)a2 - (char *)v3) >> 4)]; if ( v8 >= 328 ) { v13 = ((v8 >> 3) + 1) >> 3; sub_606FE0(v3, &v3[2 * v13], &v3[2 * v13 + 2 * v13], (void (*)())&v3[2 * v13]); sub_606FE0(&v9[-2 * v13], &v3[2 * (((char *)a2 - (char *)v3) >> 4)], &v9[2 * v13], v14); sub_606FE0(&v7[-4 * v13], &v7[-2 * v13], a2 - 2, v15); j = &v3[2 * v13]; v11 = &v3[2 * (((char *)a2 - (char *)v3) >> 4)]; v12 = &v7[-2 * v13]; v10 = j; } else { v10 = v3; v11 = &v3[2 * (((char *)a2 - (char *)v3) >> 4)]; v12 = a2 - 2; } sub_606FE0(v10, v11, v12, (void (*)())j); v18 = v9 + 2; while ( v9 != v3 && pugi::xpath_node::operator==(v9 - 2, v9) ) v9 -= 2; while ( v18 != a2 && pugi::xpath_node::operator==(v18, v9) ) v18 += 2; v26 = v9; v27 = v18; while ( 1 ) { LABEL_28: if ( v18 == a2 ) goto LABEL_34; if ( !sub_606F4C((pugi::xpath_node *)v9, (pugi::xpath_node *)v18, v16, v17) ) break; LABEL_32: v18 += 2; } if ( pugi::xpath_node::operator==(v18, v9) ) { sub_600614(v18, v27); v17 = (void (*)())(v27 + 2); v27 += 2; goto LABEL_32; } LABEL_34: while ( v26 != v3 ) { v26 -= 2; if ( !sub_606F4C((pugi::xpath_node *)v26, (pugi::xpath_node *)v9, v16, v17) ) { if ( !pugi::xpath_node::operator==(v9, v26) ) { if ( v18 == a2 ) { v9 -= 2; if ( v26 != v9 ) sub_600614(v26, v9); v27 -= 2; sub_600614(v9, v27); } else { sub_600614(v18, v26); v17 = (void (*)())(v18 + 2); v18 += 2; } goto LABEL_28; } v9 -= 2; sub_600614(v26, v9); } } v28 = v9; if ( v18 != a2 ) { if ( v27 != v18 ) { sub_600614(v9, v27); v28 = v9; } sub_600614(v18, v28); v16 = (int)(v18 + 2); v27 += 2; v9 += 2; v18 += 2; goto LABEL_28; } if ( ((char *)a2 - (char *)v27) >> 3 >= ((char *)v9 - (char *)v3) >> 3 ) { v30 = v3; v3 = v27; result = sub_6076AC(v30, v9, v5); } else { v29 = a2; a2 = v9; result = sub_6076AC(v27, v29, v5); } } if ( v3 != a2 ) { for ( i = v3 + 2; i != a2; i += 2 ) { v20 = i[1]; v31 = *i; v32 = v20; if ( sub_606F4C((pugi::xpath_node *)&v31, (pugi::xpath_node *)v3, a3, (void (*)())j) ) { for ( j = i; v3 != j; j[3] = v22 ) { j -= 2; a3 = (int)(j + 2); v22 = j[1]; j[2] = *j; } result = v31; v23 = v32; *v3 = v31; v3[1] = v23; } else { for ( k = i; sub_606F4C((pugi::xpath_node *)&v31, (pugi::xpath_node *)(k - 2), a3, (void (*)())j); k -= 2 ) { v24 = *(k - 1); *k = *(k - 2); k[1] = v24; } result = v31; v25 = v32; *k = v31; k[1] = v25; } } } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source