MiMirrorPerformBlackWrites
NTSTATUS __fastcall MiMirrorPerformBlackWrites(INT64 a1){
NTSTATUS v1;
unsigned __int64 v2;
unsigned __int64 v4;
unsigned __int64 v5;
_QWORD *v6;
__int64 i;
unsigned __int64 v8;
unsigned __int64 v9;
unsigned __int64 v10;
unsigned __int64 v11;
_DWORD *v12;
unsigned __int64 v13;
unsigned __int64 v14;
unsigned __int64 j;
unsigned __int64 v16;
_DWORD *v18;
unsigned __int64 v19;
v1 = 0;
v2 = 0i64;
while( 1 )
{
v4 = v2 & -(__int64)(v2 < *(&stru_140C4DB30 + 294));
v5 = *(&stru_140C4DB30 + 294) - 1i64;
while( 1 )
{
if( v5 - v4 == -1i64 )
goto LABEL_39;
v6 = (_QWORD *)(*(&stru_140C4DB30 + 295) + 8 * (v4 >> 6));
for( i = ~*v6 | ((1i64 << (v4 & 0x3F)) - 1); i == -1; i = ~*v6 )
{
if( (unsigned __int64)++v6 > *(&stru_140C4DB30 + 295) + 8 * (v5 >> 6) )
goto LABEL_39;
}
_BitScanForward64(&v8, ~i);
v9 = v8 + (((__int64)v6 - *(&stru_140C4DB30 + 295)) >> 3 << 6);
if( v9 > v5 )
{
LABEL_39:
v9 = -1i64;
}
else if( v9 != -1i64 )
{
break;
}
if( !v4 )
break;
v19 = v2 + 1;
if( v2 + 1 > *(&stru_140C4DB30 + 294) )
v19 = *(&stru_140C4DB30 + 294);
v5 = v19 - 1;
v4 = 0i64;
}
if( v9 < v2 || v9 == -1i64 )
return v1;
if( *(&stru_140C4DB30 + 294) > v9 )
{
v10 = v9;
v11 = *(&stru_140C4DB30 + 295) + 4 * ((unsigned __int64)(*(&stru_140C4DB30 + 294) - 1i64) >> 5);
v12 = (_DWORD *)(*(&stru_140C4DB30 + 295) + 4 * (v9 >> 5));
if( v12 != (_DWORD *)v11 && (*v12 | *((_DWORD *)qword_140011CE0 + (v9 & 0x1F))) == -1 )
{
v10 = (v9 & 0xFFFFFFFFFFFFFFE0ui64) + 32;
for( ++v12; (unsigned __int64)v12 < v11 && *v12 == -1; ++v12 )
v10 += 32i64;
}
while( v10 < *(&stru_140C4DB30 + 294) && _bittest64(*(&stru_140C4DB30 + 295), v10) )
++v10;
v13 = 0i64;
if( v12 == (_DWORD *)v11 )
goto LABEL_20;
v14 = v10 & 0x1F;
if( (~*((_DWORD *)qword_140011CE0 + v14) & *v12) != 0 )
goto LABEL_20;
v13 = 32 - v14;
if( v14 != 33 )
{
v18 = v12 + 1;
while( (unsigned __int64)v18 < v11 && !*v18 )
{
++v18;
v13 += 32i64;
if( v13 == -1i64 )
goto LABEL_25;
}
LABEL_20:
for( j = v13 + v10; j < *(&stru_140C4DB30 + 294) && !_bittest64(*(&stru_140C4DB30 + 295), j) && v13 != -1i64; ++j )
++v13;
}
LABEL_25:
if( v13 )
goto LABEL_26;
goto LABEL_41;
}
v13 = 0i64;
LABEL_41:
v10 = *(&stru_140C4DB30 + 294);
LABEL_26:
v16 = v10 - v9;
v1 = (*(__int64(__fastcall **)(unsigned __int64, unsigned __int64))(a1 + 16))(v9 << 12, v16 << 12);
if( v1 >= 0 )
{
v2 = v16 + v13 + v9;
if( v2 < *(&stru_140C4DB30 + 294) )
continue;
}
return v1;
}
}Referenced by:
MiMirrorBlackPhase