// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/aescopav2/ref/aes-core.c
// Function: aes_subbyte_shiftrows_mixcols
void aes_subbyte_shiftrows_mixcols(uint8_t state[])
{
	uint8_t tmp[16];
	
	block_copy(tmp, state);
	
	state[0] = xtime2_sbox(tmp[0]) ^ xtime3_sbox(tmp[5]) ^ sbox(tmp[10]) ^ sbox(tmp[15]);
	state[1] = sbox(tmp[0]) ^ xtime2_sbox(tmp[5]) ^ xtime3_sbox(tmp[10]) ^ sbox(tmp[15]);
	state[2] = sbox(tmp[0]) ^ sbox(tmp[5]) ^ xtime2_sbox(tmp[10]) ^ xtime3_sbox(tmp[15]);
	state[3] = xtime3_sbox(tmp[0]) ^ sbox(tmp[5]) ^ sbox(tmp[10]) ^ xtime2_sbox(tmp[15]);
	
	state[4] = xtime2_sbox(tmp[4]) ^ xtime3_sbox(tmp[9]) ^ sbox(tmp[14]) ^ sbox(tmp[3]);
	state[5] = sbox(tmp[4]) ^ xtime2_sbox(tmp[9]) ^ xtime3_sbox(tmp[14]) ^ sbox(tmp[3]);
	state[6] = sbox(tmp[4]) ^ sbox(tmp[9]) ^ xtime2_sbox(tmp[14]) ^ xtime3_sbox(tmp[3]);
	state[7] = xtime3_sbox(tmp[4]) ^ sbox(tmp[9]) ^ sbox(tmp[14]) ^ xtime2_sbox(tmp[3]);
	
	state[8] = xtime2_sbox(tmp[8]) ^ xtime3_sbox(tmp[13]) ^ sbox(tmp[2]) ^ sbox(tmp[7]);
	state[9] = sbox(tmp[8]) ^ xtime2_sbox(tmp[13]) ^ xtime3_sbox(tmp[2]) ^ sbox(tmp[7]);
	state[10] = sbox(tmp[8]) ^ sbox(tmp[13]) ^ xtime2_sbox(tmp[2]) ^ xtime3_sbox(tmp[7]);
	state[11] = xtime3_sbox(tmp[8]) ^ sbox(tmp[13]) ^ sbox(tmp[2]) ^ xtime2_sbox(tmp[7]);
	
	state[12] = xtime2_sbox(tmp[12]) ^ xtime3_sbox(tmp[1]) ^ sbox(tmp[6]) ^ sbox(tmp[11]);
	state[13] = sbox(tmp[12]) ^ xtime2_sbox(tmp[1]) ^ xtime3_sbox(tmp[6]) ^ sbox(tmp[11]);
	state[14] = sbox(tmp[12]) ^ sbox(tmp[1]) ^ xtime2_sbox(tmp[6]) ^ xtime3_sbox(tmp[11]);
	state[15] = xtime3_sbox(tmp[12]) ^ sbox(tmp[1]) ^ sbox(tmp[6]) ^ xtime2_sbox(tmp[11]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movzbl (%rdi), %r9d
movzbl 0x1(%rdi), %ecx
movzbl 0x2(%rdi), %r8d
movzbl 0x4(%rdi), %ebx
movzbl 0x5(%rdi), %edx
movzbl 0x6(%rdi), %r10d
movzbl 0x8(%rdi), %r14d
movzbl 0x9(%rdi), %esi
movzbl 0xa(%rdi), %r15d
movzbl 0xc(%rdi), %eax
movq %rax, -0x20(%rsp)
movzbl 0xd(%rdi), %r11d
leaq 0x1db4(%rip), %r12      # 0x3130
leaq 0x1ead(%rip), %r13      # 0x3230
movzbl (%rdx,%r13), %eax
movq %rdx, -0x8(%rsp)
vmovd %eax, %xmm0
movzbl (%r9,%r12), %eax
vmovd %eax, %xmm1
movzbl 0xe(%rdi), %ebp
vpinsrb $0x1, (%rdx,%r12), %xmm0, %xmm0
vpinsrb $0x2, (%r15,%r12), %xmm0, %xmm0
vpinsrb $0x3, (%r9,%r13), %xmm0, %xmm0
movq %rsi, -0x18(%rsp)
vpinsrb $0x4, (%rsi,%r13), %xmm0, %xmm0
vpinsrb $0x5, (%rsi,%r12), %xmm0, %xmm0
vpinsrb $0x6, (%rbp,%r12), %xmm0, %xmm0
vpinsrb $0x7, (%rbx,%r13), %xmm0, %xmm0
vpinsrb $0x8, (%r11,%r13), %xmm0, %xmm0
vpinsrb $0x9, (%r11,%r12), %xmm0, %xmm0
vpinsrb $0xa, (%r8,%r12), %xmm0, %xmm0
vpinsrb $0xb, (%r14,%r13), %xmm0, %xmm0
movq %rcx, -0x10(%rsp)
vpinsrb $0xc, (%rcx,%r13), %xmm0, %xmm0
vpinsrb $0xd, (%rcx,%r12), %xmm0, %xmm0
vpinsrb $0xe, (%r10,%r12), %xmm0, %xmm0
movq -0x20(%rsp), %rsi
vpinsrb $0xf, (%rsi,%r13), %xmm0, %xmm0
vpinsrb $0x1, (%r15,%r13), %xmm1, %xmm1
movzbl 0xf(%rdi), %eax
vpinsrb $0x2, (%rax,%r13), %xmm1, %xmm1
vpinsrb $0x3, (%rax,%r12), %xmm1, %xmm1
vpinsrb $0x4, (%rbx,%r12), %xmm1, %xmm1
vpinsrb $0x5, (%rbp,%r13), %xmm1, %xmm1
movzbl 0x3(%rdi), %ecx
vpinsrb $0x6, (%rcx,%r13), %xmm1, %xmm1
vpinsrb $0x7, (%rcx,%r12), %xmm1, %xmm1
vpinsrb $0x8, (%r14,%r12), %xmm1, %xmm1
vpinsrb $0x9, (%r8,%r13), %xmm1, %xmm1
movzbl 0x7(%rdi), %edx
vpinsrb $0xa, (%rdx,%r13), %xmm1, %xmm1
vpinsrb $0xb, (%rdx,%r12), %xmm1, %xmm1
vpinsrb $0xc, (%rsi,%r12), %xmm1, %xmm1
vpinsrb $0xd, (%r10,%r13), %xmm1, %xmm1
movzbl 0xb(%rdi), %esi
vpinsrb $0xe, (%rsi,%r13), %xmm1, %xmm1
vpinsrb $0xf, (%rsi,%r12), %xmm1, %xmm1
leaq 0x1b88(%rip), %r12      # 0x3020
movzbl (%r15,%r12), %r15d
vmovd %r15d, %xmm2
movzbl (%rax,%r12), %eax
vpinsrb $0x1, %eax, %xmm2, %xmm2
movzbl (%r9,%r12), %r9d
vpinsrb $0x2, %r9d, %xmm2, %xmm2
vpinsrb $0x4, (%rbp,%r12), %xmm2, %xmm2
movzbl (%rcx,%r12), %ecx
vpinsrb $0x5, %ecx, %xmm2, %xmm2
movzbl (%rbx,%r12), %ebx
vpinsrb $0x6, %ebx, %xmm2, %xmm2
vpinsrb $0x8, (%r8,%r12), %xmm2, %xmm2
movzbl (%rdx,%r12), %edx
vpinsrb $0x9, %edx, %xmm2, %xmm2
movzbl (%r14,%r12), %r8d
vpinsrb $0xa, %r8d, %xmm2, %xmm2
vpinsrb $0xc, (%r10,%r12), %xmm2, %xmm2
vmovd %eax, %xmm3
vpinsrb $0x1, %r9d, %xmm3, %xmm3
movq -0x8(%rsp), %rax
vpinsrb $0x2, (%rax,%r12), %xmm3, %xmm3
vpinsrb $0x4, %ecx, %xmm3, %xmm3
vpinsrb $0x5, %ebx, %xmm3, %xmm3
movq -0x18(%rsp), %rax
vpinsrb $0x6, (%rax,%r12), %xmm3, %xmm3
vpinsrb $0x8, %edx, %xmm3, %xmm3
vpinsrb $0x9, %r8d, %xmm3, %xmm3
vpinsrb $0xa, (%r11,%r12), %xmm3, %xmm3
movzbl (%rsi,%r12), %eax
movq -0x20(%rsp), %rcx
movzbl (%rcx,%r12), %ecx
vpinsrb $0xc, %eax, %xmm3, %xmm3
vpinsrb $0xd, %ecx, %xmm3, %xmm3
movq -0x10(%rsp), %rdx
vpinsrb $0xe, (%rdx,%r12), %xmm3, %xmm3
vpinsrb $0xd, %eax, %xmm2, %xmm2
vpinsrb $0xe, %ecx, %xmm2, %xmm2
vpshufb 0x1a89(%rip), %xmm2, %xmm2 # 0x3000
vpxor %xmm1, %xmm0, %xmm0
vpshufb 0x1a8c(%rip), %xmm3, %xmm1 # 0x3010
vpternlogq $0x96, %xmm2, %xmm0, %xmm1
vmovdqu %xmm1, (%rdi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq