// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/aezv3/ref/rijndael-alg-fst.c
// Function: rijndaelKeySetupDec
int rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits) {
	int Nr, i, j;
	u32 temp;

	/* expand the cipher key: */
	Nr = rijndaelKeySetupEnc(rk, cipherKey, keyBits);
	/* invert the order of the round keys: */
	for (i = 0, j = 4*Nr; i < j; i += 4, j -= 4) {
		temp = rk[i    ]; rk[i    ] = rk[j    ]; rk[j    ] = temp;
		temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp;
		temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp;
		temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp;
	}
	/* apply the inverse MixColumn transform to all round keys but the first and the last: */
	for (i = 1; i < Nr; i++) {
		rk += 4;
		rk[0] =
			Td0[Te4[(rk[0] >> 24)       ] & 0xff] ^
			Td1[Te4[(rk[0] >> 16) & 0xff] & 0xff] ^
			Td2[Te4[(rk[0] >>  8) & 0xff] & 0xff] ^
			Td3[Te4[(rk[0]      ) & 0xff] & 0xff];
		rk[1] =
			Td0[Te4[(rk[1] >> 24)       ] & 0xff] ^
			Td1[Te4[(rk[1] >> 16) & 0xff] & 0xff] ^
			Td2[Te4[(rk[1] >>  8) & 0xff] & 0xff] ^
			Td3[Te4[(rk[1]      ) & 0xff] & 0xff];
		rk[2] =
			Td0[Te4[(rk[2] >> 24)       ] & 0xff] ^
			Td1[Te4[(rk[2] >> 16) & 0xff] & 0xff] ^
			Td2[Te4[(rk[2] >>  8) & 0xff] & 0xff] ^
			Td3[Te4[(rk[2]      ) & 0xff] & 0xff];
		rk[3] =
			Td0[Te4[(rk[3] >> 24)       ] & 0xff] ^
			Td1[Te4[(rk[3] >> 16) & 0xff] & 0xff] ^
			Td2[Te4[(rk[3] >>  8) & 0xff] & 0xff] ^
			Td3[Te4[(rk[3]      ) & 0xff] & 0xff];
	}
	return Nr;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0x1080
movl %eax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0x10(%rsp), %eax
shll $0x2, %eax
movl %eax, 0x8(%rsp)
movl 0xc(%rsp), %eax
cmpl 0x8(%rsp), %eax
jge 0x3de1
movq 0x20(%rsp), %rax
movslq 0xc(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x4(%rsp)
movq 0x20(%rsp), %rax
movslq 0x8(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x20(%rsp), %rax
movslq 0xc(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x4(%rsp), %edx
movq 0x20(%rsp), %rax
movslq 0x8(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x20(%rsp), %rax
movl 0xc(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x4(%rsp)
movq 0x20(%rsp), %rax
movl 0x8(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq 0x20(%rsp), %rax
movl 0xc(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x4(%rsp), %edx
movq 0x20(%rsp), %rax
movl 0x8(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq 0x20(%rsp), %rax
movl 0xc(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x4(%rsp)
movq 0x20(%rsp), %rax
movl 0x8(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq 0x20(%rsp), %rax
movl 0xc(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x4(%rsp), %edx
movq 0x20(%rsp), %rax
movl 0x8(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq 0x20(%rsp), %rax
movl 0xc(%rsp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x4(%rsp)
movq 0x20(%rsp), %rax
movl 0x8(%rsp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq 0x20(%rsp), %rax
movl 0xc(%rsp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x4(%rsp), %edx
movq 0x20(%rsp), %rax
movl 0x8(%rsp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0xc(%rsp), %eax
addl $0x4, %eax
movl %eax, 0xc(%rsp)
movl 0x8(%rsp), %eax
subl $0x4, %eax
movl %eax, 0x8(%rsp)
jmp 0x3c8c
movl $0x1, 0xc(%rsp)
movl 0xc(%rsp), %eax
cmpl 0x10(%rsp), %eax
jge 0x4120
movq 0x20(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movl (%rax), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x31e6(%rip), %rax      # 0x7000
movl (%rax,%rcx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3603(%rip), %rax      # 0x7430
movl (%rax,%rcx,4), %ecx
movq 0x20(%rsp), %rax
movl (%rax), %eax
shrl $0x10, %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x31b6(%rip), %rax      # 0x7000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x39d3(%rip), %rax      # 0x7830
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl (%rax), %eax
shrl $0x8, %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x3186(%rip), %rax      # 0x7000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x3da3(%rip), %rax      # 0x7c30
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl (%rax), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x3159(%rip), %rax      # 0x7000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x4176(%rip), %rax      # 0x8030
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
movq 0x20(%rsp), %rax
movl 0x4(%rax), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3126(%rip), %rax      # 0x7000
movl (%rax,%rcx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3543(%rip), %rax      # 0x7430
movl (%rax,%rcx,4), %ecx
movq 0x20(%rsp), %rax
movl 0x4(%rax), %eax
shrl $0x10, %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x30f5(%rip), %rax      # 0x7000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x3912(%rip), %rax      # 0x7830
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl 0x4(%rax), %eax
shrl $0x8, %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x30c4(%rip), %rax      # 0x7000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x3ce1(%rip), %rax      # 0x7c30
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl 0x4(%rax), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x3096(%rip), %rax      # 0x7000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x40b3(%rip), %rax      # 0x8030
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0x20(%rsp), %rax
movl 0x8(%rax), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3062(%rip), %rax      # 0x7000
movl (%rax,%rcx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x347f(%rip), %rax      # 0x7430
movl (%rax,%rcx,4), %ecx
movq 0x20(%rsp), %rax
movl 0x8(%rax), %eax
shrl $0x10, %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x3031(%rip), %rax      # 0x7000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x384e(%rip), %rax      # 0x7830
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl 0x8(%rax), %eax
shrl $0x8, %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x3000(%rip), %rax      # 0x7000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x3c1d(%rip), %rax      # 0x7c30
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl 0x8(%rax), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x2fd2(%rip), %rax      # 0x7000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x3fef(%rip), %rax      # 0x8030
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x20(%rsp), %rax
movl 0xc(%rax), %eax
shrl $0x18, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x2f9e(%rip), %rax      # 0x7000
movl (%rax,%rcx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x33bb(%rip), %rax      # 0x7430
movl (%rax,%rcx,4), %ecx
movq 0x20(%rsp), %rax
movl 0xc(%rax), %eax
shrl $0x10, %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x2f6d(%rip), %rax      # 0x7000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x378a(%rip), %rax      # 0x7830
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl 0xc(%rax), %eax
shrl $0x8, %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x2f3c(%rip), %rax      # 0x7000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x3b59(%rip), %rax      # 0x7c30
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl 0xc(%rax), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x2f0e(%rip), %rax      # 0x7000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x3f2b(%rip), %rax      # 0x8030
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0xc(%rax)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x3de9
movl 0x10(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)