// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
movzbl (%rdi), %esi
movzbl 0x4(%rdi), %ecx
movzbl 0x8(%rdi), %edx
movzbl 0xc(%rdi), %r8d
leaq (%rsi,%rsi,2), %r9
leaq 0x23e9(%rip), %rax      # 0x5260
leaq (%rcx,%rcx,2), %r10
movb 0x1(%rax,%r10,2), %r11b
xorb %dl, %r11b
xorb %r8b, %r11b
xorb (%rax,%r9,2), %r11b
movb %r11b, (%rdi)
movl %ecx, %r11d
xorb %sil, %r11b
movb (%rax,%r10,2), %r10b
xorb %sil, %r10b
leaq (%rdx,%rdx,2), %rsi
movb 0x1(%rax,%rsi,2), %bl
xorb %r8b, %bl
xorb %r10b, %bl
movb %bl, 0x4(%rdi)
xorb (%rax,%rsi,2), %r11b
leaq (%r8,%r8,2), %rsi
xorb 0x1(%rax,%rsi,2), %r11b
movb %r11b, 0x8(%rdi)
movb 0x1(%rax,%r9,2), %r8b
xorb %cl, %r8b
xorb %dl, %r8b
xorb (%rax,%rsi,2), %r8b
movb %r8b, 0xc(%rdi)
movzbl 0x1(%rdi), %esi
movzbl 0x5(%rdi), %ecx
movzbl 0x9(%rdi), %edx
movzbl 0xd(%rdi), %r8d
leaq (%rsi,%rsi,2), %r9
leaq (%rcx,%rcx,2), %r10
movb 0x1(%rax,%r10,2), %r11b
xorb %dl, %r11b
xorb %r8b, %r11b
xorb (%rax,%r9,2), %r11b
movb %r11b, 0x1(%rdi)
movl %ecx, %r11d
xorb %sil, %r11b
movb (%rax,%r10,2), %r10b
xorb %sil, %r10b
leaq (%rdx,%rdx,2), %rsi
movb 0x1(%rax,%rsi,2), %bl
xorb %r8b, %bl
xorb %r10b, %bl
movb %bl, 0x5(%rdi)
xorb (%rax,%rsi,2), %r11b
leaq (%r8,%r8,2), %rsi
xorb 0x1(%rax,%rsi,2), %r11b
movb %r11b, 0x9(%rdi)
movb 0x1(%rax,%r9,2), %r8b
xorb %cl, %r8b
xorb %dl, %r8b
xorb (%rax,%rsi,2), %r8b
movb %r8b, 0xd(%rdi)
movzbl 0x2(%rdi), %r9d
movzbl 0x6(%rdi), %ecx
movzbl 0xa(%rdi), %edx
movzbl 0xe(%rdi), %r8d
leaq (%r9,%r9,2), %rsi
movb (%rax,%rsi,2), %r10b
movb %r10b, 0x2(%rdi)
leaq (%rcx,%rcx,2), %r11
movb 0x1(%rax,%r11,2), %bl
xorb %dl, %bl
xorb %r8b, %r10b
xorb %bl, %r10b
movb %r10b, 0x2(%rdi)
movl %ecx, %r10d
xorb %r9b, %r10b
movb (%rax,%r11,2), %r11b
xorb %r9b, %r11b
movb %r11b, 0x6(%rdi)
leaq (%rdx,%rdx,2), %r9
movb 0x1(%rax,%r9,2), %bl
xorb %r8b, %bl
xorb %r11b, %bl
movb %bl, 0x6(%rdi)
xorb (%rax,%r9,2), %r10b
movb %r10b, 0xa(%rdi)
leaq (%r8,%r8,2), %r8
xorb 0x1(%rax,%r8,2), %r10b
movb %r10b, 0xa(%rdi)
movb 0x1(%rax,%rsi,2), %sil
xorb %cl, %sil
xorb %dl, %sil
xorb (%rax,%r8,2), %sil
movb %sil, 0xe(%rdi)
movzbl 0x3(%rdi), %r9d
movzbl 0x7(%rdi), %ecx
movzbl 0xb(%rdi), %edx
movzbl 0xf(%rdi), %r8d
leaq (%r9,%r9,2), %rsi
movb (%rax,%rsi,2), %r10b
movb %r10b, 0x3(%rdi)
leaq (%rcx,%rcx,2), %r11
movb 0x1(%rax,%r11,2), %bl
xorb %dl, %bl
xorb %r8b, %r10b
xorb %bl, %r10b
movb %r10b, 0x3(%rdi)
movl %ecx, %r10d
xorb %r9b, %r10b
movb (%rax,%r11,2), %r11b
xorb %r9b, %r11b
movb %r11b, 0x7(%rdi)
leaq (%rdx,%rdx,2), %r9
movb 0x1(%rax,%r9,2), %bl
xorb %r8b, %bl
xorb %r11b, %bl
movb %bl, 0x7(%rdi)
xorb (%rax,%r9,2), %r10b
movb %r10b, 0xb(%rdi)
leaq (%r8,%r8,2), %r8
xorb 0x1(%rax,%r8,2), %r10b
movb %r10b, 0xb(%rdi)
movb 0x1(%rax,%rsi,2), %sil
xorb %cl, %sil
xorb %dl, %sil
xorb (%rax,%r8,2), %sil
movb %sil, 0xf(%rdi)
popq %rbx
retq