// // sub_1406765E0 from 0x1406765e0 to 0x14067698f (943 bytes) // // 2 xrefs: // > sub_140677050 @ 0x140677050 // > @ 0x1409325b8 // // This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True! // // 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:35:59 +0000 // const __m128i *__fastcall sub_1406765E0(__m128i *a1, __int64 a2, const __m128i *a3, size_t a4) { const __m128i *result; // rax unsigned __int64 v8; // r12 unsigned __int64 v9; // r12 int v10; // r14d __m128i *v11; // rdi __int64 v12; // r15 __m128i v13; // xmm1 __m128i *v14; // r8 int v15; // r9d __int64 v16; // rax int v17; // r10d unsigned int v18; // eax __m128i v19; // xmm2 unsigned int v20; // ecx unsigned int v21; // r10d int v22; // edx unsigned int v23; // r9d __m128i v24; // xmm2 unsigned int v25; // ecx unsigned int v26; // edx __int64 v27; // rax __int64 v28; // rcx __m128i v29; // xmm6 char v30; // r12 const __m128i *v31; // r14 __m128i *v32; // rsi __m128i *v33; // r15 __m128i v34; // xmm0 unsigned int v35; // eax unsigned int v36; // edi const __m128i *v37; // rbx __m128i v38; // xmm1 int v39; // r12d __int8 v40; // r8 __m128i *v41; // rdx signed __int64 i; // r10 __int8 *v43; // rax unsigned int v44; // [rsp+20h] [rbp-B8h] BYREF __int64 v45; // [rsp+28h] [rbp-B0h] __m128i *v46; // [rsp+30h] [rbp-A8h] BYREF __m128i v47; // [rsp+40h] [rbp-98h] const __m128i *v48; // [rsp+50h] [rbp-88h] size_t v49; // [rsp+58h] [rbp-80h] __m128i v50; // [rsp+60h] [rbp-78h] BYREF v45 = a2; if ( !a4 ) return (const __m128i *)a2; if ( a4 == 1 ) return (const __m128i *)sub_140676990(a1, a2, a3->m128i_u8[0]); v8 = a2 - (_QWORD)a1; if ( a2 - (__int64)a1 < a4 ) return (const __m128i *)a2; if ( (dword_1408FE01C & 4) == 0 || v8 < 0x10 ) { v40 = a3->m128i_i8[0]; v41 = (__m128i *)(a2 - a4); for ( i = (char *)a3 - (char *)v41; ; ++i ) { if ( v41->m128i_i8[0] == v40 ) { v43 = &v41->m128i_i8[1]; while ( *v43 == v43[i] ) { if ( ++v43 - (__int8 *)v41 == a4 ) return v41; } } if ( v41 == a1 ) break; v41 = (__m128i *)((char *)v41 - 1); } return (const __m128i *)v45; } if ( a4 > 0x10 ) { v29 = _mm_loadu_si128(a3); v30 = v8 - a4; v49 = a4; v31 = a3 + 1; v47 = v29; v48 = a3 + 1; v32 = (__m128i *)(a2 - a4); v50.m128i_i64[0] = a2 - a4; v33 = (__m128i *)((char *)a1 + (v30 & 0xF)); v46 = &v50; v34 = (__m128i)_mm_xor_ps((__m128)_mm_loadu_si128((const __m128i *)(a2 - a4)), (__m128)v29); if ( _mm_testz_si128(v34, v34) && !memcmp(&v32[1], v31, a4 - 16) ) return v32; while ( v32 != v33 ) { v50.m128i_i64[0] = (__int64)--v32; v35 = _mm_cvtsi128_si32(_mm_cmpestrm(v29, *v32, 0x10u, 0x10u)); if ( v35 ) { v44 = v35; do { _BitScanReverse(&v36, v35); v37 = v32; if ( !v36 || (v37 = (__m128i *)((char *)v32 + v36), v38 = (__m128i)_mm_xor_ps((__m128)v29, (__m128)_mm_loadu_si128(v37)), _mm_testz_si128(v38, v38)) ) { if ( !memcmp(&v37[1], v31, a4 - 16) ) return v37; } _bittestandreset((signed __int32 *)&v44, v36); v35 = v44; } while ( v44 ); } } v39 = v30 & 0xF; if ( v39 ) { v50.m128i_i64[0] = (__int64)a1; if ( (((1 << v39) - 1) & _mm_cvtsi128_si32(_mm_cmpestrm(v29, *a1, 0x10u, 0x10u))) != 0 ) { if ( (unsigned __int8)sub_140676FB0(&v46) ) return (const __m128i *)v50.m128i_i64[0]; } } return (const __m128i *)v45; } v9 = v8 & 0xF; v10 = (1 << (17 - a4)) - 1; v11 = (__m128i *)((char *)a1 + v9); memcpy(&v50, a3, a4); v12 = v45; v13 = _mm_load_si128(&v50); v14 = (__m128i *)(v45 - 16); v15 = v10 ^ 0xFFFF; LODWORD(v16) = v10 & _mm_cvtsi128_si32(_mm_cmpestrm(v13, *(__m128i *)(v45 - 16), a4, 0x10u)); if ( (_DWORD)v16 ) { _BitScanReverse((unsigned int *)&v16, v16); return (__m128i *)((char *)v14 + v16); } if ( v14 == v11 ) { LABEL_18: if ( v9 ) { v22 = ((1 << v9) - 1) & _mm_cvtsi128_si32(_mm_cmpestrm(v13, *a1, a4, 0x10u)); if ( v22 ) { v23 = v22 & v15; v44 = v23; if ( v23 ) { v24 = _mm_loadu_si128((const __m128i *)((char *)&unk_1406ED5D0 - a4)); do { _BitScanReverse(&v25, v23); result = (__m128i *)((char *)a1 + v25); if ( _mm_testz_si128((__m128i)_mm_xor_ps((__m128)_mm_loadu_si128(result), (__m128)v13), v24) ) return result; _bittestandreset((signed __int32 *)&v44, v25); v23 = v44; } while ( v44 ); } v26 = v10 & v22; if ( v26 ) { _BitScanReverse((unsigned int *)&v27, v26); return (__m128i *)((char *)a1 + v27); } } } return (const __m128i *)v12; } while ( 1 ) { v17 = _mm_cvtsi128_si32(_mm_cmpestrm(v13, *--v14, a4, 0x10u)); if ( !v17 ) goto LABEL_17; v18 = v17 & v15; v44 = v17 & v15; if ( (v17 & v15) != 0 ) break; LABEL_16: v21 = v10 & v17; if ( v21 ) { _BitScanReverse((unsigned int *)&v28, v21); return (__m128i *)((char *)v14 + v28); } LABEL_17: if ( v14 == v11 ) goto LABEL_18; } v19 = _mm_loadu_si128((const __m128i *)((char *)&unk_1406ED5D0 - a4)); while ( 1 ) { _BitScanReverse(&v20, v18); if ( _mm_testz_si128((__m128i)_mm_xor_ps((__m128)_mm_loadu_si128((__m128i *)((char *)v14 + v20)), (__m128)v13), v19) ) return (__m128i *)((char *)v14 + v20); _bittestandreset((signed __int32 *)&v44, v20); v18 = v44; if ( !v44 ) goto LABEL_16; } }
GD Web Decomp Icon

GD Web Decomp

Raw Source