RtlpReferenceAtom

INT16 __fastcall RtlpReferenceAtom(INT64 a1, INT64 a2){
  INT16 result; 
  __int16 v3; 
  if( a2 != a1 + 16 && !*(_WORD *)(a2 + 20) )
  {
    v3 = *(_WORD *)(a1 + 36);
    if( v3 == -1 )
      *(_WORD *)(a1 + 38) |= 1u;
    else
      *(_WORD *)(a1 + 36) = v3 + 1;
  }
  result = *(_WORD *)(a2 + 20);
  if( result == -1 )
    *(_WORD *)(a2 + 22) |= 1u;
  else
    *(_WORD *)(a2 + 20) = ++result;
  return result;
}

Referenced by:

RtlAddAtomToAtomTableEx