RtlCopyRetpolineStubsUnwindInfo

NTSTATUS __stdcall RtlCopyRetpolineStubsUnwindInfo(VOID *a1, INT64 a2, UINT64 *a3, INT64 a4){
  int v5; 
  __int64 v7; 
  __int64 v8; 
  unsigned int v10; 
  char *v11; 
  int v12; 
  size_t v13; 
  __int64 v14; 
  int v15[4]; 
  int v16; 
  INT64 v17; 

  v16 = a2;
  v15[0] = 0;
  LODWORD(v17) = 0;
  v5 = a4;
  LODWORD(v7) = RtlpGetRetpolineStubsFunctionTable(a1, a2, a4, *(unsigned int *)a3, &v17);
  v8 = v7;
  if( !v7 )
    return -1073741275;
  v10 = 0;
  v11 = (char *)a3 + *(unsigned int *)a3;
  v12 = 0;
  if( !(_DWORD)v17 )
    return 0;
  while( 1 )
  {
    v13 = RtlCalculateUnwindInfoSizeForRetpoline((__int64)a1, v8, v15);
    v10 += v13;
    if( v10 > 0x1F4 )
      break;
    v14 = v13;
    memmove(v11, (char *)a1 + *(unsigned int *)(v8 + 8), v13);
    if( v15[0] )
      *(_DWORD *)&v11[v15[0]] += v16 - v5;
    v11 += v14;
    v8 += 12i64;
    if( ++v12 >= (unsigned int)v17 )
      return 0;
  }
  return -2147483643;
}

Referenced by:

MiApplyRetpolineFixupsToKernelAndHal