// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/paeq160/ref/encrypt.cpp
// Function: AES_Round(unsigned char*)
void AES_Round(unsigned char* state)  //SubBytes-ShiftRows-MixColumns
{
	unsigned char tmp[4][4];

	for(unsigned i=0; i<4; ++i)
	{
		for(unsigned j=0; j<4; ++j)
			tmp[j][i] = state[4*i+j];//AES state conversion
	}
	for(unsigned i=0; i<4; ++i)//Columnwise loop
	 {
	 	state[4*i] = mul[sbox[tmp[0][i]]][2] ^ mul[sbox[tmp[3][(i+3)%4]]][1] ^
						mul[sbox[tmp[2][(i+2)%4]]][1] ^ mul[sbox[tmp[1][(i+1)%4]]][3];
		state[4*i+1] = mul[sbox[tmp[1][(i+1)%4]]][2] ^ mul[sbox[tmp[0][i]]][1] ^
					mul[sbox[tmp[3][(i+3)%4]]][1] ^ mul[sbox[tmp[2][(i+2)%4]]][3];
		state[4*i+2] = mul[sbox[tmp[2][(i+2)%4]]][2] ^ mul[sbox[tmp[1][(i+1)%4]]][1] ^
					mul[sbox[tmp[0][i]]][1] ^ mul[sbox[tmp[3][(i+3)%4]]][3];
		state[4*i+3] = mul[sbox[tmp[3][(i+3)%4]]][2] ^ mul[sbox[tmp[2][(i+2)%4]]][1] ^
					mul[sbox[tmp[1][(i+1)%4]]][1] ^ mul[sbox[tmp[0][i]]][3];
	 }

}

// Assembly:
movq %rdi, -0x8(%rsp)
movl $0x0, -0x1c(%rsp)
cmpl $0x4, -0x1c(%rsp)
jae 0x120d
movl $0x0, -0x20(%rsp)
cmpl $0x4, -0x20(%rsp)
jae 0x11fe
movq -0x8(%rsp), %rax
movl -0x1c(%rsp), %ecx
shll $0x2, %ecx
addl -0x20(%rsp), %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %dl
movl -0x20(%rsp), %eax
movl %eax, %ecx
leaq -0x18(%rsp), %rax
shlq $0x2, %rcx
addq %rcx, %rax
movl -0x1c(%rsp), %ecx
movb %dl, (%rax,%rcx)
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0x11bc
jmp 0x1200
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x11ad
movl $0x0, -0x24(%rsp)
cmpl $0x4, -0x24(%rsp)
jae 0x159d
movl -0x24(%rsp), %eax
movzbl -0x18(%rsp,%rax), %eax
movl %eax, %ecx
leaq 0x2dce(%rip), %rax      # 0x4000
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
movq 0x4db9(%rip), %rax      # 0x5ff8
shlq $0x8, %rcx
addq %rcx, %rax
movzbl 0x2(%rax), %eax
movl -0x24(%rsp), %ecx
addl $0x3, %ecx
andl $0x3, %ecx
movl %ecx, %ecx
movzbl -0xc(%rsp,%rcx), %ecx
movl %ecx, %edx
leaq 0x2d9c(%rip), %rcx      # 0x4000
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x4d87(%rip), %rcx      # 0x5ff8
shlq $0x8, %rdx
addq %rdx, %rcx
movzbl 0x1(%rcx), %ecx
xorl %ecx, %eax
movl -0x24(%rsp), %ecx
addl $0x2, %ecx
andl $0x3, %ecx
movl %ecx, %ecx
movzbl -0x10(%rsp,%rcx), %ecx
movl %ecx, %edx
leaq 0x2d68(%rip), %rcx      # 0x4000
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x4d53(%rip), %rcx      # 0x5ff8
shlq $0x8, %rdx
addq %rdx, %rcx
movzbl 0x1(%rcx), %ecx
xorl %ecx, %eax
movl -0x24(%rsp), %ecx
addl $0x1, %ecx
andl $0x3, %ecx
movl %ecx, %ecx
movzbl -0x14(%rsp,%rcx), %ecx
movl %ecx, %edx
leaq 0x2d34(%rip), %rcx      # 0x4000
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x4d1f(%rip), %rcx      # 0x5ff8
shlq $0x8, %rdx
addq %rdx, %rcx
movzbl 0x3(%rcx), %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movl -0x24(%rsp), %ecx
shll $0x2, %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x24(%rsp), %eax
addl $0x1, %eax
andl $0x3, %eax
movl %eax, %eax
movzbl -0x14(%rsp,%rax), %eax
movl %eax, %ecx
leaq 0x2ced(%rip), %rax      # 0x4000
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
movq 0x4cd8(%rip), %rax      # 0x5ff8
shlq $0x8, %rcx
addq %rcx, %rax
movzbl 0x2(%rax), %eax
movl -0x24(%rsp), %ecx
movzbl -0x18(%rsp,%rcx), %ecx
movl %ecx, %edx
leaq 0x2cc3(%rip), %rcx      # 0x4000
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x4cae(%rip), %rcx      # 0x5ff8
shlq $0x8, %rdx
addq %rdx, %rcx
movzbl 0x1(%rcx), %ecx
xorl %ecx, %eax
movl -0x24(%rsp), %ecx
addl $0x3, %ecx
andl $0x3, %ecx
movl %ecx, %ecx
movzbl -0xc(%rsp,%rcx), %ecx
movl %ecx, %edx
leaq 0x2c8f(%rip), %rcx      # 0x4000
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x4c7a(%rip), %rcx      # 0x5ff8
shlq $0x8, %rdx
addq %rdx, %rcx
movzbl 0x1(%rcx), %ecx
xorl %ecx, %eax
movl -0x24(%rsp), %ecx
addl $0x2, %ecx
andl $0x3, %ecx
movl %ecx, %ecx
movzbl -0x10(%rsp,%rcx), %ecx
movl %ecx, %edx
leaq 0x2c5b(%rip), %rcx      # 0x4000
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x4c46(%rip), %rcx      # 0x5ff8
shlq $0x8, %rdx
addq %rdx, %rcx
movzbl 0x3(%rcx), %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movl -0x24(%rsp), %ecx
shll $0x2, %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x24(%rsp), %eax
addl $0x2, %eax
andl $0x3, %eax
movl %eax, %eax
movzbl -0x10(%rsp,%rax), %eax
movl %eax, %ecx
leaq 0x2c11(%rip), %rax      # 0x4000
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
movq 0x4bfc(%rip), %rax      # 0x5ff8
shlq $0x8, %rcx
addq %rcx, %rax
movzbl 0x2(%rax), %eax
movl -0x24(%rsp), %ecx
addl $0x1, %ecx
andl $0x3, %ecx
movl %ecx, %ecx
movzbl -0x14(%rsp,%rcx), %ecx
movl %ecx, %edx
leaq 0x2bdf(%rip), %rcx      # 0x4000
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x4bca(%rip), %rcx      # 0x5ff8
shlq $0x8, %rdx
addq %rdx, %rcx
movzbl 0x1(%rcx), %ecx
xorl %ecx, %eax
movl -0x24(%rsp), %ecx
movzbl -0x18(%rsp,%rcx), %ecx
movl %ecx, %edx
leaq 0x2bb3(%rip), %rcx      # 0x4000
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x4b9e(%rip), %rcx      # 0x5ff8
shlq $0x8, %rdx
addq %rdx, %rcx
movzbl 0x1(%rcx), %ecx
xorl %ecx, %eax
movl -0x24(%rsp), %ecx
addl $0x3, %ecx
andl $0x3, %ecx
movl %ecx, %ecx
movzbl -0xc(%rsp,%rcx), %ecx
movl %ecx, %edx
leaq 0x2b7f(%rip), %rcx      # 0x4000
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x4b6a(%rip), %rcx      # 0x5ff8
shlq $0x8, %rdx
addq %rdx, %rcx
movzbl 0x3(%rcx), %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movl -0x24(%rsp), %ecx
shll $0x2, %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x24(%rsp), %eax
addl $0x3, %eax
andl $0x3, %eax
movl %eax, %eax
movzbl -0xc(%rsp,%rax), %eax
movl %eax, %ecx
leaq 0x2b35(%rip), %rax      # 0x4000
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
movq 0x4b20(%rip), %rax      # 0x5ff8
shlq $0x8, %rcx
addq %rcx, %rax
movzbl 0x2(%rax), %eax
movl -0x24(%rsp), %ecx
addl $0x2, %ecx
andl $0x3, %ecx
movl %ecx, %ecx
movzbl -0x10(%rsp,%rcx), %ecx
movl %ecx, %edx
leaq 0x2b03(%rip), %rcx      # 0x4000
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x4aee(%rip), %rcx      # 0x5ff8
shlq $0x8, %rdx
addq %rdx, %rcx
movzbl 0x1(%rcx), %ecx
xorl %ecx, %eax
movl -0x24(%rsp), %ecx
addl $0x1, %ecx
andl $0x3, %ecx
movl %ecx, %ecx
movzbl -0x14(%rsp,%rcx), %ecx
movl %ecx, %edx
leaq 0x2acf(%rip), %rcx      # 0x4000
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x4aba(%rip), %rcx      # 0x5ff8
shlq $0x8, %rdx
addq %rdx, %rcx
movzbl 0x1(%rcx), %ecx
xorl %ecx, %eax
movl -0x24(%rsp), %ecx
movzbl -0x18(%rsp,%rcx), %ecx
movl %ecx, %edx
leaq 0x2aa3(%rip), %rcx      # 0x4000
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x4a8e(%rip), %rcx      # 0x5ff8
shlq $0x8, %rdx
addq %rdx, %rcx
movzbl 0x3(%rcx), %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movl -0x24(%rsp), %ecx
shll $0x2, %ecx
addl $0x3, %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rsp)
jmp 0x1215
retq
nop