// File: xocoder[P]m_kcptun/vendor/m_foundation/src/crypto/m_rc4.c
// Function: hmac(unsigned long, unsigned long)
static uint64_t
hmac(uint64_t x, uint64_t y) {
// Constants are the integer part of the sines of integers (in radians) * 2^32.
   static const uint32_t k[64] = {
      0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee ,
      0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501 ,
      0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be ,
      0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821 ,
      0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa ,
      0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8 ,
      0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed ,
      0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a ,
      0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c ,
      0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70 ,
      0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05 ,
      0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665 ,
      0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039 ,
      0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1 ,
      0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1 ,
      0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 };
 
// r specifies the per-round shift amounts
   static const uint32_t r[] = {7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
                                5,  9, 14, 20, 5,  9, 14, 20, 5,  9, 14, 20, 5,  9, 14, 20,
                                4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23,
                                6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21};
 
   uint32_t w[16];
   uint32_t a, b, c, d, f, g, temp;
   int i;
 
   a = 0x67452301u;
   b = 0xefcdab89u;
   c = 0x98badcfeu;
   d = 0x10325476u;

   for (i=0;i<16;i+=4) {
      w[i] = (uint32_t)(x << 32);
      w[i+1] = (uint32_t)x;
      w[i+2] = (uint32_t)(y << 32);
      w[i+3] = (uint32_t)y;
   }

   for(i = 0; i<64; i++) {
      if (i < 16) {
         f = (b & c) | ((~b) & d);
         g = i;
      } else if (i < 32) {
         f = (d & b) | ((~d) & c);
         g = (5*i + 1) % 16;
      } else if (i < 48) {
         f = b ^ c ^ d;
         g = (3*i + 5) % 16; 
      } else {
         f = c ^ (b | (~d));
         g = (7*i) % 16;
      }

      temp = d;
      d = c;
      c = b;
      b = b + LEFTROTATE((a + f + k[i] + w[g]), r[i]);
      a = temp;

   }

   return (uint64_t)(a^b) << 32 | (c^d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x67452301, -0x54(%rbp) # imm = 0x67452301
movl $0xefcdab89, -0x58(%rbp) # imm = 0xEFCDAB89
movl $0x98badcfe, -0x5c(%rbp) # imm = 0x98BADCFE
movl $0x10325476, -0x60(%rbp) # imm = 0x10325476
movl $0x0, -0x70(%rbp)
cmpl $0x10, -0x70(%rbp)
jge 0x932c
movq -0x8(%rbp), %rax
shlq $0x20, %rax
movl %eax, %ecx
movslq -0x70(%rbp), %rax
movl %ecx, -0x50(%rbp,%rax,4)
movq -0x8(%rbp), %rax
movl %eax, %ecx
movl -0x70(%rbp), %eax
addl $0x1, %eax
cltq
movl %ecx, -0x50(%rbp,%rax,4)
movq -0x10(%rbp), %rax
shlq $0x20, %rax
movl %eax, %ecx
movl -0x70(%rbp), %eax
addl $0x2, %eax
cltq
movl %ecx, -0x50(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl %eax, %ecx
movl -0x70(%rbp), %eax
addl $0x3, %eax
cltq
movl %ecx, -0x50(%rbp,%rax,4)
movl -0x70(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x70(%rbp)
jmp 0x92cf
movl $0x0, -0x70(%rbp)
cmpl $0x40, -0x70(%rbp)
jge 0x946a
cmpl $0x10, -0x70(%rbp)
jge 0x935f
movl -0x58(%rbp), %eax
andl -0x5c(%rbp), %eax
movl -0x58(%rbp), %ecx
xorl $-0x1, %ecx
andl -0x60(%rbp), %ecx
orl %ecx, %eax
movl %eax, -0x64(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x68(%rbp)
jmp 0x93d9
cmpl $0x20, -0x70(%rbp)
jge 0x938d
movl -0x60(%rbp), %eax
andl -0x58(%rbp), %eax
movl -0x60(%rbp), %ecx
xorl $-0x1, %ecx
andl -0x5c(%rbp), %ecx
orl %ecx, %eax
movl %eax, -0x64(%rbp)
imull $0x5, -0x70(%rbp), %eax
addl $0x1, %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %edx, -0x68(%rbp)
jmp 0x93d7
cmpl $0x30, -0x70(%rbp)
jge 0x93b3
movl -0x58(%rbp), %eax
xorl -0x5c(%rbp), %eax
xorl -0x60(%rbp), %eax
movl %eax, -0x64(%rbp)
imull $0x3, -0x70(%rbp), %eax
addl $0x5, %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %edx, -0x68(%rbp)
jmp 0x93d5
movl -0x5c(%rbp), %eax
movl -0x58(%rbp), %ecx
movl -0x60(%rbp), %edx
xorl $-0x1, %edx
orl %edx, %ecx
xorl %ecx, %eax
movl %eax, -0x64(%rbp)
imull $0x7, -0x70(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %edx, -0x68(%rbp)
jmp 0x93d7
jmp 0x93d9
movl -0x60(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x58(%rbp), %eax
movl -0x54(%rbp), %edx
addl -0x64(%rbp), %edx
movslq -0x70(%rbp), %rsi
leaq 0xa1d1(%rip), %rcx      # 0x135d0
addl (%rcx,%rsi,4), %edx
movl -0x68(%rbp), %ecx
addl -0x50(%rbp,%rcx,4), %edx
movslq -0x70(%rbp), %rsi
leaq 0xa2bc(%rip), %rcx      # 0x136d0
movl (%rcx,%rsi,4), %ecx
shll %cl, %edx
movl %edx, -0x74(%rbp)
movl -0x54(%rbp), %edx
addl -0x64(%rbp), %edx
movslq -0x70(%rbp), %rsi
leaq 0xa1a3(%rip), %rcx      # 0x135d0
addl (%rcx,%rsi,4), %edx
movl -0x68(%rbp), %ecx
addl -0x50(%rbp,%rcx,4), %edx
movslq -0x70(%rbp), %rdi
movl $0x20, %ecx
leaq 0xa289(%rip), %rsi      # 0x136d0
subl (%rsi,%rdi,4), %ecx
shrl %cl, %edx
movl -0x74(%rbp), %ecx
orl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x58(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x9333
movl -0x54(%rbp), %eax
xorl -0x58(%rbp), %eax
movl %eax, %eax
shlq $0x20, %rax
movl -0x5c(%rbp), %ecx
xorl -0x60(%rbp), %ecx
movl %ecx, %ecx
orq %rcx, %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)