// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/lakekeyakv2/generic32/KeccakP-400-reference.c
// Function: KeccakP400Round
void KeccakP400Round(tKeccakLane *state, unsigned int indexRound)
{
#ifdef KeccakReference
    displayRoundNumber(3, indexRound);
#endif

    theta(state);
#ifdef KeccakReference
    displayStateAsLanes(3, "After theta", state, 400);
#endif

    rho(state);
#ifdef KeccakReference
    displayStateAsLanes(3, "After rho", state, 400);
#endif

    pi(state);
#ifdef KeccakReference
    displayStateAsLanes(3, "After pi", state, 400);
#endif

    chi(state);
#ifdef KeccakReference
    displayStateAsLanes(3, "After chi", state, 400);
#endif

    iota(state, indexRound);
#ifdef KeccakReference
    displayStateAsLanes(3, "After iota", state, 400);
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
xorl %eax, %eax
movabsq $-0x32, %rcx
movq %rdi, %rdx
cmpq $0x5, %rax
je 0x8f91
xorl %r8d, %r8d
movq %rcx, %r9
testq %r9, %r9
je 0x8f82
xorw 0x32(%rdx,%r9), %r8w
addq $0xa, %r9
jmp 0x8f71
movw %r8w, -0x38(%rsp,%rax,2)
incq %rax
addq $0x2, %rdx
jmp 0x8f65
movl $0xfffffffd, %r8d       # imm = 0xFFFFFFFD
xorl %eax, %eax
movabsq $0x4, %rcx
cmpq $0x5, %rax
je 0x8fe3
leaq 0x1(%rax), %rdx
cmpq $0x5, %rdx
movl $0x0, %r9d
cmovneq %rdx, %r9
movzwl -0x38(%rsp,%r9,2), %r9d
rolw %r9w
cmpq $0x1, %rdx
leal 0x2(%r8,%rax), %r10d
cmoveq %rcx, %r10
xorw -0x38(%rsp,%r10,2), %r9w
movw %r9w, -0x42(%rsp,%rax,2)
movq %rdx, %rax
jmp 0x8fa3
xorl %eax, %eax
movq %rdi, %rcx
cmpq $0x5, %rax
je 0x9010
movzwl -0x42(%rsp,%rax,2), %edx
xorl %r9d, %r9d
cmpq $0x32, %r9
je 0x9007
xorw %dx, (%rcx,%r9)
addq $0xa, %r9
jmp 0x8ff6
incq %rax
addq $0x2, %rcx
jmp 0x8fe8
leaq 0x8849(%rip), %rax      # 0x11860
xorl %ecx, %ecx
cmpq $0x5, %rcx
je 0x907c
xorl %edx, %edx
movq %rcx, %r9
xorl %r10d, %r10d
cmpq $0x19, %rdx
je 0x9073
movl %edx, %r11d
orl %ecx, %r11d
je 0x905a
leaq (%r10,%r10,4), %r11
addq %rcx, %r11
movzwl (%rdi,%r9,2), %ebx
movb (%rax,%rdx,4), %bpl
shlxl %ebp, %ebx, %r14d
movb $0x10, %r15b
subb %bpl, %r15b
shrxl %r15d, %ebx, %ebx
xorl %r14d, %ebx
jmp 0x9061
movzwl (%rdi,%rdx,2), %ebx
movq %r9, %r11
movw %bx, (%rdi,%r11,2)
incq %r10
addq $0x5, %r9
addq $0x5, %rdx
jmp 0x9027
incq %rcx
addq $0x4, %rax
jmp 0x9019
leaq -0x38(%rsp), %rax
xorl %ecx, %ecx
movq %rdi, %rdx
cmpq $0x5, %rcx
je 0x90b2
xorl %r9d, %r9d
cmpq $0x32, %r9
je 0x90a5
movzwl (%rdx,%r9), %r10d
movw %r10w, (%rax,%r9)
addq $0xa, %r9
jmp 0x908f
incq %rcx
addq $0x2, %rax
addq $0x2, %rdx
jmp 0x9086
xorl %r10d, %r10d
leaq -0x38(%rsp), %r11
movl $0x5, %r9d
xorl %ebx, %ebx
xorl %r14d, %r14d
cmpq $0x5, %r14
je 0x9114
xorl %r15d, %r15d
movl %r10d, %ecx
movl %ebx, %ebp
movq %rdi, %r12
movl %ecx, %eax
xorl %edx, %edx
divl %r9d
cmpq $0x19, %r15
je 0x9104
imull $0x19, %eax, %eax
movl %ebp, %edx
subl %eax, %edx
movzwl (%r11,%r15,2), %eax
movw %ax, (%r12,%rdx,2)
addq $0x2, %r12
addl $0xf, %ebp
addl $0x3, %ecx
addq $0x5, %r15
jmp 0x90d6
incq %r14
addl $0xa, %ebx
addl $0x2, %r10d
addq $0x2, %r11
jmp 0x90c5
xorl %r10d, %r10d
movl $0x2, %r11d
movq %rdi, %rbx
xorl %ecx, %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %r9d
cmpq $0x5, %rcx
je 0x91b4
imull $0x19, %eax, %eax
movl %r10d, %edx
subl %eax, %edx
leaq (%rdi,%rdx,2), %rax
imulq $0xa, %rcx, %rdx
addq %rdi, %rdx
xorl %r14d, %r14d
cmpq $0x5, %r14
je 0x918e
leaq 0x1(%r14), %r15
cmpq $0x5, %r15
movl $0x0, %r12d
cmovneq %r15, %r12
movzwl (%rdx,%r12,2), %ebp
notl %ebp
cmpq $0x3, %r14
movl %r11d, %r12d
cmovael %r8d, %r12d
addl %r14d, %r12d
addl %r10d, %r12d
andw (%rdi,%r12,2), %bp
xorw (%rbx,%r14,2), %bp
movw %bp, -0x38(%rsp,%r14,2)
movq %r15, %r14
jmp 0x9149
xorl %edx, %edx
cmpq $0x5, %rdx
je 0x91a4
movzwl -0x38(%rsp,%rdx,2), %ebp
movw %bp, (%rax,%rdx,2)
incq %rdx
jmp 0x9190
incq %rcx
addq $0x5, %r10
addq $0xa, %rbx
jmp 0x9122
movl %esi, %eax
leaq 0x8673(%rip), %rcx      # 0x11830
movzwl (%rcx,%rax,2), %eax
xorw %ax, (%rdi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq