// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/aezv3/ref/rijndael-alg-fst.c
// Function: rijndaelDecryptRound
void rijndaelDecryptRound(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 =
			Td0[(s0 >> 24)       ] ^
			Td1[(s3 >> 16) & 0xff] ^
			Td2[(s2 >>  8) & 0xff] ^
			Td3[(s1      ) & 0xff] ^
			rk[0];
		t1 =
			Td0[(s1 >> 24)       ] ^
			Td1[(s0 >> 16) & 0xff] ^
			Td2[(s3 >>  8) & 0xff] ^
			Td3[(s2      ) & 0xff] ^
			rk[1];
		t2 =
			Td0[(s2 >> 24)       ] ^
			Td1[(s1 >> 16) & 0xff] ^
			Td2[(s0 >>  8) & 0xff] ^
			Td3[(s3      ) & 0xff] ^
			rk[2];
		t3 =
			Td0[(s3 >> 24)       ] ^
			Td1[(s2 >> 16) & 0xff] ^
			Td2[(s1 >>  8) & 0xff] ^
			Td3[(s0      ) & 0xff] ^
			rk[3];

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

    }

    /*
	 * complete the last round and
	 * map cipher state to byte array block:
	 */
	t0 =
		(Td4[(s0 >> 24)       ] & 0xff000000) ^
		(Td4[(s3 >> 16) & 0xff] & 0x00ff0000) ^
		(Td4[(s2 >>  8) & 0xff] & 0x0000ff00) ^
		(Td4[(s1      ) & 0xff] & 0x000000ff);
	t1 =
		(Td4[(s1 >> 24)       ] & 0xff000000) ^
		(Td4[(s0 >> 16) & 0xff] & 0x00ff0000) ^
		(Td4[(s3 >>  8) & 0xff] & 0x0000ff00) ^
		(Td4[(s2      ) & 0xff] & 0x000000ff);
	t2 =
		(Td4[(s2 >> 24)       ] & 0xff000000) ^
		(Td4[(s1 >> 16) & 0xff] & 0x00ff0000) ^
		(Td4[(s0 >>  8) & 0xff] & 0x0000ff00) ^
		(Td4[(s3      ) & 0xff] & 0x000000ff);
	t3 =
		(Td4[(s3 >> 24)       ] & 0xff000000) ^
		(Td4[(s2 >> 16) & 0xff] & 0x00ff0000) ^
		(Td4[(s1 >>  8) & 0xff] & 0x0000ff00) ^
		(Td4[(s0      ) & 0xff] & 0x000000ff);

	if (rounds == Nr) {
	    t0 ^= rk[0];
	    t1 ^= rk[1];
	    t2 ^= rk[2];
	    t3 ^= rk[3];
	}

	PUTU32(block     , t0);
	PUTU32(block +  4, t1);
	PUTU32(block +  8, t2);
	PUTU32(block + 12, t3);
}

// 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 0x58ee
movl -0x1c(%rsp), %eax
movl %eax, -0x44(%rsp)
jmp 0x58f6
movl -0xc(%rsp), %eax
movl %eax, -0x44(%rsp)
movl -0x44(%rsp), %eax
subl $0x1, %eax
movl %eax, -0x20(%rsp)
cmpl $0x0, -0x20(%rsp)
jle 0x5b05
movl -0x24(%rsp), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x1b12(%rip), %rax      # 0x7430
movl (%rax,%rcx,4), %eax
movl -0x30(%rsp), %ecx
shrl $0x10, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x1ef7(%rip), %rcx      # 0x7830
xorl (%rcx,%rdx,4), %eax
movl -0x2c(%rsp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x22dc(%rip), %rcx      # 0x7c30
xorl (%rcx,%rdx,4), %eax
movl -0x28(%rsp), %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x26c4(%rip), %rcx      # 0x8030
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 0x1aa4(%rip), %rax      # 0x7430
movl (%rax,%rcx,4), %eax
movl -0x24(%rsp), %ecx
shrl $0x10, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x1e89(%rip), %rcx      # 0x7830
xorl (%rcx,%rdx,4), %eax
movl -0x30(%rsp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x226e(%rip), %rcx      # 0x7c30
xorl (%rcx,%rdx,4), %eax
movl -0x2c(%rsp), %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x2656(%rip), %rcx      # 0x8030
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 0x1a35(%rip), %rax      # 0x7430
movl (%rax,%rcx,4), %eax
movl -0x28(%rsp), %ecx
shrl $0x10, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x1e1a(%rip), %rcx      # 0x7830
xorl (%rcx,%rdx,4), %eax
movl -0x24(%rsp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x21ff(%rip), %rcx      # 0x7c30
xorl (%rcx,%rdx,4), %eax
movl -0x30(%rsp), %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x25e7(%rip), %rcx      # 0x8030
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 0x19c6(%rip), %rax      # 0x7430
movl (%rax,%rcx,4), %eax
movl -0x2c(%rsp), %ecx
shrl $0x10, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x1dab(%rip), %rcx      # 0x7830
xorl (%rcx,%rdx,4), %eax
movl -0x28(%rsp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x2190(%rip), %rcx      # 0x7c30
xorl (%rcx,%rdx,4), %eax
movl -0x24(%rsp), %ecx
andl $0xff, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x2578(%rip), %rcx      # 0x8030
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 0x5901
movl -0x24(%rsp), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3919(%rip), %rax      # 0x9430
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 0x38f9(%rip), %rcx      # 0x9430
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 0x38d6(%rip), %rcx      # 0x9430
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 0x38b6(%rip), %rcx      # 0x9430
movl (%rcx,%rdx,4), %ecx
andl $0xff, %ecx
xorl %ecx, %eax
movl %eax, -0x34(%rsp)
movl -0x28(%rsp), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3895(%rip), %rax      # 0x9430
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 0x3875(%rip), %rcx      # 0x9430
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 0x3852(%rip), %rcx      # 0x9430
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 0x3832(%rip), %rcx      # 0x9430
movl (%rcx,%rdx,4), %ecx
andl $0xff, %ecx
xorl %ecx, %eax
movl %eax, -0x38(%rsp)
movl -0x2c(%rsp), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3811(%rip), %rax      # 0x9430
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 0x37f1(%rip), %rcx      # 0x9430
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 0x37ce(%rip), %rcx      # 0x9430
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 0x37ae(%rip), %rcx      # 0x9430
movl (%rcx,%rdx,4), %ecx
andl $0xff, %ecx
xorl %ecx, %eax
movl %eax, -0x3c(%rsp)
movl -0x30(%rsp), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x378d(%rip), %rax      # 0x9430
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 0x376d(%rip), %rcx      # 0x9430
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 0x374a(%rip), %rcx      # 0x9430
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 0x372a(%rip), %rcx      # 0x9430
movl (%rcx,%rdx,4), %ecx
andl $0xff, %ecx
xorl %ecx, %eax
movl %eax, -0x40(%rsp)
movl -0x1c(%rsp), %eax
cmpl -0xc(%rsp), %eax
jne 0x5d5e
movq -0x8(%rsp), %rax
movl (%rax), %eax
xorl -0x34(%rsp), %eax
movl %eax, -0x34(%rsp)
movq -0x8(%rsp), %rax
movl 0x4(%rax), %eax
xorl -0x38(%rsp), %eax
movl %eax, -0x38(%rsp)
movq -0x8(%rsp), %rax
movl 0x8(%rax), %eax
xorl -0x3c(%rsp), %eax
movl %eax, -0x3c(%rsp)
movq -0x8(%rsp), %rax
movl 0xc(%rax), %eax
xorl -0x40(%rsp), %eax
movl %eax, -0x40(%rsp)
movl -0x34(%rsp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, (%rax)
movl -0x34(%rsp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x1(%rax)
movl -0x34(%rsp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x2(%rax)
movl -0x34(%rsp), %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x3(%rax)
movl -0x38(%rsp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x4(%rax)
movl -0x38(%rsp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x5(%rax)
movl -0x38(%rsp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x6(%rax)
movl -0x38(%rsp), %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x7(%rax)
movl -0x3c(%rsp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x8(%rax)
movl -0x3c(%rsp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0x9(%rax)
movl -0x3c(%rsp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0xa(%rax)
movl -0x3c(%rsp), %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0xb(%rax)
movl -0x40(%rsp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0xc(%rax)
movl -0x40(%rsp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0xd(%rax)
movl -0x40(%rsp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0xe(%rax)
movl -0x40(%rsp), %eax
movb %al, %cl
movq -0x18(%rsp), %rax
movb %cl, 0xf(%rax)
retq
nopw %cs:(%rax,%rax)
nopl (%rax)