// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/lunarkeyakv2/compact/KeccakP-200-compact.c
// Function: KeccakP200_Permute_Nrounds
void KeccakP200_Permute_Nrounds(void *argState, unsigned int nr)
{
    tSmallUInt x, y;
    tKeccakLane temp;
    tKeccakLane BC[5];
    tKeccakLane *state;
    const tKeccakLane *rc;

    state = (tKeccakLane*)argState;
    rc = KeccakF200_RoundConstants + 18 - nr;
    do
    {
        /* Theta */
        for ( x = 0; x < 5; ++x )
        {
            BC[x] = state[x] ^ state[5 + x] ^ state[10 + x] ^ state[15 + x] ^ state[20 + x];
        }
        for ( x = 0; x < 5; ++x )
        {
            temp = BC[MOD5(x+4)] ^ ROL8(BC[MOD5(x+1)], 1);
            for ( y = 0; y < 25; y += 5 )
            {
                state[y + x] ^= temp;
            }
        }

        /* Rho Pi */
        temp = state[1];
        for ( x = 0; x < 24; ++x )
        {
            BC[0] = state[KeccakP200_PiLane[x]];
            state[KeccakP200_PiLane[x]] = ROL8( temp, KeccakP200_RotationConstants[x] );
            temp = BC[0];
        }

        /*    Chi */
        for ( y = 0; y < 25; y += 5 )
        {
#if defined(UNROLL_CHILOOP)
            BC[0] = state[y + 0];
            BC[1] = state[y + 1];
            BC[2] = state[y + 2];
            BC[3] = state[y + 3];
            BC[4] = state[y + 4];
#else
            for ( x = 0; x < 5; ++x )
            {
                BC[x] = state[y + x];
            }
#endif
            for ( x = 0; x < 5; ++x )
            {
                state[y + x] = BC[x] ^((~BC[MOD5(x+1)]) & BC[MOD5(x+2)]);
            }
        }

        /*    Iota */
        temp = *(rc++);
        state[0] ^= temp;
    }
    while( temp != 0x80 );
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x28(%rsp)
movl -0xc(%rsp), %eax
xorl %ecx, %ecx
subq %rax, %rcx
movq 0x11b85(%rip), %rax     # 0x18ff8
addq $0x12, %rax
addq %rcx, %rax
movq %rax, -0x30(%rsp)
movl $0x0, -0x10(%rsp)
cmpl $0x5, -0x10(%rsp)
jae 0x7502
movq -0x28(%rsp), %rax
movl -0x10(%rsp), %ecx
movzbl (%rax,%rcx), %eax
movq -0x28(%rsp), %rcx
movl -0x10(%rsp), %edx
addl $0x5, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
xorl %ecx, %eax
movq -0x28(%rsp), %rcx
movl -0x10(%rsp), %edx
addl $0xa, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
xorl %ecx, %eax
movq -0x28(%rsp), %rcx
movl -0x10(%rsp), %edx
addl $0xf, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
xorl %ecx, %eax
movq -0x28(%rsp), %rcx
movl -0x10(%rsp), %edx
addl $0x14, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
xorl %ecx, %eax
movb %al, %cl
movl -0x10(%rsp), %eax
movb %cl, -0x1a(%rsp,%rax)
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x7487
movl $0x0, -0x10(%rsp)
cmpl $0x5, -0x10(%rsp)
jae 0x75c1
movl -0x10(%rsp), %eax
addl $0x4, %eax
movl %eax, %eax
movl %eax, %ecx
movq 0x11aa1(%rip), %rax     # 0x18fc8
movzbl (%rax,%rcx), %eax
movzbl -0x1a(%rsp,%rax), %eax
movl -0x10(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movl %ecx, %edx
movq 0x11a86(%rip), %rcx     # 0x18fc8
movzbl (%rcx,%rdx), %ecx
movzbl -0x1a(%rsp,%rcx), %ecx
shll %ecx
movl -0x10(%rsp), %edx
addl $0x1, %edx
movl %edx, %edx
movl %edx, %esi
movq 0x11a69(%rip), %rdx     # 0x18fc8
movzbl (%rdx,%rsi), %edx
movzbl -0x1a(%rsp,%rdx), %edx
sarl $0x7, %edx
xorl %edx, %ecx
movzbl %cl, %ecx
xorl %ecx, %eax
movb %al, -0x15(%rsp)
movl $0x0, -0x14(%rsp)
cmpl $0x19, -0x14(%rsp)
jae 0x75af
movzbl -0x15(%rsp), %esi
movq -0x28(%rsp), %rax
movl -0x14(%rsp), %ecx
addl -0x10(%rsp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movl -0x14(%rsp), %eax
addl $0x5, %eax
movl %eax, -0x14(%rsp)
jmp 0x757e
jmp 0x75b1
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x750a
movq -0x28(%rsp), %rax
movb 0x1(%rax), %al
movb %al, -0x15(%rsp)
movl $0x0, -0x10(%rsp)
cmpl $0x18, -0x10(%rsp)
jae 0x7671
movq -0x28(%rsp), %rax
movl -0x10(%rsp), %ecx
movl %ecx, %edx
movq 0x119f6(%rip), %rcx     # 0x18fe8
movzbl (%rcx,%rdx), %ecx
movb (%rax,%rcx), %al
movb %al, -0x1a(%rsp)
movzbl -0x15(%rsp), %eax
movl -0x10(%rsp), %ecx
movl %ecx, %edx
movq 0x11981(%rip), %rcx     # 0x18f90
movzbl (%rcx,%rdx), %ecx
andl $0x7, %ecx
shll %cl, %eax
movzbl -0x15(%rsp), %edx
movl -0x10(%rsp), %ecx
movl %ecx, %esi
movq 0x11966(%rip), %rcx     # 0x18f90
movzbl (%rcx,%rsi), %esi
andl $0x7, %esi
movl $0x8, %ecx
subl %esi, %ecx
sarl %cl, %edx
movl %edx, %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0x28(%rsp), %rax
movl -0x10(%rsp), %ecx
movl %ecx, %esi
movq 0x11996(%rip), %rcx     # 0x18fe8
movzbl (%rcx,%rsi), %ecx
movb %dl, (%rax,%rcx)
movb -0x1a(%rsp), %al
movb %al, -0x15(%rsp)
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x75d5
movl $0x0, -0x14(%rsp)
cmpl $0x19, -0x14(%rsp)
jae 0x7775
movq -0x28(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x0, %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %al
movb %al, -0x1a(%rsp)
movq -0x28(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %al
movb %al, -0x19(%rsp)
movq -0x28(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %al
movb %al, -0x18(%rsp)
movq -0x28(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x3, %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %al
movb %al, -0x17(%rsp)
movq -0x28(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x4, %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %al
movb %al, -0x16(%rsp)
movl $0x0, -0x10(%rsp)
cmpl $0x5, -0x10(%rsp)
jae 0x7763
movl -0x10(%rsp), %eax
movzbl -0x1a(%rsp,%rax), %eax
movl -0x10(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movl %ecx, %edx
movq 0x118b1(%rip), %rcx     # 0x18fc8
movzbl (%rcx,%rdx), %ecx
movzbl -0x1a(%rsp,%rcx), %ecx
xorl $-0x1, %ecx
movl -0x10(%rsp), %edx
addl $0x2, %edx
movl %edx, %edx
movl %edx, %esi
movq 0x11893(%rip), %rdx     # 0x18fc8
movzbl (%rdx,%rsi), %edx
movzbl -0x1a(%rsp,%rdx), %edx
andl %edx, %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0x28(%rsp), %rax
movl -0x14(%rsp), %ecx
addl -0x10(%rsp), %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x76f5
jmp 0x7765
movl -0x14(%rsp), %eax
addl $0x5, %eax
movl %eax, -0x14(%rsp)
jmp 0x7679
movq -0x30(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rsp)
movb (%rax), %al
movb %al, -0x15(%rsp)
movzbl -0x15(%rsp), %edx
movq -0x28(%rsp), %rax
movzbl (%rax), %ecx
xorl %edx, %ecx
movb %cl, (%rax)
movzbl -0x15(%rsp), %eax
cmpl $0x80, %eax
jne 0x747f
retq
nop