// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/stribob192r2/ref/wbob_pi64.c
// Function: wbob_pi
void wbob_pi(w512_t *s512)
{
    int i;
    uint64_t k[8], l[8];

    // load block
    for (i = 0; i < 8; i++)
        k[i] = s512->q[i];

    for (i = 0; i < 12; i++) {

        l[0] =  WBOB_SM(0, k[0]) ^  WBOB_SM(1, k[7]) ^
                WBOB_SM(2, k[6]) ^  WBOB_SM(3, k[5]) ^
                WBOB_SM(4, k[4]) ^  WBOB_SM(5, k[3]) ^
                WBOB_SM(6, k[2]) ^  WBOB_SM(7, k[1]) ^ wbob_rc[i];

        l[1] =  WBOB_SM(0, k[1]) ^  WBOB_SM(1, k[0]) ^
                WBOB_SM(2, k[7]) ^  WBOB_SM(3, k[6]) ^
                WBOB_SM(4, k[5]) ^  WBOB_SM(5, k[4]) ^
                WBOB_SM(6, k[3]) ^  WBOB_SM(7, k[2]);

        l[2] =  WBOB_SM(0, k[2]) ^  WBOB_SM(1, k[1]) ^
                WBOB_SM(2, k[0]) ^  WBOB_SM(3, k[7]) ^
                WBOB_SM(4, k[6]) ^  WBOB_SM(5, k[5]) ^
                WBOB_SM(6, k[4]) ^  WBOB_SM(7, k[3]);

        l[3] =  WBOB_SM(0, k[3]) ^  WBOB_SM(1, k[2]) ^
                WBOB_SM(2, k[1]) ^  WBOB_SM(3, k[0]) ^
                WBOB_SM(4, k[7]) ^  WBOB_SM(5, k[6]) ^
                WBOB_SM(6, k[5]) ^  WBOB_SM(7, k[4]);

        l[4] =  WBOB_SM(0, k[4]) ^  WBOB_SM(1, k[3]) ^
                WBOB_SM(2, k[2]) ^  WBOB_SM(3, k[1]) ^
                WBOB_SM(4, k[0]) ^  WBOB_SM(5, k[7]) ^
                WBOB_SM(6, k[6]) ^  WBOB_SM(7, k[5]);

        l[5] =  WBOB_SM(0, k[5]) ^  WBOB_SM(1, k[4]) ^
                WBOB_SM(2, k[3]) ^  WBOB_SM(3, k[2]) ^
                WBOB_SM(4, k[1]) ^  WBOB_SM(5, k[0]) ^
                WBOB_SM(6, k[7]) ^  WBOB_SM(7, k[6]);

        l[6] =  WBOB_SM(0, k[6]) ^  WBOB_SM(1, k[5]) ^
                WBOB_SM(2, k[4]) ^  WBOB_SM(3, k[3]) ^
                WBOB_SM(4, k[2]) ^  WBOB_SM(5, k[1]) ^
                WBOB_SM(6, k[0]) ^  WBOB_SM(7, k[7]);

        l[7] =  WBOB_SM(0, k[7]) ^  WBOB_SM(1, k[6]) ^
                WBOB_SM(2, k[5]) ^  WBOB_SM(3, k[4]) ^
                WBOB_SM(4, k[3]) ^  WBOB_SM(5, k[2]) ^
                WBOB_SM(6, k[1]) ^  WBOB_SM(7, k[0]);

        if (i < 11) {
            k[0] = l[0];
            k[1] = l[1];
            k[2] = l[2];
            k[3] = l[3];
            k[4] = l[4];
            k[5] = l[5];
            k[6] = l[6];
            k[7] = l[7];
        }
    }

    for (i = 0; i < 8; i++)
        s512->q[i] = l[i];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
xorl %eax, %eax
cmpq $0x8, %rax
je 0x15f4
movq (%rdi,%rax,8), %rcx
movq %rcx, 0x20(%rsp,%rax,8)
incq %rax
jmp 0x15e0
movq %rdi, -0x38(%rsp)
movq 0x20(%rsp), %rax
movq %rax, -0x60(%rsp)
movq 0x28(%rsp), %rax
movq %rax, -0x50(%rsp)
movq 0x58(%rsp), %rax
movq %rax, -0x80(%rsp)
movq 0x50(%rsp), %rax
movq %rax, -0x78(%rsp)
movq 0x48(%rsp), %rax
movq %rax, -0x68(%rsp)
movq 0x40(%rsp), %rax
movq %rax, -0x70(%rsp)
movq 0x38(%rsp), %rax
movq %rax, -0x40(%rsp)
movq 0x30(%rsp), %rax
movq %rax, -0x58(%rsp)
xorl %ecx, %ecx
movl $0xff, %r13d
cmpq $0x60, %rcx
je 0x1bf5
movq -0x60(%rsp), %rbp
movl %ebp, %eax
andl %r13d, %eax
movq -0x80(%rsp), %r9
movl %r9d, %edx
movq %r9, -0x80(%rsp)
shrl $0x8, %edx
andl %r13d, %edx
leaq 0x1181(%rip), %rsi      # 0x2800
movq (%rsi,%rdx,8), %rdx
leaq 0x976(%rip), %rsi       # 0x2000
xorq (%rsi,%rax,8), %rdx
movq -0x78(%rsp), %r14
movl %r14d, %eax
shrl $0xd, %eax
movl $0x7f8, %esi            # imm = 0x7F8
andl %esi, %eax
leaq 0x1959(%rip), %r11      # 0x3000
xorq (%rax,%r11), %rdx
movq -0x68(%rsp), %r10
movl %r10d, %eax
shrl $0x18, %eax
leaq 0x2143(%rip), %rsi      # 0x3800
xorq (%rsi,%rax,8), %rdx
movq -0x70(%rsp), %rdi
movq %rdi, %rax
movq %rdi, -0x70(%rsp)
shrq $0x20, %rax
andl %r13d, %eax
leaq 0x2924(%rip), %rsi      # 0x4000
xorq (%rsi,%rax,8), %rdx
movq -0x40(%rsp), %rbx
movq %rbx, %rax
shrq $0x28, %rax
andl %r13d, %eax
leaq 0x310a(%rip), %rsi      # 0x4800
xorq (%rsi,%rax,8), %rdx
movq -0x58(%rsp), %rsi
movq %rsi, %rax
movq %rsi, %r12
shrq $0x30, %rax
andl %r13d, %eax
leaq 0x38ed(%rip), %rsi      # 0x5000
xorq (%rsi,%rax,8), %rdx
movq %rcx, -0x28(%rsp)
movq -0x50(%rsp), %r15
movq %r15, %rax
shrq $0x38, %rax
leaq 0x40d1(%rip), %rsi      # 0x5800
xorq (%rsi,%rax,8), %rdx
movq %rdx, -0x30(%rsp)
movl %r15d, %esi
andl %r13d, %esi
movl %ebp, %eax
shrl $0x8, %eax
andl %r13d, %eax
leaq 0x10b3(%rip), %rcx      # 0x2800
movq (%rcx,%rax,8), %r8
leaq 0x8a8(%rip), %rax       # 0x2000
xorq (%rax,%rsi,8), %r8
movl %r9d, %esi
shrl $0xd, %esi
movl $0x7f8, %eax            # imm = 0x7F8
andl %eax, %esi
xorq (%rsi,%r11), %r8
movl %r14d, %esi
shrl $0x18, %esi
leaq 0x2086(%rip), %r11      # 0x3800
xorq (%r11,%rsi,8), %r8
movq %r10, %rax
movq %r10, -0x68(%rsp)
movq %r10, %rsi
shrq $0x20, %rsi
andl %r13d, %esi
leaq 0x2869(%rip), %rdx      # 0x4000
xorq (%rdx,%rsi,8), %r8
shrq $0x28, %rdi
andl %r13d, %edi
leaq 0x3057(%rip), %r10      # 0x4800
xorq (%r10,%rdi,8), %r8
movq %rbx, %r9
movq %rbx, %rsi
shrq $0x30, %rsi
andl %r13d, %esi
leaq 0x383f(%rip), %rbx      # 0x5000
xorq (%rbx,%rsi,8), %r8
movq %r12, %rsi
shrq $0x38, %rsi
leaq 0x402d(%rip), %rcx      # 0x5800
xorq (%rcx,%rsi,8), %r8
movq %r8, -0x48(%rsp)
movl %r12d, %r8d
andl %r13d, %r8d
movq %r15, %rdi
movl %edi, %esi
shrl $0x8, %esi
andl %r13d, %esi
leaq 0x100c(%rip), %r15      # 0x2800
movq (%r15,%rsi,8), %rsi
leaq 0x801(%rip), %r15       # 0x2000
xorq (%r15,%r8,8), %rsi
movq %rbp, -0x60(%rsp)
movl %ebp, %r8d
shrl $0xd, %r8d
movl $0x7f8, %r15d           # imm = 0x7F8
andl %r15d, %r8d
leaq 0x17e1(%rip), %r15      # 0x3000
xorq (%r8,%r15), %rsi
movq -0x80(%rsp), %r15
movl %r15d, %r8d
shrl $0x18, %r8d
xorq (%r11,%r8,8), %rsi
movq %r14, %r8
shrq $0x20, %r8
andl %r13d, %r8d
xorq (%rdx,%r8,8), %rsi
shrq $0x28, %rax
andl %r13d, %eax
xorq (%r10,%rax,8), %rsi
movq -0x70(%rsp), %rax
movq %rax, %r8
shrq $0x30, %r8
andl %r13d, %r8d
xorq (%rbx,%r8,8), %rsi
movq %rbx, %r10
movq %r9, %r8
shrq $0x38, %r8
xorq (%rcx,%r8,8), %rsi
movq %rcx, %rdx
movl %r9d, %ecx
movq %r9, %r11
andl %r13d, %ecx
movl %r12d, %r8d
movq %r12, -0x58(%rsp)
shrl $0x8, %r8d
andl %r13d, %r8d
leaq 0xf71(%rip), %r9        # 0x2800
movq (%r9,%r8,8), %r8
leaq 0x766(%rip), %r9        # 0x2000
xorq (%r9,%rcx,8), %r8
movl %edi, %r9d
movq %rdi, %rbx
shrl $0xd, %r9d
movl $0x7f8, %ecx            # imm = 0x7F8
andl %ecx, %r9d
leaq 0x1749(%rip), %rcx      # 0x3000
xorq (%r9,%rcx), %r8
movl %ebp, %r9d
shrl $0x18, %r9d
leaq 0x1f37(%rip), %rcx      # 0x3800
xorq (%rcx,%r9,8), %r8
movq %r15, %r9
shrq $0x20, %r9
andl %r13d, %r9d
leaq 0x2722(%rip), %rcx      # 0x4000
xorq (%rcx,%r9,8), %r8
movq %r14, -0x78(%rsp)
movq %r14, %r9
shrq $0x28, %r9
andl %r13d, %r9d
leaq 0x2f08(%rip), %rcx      # 0x4800
xorq (%rcx,%r9,8), %r8
movq -0x68(%rsp), %rdi
movq %rdi, %r9
shrq $0x30, %r9
andl %r13d, %r9d
xorq (%r10,%r9,8), %r8
movq %rax, %r9
shrq $0x38, %r9
xorq (%rdx,%r9,8), %r8
movl %eax, %r10d
movq %rax, %rdx
andl %r13d, %r10d
movq %r11, %rbp
movl %ebp, %r9d
shrl $0x8, %r9d
andl %r13d, %r9d
leaq 0xec9(%rip), %rax       # 0x2800
movq (%rax,%r9,8), %r9
leaq 0x6be(%rip), %rax       # 0x2000
xorq (%rax,%r10,8), %r9
movl %r12d, %r10d
shrl $0xd, %r10d
movl $0x7f8, %eax            # imm = 0x7F8
andl %eax, %r10d
leaq 0x16a4(%rip), %rax      # 0x3000
xorq (%r10,%rax), %r9
movq %rbx, %r15
movq %rbx, -0x50(%rsp)
movl %r15d, %r10d
shrl $0x18, %r10d
leaq 0x1e8a(%rip), %rbx      # 0x3800
xorq (%rbx,%r10,8), %r9
movq -0x60(%rsp), %rcx
movq %rcx, %r10
shrq $0x20, %r10
andl %r13d, %r10d
leaq 0x2670(%rip), %rax      # 0x4000
xorq (%rax,%r10,8), %r9
movq -0x80(%rsp), %rax
movq %rax, %r10
shrq $0x28, %r10
andl %r13d, %r10d
leaq 0x2e56(%rip), %r11      # 0x4800
xorq (%r11,%r10,8), %r9
movq %r14, %r10
shrq $0x30, %r10
andl %r13d, %r10d
leaq 0x3641(%rip), %r14      # 0x5000
xorq (%r14,%r10,8), %r9
movq %rdi, %r10
shrq $0x38, %r10
leaq 0x3e2f(%rip), %r11      # 0x5800
xorq (%r11,%r10,8), %r9
movl %edi, %r11d
andl %r13d, %r11d
movl %edx, %r10d
shrl $0x8, %r10d
andl %r13d, %r10d
leaq 0xe14(%rip), %rdx       # 0x2800
movq (%rdx,%r10,8), %r10
leaq 0x609(%rip), %r12       # 0x2000
xorq (%r12,%r11,8), %r10
movl %ebp, %r11d
shrl $0xd, %r11d
movl $0x7f8, %edx            # imm = 0x7F8
andl %edx, %r11d
leaq 0x15ef(%rip), %rdx      # 0x3000
xorq (%r11,%rdx), %r10
movq -0x58(%rsp), %rdx
movl %edx, %r11d
shrl $0x18, %r11d
xorq (%rbx,%r11,8), %r10
movq %r15, %r11
shrq $0x20, %r11
andl %r13d, %r11d
leaq 0x25ca(%rip), %rbx      # 0x4000
xorq (%rbx,%r11,8), %r10
movq %rcx, %r11
shrq $0x28, %r11
andl %r13d, %r11d
leaq 0x2db5(%rip), %rcx      # 0x4800
xorq (%rcx,%r11,8), %r10
movq %rax, %r11
shrq $0x30, %r11
andl %r13d, %r11d
xorq (%r14,%r11,8), %r10
movq -0x78(%rsp), %rbx
movq %rbx, %r11
shrq $0x38, %r11
leaq 0x3d90(%rip), %r15      # 0x5800
xorq (%r15,%r11,8), %r10
andl %r13d, %ebx
movl %edi, %r11d
shrl $0x8, %r11d
andl %r13d, %r11d
leaq 0xd78(%rip), %rax       # 0x2800
movq (%rax,%r11,8), %r11
xorq (%r12,%rbx,8), %r11
movq -0x70(%rsp), %rax
movl %eax, %ebx
shrl $0xd, %ebx
movl $0x7f8, %ecx            # imm = 0x7F8
andl %ecx, %ebx
leaq 0x1558(%rip), %rcx      # 0x3000
xorq (%rbx,%rcx), %r11
movl %ebp, %ebx
shrl $0x18, %ebx
leaq 0x1d48(%rip), %rcx      # 0x3800
xorq (%rcx,%rbx,8), %r11
movq %rdx, %rbx
movq %rdx, %r12
shrq $0x20, %rbx
andl %r13d, %ebx
leaq 0x2530(%rip), %rcx      # 0x4000
xorq (%rcx,%rbx,8), %r11
movq -0x50(%rsp), %rcx
movq %rcx, %rbx
shrq $0x28, %rbx
andl %r13d, %ebx
leaq 0x2d16(%rip), %rdx      # 0x4800
xorq (%rdx,%rbx,8), %r11
movq -0x60(%rsp), %rdx
movq %rdx, %rbx
shrq $0x30, %rbx
andl %r13d, %ebx
xorq (%r14,%rbx,8), %r11
movq -0x80(%rsp), %r14
movq %r14, %rbx
shrq $0x38, %rbx
xorq (%r15,%rbx,8), %r11
andl %r13d, %r14d
movq -0x78(%rsp), %rbx
shrl $0x8, %ebx
andl %r13d, %ebx
leaq 0xcda(%rip), %rdi       # 0x2800
movq (%rdi,%rbx,8), %rbx
leaq 0x4cf(%rip), %rdi       # 0x2000
xorq (%rdi,%r14,8), %rbx
movq -0x68(%rsp), %r14
shrl $0xd, %r14d
movl $0x7f8, %edi            # imm = 0x7F8
andl %edi, %r14d
leaq 0x14b3(%rip), %rdi      # 0x3000
xorq (%r14,%rdi), %rbx
movl %eax, %r14d
shrl $0x18, %r14d
leaq 0x1ca1(%rip), %rax      # 0x3800
xorq (%rax,%r14,8), %rbx
shrq $0x20, %rbp
andl %r13d, %ebp
leaq 0x248f(%rip), %rax      # 0x4000
xorq (%rax,%rbp,8), %rbx
shrq $0x28, %r12
andl %r13d, %r12d
leaq 0x2c7d(%rip), %rax      # 0x4800
xorq (%rax,%r12,8), %rbx
movq %rcx, %r14
movq -0x28(%rsp), %rcx
shrq $0x30, %r14
andl %r13d, %r14d
leaq 0x3463(%rip), %rax      # 0x5000
xorq (%rax,%r14,8), %rbx
shrq $0x38, %rdx
xorq (%r15,%rdx,8), %rbx
leaq 0x4450(%rip), %rdi      # 0x6000
movq -0x30(%rsp), %rdx
xorq (%rcx,%rdi), %rdx
cmpq $0x58, %rcx
je 0x1bec
movq -0x48(%rsp), %rax
movq %rax, -0x50(%rsp)
movq %rsi, -0x58(%rsp)
movq %r8, -0x40(%rsp)
movq %r9, -0x70(%rsp)
movq %r10, -0x68(%rsp)
movq %r11, -0x78(%rsp)
movq %rbx, -0x80(%rsp)
movq %rdx, -0x60(%rsp)
addq $0x8, %rcx
jmp 0x1651
movq %rdx, -0x20(%rsp)
movq -0x48(%rsp), %rax
movq %rax, -0x18(%rsp)
movq %rsi, -0x10(%rsp)
movq %r8, -0x8(%rsp)
movq %r9, (%rsp)
movq %r10, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
xorl %eax, %eax
movq -0x38(%rsp), %rdx
cmpq $0x8, %rax
je 0x1c3c
movq -0x20(%rsp,%rax,8), %rcx
movq %rcx, (%rdx,%rax,8)
incq %rax
jmp 0x1c28
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop