// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/aes.c
// Function: aesKeySetupDec
void aesKeySetupDec(u32 rk[], const u8 key[]) {

	int Nr, i, j;
	u32 temp;

    Nr=10;

	/* expand the cipher key: */
	aesKeySetupEnc(rk, key);

	/* 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];
	}
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl $0xa, 0x14(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x2170
movl $0x0, 0x10(%rsp)
movl 0x14(%rsp), %eax
shll $0x2, %eax
movl %eax, 0xc(%rsp)
movl 0x10(%rsp), %eax
cmpl 0xc(%rsp), %eax
jge 0x271d
movq 0x20(%rsp), %rax
movslq 0x10(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movslq 0xc(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x20(%rsp), %rax
movslq 0x10(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x8(%rsp), %edx
movq 0x20(%rsp), %rax
movslq 0xc(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x20(%rsp), %rax
movl 0x10(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movl 0xc(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq 0x20(%rsp), %rax
movl 0x10(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x8(%rsp), %edx
movq 0x20(%rsp), %rax
movl 0xc(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq 0x20(%rsp), %rax
movl 0x10(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movl 0xc(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq 0x20(%rsp), %rax
movl 0x10(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x8(%rsp), %edx
movq 0x20(%rsp), %rax
movl 0xc(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq 0x20(%rsp), %rax
movl 0x10(%rsp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movl 0xc(%rsp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq 0x20(%rsp), %rax
movl 0x10(%rsp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x8(%rsp), %edx
movq 0x20(%rsp), %rax
movl 0xc(%rsp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x10(%rsp), %eax
addl $0x4, %eax
movl %eax, 0x10(%rsp)
movl 0xc(%rsp), %eax
subl $0x4, %eax
movl %eax, 0xc(%rsp)
jmp 0x25c8
movl $0x1, 0x10(%rsp)
movl 0x10(%rsp), %eax
cmpl 0x14(%rsp), %eax
jge 0x2a5c
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 0x68aa(%rip), %rax      # 0x9000
movl (%rax,%rcx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x6cc7(%rip), %rax      # 0x9430
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 0x687a(%rip), %rax      # 0x9000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x7097(%rip), %rax      # 0x9830
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 0x684a(%rip), %rax      # 0x9000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x7467(%rip), %rax      # 0x9c30
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl (%rax), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x681d(%rip), %rax      # 0x9000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x783a(%rip), %rax      # 0xa030
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 0x67ea(%rip), %rax      # 0x9000
movl (%rax,%rcx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x6c07(%rip), %rax      # 0x9430
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 0x67b9(%rip), %rax      # 0x9000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x6fd6(%rip), %rax      # 0x9830
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 0x6788(%rip), %rax      # 0x9000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x73a5(%rip), %rax      # 0x9c30
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl 0x4(%rax), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x675a(%rip), %rax      # 0x9000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x7777(%rip), %rax      # 0xa030
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 0x6726(%rip), %rax      # 0x9000
movl (%rax,%rcx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x6b43(%rip), %rax      # 0x9430
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 0x66f5(%rip), %rax      # 0x9000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x6f12(%rip), %rax      # 0x9830
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 0x66c4(%rip), %rax      # 0x9000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x72e1(%rip), %rax      # 0x9c30
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl 0x8(%rax), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x6696(%rip), %rax      # 0x9000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x76b3(%rip), %rax      # 0xa030
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 0x6662(%rip), %rax      # 0x9000
movl (%rax,%rcx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x6a7f(%rip), %rax      # 0x9430
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 0x6631(%rip), %rax      # 0x9000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x6e4e(%rip), %rax      # 0x9830
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 0x6600(%rip), %rax      # 0x9000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x721d(%rip), %rax      # 0x9c30
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl 0xc(%rax), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x65d2(%rip), %rax      # 0x9000
movl (%rax,%rdx,4), %eax
andl $0xff, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x75ef(%rip), %rax      # 0xa030
xorl (%rax,%rdx,4), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0xc(%rax)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x2725
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)