/* This function divides the 64-bit unsigned value Dividend by the 32-bit unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder is not NULL, then the 32-bit unsigned remainder is returned in Remainder. This function returns the 64-bit unsigned quotient. */
UINT64 EFIAPI InternalMathDivRemU64x32(IN UINT64 Dividend, IN UINT32 Divisor, OUT UINT32 *Remainder)
/* This function divides the 64-bit unsigned value Dividend by the 32-bit unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder is not NULL, then the 32-bit unsigned remainder is returned in Remainder. This function returns the 64-bit unsigned quotient. */
UINT64 EFIAPI InternalMathDivRemU64x32(IN UINT64 Dividend, IN UINT32 Divisor, OUT UINT32 *Remainder)
{
  _asm {
    mov     ecx, Divisor
    mov     eax, dword ptr [Dividend + 4]
    xor     edx, edx
    div     ecx
    push    eax
    mov     eax, dword ptr [Dividend + 0]
    div     ecx
    mov     ecx, Remainder
    jecxz   RemainderNull
    mov     [ecx], edx
RemainderNull:
    pop     edx
  }
}