// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/aes128poetv2aes128ni/ref/poet.c
// Function: aes_expand_key
static void aes_expand_key(__m128i userkey, AES_KEY enc_key)
{
    __m128i temp1, temp2;
    __m128i *key = (__m128i*)enc_key;

    _mm_store_si128(&temp1, userkey);
    _mm_store_si128(&key[0], temp1);

    aes_create_round_key(temp1, temp2, 0x01, &key[1]);
    aes_create_round_key(temp1, temp2, 0x02, &key[2]);
    aes_create_round_key(temp1, temp2, 0x04, &key[3]);
    aes_create_round_key(temp1, temp2, 0x08, &key[4]);
    aes_create_round_key(temp1, temp2, 0x10, &key[5]);
    aes_create_round_key(temp1, temp2, 0x20, &key[6]);
    aes_create_round_key(temp1, temp2, 0x40, &key[7]);
    aes_create_round_key(temp1, temp2, 0x80, &key[8]);
    aes_create_round_key(temp1, temp2, 0x1b, &key[9]);
    aes_create_round_key(temp1, temp2, 0x36, &key[10]);
}

// Assembly:
subq $0x1c8, %rsp            # imm = 0x1C8
vmovdqa %xmm0, 0x40(%rsp)
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
vmovdqa 0x40(%rsp), %xmm0
leaq 0x20(%rsp), %rax
movq %rax, 0x1c0(%rsp)
vmovdqa %xmm0, 0x1b0(%rsp)
vmovdqa 0x1b0(%rsp), %xmm0
movq 0x1c0(%rsp), %rax
vmovdqa %xmm0, (%rax)
movq 0x8(%rsp), %rax
vmovdqa 0x20(%rsp), %xmm0
movq %rax, 0x1a8(%rsp)
vmovdqa %xmm0, 0x190(%rsp)
vmovdqa 0x190(%rsp), %xmm0
movq 0x1a8(%rsp), %rax
vmovdqa %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x1, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0xbd60
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
vmovdqa %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x2, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0xbd60
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
vmovdqa %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x4, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0xbd60
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
vmovdqa %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x8, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0xbd60
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
vmovdqa %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x10, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0xbd60
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
vmovdqa %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x20, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0xbd60
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
vmovdqa %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x40, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0xbd60
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
vmovdqa %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x80, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0xbd60
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
vmovdqa %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x1b, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0xbd60
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
vmovdqa %xmm0, (%rax)
vmovdqa 0x20(%rsp), %xmm0
vaeskeygenassist $0x36, %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
callq 0xbd60
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
vmovdqa %xmm0, (%rax)
addq $0x1c8, %rsp            # imm = 0x1C8
retq
nopw %cs:(%rax,%rax)