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

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

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

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movw $0x1f, %ax
kmovd %eax, %k1
vmovdqu8 (%rdi), %xmm0 {%k1} {z}
vmovdqu8 0x5(%rdi), %xmm1 {%k1} {z}
vmovdqu8 0xa(%rdi), %xmm2 {%k1} {z}
vpternlogq $0x96, %xmm0, %xmm1, %xmm2
vmovdqu8 0xf(%rdi), %xmm0 {%k1} {z}
vmovdqu8 0x14(%rdi), %xmm1 {%k1} {z}
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
vpternlogq $0x96, %xmm2, %xmm0, %xmm1
vmovdqu8 %xmm1, -0x20(%rsp) {%k1}
xorl %ecx, %ecx
movl $0x4, %edx
leaq 0x1(%rcx), %r8
cmpq $0x4, %rcx
movl $0x0, %r9d
cmovneq %r8, %r9
movb -0x20(%rsp,%r9), %r9b
rolb %r9b
testq %rcx, %rcx
leal 0x2(%rax,%rcx), %r10d
cmoveq %rdx, %r10
xorb -0x20(%rsp,%r10), %r9b
movb %r9b, -0x25(%rsp,%rcx)
movq %r8, %rcx
cmpq $0x5, %r8
jne 0x8a59
xorl %ecx, %ecx
movq %rdi, %rdx
movb -0x25(%rsp,%rcx), %r8b
xorl %r9d, %r9d
xorb %r8b, (%rdx,%r9)
addq $0x5, %r9
cmpq $0x19, %r9
jne 0x8a9f
incq %rcx
incq %rdx
cmpq $0x5, %rcx
jne 0x8a97
leaq 0x9aa0(%rip), %rcx      # 0x12560
xorl %edx, %edx
movl $0x880001, %r8d         # imm = 0x880001
movq %rdi, %r9
xorl %r10d, %r10d
leal (%rdx,%r10), %r11d
btq %r11, %r8
movb (%r9,%r10), %r11b
jb 0x8af7
movzbl %r11b, %r11d
movb (%rcx,%r10,4), %bl
shlxl %ebx, %r11d, %ebp
movb $0x8, %r14b
subb %bl, %r14b
shrxl %r14d, %r11d, %r11d
xorl %ebp, %r11d
movb %r11b, (%r9,%r10)
addq $0x5, %r10
cmpq $0x19, %r10
jne 0x8ace
incq %rdx
addq $0x4, %rcx
incq %r9
cmpq $0x5, %rdx
jne 0x8acb
leaq -0x20(%rsp), %rcx
xorl %edx, %edx
movq %rdi, %r8
xorl %r9d, %r9d
movb (%r8,%r9), %r10b
movb %r10b, (%rcx,%r9)
addq $0x5, %r9
cmpq $0x19, %r9
jne 0x8b22
incq %rdx
incq %rcx
incq %r8
cmpq $0x5, %rdx
jne 0x8b1f
xorl %ecx, %ecx
leaq -0x20(%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
movb (%rdx,%r15), %bpl
movb %bpl, (%r14,%r12)
addq $0x5, %r15
incq %r14
addl $0xf, %ebx
addl $0x3, %r11d
cmpq $0x19, %r15
jne 0x8b62
incq %r10
addl $0xa, %r9d
addl $0x2, %ecx
incq %rdx
cmpq $0x5, %r10
jne 0x8b56
xorl %ecx, %ecx
movl $0xcccccccd, %edx       # imm = 0xCCCCCCCD
xorl %r8d, %r8d
leaq (%r8,%r8,4), %r9
movl %r8d, %r10d
imulq %rdx, %r10
shrq $0x22, %r10
imull $-0x19, %r10d, %r10d
addl %r9d, %r10d
addq %rdi, %r9
leaq (%rdi,%rcx), %r11
xorl %ebx, %ebx
leaq 0x1(%rbx), %r14
cmpq $0x4, %rbx
movl $0x0, %r15d
cmovneq %r14, %r15
movb (%r9,%r15), %bpl
notb %bpl
cmpq $0x3, %rbx
movl $0x2, %r15d
cmovael %eax, %r15d
addl %ecx, %r15d
addl %ebx, %r15d
andb (%rdi,%r15), %bpl
xorb (%r11,%rbx), %bpl
movb %bpl, -0x20(%rsp,%rbx)
movq %r14, %rbx
cmpq $0x5, %r14
jne 0x8bd3
movb -0x1c(%rsp), %r9b
movb %r9b, 0x4(%rdi,%r10)
movl -0x20(%rsp), %r9d
movl %r9d, (%rdi,%r10)
incq %r8
addq $0x5, %rcx
cmpq $0x5, %r8
jne 0x8bb4
movl %esi, %eax
leaq 0x98fd(%rip), %rcx      # 0x12540
movb (%rax,%rcx), %al
xorb %al, (%rdi)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq