// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/aezv3/ref/rijndael-alg-fst.c
// Function: rijndaelEncryptRound
void rijndaelEncryptRound(const u32 rk[/*4*(Nr + 1)*/], int Nr, u8 block[16], int rounds) {
	int r;
	u32 s0, s1, s2, s3, t0, t1, t2, t3;

    /*
	 * map byte array block to cipher state
	 * and add initial round key:
	 */
	s0 = GETU32(block     ) ^ rk[0];
	s1 = GETU32(block +  4) ^ rk[1];
	s2 = GETU32(block +  8) ^ rk[2];
	s3 = GETU32(block + 12) ^ rk[3];
    rk += 4;

    /*
	 * Nr - 1 full rounds:
	 */
	for (r = (rounds < Nr ? rounds : Nr - 1); r > 0; r--) {
		t0 =
			Te0[(s0 >> 24)       ] ^
			Te1[(s1 >> 16) & 0xff] ^
			Te2[(s2 >>  8) & 0xff] ^
			Te3[(s3      ) & 0xff] ^
			rk[0];
		t1 =
			Te0[(s1 >> 24)       ] ^
			Te1[(s2 >> 16) & 0xff] ^
			Te2[(s3 >>  8) & 0xff] ^
			Te3[(s0      ) & 0xff] ^
			rk[1];
		t2 =
			Te0[(s2 >> 24)       ] ^
			Te1[(s3 >> 16) & 0xff] ^
			Te2[(s0 >>  8) & 0xff] ^
			Te3[(s1      ) & 0xff] ^
			rk[2];
		t3 =
			Te0[(s3 >> 24)       ] ^
			Te1[(s0 >> 16) & 0xff] ^
			Te2[(s1 >>  8) & 0xff] ^
			Te3[(s2      ) & 0xff] ^
			rk[3];

		s0 = t0;
		s1 = t1;
		s2 = t2;
		s3 = t3;
		rk += 4;

    }

    /*
	 * apply last round and
	 * map cipher state to byte array block:
	 */
	if (rounds == Nr) {
    	t0 =
    		(Te4[(s0 >> 24)       ] & 0xff000000) ^
    		(Te4[(s1 >> 16) & 0xff] & 0x00ff0000) ^
    		(Te4[(s2 >>  8) & 0xff] & 0x0000ff00) ^
    		(Te4[(s3      ) & 0xff] & 0x000000ff) ^
    		rk[0];
    	t1 =
    		(Te4[(s1 >> 24)       ] & 0xff000000) ^
    		(Te4[(s2 >> 16) & 0xff] & 0x00ff0000) ^
    		(Te4[(s3 >>  8) & 0xff] & 0x0000ff00) ^
    		(Te4[(s0      ) & 0xff] & 0x000000ff) ^
    		rk[1];
    	t2 =
    		(Te4[(s2 >> 24)       ] & 0xff000000) ^
    		(Te4[(s3 >> 16) & 0xff] & 0x00ff0000) ^
    		(Te4[(s0 >>  8) & 0xff] & 0x0000ff00) ^
    		(Te4[(s1      ) & 0xff] & 0x000000ff) ^
    		rk[2];
    	t3 =
    		(Te4[(s3 >> 24)       ] & 0xff000000) ^
    		(Te4[(s0 >> 16) & 0xff] & 0x00ff0000) ^
    		(Te4[(s1 >>  8) & 0xff] & 0x0000ff00) ^
    		(Te4[(s2      ) & 0xff] & 0x000000ff) ^
    		rk[3];
		
		s0 = t0;
		s1 = t1;
		s2 = t2;
		s3 = t3;
	}

	PUTU32(block     , s0);
	PUTU32(block +  4, s1);
	PUTU32(block +  8, s2);
	PUTU32(block + 12, s3);
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq %rdx, -0x18(%rsp)
movl %ecx, -0x1c(%rsp)
movq -0x18(%rsp), %rax
movzbl (%rax), %eax
shll $0x18, %eax
movq -0x18(%rsp), %rcx
movzbl 0x1(%rcx), %ecx
shll $0x10, %ecx
xorl %ecx, %eax
movq -0x18(%rsp), %rcx
movzbl 0x2(%rcx), %ecx
shll $0x8, %ecx
xorl %ecx, %eax
movq -0x18(%rsp), %rcx
movzbl 0x3(%rcx), %ecx
xorl %ecx, %eax
movq -0x8(%rsp), %rcx
xorl (%rcx), %eax
movl %eax, -0x24(%rsp)
movq -0x18(%rsp), %rax
movzbl 0x4(%rax), %eax
shll $0x18, %eax
movq -0x18(%rsp), %rcx
movzbl 0x5(%rcx), %ecx
shll $0x10, %ecx
xorl %ecx, %eax
movq -0x18(%rsp), %rcx
movzbl 0x6(%rcx), %ecx
shll $0x8, %ecx
xorl %ecx, %eax
movq -0x18(%rsp), %rcx
movzbl 0x7(%rcx), %ecx
xorl %ecx, %eax
movq -0x8(%rsp), %rcx
xorl 0x4(%rcx), %eax
movl %eax, -0x28(%rsp)
movq -0x18(%rsp), %rax
movzbl 0x8(%rax), %eax
shll $0x18, %eax
movq -0x18(%rsp), %rcx
movzbl 0x9(%rcx), %ecx
shll $0x10, %ecx
xorl %ecx, %eax
movq -0x18(%rsp), %rcx
movzbl 0xa(%rcx), %ecx
shll $0x8, %ecx
xorl %ecx, %eax
movq -0x18(%rsp), %rcx
movzbl 0xb(%rcx), %ecx
xorl %ecx, %eax
movq -0x8(%rsp), %rcx
xorl 0x8(%rcx), %eax
movl %eax, -0x2c(%rsp)
movq -0x18(%rsp), %rax
movzbl 0xc(%rax), %eax
shll $0x18, %eax
movq -0x18(%rsp), %rcx
movzbl 0xd(%rcx), %ecx
shll $0x10, %ecx
xorl %ecx, %eax
movq -0x18(%rsp), %rcx
movzbl 0xe(%rcx), %ecx
shll $0x8, %ecx
xorl %ecx, %eax
movq -0x18(%rsp), %rcx
movzbl 0xf(%rcx), %ecx
xorl %ecx, %eax
movq -0x8(%rsp), %rcx
xorl 0xc(%rcx), %eax
movl %eax, -0x30(%rsp)
movq -0x8(%rsp), %rax
addq $0x10, %rax
movq %rax, -0x8(%rsp)
movl -0x1c(%rsp), %eax
cmpl -0xc(%rsp), %eax
jge 0x523e
movl -0x1c(%rsp), %eax
movl %eax, -0x44(%rsp)
jmp 0x5249
movl -0xc(%rsp), %eax
subl $0x1, %eax
movl %eax, -0x44(%rsp)
movl -0x44(%rsp), %eax
movl %eax, -0x20(%rsp)
cmpl $0x0, -0x20(%rsp)
jle 0x5455
movl -0x24(%rsp), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x31c2(%rip), %rax      # 0x8430
movl (%rax,%rcx,4), %eax
movl -0x28(%rsp), %ecx
shrl $0x10, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x35a7(%rip), %rcx      # 0x8830
xorl (%rcx,%rdx,4), %eax
movl -0x2c(%rsp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x398c(%rip), %rcx      # 0x8c30
xorl (%rcx,%rdx,4), %eax
movl -0x30(%rsp), %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x3d74(%rip), %rcx      # 0x9030
xorl (%rcx,%rdx,4), %eax
movq -0x8(%rsp), %rcx
xorl (%rcx), %eax
movl %eax, -0x34(%rsp)
movl -0x28(%rsp), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3154(%rip), %rax      # 0x8430
movl (%rax,%rcx,4), %eax
movl -0x2c(%rsp), %ecx
shrl $0x10, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x3539(%rip), %rcx      # 0x8830
xorl (%rcx,%rdx,4), %eax
movl -0x30(%rsp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x391e(%rip), %rcx      # 0x8c30
xorl (%rcx,%rdx,4), %eax
movl -0x24(%rsp), %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x3d06(%rip), %rcx      # 0x9030
xorl (%rcx,%rdx,4), %eax
movq -0x8(%rsp), %rcx
xorl 0x4(%rcx), %eax
movl %eax, -0x38(%rsp)
movl -0x2c(%rsp), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x30e5(%rip), %rax      # 0x8430
movl (%rax,%rcx,4), %eax
movl -0x30(%rsp), %ecx
shrl $0x10, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x34ca(%rip), %rcx      # 0x8830
xorl (%rcx,%rdx,4), %eax
movl -0x24(%rsp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x38af(%rip), %rcx      # 0x8c30
xorl (%rcx,%rdx,4), %eax
movl -0x28(%rsp), %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x3c97(%rip), %rcx      # 0x9030
xorl (%rcx,%rdx,4), %eax
movq -0x8(%rsp), %rcx
xorl 0x8(%rcx), %eax
movl %eax, -0x3c(%rsp)
movl -0x30(%rsp), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3076(%rip), %rax      # 0x8430
movl (%rax,%rcx,4), %eax
movl -0x24(%rsp), %ecx
shrl $0x10, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x345b(%rip), %rcx      # 0x8830
xorl (%rcx,%rdx,4), %eax
movl -0x28(%rsp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x3840(%rip), %rcx      # 0x8c30
xorl (%rcx,%rdx,4), %eax
movl -0x2c(%rsp), %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x3c28(%rip), %rcx      # 0x9030
xorl (%rcx,%rdx,4), %eax
movq -0x8(%rsp), %rcx
xorl 0xc(%rcx), %eax
movl %eax, -0x40(%rsp)
movl -0x34(%rsp), %eax
movl %eax, -0x24(%rsp)
movl -0x38(%rsp), %eax
movl %eax, -0x28(%rsp)
movl -0x3c(%rsp), %eax
movl %eax, -0x2c(%rsp)
movl -0x40(%rsp), %eax
movl %eax, -0x30(%rsp)
movq -0x8(%rsp), %rax
addq $0x10, %rax
movq %rax, -0x8(%rsp)
movl -0x20(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0x5251
movl -0x1c(%rsp), %eax
cmpl -0xc(%rsp), %eax
jne 0x56b2
movl -0x24(%rsp), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x1b8b(%rip), %rax      # 0x7000
movl (%rax,%rcx,4), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
movl -0x28(%rsp), %ecx
shrl $0x10, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x1b6b(%rip), %rcx      # 0x7000
movl (%rcx,%rdx,4), %ecx
andl $0xff0000, %ecx         # imm = 0xFF0000
xorl %ecx, %eax
movl -0x2c(%rsp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x1b48(%rip), %rcx      # 0x7000
movl (%rcx,%rdx,4), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
xorl %ecx, %eax
movl -0x30(%rsp), %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x1b28(%rip), %rcx      # 0x7000
movl (%rcx,%rdx,4), %ecx
andl $0xff, %ecx
xorl %ecx, %eax
movq -0x8(%rsp), %rcx
xorl (%rcx), %eax
movl %eax, -0x34(%rsp)
movl -0x28(%rsp), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x1b00(%rip), %rax      # 0x7000
movl (%rax,%rcx,4), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
movl -0x2c(%rsp), %ecx
shrl $0x10, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x1ae0(%rip), %rcx      # 0x7000
movl (%rcx,%rdx,4), %ecx
andl $0xff0000, %ecx         # imm = 0xFF0000
xorl %ecx, %eax
movl -0x30(%rsp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x1abd(%rip), %rcx      # 0x7000
movl (%rcx,%rdx,4), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
xorl %ecx, %eax
movl -0x24(%rsp), %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x1a9d(%rip), %rcx      # 0x7000
movl (%rcx,%rdx,4), %ecx
andl $0xff, %ecx
xorl %ecx, %eax
movq -0x8(%rsp), %rcx
xorl 0x4(%rcx), %eax
movl %eax, -0x38(%rsp)
movl -0x2c(%rsp), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x1a74(%rip), %rax      # 0x7000
movl (%rax,%rcx,4), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
movl -0x30(%rsp), %ecx
shrl $0x10, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x1a54(%rip), %rcx      # 0x7000
movl (%rcx,%rdx,4), %ecx
andl $0xff0000, %ecx         # imm = 0xFF0000
xorl %ecx, %eax
movl -0x24(%rsp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x1a31(%rip), %rcx      # 0x7000
movl (%rcx,%rdx,4), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
xorl %ecx, %eax
movl -0x28(%rsp), %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x1a11(%rip), %rcx      # 0x7000
movl (%rcx,%rdx,4), %ecx
andl $0xff, %ecx
xorl %ecx, %eax
movq -0x8(%rsp), %rcx
xorl 0x8(%rcx), %eax
movl %eax, -0x3c(%rsp)
movl -0x30(%rsp), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x19e8(%rip), %rax      # 0x7000
movl (%rax,%rcx,4), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
movl -0x24(%rsp), %ecx
shrl $0x10, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x19c8(%rip), %rcx      # 0x7000
movl (%rcx,%rdx,4), %ecx
andl $0xff0000, %ecx         # imm = 0xFF0000
xorl %ecx, %eax
movl -0x28(%rsp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x19a5(%rip), %rcx      # 0x7000
movl (%rcx,%rdx,4), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
xorl %ecx, %eax
movl -0x2c(%rsp), %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x1985(%rip), %rcx      # 0x7000
movl (%rcx,%rdx,4), %ecx
andl $0xff, %ecx
xorl %ecx, %eax
movq -0x8(%rsp), %rcx
xorl 0xc(%rcx), %eax
movl %eax, -0x40(%rsp)
movl -0x34(%rsp), %eax
movl %eax, -0x24(%rsp)
movl -0x38(%rsp), %eax
movl %eax, -0x28(%rsp)
movl -0x3c(%rsp), %eax
movl %eax, -0x2c(%rsp)
movl -0x40(%rsp), %eax
movl %eax, -0x30(%rsp)
movl -0x24(%rsp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, (%rax)
movl -0x24(%rsp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x1(%rax)
movl -0x24(%rsp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x2(%rax)
movl -0x24(%rsp), %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x3(%rax)
movl -0x28(%rsp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x4(%rax)
movl -0x28(%rsp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x5(%rax)
movl -0x28(%rsp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x6(%rax)
movl -0x28(%rsp), %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x7(%rax)
movl -0x2c(%rsp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x8(%rax)
movl -0x2c(%rsp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x9(%rax)
movl -0x2c(%rsp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0xa(%rax)
movl -0x2c(%rsp), %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0xb(%rax)
movl -0x30(%rsp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0xc(%rax)
movl -0x30(%rsp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0xd(%rax)
movl -0x30(%rsp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0xe(%rax)
movl -0x30(%rsp), %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0xf(%rax)
retq
nopw %cs:(%rax,%rax)