// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, %rcx
movw $0x0, -0x38(%rsp,%rax,2)
xorl %edx, %edx
xorl %r8d, %r8d
xorw (%rcx,%rdx), %r8w
addq $0xa, %rdx
cmpq $0x32, %rdx
jne 0x94d7
movw %r8w, -0x38(%rsp,%rax,2)
incq %rax
addq $0x2, %rcx
cmpq $0x5, %rax
jne 0x94cb
movl $0x4, %edx
leaq -0x30(%rsp), %rcx
xorl %r8d, %r8d
movabsq $-0x3333333333333333, %rax # imm = 0xCCCCCCCCCCCCCCCD
leaq 0x1(%r8), %r9
mulxq %rax, %r10, %r10
shrq %r10
andq $-0x2, %r10
leaq (%r10,%r10,4), %r10
movq %rcx, %r11
subq %r10, %r11
cmpq $0x4, %r8
movl $0x0, %r10d
cmovneq %r9, %r10
movzwl -0x38(%rsp,%r10,2), %r10d
rolw %r10w
xorw (%r11,%r8,2), %r10w
movw %r10w, -0x42(%rsp,%r8,2)
incq %rdx
movq %r9, %r8
cmpq $0x5, %r9
jne 0x9510
xorl %ecx, %ecx
movq %rdi, %rdx
movzwl -0x42(%rsp,%rcx,2), %r8d
xorl %r9d, %r9d
xorw %r8w, (%rdx,%r9)
addq $0xa, %r9
cmpq $0x32, %r9
jne 0x9567
incq %rcx
addq $0x2, %rdx
cmpq $0x5, %rcx
jne 0x955e
leaq 0x93b6(%rip), %rcx      # 0x12940
xorl %edx, %edx
xorl %r8d, %r8d
leaq (%rdi,%rdx), %r9
xorl %r10d, %r10d
movl %r10d, %r11d
orl %r8d, %r11d
je 0x95bc
movzwl (%r9,%r10,2), %r11d
movb (%rcx,%r10,4), %bl
shlxl %ebx, %r11d, %ebp
movb $0x10, %r14b
subb %bl, %r14b
shrxl %r14d, %r11d, %r11d
xorl %ebp, %r11d
jmp 0x95c1
movzwl (%rdi,%r10,2), %r11d
movw %r11w, (%r9,%r10,2)
addq $0x5, %r10
cmpq $0x19, %r10
jne 0x9596
incq %r8
addq $0x2, %rdx
addq $0x4, %rcx
cmpq $0x5, %r8
jne 0x958f
leaq -0x38(%rsp), %rcx
xorl %edx, %edx
movq %rdi, %r8
xorl %r9d, %r9d
movzwl (%r8,%r9), %r10d
movw %r10w, (%rcx,%r9)
addq $0xa, %r9
cmpq $0x32, %r9
jne 0x95ee
incq %rdx
addq $0x2, %rcx
addq $0x2, %r8
cmpq $0x5, %rdx
jne 0x95eb
xorl %ecx, %ecx
leaq -0x38(%rsp), %rdx
movl $0xcccccccd, %r8d       # imm = 0xCCCCCCCD
xorl %r9d, %r9d
xorl %r10d, %r10d
movl %ecx, %r11d
movl %r9d, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
movl %r11d, %r12d
imulq %r8, %r12
shrq $0x22, %r12
leal (%r12,%r12,4), %r12d
leal (%r12,%r12,4), %ebp
movl %ebx, %r12d
subl %ebp, %r12d
movzwl (%rdx,%r15,2), %ebp
movw %bp, (%r14,%r12,2)
addq $0x5, %r15
addq $0x2, %r14
addl $0xf, %ebx
addl $0x3, %r11d
cmpq $0x19, %r15
jne 0x9632
incq %r10
addl $0xa, %r9d
addl $0x2, %ecx
addq $0x2, %rdx
cmpq $0x5, %r10
jne 0x9626
leaq 0x4(%rdi), %rcx
xorl %r8d, %r8d
movl $0xcccccccd, %r9d       # imm = 0xCCCCCCCD
movq %rdi, %r10
movl %r8d, %edx
imulq %r9, %rdx
shrq $0x22, %rdx
imull $-0x19, %edx, %edx
leal (%r8,%r8,4), %r11d
addl %edx, %r11d
addq %r11, %r11
leaq (%r8,%r8,4), %rdx
leaq (%rdi,%rdx,2), %rbx
movl $0x2, %edx
xorl %r14d, %r14d
mulxq %rax, %r15, %r15
shrq %r15
andq $-0x2, %r15
leaq (%r15,%r15,4), %r15
movq %rcx, %r12
subq %r15, %r12
leaq 0x1(%r14), %r15
cmpq $0x4, %r14
movl $0x0, %r13d
cmovneq %r15, %r13
movzwl (%rbx,%r13,2), %ebp
notl %ebp
andw (%r12,%r14,2), %bp
xorw (%r10,%r14,2), %bp
movw %bp, -0x38(%rsp,%r14,2)
incq %rdx
movq %r15, %r14
cmpq $0x5, %r15
jne 0x96b6
movzwl -0x30(%rsp), %edx
movw %dx, 0x8(%rdi,%r11)
movq -0x38(%rsp), %rdx
movq %rdx, (%rdi,%r11)
incq %r8
addq $0xa, %r10
addq $0xa, %rcx
cmpq $0x5, %r8
jne 0x968e
movl %esi, %eax
leaq 0x91dd(%rip), %rcx      # 0x12910
movzwl (%rcx,%rax,2), %eax
xorw %ax, (%rdi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq