HalpBlkInitializeIdt

UINT64 __fastcall HalpBlkInitializeIdt(INT64 a1, INT64 a2){
  unsigned int v3; 
  void(__fastcall __noreturn **v4)(); 
  INT64 v5; 
  UINT64 result; 
  void(__fastcall __noreturn *v7)(); 
  __int16 v8; 
  *(_QWORD *)(a1 + 8) = a2;
  *(_WORD *)(a1 + 6) = 4095;
  memset(a2, 0i64);
  v3 = 0;
  v4 = &off_140C05538;
  v5 = a2 + 4;
  do
  {
    if( v3 == *((unsigned __int8 *)v4 - 8) )
    {
      *(_WORD *)(v5 - 4) = *(_WORD *)v4;
      *(_WORD *)(v5 - 2) = 16;
      *(_WORD *)v5 = *(_WORD *)v5 & 0xF8 | *((_BYTE *)v4 - 7) & 7 | 0x8E00;
      result = (unsigned __int64)*(unsigned int *)v4 >> 16;
      *(_WORD *)(v5 + 2) = result;
      v7 = *v4;
      v4 += 2;
    }
    else
    {
      *(_WORD *)(v5 - 2) = 16;
      v7 = (void(__fastcall __noreturn *)())((char *)HalpBlkUnexpectedInterrupt + 8 * v3);
      v8 = *(_WORD *)v5 & 0xF8;
      *(_WORD *)(v5 - 4) = (_WORD)v7;
      *(_WORD *)v5 = v8 | 0x8E00;
      result = (unsigned __int64)v7 >> 16;
      *(_WORD *)(v5 + 2) = WORD1(v7);
    }
    ++v3;
    *(_DWORD *)(v5 + 4) = HIDWORD(v7);
    v5 += 16i64;
  }
  while( v3 < 0x100 );
  return result;
}

Referenced by:

HalpBlkInitializeProcessorState