// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/aes128poetv1aes4/ni/aes-ni.c
// Function: AESNI_Key_Expansion
void AESNI_Key_Expansion(const unsigned char *userkey, AES_KEY enc_key)
{
    __m128i temp1, temp2;
    __m128i *Key_Schedule = (__m128i*)enc_key;

    temp1 = _mm_loadu_si128((__m128i*)userkey);
    _mm_storeu_si128(&Key_Schedule[0], temp1);
    temp2= _mm_aeskeygenassist_si128 (temp1 ,0x1);
    temp1 = AES_128_ASSIST(temp1, temp2);
    _mm_storeu_si128(&Key_Schedule[1], temp1);
    temp2 = _mm_aeskeygenassist_si128 (temp1,0x2);
    temp1 = AES_128_ASSIST(temp1, temp2);
    _mm_storeu_si128(&Key_Schedule[2], temp1);
    temp2 = _mm_aeskeygenassist_si128 (temp1,0x4);
    temp1 = AES_128_ASSIST(temp1, temp2);
    _mm_storeu_si128(&Key_Schedule[3], temp1);
    temp2 = _mm_aeskeygenassist_si128 (temp1,0x8);
    temp1 = AES_128_ASSIST(temp1, temp2);
    _mm_storeu_si128(&Key_Schedule[4], temp1);
    temp2 = _mm_aeskeygenassist_si128 (temp1,0x10);
    temp1 = AES_128_ASSIST(temp1, temp2);
    _mm_storeu_si128(&Key_Schedule[5], temp1);
    temp2 = _mm_aeskeygenassist_si128 (temp1,0x20);
    temp1 = AES_128_ASSIST(temp1, temp2);
    _mm_storeu_si128(&Key_Schedule[6], temp1);
    temp2 = _mm_aeskeygenassist_si128 (temp1,0x40);
    temp1 = AES_128_ASSIST(temp1, temp2);
    _mm_storeu_si128(&Key_Schedule[7], temp1);
    temp2 = _mm_aeskeygenassist_si128 (temp1,0x80);
    temp1 = AES_128_ASSIST(temp1, temp2);
    _mm_storeu_si128(&Key_Schedule[8], temp1);
    temp2 = _mm_aeskeygenassist_si128 (temp1,0x1b);
    temp1 = AES_128_ASSIST(temp1, temp2);
    _mm_storeu_si128(&Key_Schedule[9], temp1);
    temp2 = _mm_aeskeygenassist_si128 (temp1,0x36);
    temp1 = AES_128_ASSIST(temp1, temp2);
    _mm_storeu_si128(&Key_Schedule[10], temp1);
}

// Assembly:
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
vmovdqu (%rax), %xmm0
vmovdqa %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rax
vmovdqa 0x20(%rsp), %xmm0
movq %rax, 0x1a0(%rsp)
vmovdqa %xmm0, 0x190(%rsp)
vmovdqa 0x190(%rsp), %xmm0
movq 0x1a0(%rsp), %rax
vmovdqu %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x1, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0x1810
vmovdqa %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rax
addq $0x10, %rax
vmovdqa 0x20(%rsp), %xmm0
movq %rax, 0x188(%rsp)
vmovdqa %xmm0, 0x170(%rsp)
vmovdqa 0x170(%rsp), %xmm0
movq 0x188(%rsp), %rax
vmovdqu %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x2, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0x1810
vmovdqa %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rax
addq $0x20, %rax
vmovdqa 0x20(%rsp), %xmm0
movq %rax, 0x168(%rsp)
vmovdqa %xmm0, 0x150(%rsp)
vmovdqa 0x150(%rsp), %xmm0
movq 0x168(%rsp), %rax
vmovdqu %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x4, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0x1810
vmovdqa %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rax
addq $0x30, %rax
vmovdqa 0x20(%rsp), %xmm0
movq %rax, 0x148(%rsp)
vmovdqa %xmm0, 0x130(%rsp)
vmovdqa 0x130(%rsp), %xmm0
movq 0x148(%rsp), %rax
vmovdqu %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x8, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0x1810
vmovdqa %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rax
addq $0x40, %rax
vmovdqa 0x20(%rsp), %xmm0
movq %rax, 0x128(%rsp)
vmovdqa %xmm0, 0x110(%rsp)
vmovdqa 0x110(%rsp), %xmm0
movq 0x128(%rsp), %rax
vmovdqu %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x10, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0x1810
vmovdqa %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rax
addq $0x50, %rax
vmovdqa 0x20(%rsp), %xmm0
movq %rax, 0x108(%rsp)
vmovdqa %xmm0, 0xf0(%rsp)
vmovdqa 0xf0(%rsp), %xmm0
movq 0x108(%rsp), %rax
vmovdqu %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x20, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0x1810
vmovdqa %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rax
addq $0x60, %rax
vmovdqa 0x20(%rsp), %xmm0
movq %rax, 0xe8(%rsp)
vmovdqa %xmm0, 0xd0(%rsp)
vmovdqa 0xd0(%rsp), %xmm0
movq 0xe8(%rsp), %rax
vmovdqu %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x40, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0x1810
vmovdqa %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rax
addq $0x70, %rax
vmovdqa 0x20(%rsp), %xmm0
movq %rax, 0xc8(%rsp)
vmovdqa %xmm0, 0xb0(%rsp)
vmovdqa 0xb0(%rsp), %xmm0
movq 0xc8(%rsp), %rax
vmovdqu %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x80, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0x1810
vmovdqa %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rax
addq $0x80, %rax
vmovdqa 0x20(%rsp), %xmm0
movq %rax, 0xa8(%rsp)
vmovdqa %xmm0, 0x90(%rsp)
vmovdqa 0x90(%rsp), %xmm0
movq 0xa8(%rsp), %rax
vmovdqu %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x1b, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0x1810
vmovdqa %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rax
addq $0x90, %rax
vmovdqa 0x20(%rsp), %xmm0
movq %rax, 0x88(%rsp)
vmovdqa %xmm0, 0x70(%rsp)
vmovdqa 0x70(%rsp), %xmm0
movq 0x88(%rsp), %rax
vmovdqu %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x36, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0x1810
vmovdqa %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rax
addq $0xa0, %rax
vmovdqa 0x20(%rsp), %xmm0
movq %rax, 0x68(%rsp)
vmovdqa %xmm0, 0x50(%rsp)
vmovdqa 0x50(%rsp), %xmm0
movq 0x68(%rsp), %rax
vmovdqu %xmm0, (%rax)
addq $0x1a8, %rsp            # imm = 0x1A8
retq
nopl (%rax)