// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/stribob192r2/8bit/wbob_pi8.c
// Function: wbob_pi
void wbob_pi(w512_t *s512)
{
    int r, i, j;
    uint8_t t[64], x, *pt;

    for (r = 0; r < 12; r++) {                      // 12 rounds

        for (i = 0; i < 64; i++) {
            t[(i & 7) + ((i + (i << 3)) & 070)] =   // P
                wbob_sbox[s512->b[i]];              // S
        }

        // The round constants C comes from the S-box
        pt = (uint8_t *) &wbob_sbox[8 * r];
        for (i = 0; i < 8; i++)
            s512->b[i] = pt[i];                     // C in first 8
        for (i = 8; i < 64; i++)
            s512->b[i] = 0;                         // zero the rest

        // Apply the circular, low weight MDS matrix
        for (i = 0; i < 64; i += 8) {
            pt = &s512->b[i];                       // start of row
            for (j = 0; j < 8; j++) {
                x = t[i + j];                       // Circular MDS
                pt[j & 7] ^= x;                     // 01
                pt[(j + 1) & 7] ^= x;               // 01
                pt[(j + 3) & 7] ^= x;               // 01
                pt[(j + 5) & 7] ^= x;
                pt[(j + 7) & 7] ^= x;

                // x <- 02
                x = (x << 1) ^ (x & 0x80 ? 0x1D : 0x00);
                pt[(j + 6) & 7] ^= x;               // 02

                // x <- 04
                x = (x << 1) ^ (x & 0x80 ? 0x1D : 0x00);
                pt[(j + 2) & 7] ^= x;               // 04
                pt[(j + 5) & 7] ^= x;               // 01 + 04 = 05

                // x <- 08
                x = (x << 1) ^ (x & 0x80 ? 0x1D : 0x00);
                pt[(j + 4) & 7] ^= x;               // 08
                pt[(j + 7) & 7] ^= x;               // 01 + 08 = 09
            }
        }
    }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl $0x0, -0xc(%rsp)
cmpl $0xc, -0xc(%rsp)
jge 0x1c40
movl $0x0, -0x10(%rsp)
cmpl $0x40, -0x10(%rsp)
jge 0x199d
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x692(%rip), %rax       # 0x2000
movb (%rax,%rcx), %cl
movl -0x10(%rsp), %eax
andl $0x7, %eax
movl -0x10(%rsp), %edx
movl -0x10(%rsp), %esi
shll $0x3, %esi
addl %esi, %edx
andl $0x38, %edx
addl %edx, %eax
cltq
movb %cl, -0x58(%rsp,%rax)
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x1950
movl -0xc(%rsp), %eax
shll $0x3, %eax
movslq %eax, %rcx
leaq 0x652(%rip), %rax       # 0x2000
addq %rcx, %rax
movq %rax, -0x68(%rsp)
movl $0x0, -0x10(%rsp)
cmpl $0x8, -0x10(%rsp)
jge 0x19ec
movq -0x68(%rsp), %rax
movslq -0x10(%rsp), %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x19be
movl $0x8, -0x10(%rsp)
cmpl $0x40, -0x10(%rsp)
jge 0x1a16
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x19f4
movl $0x0, -0x10(%rsp)
cmpl $0x40, -0x10(%rsp)
jge 0x1c2e
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
addq %rcx, %rax
movq %rax, -0x68(%rsp)
movl $0x0, -0x14(%rsp)
cmpl $0x8, -0x14(%rsp)
jge 0x1c1c
movl -0x10(%rsp), %eax
addl -0x14(%rsp), %eax
cltq
movb -0x58(%rsp,%rax), %al
movb %al, -0x59(%rsp)
movzbl -0x59(%rsp), %esi
movq -0x68(%rsp), %rax
movl -0x14(%rsp), %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movzbl -0x59(%rsp), %esi
movq -0x68(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x1, %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movzbl -0x59(%rsp), %esi
movq -0x68(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x3, %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movzbl -0x59(%rsp), %esi
movq -0x68(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x5, %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movzbl -0x59(%rsp), %esi
movq -0x68(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x7, %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movzbl -0x59(%rsp), %eax
shll %eax
movzbl -0x59(%rsp), %esi
andl $0x80, %esi
xorl %ecx, %ecx
movl $0x1d, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
xorl %ecx, %eax
movb %al, -0x59(%rsp)
movzbl -0x59(%rsp), %esi
movq -0x68(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x6, %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movzbl -0x59(%rsp), %eax
shll %eax
movzbl -0x59(%rsp), %esi
andl $0x80, %esi
xorl %ecx, %ecx
movl $0x1d, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
xorl %ecx, %eax
movb %al, -0x59(%rsp)
movzbl -0x59(%rsp), %esi
movq -0x68(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x2, %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movzbl -0x59(%rsp), %esi
movq -0x68(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x5, %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movzbl -0x59(%rsp), %eax
shll %eax
movzbl -0x59(%rsp), %esi
andl $0x80, %esi
xorl %ecx, %ecx
movl $0x1d, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
xorl %ecx, %eax
movb %al, -0x59(%rsp)
movzbl -0x59(%rsp), %esi
movq -0x68(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x4, %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movzbl -0x59(%rsp), %esi
movq -0x68(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x7, %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0x1a43
jmp 0x1c1e
movl -0x10(%rsp), %eax
addl $0x8, %eax
movl %eax, -0x10(%rsp)
jmp 0x1a1e
jmp 0x1c30
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0x193d
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)