// File: /workspace/github_c_makefile_star2_O2/jogolden[P]ps4flashtool/aes.c
// Function: InvCipher
static void InvCipher(state_t* state,uint8_t* RoundKey)
{
  uint8_t round = 0;

  // Add the First round key to the state before starting the rounds.
  AddRoundKey(Nr, state, RoundKey); 

  // There will be Nr rounds.
  // The first Nr-1 rounds are identical.
  // These Nr-1 rounds are executed in the loop below.
  for (round = (Nr - 1); round > 0; --round)
  {
    InvShiftRows(state);
    InvSubBytes(state);
    AddRoundKey(round, state, RoundKey);
    InvMixColumns(state);
  }
  
  // The last round is given below.
  // The MixColumns function is not here in the last round.
  InvShiftRows(state);
  InvSubBytes(state);
  AddRoundKey(0, state, RoundKey);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rdx
movq %rdi, %r14
pushq $0xa
popq %rdi
movq %r14, %rsi
movq %rdx, 0x10(%rsp)
callq 0x273d
movb $0x9, %bl
movb $0x9, %bpl
movq %r14, 0x18(%rsp)
movq %r14, %rdi
callq 0x27e6
movq %r14, %rdi
callq 0x282f
subb $0x1, %bpl
jb 0x264b
movb %bpl, 0xf(%rsp)
movzbl %bl, %edi
movq %r14, %rsi
movq 0x10(%rsp), %rdx
callq 0x273d
xorl %eax, %eax
cmpq $0x4, %rax
je 0x263f
movb (%r14,%rax,4), %r10b
movb 0x1(%r14,%rax,4), %cl
movb 0x2(%r14,%rax,4), %r8b
movb 0x3(%r14,%rax,4), %dil
leal (%r10,%r10), %edx
leal (%rcx,%rcx), %esi
movl %ecx, %r9d
movl %r8d, %r11d
xorb %cl, %r11b
movl %r8d, %r15d
xorb %r10b, %r15b
xorb %r10b, %cl
movq %rcx, 0x20(%rsp)
sarb $0x7, %r10b
andb $0x1b, %r10b
xorb %dl, %r10b
leal (%r10,%r10), %r12d
sarb $0x7, %dl
andb $0x1b, %dl
xorb %r12b, %dl
leal (%rdx,%rdx), %ebx
sarb $0x7, %r12b
andb $0x1b, %r12b
xorb %bl, %r12b
sarb $0x7, %r9b
andb $0x1b, %r9b
xorb %sil, %r9b
leal (%r9,%r9), %ebp
sarb $0x7, %sil
andb $0x1b, %sil
xorb %bpl, %sil
leal (%rsi,%rsi), %ebx
sarb $0x7, %bpl
andb $0x1b, %bpl
xorb %bl, %bpl
leal (%r8,%r8), %r13d
xorb %dil, %r11b
xorb %r10b, %r11b
xorb %r8b, %r10b
sarb $0x7, %r8b
andb $0x1b, %r8b
xorb %r13b, %r8b
leal (%r8,%r8), %ebx
sarb $0x7, %r13b
andb $0x1b, %r13b
xorb %bl, %r13b
leal (,%r13,2), %r14d
sarb $0x7, %bl
andb $0x1b, %bl
xorb %r14b, %bl
xorb %bpl, %bl
leal (%rdi,%rdi), %ebp
xorb %dil, %r15b
xorb %r9b, %r15b
xorb %r8b, %r15b
xorb %dil, %r8b
movl %edi, %r14d
sarb $0x7, %r14b
andb $0x1b, %r14b
xorb %bpl, %r14b
leal (%r14,%r14), %edi
sarb $0x7, %bpl
andb $0x1b, %bpl
xorb %dil, %bpl
movq %rax, %rcx
leal (,%rbp,2), %eax
sarb $0x7, %dil
andb $0x1b, %dil
xorb %al, %dil
movq %rcx, %rax
xorb %r9b, %r11b
movq 0x20(%rsp), %rcx
xorb %r14b, %cl
movq 0x18(%rsp), %r14
xorb %dl, %r11b
xorb %cl, %r8b
xorb %dl, %r8b
xorb %r13b, %r11b
xorb %r13b, %r8b
xorb %r12b, %r11b
xorb %bl, %r11b
xorb %dil, %r11b
movb %r11b, (%r14,%rax,4)
xorb %sil, %r15b
xorb %bpl, %r15b
xorb %r12b, %r15b
xorb %bl, %r15b
xorb %dil, %r15b
movb %r15b, 0x1(%r14,%rax,4)
xorb %r12b, %r8b
xorb %bl, %r8b
xorb %dil, %r8b
movb %r8b, 0x2(%r14,%rax,4)
xorb %cl, %r10b
xorb %sil, %r10b
xorb %bpl, %r10b
xorb %r12b, %r10b
xorb %bl, %r10b
xorb %dil, %r10b
movb %r10b, 0x3(%r14,%rax,4)
incq %rax
jmp 0x24ca
movb 0xf(%rsp), %bpl
movl %ebp, %ebx
jmp 0x2499
xorl %edi, %edi
movq %r14, %rsi
movq 0x10(%rsp), %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x273d