// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]libcperciva/liball/../crypto/crypto_aes_aesni.c
// Function: crypto_aes_key_expand_aesni
void *
crypto_aes_key_expand_aesni(const uint8_t * key_unexpanded, size_t len)
{
	struct crypto_aes_key_aesni * kexp;

	/* Allocate structure. */
	if ((kexp = malloc(sizeof(struct crypto_aes_key_aesni))) == NULL)
		goto err0;

	/* Figure out where to put the round keys. */
	ALIGN_PTR_INIT(kexp->rkeys, sizeof(__m128i));

	/* Compute round keys. */
	if (len == 16) {
		kexp->nr = 10;
		crypto_aes_key_expand_128_aesni(key_unexpanded, kexp->rkeys);
	} else if (len == 32) {
		kexp->nr = 14;
		crypto_aes_key_expand_256_aesni(key_unexpanded, kexp->rkeys);
	} else {
		warn0("Unsupported AES key length: %zu bytes", len);
		goto err1;
	}

	/* Success! */
	return (kexp);

err1:
	free(kexp);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x110, %edi            # imm = 0x110
callq 0x20d0
testq %rax, %rax
je 0x3b1e
movq %rax, %rbx
negl %eax
andl $0xf, %eax
addq %rbx, %rax
movq %rax, 0x100(%rbx)
cmpq $0x20, %r14
je 0x386e
cmpq $0x10, %r14
jne 0x3afa
movq $0xa, 0x108(%rbx)
movdqu (%r15), %xmm0
movdqa %xmm0, (%rax)
movdqa %xmm0, %xmm1
pslldq $0x4, %xmm1             # xmm1 = zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm0, %xmm1
movdqa %xmm1, %xmm2
pslldq $0x8, %xmm2             # xmm2 = zero,zero,zero,zero,zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7]
aeskeygenassist $0x1, %xmm0, %xmm0
pshufd $0xff, %xmm0, %xmm0     # xmm0 = xmm0[3,3,3,3]
pxor %xmm1, %xmm2
pxor %xmm0, %xmm2
movdqa %xmm2, 0x10(%rax)
movdqa %xmm2, %xmm0
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm2, %xmm0
movdqa %xmm0, %xmm1
pslldq $0x8, %xmm1             # xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7]
aeskeygenassist $0x2, %xmm2, %xmm2
pshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
pxor %xmm0, %xmm1
pxor %xmm2, %xmm1
movdqa %xmm1, 0x20(%rax)
movdqa %xmm1, %xmm0
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm1, %xmm0
movdqa %xmm0, %xmm2
pslldq $0x8, %xmm2             # xmm2 = zero,zero,zero,zero,zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7]
aeskeygenassist $0x4, %xmm1, %xmm1
pshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
pxor %xmm0, %xmm2
pxor %xmm1, %xmm2
movdqa %xmm2, 0x30(%rax)
movdqa %xmm2, %xmm0
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm2, %xmm0
movdqa %xmm0, %xmm1
pslldq $0x8, %xmm1             # xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7]
aeskeygenassist $0x8, %xmm2, %xmm2
pshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
pxor %xmm0, %xmm1
pxor %xmm2, %xmm1
movdqa %xmm1, 0x40(%rax)
movdqa %xmm1, %xmm0
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm1, %xmm0
movdqa %xmm0, %xmm2
pslldq $0x8, %xmm2             # xmm2 = zero,zero,zero,zero,zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7]
aeskeygenassist $0x10, %xmm1, %xmm1
pshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
pxor %xmm0, %xmm2
pxor %xmm1, %xmm2
movdqa %xmm2, 0x50(%rax)
movdqa %xmm2, %xmm0
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm2, %xmm0
movdqa %xmm0, %xmm1
pslldq $0x8, %xmm1             # xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7]
aeskeygenassist $0x20, %xmm2, %xmm2
pshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
pxor %xmm0, %xmm1
pxor %xmm2, %xmm1
movdqa %xmm1, 0x60(%rax)
movdqa %xmm1, %xmm0
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm1, %xmm0
movdqa %xmm0, %xmm2
pslldq $0x8, %xmm2             # xmm2 = zero,zero,zero,zero,zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7]
aeskeygenassist $0x40, %xmm1, %xmm1
pshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
pxor %xmm0, %xmm2
pxor %xmm1, %xmm2
movdqa %xmm2, 0x70(%rax)
movdqa %xmm2, %xmm0
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm2, %xmm0
movdqa %xmm0, %xmm1
pslldq $0x8, %xmm1             # xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7]
aeskeygenassist $0x80, %xmm2, %xmm2
pshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
pxor %xmm0, %xmm1
pxor %xmm2, %xmm1
movdqa %xmm1, 0x80(%rax)
movdqa %xmm1, %xmm0
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm1, %xmm0
movdqa %xmm0, %xmm2
pslldq $0x8, %xmm2             # xmm2 = zero,zero,zero,zero,zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7]
aeskeygenassist $0x1b, %xmm1, %xmm1
pshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
pxor %xmm0, %xmm2
pxor %xmm1, %xmm2
movdqa %xmm2, 0x90(%rax)
movdqa %xmm2, %xmm0
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm2, %xmm0
movdqa %xmm0, %xmm1
pslldq $0x8, %xmm1             # xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7]
aeskeygenassist $0x36, %xmm2, %xmm2
pshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
pxor %xmm0, %xmm1
pxor %xmm2, %xmm1
movdqa %xmm1, 0xa0(%rax)
jmp 0x3b20
movq $0xe, 0x108(%rbx)
movdqu (%r15), %xmm0
movdqa %xmm0, (%rax)
movdqu 0x10(%r15), %xmm1
movdqa %xmm1, 0x10(%rax)
movdqa %xmm0, %xmm2
pslldq $0x4, %xmm2             # xmm2 = zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm0, %xmm2
movdqa %xmm2, %xmm0
pslldq $0x8, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
aeskeygenassist $0x1, %xmm1, %xmm3
pshufd $0xff, %xmm3, %xmm3     # xmm3 = xmm3[3,3,3,3]
pxor %xmm2, %xmm0
pxor %xmm3, %xmm0
movdqa %xmm0, 0x20(%rax)
movdqa %xmm1, %xmm2
pslldq $0x4, %xmm2             # xmm2 = zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm1, %xmm2
movdqa %xmm2, %xmm1
pslldq $0x8, %xmm1             # xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7]
aeskeygenassist $0x0, %xmm0, %xmm3
pshufd $0xaa, %xmm3, %xmm3     # xmm3 = xmm3[2,2,2,2]
pxor %xmm2, %xmm1
pxor %xmm3, %xmm1
movdqa %xmm1, 0x30(%rax)
movdqa %xmm0, %xmm2
pslldq $0x4, %xmm2             # xmm2 = zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm0, %xmm2
movdqa %xmm2, %xmm0
pslldq $0x8, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
aeskeygenassist $0x2, %xmm1, %xmm3
pshufd $0xff, %xmm3, %xmm3     # xmm3 = xmm3[3,3,3,3]
pxor %xmm2, %xmm0
pxor %xmm3, %xmm0
movdqa %xmm0, 0x40(%rax)
movdqa %xmm1, %xmm2
pslldq $0x4, %xmm2             # xmm2 = zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm1, %xmm2
movdqa %xmm2, %xmm1
pslldq $0x8, %xmm1             # xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7]
aeskeygenassist $0x0, %xmm0, %xmm3
pshufd $0xaa, %xmm3, %xmm3     # xmm3 = xmm3[2,2,2,2]
pxor %xmm2, %xmm1
pxor %xmm3, %xmm1
movdqa %xmm1, 0x50(%rax)
movdqa %xmm0, %xmm2
pslldq $0x4, %xmm2             # xmm2 = zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm0, %xmm2
movdqa %xmm2, %xmm0
pslldq $0x8, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
aeskeygenassist $0x4, %xmm1, %xmm3
pshufd $0xff, %xmm3, %xmm3     # xmm3 = xmm3[3,3,3,3]
pxor %xmm2, %xmm0
pxor %xmm3, %xmm0
movdqa %xmm0, 0x60(%rax)
movdqa %xmm1, %xmm2
pslldq $0x4, %xmm2             # xmm2 = zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm1, %xmm2
movdqa %xmm2, %xmm1
pslldq $0x8, %xmm1             # xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7]
aeskeygenassist $0x0, %xmm0, %xmm3
pshufd $0xaa, %xmm3, %xmm3     # xmm3 = xmm3[2,2,2,2]
pxor %xmm2, %xmm1
pxor %xmm3, %xmm1
movdqa %xmm1, 0x70(%rax)
movdqa %xmm0, %xmm2
pslldq $0x4, %xmm2             # xmm2 = zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm0, %xmm2
movdqa %xmm2, %xmm0
pslldq $0x8, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
aeskeygenassist $0x8, %xmm1, %xmm3
pshufd $0xff, %xmm3, %xmm3     # xmm3 = xmm3[3,3,3,3]
pxor %xmm2, %xmm0
pxor %xmm3, %xmm0
movdqa %xmm0, 0x80(%rax)
movdqa %xmm1, %xmm2
pslldq $0x4, %xmm2             # xmm2 = zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm1, %xmm2
movdqa %xmm2, %xmm1
pslldq $0x8, %xmm1             # xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7]
aeskeygenassist $0x0, %xmm0, %xmm3
pshufd $0xaa, %xmm3, %xmm3     # xmm3 = xmm3[2,2,2,2]
pxor %xmm2, %xmm1
pxor %xmm3, %xmm1
movdqa %xmm1, 0x90(%rax)
movdqa %xmm0, %xmm2
pslldq $0x4, %xmm2             # xmm2 = zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm0, %xmm2
movdqa %xmm2, %xmm0
pslldq $0x8, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
aeskeygenassist $0x10, %xmm1, %xmm3
pshufd $0xff, %xmm3, %xmm3     # xmm3 = xmm3[3,3,3,3]
pxor %xmm2, %xmm0
pxor %xmm3, %xmm0
movdqa %xmm0, 0xa0(%rax)
movdqa %xmm1, %xmm2
pslldq $0x4, %xmm2             # xmm2 = zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm1, %xmm2
movdqa %xmm2, %xmm1
pslldq $0x8, %xmm1             # xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7]
aeskeygenassist $0x0, %xmm0, %xmm3
pshufd $0xaa, %xmm3, %xmm3     # xmm3 = xmm3[2,2,2,2]
pxor %xmm2, %xmm1
pxor %xmm3, %xmm1
movdqa %xmm1, 0xb0(%rax)
movdqa %xmm0, %xmm2
pslldq $0x4, %xmm2             # xmm2 = zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm0, %xmm2
movdqa %xmm2, %xmm0
pslldq $0x8, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
aeskeygenassist $0x20, %xmm1, %xmm3
pshufd $0xff, %xmm3, %xmm3     # xmm3 = xmm3[3,3,3,3]
pxor %xmm2, %xmm0
pxor %xmm3, %xmm0
movdqa %xmm0, 0xc0(%rax)
movdqa %xmm1, %xmm2
pslldq $0x4, %xmm2             # xmm2 = zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm1, %xmm2
movdqa %xmm2, %xmm1
pslldq $0x8, %xmm1             # xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7]
aeskeygenassist $0x0, %xmm0, %xmm3
pshufd $0xaa, %xmm3, %xmm3     # xmm3 = xmm3[2,2,2,2]
pxor %xmm2, %xmm1
pxor %xmm3, %xmm1
movdqa %xmm1, 0xd0(%rax)
movdqa %xmm0, %xmm2
pslldq $0x4, %xmm2             # xmm2 = zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11]
pxor %xmm0, %xmm2
movdqa %xmm2, %xmm0
pslldq $0x8, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
aeskeygenassist $0x40, %xmm1, %xmm1
pshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
pxor %xmm2, %xmm0
pxor %xmm1, %xmm0
movdqa %xmm0, 0xe0(%rax)
jmp 0x3b20
leaq 0x2d3e(%rip), %rdi      # 0x683f
movq %r14, %rsi
xorl %eax, %eax
callq 0x4e37
callq 0x21c0
movl $0x0, (%rax)
movq %rbx, %rdi
callq 0x2130
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq