// File: /workspace/github_cpp_makefile_star2_O3/DiplIngFrankGerlach[P]MST/./aes/aes.c
// Function: MixColumns
void MixColumns(BYTE state[][4])
{
	BYTE col[4];

	// Column 1
	col[0] = state[0][0];
	col[1] = state[1][0];
	col[2] = state[2][0];
	col[3] = state[3][0];
	state[0][0] = gf_mul[col[0]][0];
	state[0][0] ^= gf_mul[col[1]][1];
	state[0][0] ^= col[2];
	state[0][0] ^= col[3];
	state[1][0] = col[0];
	state[1][0] ^= gf_mul[col[1]][0];
	state[1][0] ^= gf_mul[col[2]][1];
	state[1][0] ^= col[3];
	state[2][0] = col[0];
	state[2][0] ^= col[1];
	state[2][0] ^= gf_mul[col[2]][0];
	state[2][0] ^= gf_mul[col[3]][1];
	state[3][0] = gf_mul[col[0]][1];
	state[3][0] ^= col[1];
	state[3][0] ^= col[2];
	state[3][0] ^= gf_mul[col[3]][0];
	// Column 2
	col[0] = state[0][1];
	col[1] = state[1][1];
	col[2] = state[2][1];
	col[3] = state[3][1];
	state[0][1] = gf_mul[col[0]][0];
	state[0][1] ^= gf_mul[col[1]][1];
	state[0][1] ^= col[2];
	state[0][1] ^= col[3];
	state[1][1] = col[0];
	state[1][1] ^= gf_mul[col[1]][0];
	state[1][1] ^= gf_mul[col[2]][1];
	state[1][1] ^= col[3];
	state[2][1] = col[0];
	state[2][1] ^= col[1];
	state[2][1] ^= gf_mul[col[2]][0];
	state[2][1] ^= gf_mul[col[3]][1];
	state[3][1] = gf_mul[col[0]][1];
	state[3][1] ^= col[1];
	state[3][1] ^= col[2];
	state[3][1] ^= gf_mul[col[3]][0];
	// Column 3
	col[0] = state[0][2];
	col[1] = state[1][2];
	col[2] = state[2][2];
	col[3] = state[3][2];
	state[0][2] = gf_mul[col[0]][0];
	state[0][2] ^= gf_mul[col[1]][1];
	state[0][2] ^= col[2];
	state[0][2] ^= col[3];
	state[1][2] = col[0];
	state[1][2] ^= gf_mul[col[1]][0];
	state[1][2] ^= gf_mul[col[2]][1];
	state[1][2] ^= col[3];
	state[2][2] = col[0];
	state[2][2] ^= col[1];
	state[2][2] ^= gf_mul[col[2]][0];
	state[2][2] ^= gf_mul[col[3]][1];
	state[3][2] = gf_mul[col[0]][1];
	state[3][2] ^= col[1];
	state[3][2] ^= col[2];
	state[3][2] ^= gf_mul[col[3]][0];
	// Column 4
	col[0] = state[0][3];
	col[1] = state[1][3];
	col[2] = state[2][3];
	col[3] = state[3][3];
	state[0][3] = gf_mul[col[0]][0];
	state[0][3] ^= gf_mul[col[1]][1];
	state[0][3] ^= col[2];
	state[0][3] ^= col[3];
	state[1][3] = col[0];
	state[1][3] ^= gf_mul[col[1]][0];
	state[1][3] ^= gf_mul[col[2]][1];
	state[1][3] ^= col[3];
	state[2][3] = col[0];
	state[2][3] ^= col[1];
	state[2][3] ^= gf_mul[col[2]][0];
	state[2][3] ^= gf_mul[col[3]][1];
	state[3][3] = gf_mul[col[0]][1];
	state[3][3] ^= col[1];
	state[3][3] ^= col[2];
	state[3][3] ^= gf_mul[col[3]][0];
}

// Assembly:
pushq %rbp
pushq %rbx
movzbl (%rdi), %edx
movzbl 0x4(%rdi), %ecx
movzbl 0x8(%rdi), %r9d
movzbl 0xc(%rdi), %r8d
leaq (%rdx,%rdx,2), %rsi
leaq 0x2410(%rip), %rax      # 0x5260
leaq (%rcx,%rcx,2), %r10
leaq (%r9,%r9,2), %r11
movl %edx, %ebx
xorb %cl, %dl
xorb %r9b, %cl
movb 0x1(%rax,%r10,2), %bpl
xorb (%rax,%rsi,2), %bpl
xorb %r8b, %r9b
xorb %bpl, %r9b
movb (%rax,%r10,2), %r10b
movb %r9b, (%rdi)
xorb 0x1(%rax,%r11,2), %r10b
xorb %r8b, %bl
xorb %r10b, %bl
movb %bl, 0x4(%rdi)
movb (%rax,%r11,2), %r9b
leaq (%r8,%r8,2), %r8
xorb 0x1(%rax,%r8,2), %r9b
xorb %r9b, %dl
movb %dl, 0x8(%rdi)
movb 0x1(%rax,%rsi,2), %dl
xorb (%rax,%r8,2), %dl
xorb %dl, %cl
movb %cl, 0xc(%rdi)
movzbl 0x1(%rdi), %edx
movzbl 0x5(%rdi), %ecx
movzbl 0x9(%rdi), %esi
movzbl 0xd(%rdi), %r9d
leaq (%rdx,%rdx,2), %r8
leaq (%rcx,%rcx,2), %r10
movb (%rax,%r10,2), %r11b
movb 0x1(%rax,%r10,2), %r10b
xorb (%rax,%r8,2), %r10b
leaq (%rsi,%rsi,2), %rbx
movl %esi, %ebp
xorb %r9b, %bpl
xorb %r10b, %bpl
movb %bpl, 0x1(%rdi)
xorb 0x1(%rax,%rbx,2), %r11b
movl %edx, %r10d
xorb %r9b, %r10b
xorb %r11b, %r10b
movb %r10b, 0x5(%rdi)
movb (%rax,%rbx,2), %r10b
leaq (%r9,%r9,2), %r9
xorb 0x1(%rax,%r9,2), %r10b
xorb %cl, %dl
xorb %sil, %cl
xorb %r10b, %dl
movb %dl, 0x9(%rdi)
movb 0x1(%rax,%r8,2), %dl
xorb (%rax,%r9,2), %dl
xorb %dl, %cl
movb %cl, 0xd(%rdi)
movzbl 0x2(%rdi), %edx
movzbl 0x6(%rdi), %ecx
movzbl 0xa(%rdi), %r9d
movzbl 0xe(%rdi), %r8d
leaq (%rdx,%rdx,2), %rsi
leaq (%rcx,%rcx,2), %r10
leaq (%r9,%r9,2), %r11
movl %edx, %ebx
xorb %cl, %dl
xorb %r9b, %cl
movb 0x1(%rax,%r10,2), %bpl
xorb (%rax,%rsi,2), %bpl
xorb %r8b, %r9b
xorb %bpl, %r9b
movb (%rax,%r10,2), %r10b
movb %r9b, 0x2(%rdi)
xorb 0x1(%rax,%r11,2), %r10b
xorb %r8b, %bl
xorb %r10b, %bl
movb %bl, 0x6(%rdi)
movb (%rax,%r11,2), %r9b
leaq (%r8,%r8,2), %r8
xorb 0x1(%rax,%r8,2), %r9b
xorb %r9b, %dl
movb %dl, 0xa(%rdi)
movb 0x1(%rax,%rsi,2), %dl
xorb (%rax,%r8,2), %dl
xorb %dl, %cl
movb %cl, 0xe(%rdi)
movzbl 0x3(%rdi), %edx
movzbl 0x7(%rdi), %ecx
movzbl 0xb(%rdi), %esi
movzbl 0xf(%rdi), %r9d
leaq (%rdx,%rdx,2), %r8
leaq (%rcx,%rcx,2), %r10
movb (%rax,%r10,2), %r11b
movb 0x1(%rax,%r10,2), %r10b
xorb (%rax,%r8,2), %r10b
leaq (%rsi,%rsi,2), %rbx
movl %esi, %ebp
xorb %r9b, %bpl
xorb %r10b, %bpl
movb %bpl, 0x3(%rdi)
xorb 0x1(%rax,%rbx,2), %r11b
movl %edx, %r10d
xorb %r9b, %r10b
xorb %r11b, %r10b
movb %r10b, 0x7(%rdi)
movb (%rax,%rbx,2), %r10b
leaq (%r9,%r9,2), %r9
xorb 0x1(%rax,%r9,2), %r10b
xorb %cl, %dl
xorb %sil, %cl
xorb %r10b, %dl
movb %dl, 0xb(%rdi)
movb 0x1(%rax,%r8,2), %dl
xorb (%rax,%r9,2), %dl
xorb %dl, %cl
movb %cl, 0xf(%rdi)
popq %rbx
popq %rbp
retq