CmpCommitSetSecurityUoW

__int64 __fastcall CmpCommitSetSecurityUoW(__int64 a1, __int64 *a2){
  __int64 v3; 
  __int64 v4; 
  __int64 v5; 
  unsigned int v6; 
  UINT64 v7; 
  INT64 v8; 
  unsigned int v9; 
  __int64 v10; 
  unsigned int v11; 
  int v12; 
  int v13; 
  __int64 v14; 
  int v16[2]; 
  int v17[4]; 
  unsigned int v18; 
  unsigned int v20; 
  int v21; 
  int v22; 
  v16[1] = 0;
  v17[1] = 0;
  v22 = 0;
  v3 = 0i64;
  v16[0] = -1;
  v4 = 0i64;
  v5 = *(_QWORD *)(a1 + 48);
  v17[0] = -1;
  v21 = -1;
  v6 = *(_DWORD *)(v5 + 40);
  v7 = *(_QWORD *)(v5 + 32);
  v20 = v6;
  v8 = (*(__int64(__fastcall **)(UINT64, _QWORD, int *))(v7 + 8))(v7, v6, v16);
  if( !v8 )
    return(unsigned int)-1073741670;
  if( !HvMarkCellDirty(v7, v6, 1) )
  {
LABEL_21:
    v12 = -1073741443;
    goto LABEL_12;
  }
  v3 = (*(__int64(__fastcall **)(UINT64, _QWORD, int *))(v7 + 8))(v7, *(unsigned int *)(a1 + 96), v17);
  if( v3 )
  {
    v9 = *(_DWORD *)(v8 + 44);
    v10 = (*(__int64(__fastcall **)(UINT64, _QWORD, int *))(v7 + 8))(v7, v9, &v21);
    v4 = v10;
    if( v10 )
    {
      v11 = *(_DWORD *)(v10 + 8);
      v18 = *(_DWORD *)(v10 + 4);
      if( HvMarkCellDirty(v7, v9, 1) && HvMarkCellDirty(v7, v11, 1) && HvMarkCellDirty(v7, v18, 1) )
      {
        v12 = CmpAssignSecurityDescriptor(v7, v20, v8, (VOID *)(v3 + 20), 1);
        if( v12 < 0 )
        {
          *(_DWORD *)(v8 + 44) = v9;
        }
        else
        {
          v13 = *(_DWORD *)(v4 + 12);
          if( v13 == 1 )
          {
            (*(void(__fastcall **)(UINT64, int *))(v7 + 16))(v7, &v21);
            v4 = 0i64;
            CmpRemoveSecurityCellList((_HHIVE *)v7, v9);
            HvFreeCell(v7, v9);
          }
          else
          {
            *(_DWORD *)(v4 + 12) = v13 - 1;
          }
          v14 = *a2;
          *(_QWORD *)(v8 + 4) = *a2;
          *(_QWORD *)(*(_QWORD *)(a1 + 48) + 168i64) = v14;
          CmpAssignSecurityToKcb(*(_QWORD *)(a1 + 48), *(unsigned int *)(v8 + 44), 0i64, 0, 0);
          ++*(_QWORD *)(*(_QWORD *)(a1 + 48) + 304i64);
        }
        goto LABEL_12;
      }
      goto LABEL_21;
    }
  }
  v12 = -1073741670;
LABEL_12:
  (*(void(__fastcall **)(UINT64, int *))(v7 + 16))(v7, v16);
  if( v3 )
    (*(void(__fastcall **)(UINT64, int *))(v7 + 16))(v7, v17);
  if( v4 )
    (*(void(__fastcall **)(UINT64, int *))(v7 + 16))(v7, &v21);
  return(unsigned int)v12;
}

Referenced by:

CmpTransMgrCommitUoW