HalpDmaFlushContiguousTransferV2

void __fastcall HalpDmaFlushContiguousTransferV2(
        __int64 a1,
        __int64 a2,
        _QWORD *a3,
        __int64 a4,
        unsigned int a5,
        char a6){
  unsigned int ContiguousPiece; 
  __int64 v11; 
  __int64 v12; 
  __int64 v13; 
  char v14; 
  char v15; 
  ContiguousPiece = HalpDmaNextContiguousPiece(a1, a2, 0i64, a4, a6, a5);
  v11 = (a4 & 0xFFF)
      + (*(_QWORD *)(a2 + 8i64 * (unsigned int)((unsigned __int64)(a4 - *(_QWORD *)(a2 + 32)) >> 12) + 48) << 12);
  if( ContiguousPiece != a5 || (v12 = v11 + ContiguousPiece, *(_QWORD *)(a1 + 136) < (unsigned __int64)(v12 - 1)) )
  {
    v14 = 0;
    if( a6 )
      return;
    goto LABEL_10;
  }
  if( !a6 && !*(_BYTE *)(a1 + 437) )
  {
    v13 = (unsigned int)HalpDmaGetAdapterCacheAlignment(a1) - 1;
    if( (v13 & v11) == 0 && (v13 & v12) == 0 )
    {
      if( !v15 )
        HalpDmaFlushBuffer(v13, a2, a4, a5, v14, v14);
      return;
    }
LABEL_10:
    HalpDmaSyncMapBuffers(a1, a2, a4, a3, a5, v14, v14, v14);
  }
}

Referenced by:

IoFlushAdapterBuffersV2