// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/aes128poetv1aes4/ni/aes-ni.c
// Function: AESNI_encrypt
void AESNI_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY enc_key)
{
    __m128i tmp;

    tmp = _mm_loadu_si128 ((__m128i*)in);

    tmp = _mm_xor_si128 (tmp,enc_key[0]);
    tmp = _mm_aesenc_si128 (tmp, enc_key[1]);
    tmp = _mm_aesenc_si128 (tmp, enc_key[2]);
    tmp = _mm_aesenc_si128 (tmp, enc_key[3]);
    tmp = _mm_aesenc_si128 (tmp, enc_key[4]);
    tmp = _mm_aesenc_si128 (tmp, enc_key[5]);
    tmp = _mm_aesenc_si128 (tmp, enc_key[6]);
    tmp = _mm_aesenc_si128 (tmp, enc_key[7]);
    tmp = _mm_aesenc_si128 (tmp, enc_key[8]);
    tmp = _mm_aesenc_si128 (tmp, enc_key[9]);
    tmp = _mm_aesenclast_si128 (tmp, enc_key[10]);

   _mm_storeu_si128 ((__m128i*)out,tmp);
}

// Assembly:
subq $0x138, %rsp            # imm = 0x138
movq %rdi, -0x60(%rsp)
movq %rsi, -0x68(%rsp)
movq %rdx, -0x70(%rsp)
movq -0x60(%rsp), %rax
movq %rax, -0x58(%rsp)
movq -0x58(%rsp), %rax
vmovdqu (%rax), %xmm0
vmovdqa %xmm0, -0x80(%rsp)
vmovdqa -0x80(%rsp), %xmm1
movq -0x70(%rsp), %rax
vmovdqa (%rax), %xmm0
vmovdqa %xmm1, -0x20(%rsp)
vmovdqa %xmm0, -0x30(%rsp)
vmovdqa -0x20(%rsp), %xmm0
vpxor -0x30(%rsp), %xmm0, %xmm0
vmovdqa %xmm0, -0x80(%rsp)
vmovdqa -0x80(%rsp), %xmm1
movq -0x70(%rsp), %rax
vmovdqa 0x10(%rax), %xmm0
vmovdqa %xmm1, 0x100(%rsp)
vmovdqa %xmm0, 0xf0(%rsp)
vmovdqa 0x100(%rsp), %xmm0
vmovdqa 0xf0(%rsp), %xmm1
vaesenc %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x80(%rsp)
vmovdqa -0x80(%rsp), %xmm1
movq -0x70(%rsp), %rax
vmovdqa 0x20(%rax), %xmm0
vmovdqa %xmm1, 0xe0(%rsp)
vmovdqa %xmm0, 0xd0(%rsp)
vmovdqa 0xe0(%rsp), %xmm0
vmovdqa 0xd0(%rsp), %xmm1
vaesenc %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x80(%rsp)
vmovdqa -0x80(%rsp), %xmm1
movq -0x70(%rsp), %rax
vmovdqa 0x30(%rax), %xmm0
vmovdqa %xmm1, 0xc0(%rsp)
vmovdqa %xmm0, 0xb0(%rsp)
vmovdqa 0xc0(%rsp), %xmm0
vmovdqa 0xb0(%rsp), %xmm1
vaesenc %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x80(%rsp)
vmovdqa -0x80(%rsp), %xmm1
movq -0x70(%rsp), %rax
vmovdqa 0x40(%rax), %xmm0
vmovdqa %xmm1, 0xa0(%rsp)
vmovdqa %xmm0, 0x90(%rsp)
vmovdqa 0xa0(%rsp), %xmm0
vmovdqa 0x90(%rsp), %xmm1
vaesenc %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x80(%rsp)
vmovdqa -0x80(%rsp), %xmm1
movq -0x70(%rsp), %rax
vmovdqa 0x50(%rax), %xmm0
vmovdqa %xmm1, 0x80(%rsp)
vmovdqa %xmm0, 0x70(%rsp)
vmovdqa 0x80(%rsp), %xmm0
vmovdqa 0x70(%rsp), %xmm1
vaesenc %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x80(%rsp)
vmovdqa -0x80(%rsp), %xmm1
movq -0x70(%rsp), %rax
vmovdqa 0x60(%rax), %xmm0
vmovdqa %xmm1, 0x60(%rsp)
vmovdqa %xmm0, 0x50(%rsp)
vmovdqa 0x60(%rsp), %xmm0
vmovdqa 0x50(%rsp), %xmm1
vaesenc %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x80(%rsp)
vmovdqa -0x80(%rsp), %xmm1
movq -0x70(%rsp), %rax
vmovdqa 0x70(%rax), %xmm0
vmovdqa %xmm1, 0x40(%rsp)
vmovdqa %xmm0, 0x30(%rsp)
vmovdqa 0x40(%rsp), %xmm0
vmovdqa 0x30(%rsp), %xmm1
vaesenc %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x80(%rsp)
vmovdqa -0x80(%rsp), %xmm1
movq -0x70(%rsp), %rax
vmovdqa 0x80(%rax), %xmm0
vmovdqa %xmm1, 0x20(%rsp)
vmovdqa %xmm0, 0x10(%rsp)
vmovdqa 0x20(%rsp), %xmm0
vmovdqa 0x10(%rsp), %xmm1
vaesenc %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x80(%rsp)
vmovdqa -0x80(%rsp), %xmm1
movq -0x70(%rsp), %rax
vmovdqa 0x90(%rax), %xmm0
vmovdqa %xmm1, (%rsp)
vmovdqa %xmm0, -0x10(%rsp)
vmovdqa (%rsp), %xmm0
vmovdqa -0x10(%rsp), %xmm1
vaesenc %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x80(%rsp)
vmovdqa -0x80(%rsp), %xmm1
movq -0x70(%rsp), %rax
vmovdqa 0xa0(%rax), %xmm0
vmovdqa %xmm1, 0x120(%rsp)
vmovdqa %xmm0, 0x110(%rsp)
vmovdqa 0x120(%rsp), %xmm0
vmovdqa 0x110(%rsp), %xmm1
vaesenclast %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x80(%rsp)
movq -0x68(%rsp), %rax
vmovdqa -0x80(%rsp), %xmm0
movq %rax, -0x38(%rsp)
vmovdqa %xmm0, -0x50(%rsp)
vmovdqa -0x50(%rsp), %xmm0
movq -0x38(%rsp), %rax
vmovdqu %xmm0, (%rax)
addq $0x138, %rsp            # imm = 0x138
retq