// File: /workspace/github_c_makefile_star2_O0/MartinDrab[P]netpipe/aes.c
// Function: rijndaelSetupDecrypt
int rijndaelSetupDecrypt(u32 *rk, const u8 *key, int keybits)
{
  int nrounds, i, j;
  u32 temp;

  /* expand the cipher key: */
  nrounds = rijndaelSetupEncrypt(rk, key, keybits);
  /* invert the order of the round keys: */
  for (i = 0, j = 4*nrounds; 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 < nrounds; 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 nrounds;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x2370
movl %eax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x18(%rbp), %eax
shll $0x2, %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x2bb5
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x1c(%rbp)
movl -0x20(%rbp), %eax
subl $0x4, %eax
movl %eax, -0x20(%rbp)
jmp 0x2a76
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x2ed1
movq -0x8(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
shrq $0x18, %rcx
leaq 0x842a(%rip), %rax      # 0xb010
movq (%rax,%rcx,8), %rcx
andq $0xff, %rcx
leaq 0x8c68(%rip), %rax      # 0xb860
movq (%rax,%rcx,8), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rdx
shrq $0x10, %rdx
andq $0xff, %rdx
leaq 0x83fb(%rip), %rax      # 0xb010
movq (%rax,%rdx,8), %rdx
andq $0xff, %rdx
leaq 0x9439(%rip), %rax      # 0xc060
xorq (%rax,%rdx,8), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rdx
shrq $0x8, %rdx
andq $0xff, %rdx
leaq 0x83cc(%rip), %rax      # 0xb010
movq (%rax,%rdx,8), %rdx
andq $0xff, %rdx
leaq 0x9c0a(%rip), %rax      # 0xc860
xorq (%rax,%rdx,8), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rdx
andq $0xff, %rdx
leaq 0x83a1(%rip), %rax      # 0xb010
movq (%rax,%rdx,8), %rdx
andq $0xff, %rdx
leaq 0xa3df(%rip), %rax      # 0xd060
xorq (%rax,%rdx,8), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x18, %rcx
leaq 0x8371(%rip), %rax      # 0xb010
movq (%rax,%rcx,8), %rcx
andq $0xff, %rcx
leaq 0x8baf(%rip), %rax      # 0xb860
movq (%rax,%rcx,8), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
shrq $0x10, %rdx
andq $0xff, %rdx
leaq 0x8341(%rip), %rax      # 0xb010
movq (%rax,%rdx,8), %rdx
andq $0xff, %rdx
leaq 0x937f(%rip), %rax      # 0xc060
xorq (%rax,%rdx,8), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
shrq $0x8, %rdx
andq $0xff, %rdx
leaq 0x8311(%rip), %rax      # 0xb010
movq (%rax,%rdx,8), %rdx
andq $0xff, %rdx
leaq 0x9b4f(%rip), %rax      # 0xc860
xorq (%rax,%rdx,8), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
andq $0xff, %rdx
leaq 0x82e5(%rip), %rax      # 0xb010
movq (%rax,%rdx,8), %rdx
andq $0xff, %rdx
leaq 0xa323(%rip), %rax      # 0xd060
xorq (%rax,%rdx,8), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
shrq $0x18, %rcx
leaq 0x82b4(%rip), %rax      # 0xb010
movq (%rax,%rcx,8), %rcx
andq $0xff, %rcx
leaq 0x8af2(%rip), %rax      # 0xb860
movq (%rax,%rcx,8), %rcx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
shrq $0x10, %rdx
andq $0xff, %rdx
leaq 0x8284(%rip), %rax      # 0xb010
movq (%rax,%rdx,8), %rdx
andq $0xff, %rdx
leaq 0x92c2(%rip), %rax      # 0xc060
xorq (%rax,%rdx,8), %rcx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
shrq $0x8, %rdx
andq $0xff, %rdx
leaq 0x8254(%rip), %rax      # 0xb010
movq (%rax,%rdx,8), %rdx
andq $0xff, %rdx
leaq 0x9a92(%rip), %rax      # 0xc860
xorq (%rax,%rdx,8), %rcx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
andq $0xff, %rdx
leaq 0x8228(%rip), %rax      # 0xb010
movq (%rax,%rdx,8), %rdx
andq $0xff, %rdx
leaq 0xa266(%rip), %rax      # 0xd060
xorq (%rax,%rdx,8), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
shrq $0x18, %rcx
leaq 0x81f7(%rip), %rax      # 0xb010
movq (%rax,%rcx,8), %rcx
andq $0xff, %rcx
leaq 0x8a35(%rip), %rax      # 0xb860
movq (%rax,%rcx,8), %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdx
shrq $0x10, %rdx
andq $0xff, %rdx
leaq 0x81c7(%rip), %rax      # 0xb010
movq (%rax,%rdx,8), %rdx
andq $0xff, %rdx
leaq 0x9205(%rip), %rax      # 0xc060
xorq (%rax,%rdx,8), %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdx
shrq $0x8, %rdx
andq $0xff, %rdx
leaq 0x8197(%rip), %rax      # 0xb010
movq (%rax,%rdx,8), %rdx
andq $0xff, %rdx
leaq 0x99d5(%rip), %rax      # 0xc860
xorq (%rax,%rdx,8), %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdx
andq $0xff, %rdx
leaq 0x816b(%rip), %rax      # 0xb010
movq (%rax,%rdx,8), %rdx
andq $0xff, %rdx
leaq 0xa1a9(%rip), %rax      # 0xd060
xorq (%rax,%rdx,8), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2bbc
movl -0x18(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)