// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/aes128n12t8clocv2/aesni/aes.h
// Function: AES128_KeyExpansion
void AES128_KeyExpansion(const unsigned char *userkey)
{
	__m128i x0,x1,x2;
	roundkeys[0] = x0 = LOAD(userkey);
	x2 = _mm_setzero_si128();
	EXPAND_ASSIST(x0, x1, x2, x0,   1);    roundkeys[1]  = x0;
	EXPAND_ASSIST(x0, x1, x2, x0,   2);    roundkeys[2]  = x0;
	EXPAND_ASSIST(x0, x1, x2, x0,   4);    roundkeys[3]  = x0;
	EXPAND_ASSIST(x0, x1, x2, x0,   8);    roundkeys[4]  = x0;
	EXPAND_ASSIST(x0, x1, x2, x0,  16);    roundkeys[5]  = x0;
	EXPAND_ASSIST(x0, x1, x2, x0,  32);    roundkeys[6]  = x0;
	EXPAND_ASSIST(x0, x1, x2, x0,  64);    roundkeys[7]  = x0;
	EXPAND_ASSIST(x0, x1, x2, x0, 128);    roundkeys[8]  = x0;
	EXPAND_ASSIST(x0, x1, x2, x0,  27);    roundkeys[9]  = x0;
	EXPAND_ASSIST(x0, x1, x2, x0,  54);    roundkeys[10] = x0;
}

// Assembly:
vmovdqa (%rdi), %xmm1
vaeskeygenassist $0x1, %xmm1, %xmm2
movq 0x3e73(%rip), %rax      # 0x4ff0
vxorps %xmm0, %xmm0, %xmm0
vshufps $0x10, %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm1[1,0]
vxorps %xmm3, %xmm1, %xmm4
vshufps $0x8c, %xmm4, %xmm3, %xmm3 # xmm3 = xmm3[0,3],xmm4[0,2]
vpshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
vpternlogq $0x96, %xmm3, %xmm4, %xmm2
vaeskeygenassist $0x2, %xmm2, %xmm3
vmovdqa %xmm1, (%rax)
vshufps $0x10, %xmm2, %xmm0, %xmm1 # xmm1 = xmm0[0,0],xmm2[1,0]
vxorps %xmm1, %xmm2, %xmm4
vshufps $0x8c, %xmm4, %xmm1, %xmm1 # xmm1 = xmm1[0,3],xmm4[0,2]
vpshufd $0xff, %xmm3, %xmm3     # xmm3 = xmm3[3,3,3,3]
vpternlogq $0x96, %xmm1, %xmm4, %xmm3
vaeskeygenassist $0x4, %xmm3, %xmm1
vmovdqa %xmm2, 0x10(%rax)
vshufps $0x10, %xmm3, %xmm0, %xmm2 # xmm2 = xmm0[0,0],xmm3[1,0]
vxorps %xmm2, %xmm3, %xmm4
vshufps $0x8c, %xmm4, %xmm2, %xmm2 # xmm2 = xmm2[0,3],xmm4[0,2]
vpshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
vpternlogq $0x96, %xmm2, %xmm4, %xmm1
vaeskeygenassist $0x8, %xmm1, %xmm2
vmovdqa %xmm3, 0x20(%rax)
vshufps $0x10, %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm1[1,0]
vxorps %xmm3, %xmm1, %xmm4
vshufps $0x8c, %xmm4, %xmm3, %xmm3 # xmm3 = xmm3[0,3],xmm4[0,2]
vpshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
vpternlogq $0x96, %xmm3, %xmm4, %xmm2
vaeskeygenassist $0x10, %xmm2, %xmm3
vmovdqa %xmm1, 0x30(%rax)
vshufps $0x10, %xmm2, %xmm0, %xmm1 # xmm1 = xmm0[0,0],xmm2[1,0]
vxorps %xmm1, %xmm2, %xmm4
vshufps $0x8c, %xmm4, %xmm1, %xmm1 # xmm1 = xmm1[0,3],xmm4[0,2]
vpshufd $0xff, %xmm3, %xmm3     # xmm3 = xmm3[3,3,3,3]
vpternlogq $0x96, %xmm1, %xmm4, %xmm3
vaeskeygenassist $0x20, %xmm3, %xmm1
vmovdqa %xmm2, 0x40(%rax)
vshufps $0x10, %xmm3, %xmm0, %xmm2 # xmm2 = xmm0[0,0],xmm3[1,0]
vxorps %xmm2, %xmm3, %xmm4
vshufps $0x8c, %xmm4, %xmm2, %xmm2 # xmm2 = xmm2[0,3],xmm4[0,2]
vpshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
vpternlogq $0x96, %xmm2, %xmm4, %xmm1
vaeskeygenassist $0x40, %xmm1, %xmm2
vmovdqa %xmm3, 0x50(%rax)
vshufps $0x10, %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm1[1,0]
vxorps %xmm3, %xmm1, %xmm4
vshufps $0x8c, %xmm4, %xmm3, %xmm3 # xmm3 = xmm3[0,3],xmm4[0,2]
vpshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
vpternlogq $0x96, %xmm3, %xmm4, %xmm2
vaeskeygenassist $0x80, %xmm2, %xmm3
vmovdqa %xmm1, 0x60(%rax)
vshufps $0x10, %xmm2, %xmm0, %xmm1 # xmm1 = xmm0[0,0],xmm2[1,0]
vxorps %xmm1, %xmm2, %xmm4
vshufps $0x8c, %xmm4, %xmm1, %xmm1 # xmm1 = xmm1[0,3],xmm4[0,2]
vpshufd $0xff, %xmm3, %xmm3     # xmm3 = xmm3[3,3,3,3]
vpternlogq $0x96, %xmm1, %xmm4, %xmm3
vaeskeygenassist $0x1b, %xmm3, %xmm1
vmovdqa %xmm2, 0x70(%rax)
vshufps $0x10, %xmm3, %xmm0, %xmm2 # xmm2 = xmm0[0,0],xmm3[1,0]
vxorps %xmm2, %xmm3, %xmm4
vshufps $0x8c, %xmm4, %xmm2, %xmm2 # xmm2 = xmm2[0,3],xmm4[0,2]
vpshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
vpternlogq $0x96, %xmm2, %xmm4, %xmm1
vaeskeygenassist $0x36, %xmm1, %xmm2
vmovdqa %xmm3, 0x80(%rax)
vmovdqa %xmm1, 0x90(%rax)
vshufps $0x10, %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[0,0],xmm1[1,0]
vxorps %xmm0, %xmm1, %xmm1
vshufps $0x8c, %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[0,3],xmm1[0,2]
vpshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
vpternlogq $0x96, %xmm0, %xmm1, %xmm2
vmovdqa %xmm2, 0xa0(%rax)
retq