// File: /workspace/github_c_makefile_star2_O1/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
movq 0x38(%rdi), %rax
movq %rax, -0x50(%rsp)
movq 0x30(%rdi), %rax
movq %rax, -0x58(%rsp)
movq 0x28(%rdi), %rax
movq %rax, -0x48(%rsp)
movq 0x20(%rdi), %rax
movq %rax, -0x40(%rsp)
movq 0x18(%rdi), %rax
movq %rax, -0x18(%rsp)
movq 0x10(%rdi), %rax
movq %rax, -0x38(%rsp)
movq (%rdi), %rax
movq %rax, -0x28(%rsp)
movq %rdi, -0x10(%rsp)
movq 0x8(%rdi), %rax
movq %rax, -0x20(%rsp)
xorl %edi, %edi
movq %rdi, -0x8(%rsp)
movq -0x28(%rsp), %rcx
movl %ecx, %eax
movq %rcx, %rsi
movl $0xff, %r10d
andl %r10d, %eax
movq -0x50(%rsp), %rdx
movl %edx, %ecx
movq %rdx, %r15
shrl $0x8, %ecx
andl %r10d, %ecx
leaq 0x1181(%rip), %rdx      # 0x2800
movq (%rdx,%rcx,8), %r11
movq %rdx, %r12
leaq 0x973(%rip), %r13       # 0x2000
xorq (%r13,%rax,8), %r11
movq -0x58(%rsp), %rcx
movl %ecx, %eax
movq %rcx, %rdi
shrl $0xd, %eax
movl $0x7f8, %ecx            # imm = 0x7F8
andl %ecx, %eax
leaq 0x1953(%rip), %rcx      # 0x3000
xorq (%rax,%rcx), %r11
movq -0x48(%rsp), %r8
movl %r8d, %eax
shrl $0x18, %eax
leaq 0x213d(%rip), %rcx      # 0x3800
xorq (%rcx,%rax,8), %r11
movq -0x40(%rsp), %r14
movq %r14, %rax
shrq $0x20, %rax
andl %r10d, %eax
leaq 0x2923(%rip), %rcx      # 0x4000
xorq (%rcx,%rax,8), %r11
movq -0x18(%rsp), %r9
movq %r9, %rax
shrq $0x28, %rax
andl %r10d, %eax
leaq 0x3109(%rip), %rcx      # 0x4800
xorq (%rcx,%rax,8), %r11
movq -0x38(%rsp), %rbp
movq %rbp, %rax
shrq $0x30, %rax
andl %r10d, %eax
leaq 0x38ef(%rip), %rcx      # 0x5000
xorq (%rcx,%rax,8), %r11
movq -0x20(%rsp), %rdx
movq %rdx, %rax
shrq $0x38, %rax
leaq 0x40d8(%rip), %rcx      # 0x5800
xorq (%rcx,%rax,8), %r11
movl %edx, %eax
movq %rdx, %rbx
andl %r10d, %eax
movq %rsi, %rdx
movl %edx, %ecx
shrl $0x8, %ecx
andl %r10d, %ecx
movq (%r12,%rcx,8), %rcx
movq %r12, %rsi
xorq (%r13,%rax,8), %rcx
movl %r15d, %eax
shrl $0xd, %eax
movl $0x7f8, %r12d           # imm = 0x7F8
andl %r12d, %eax
leaq 0x189f(%rip), %r12      # 0x3000
xorq (%rax,%r12), %rcx
movl %edi, %eax
shrl $0x18, %eax
leaq 0x208f(%rip), %r12      # 0x3800
xorq (%r12,%rax,8), %rcx
movq %r8, %rax
shrq $0x20, %rax
andl %r10d, %eax
leaq 0x287a(%rip), %r12      # 0x4000
xorq (%r12,%rax,8), %rcx
movq %r14, %rax
shrq $0x28, %rax
andl %r10d, %eax
leaq 0x3065(%rip), %r12      # 0x4800
xorq (%r12,%rax,8), %rcx
movq %r9, %rax
shrq $0x30, %rax
andl %r10d, %eax
leaq 0x3850(%rip), %r12      # 0x5000
xorq (%r12,%rax,8), %rcx
movq %rbp, %rax
shrq $0x38, %rax
leaq 0x403e(%rip), %r12      # 0x5800
xorq (%r12,%rax,8), %rcx
movq %rcx, -0x30(%rsp)
movl %ebp, %ecx
andl %r10d, %ecx
movl %ebx, %eax
shrl $0x8, %eax
andl %r10d, %eax
movq (%rsi,%rax,8), %rax
xorq (%r13,%rcx,8), %rax
movl %edx, %ecx
movq %rdx, %rsi
shrl $0xd, %ecx
movl $0x7f8, %edx            # imm = 0x7F8
andl %edx, %ecx
leaq 0x1809(%rip), %rdx      # 0x3000
xorq (%rcx,%rdx), %rax
movl %r15d, %ecx
shrl $0x18, %ecx
leaq 0x1ff8(%rip), %rdx      # 0x3800
xorq (%rdx,%rcx,8), %rax
movq %rdi, %rcx
movq %rdi, %r13
movq %rdi, -0x58(%rsp)
shrq $0x20, %rcx
andl %r10d, %ecx
leaq 0x27db(%rip), %rdx      # 0x4000
xorq (%rdx,%rcx,8), %rax
movq %r8, %rcx
shrq $0x28, %rcx
andl %r10d, %ecx
leaq 0x2fc6(%rip), %rdx      # 0x4800
xorq (%rdx,%rcx,8), %rax
movq %r14, %rdi
movq %r14, %rcx
shrq $0x30, %rcx
andl %r10d, %ecx
leaq 0x37ae(%rip), %rdx      # 0x5000
xorq (%rdx,%rcx,8), %rax
movq %r9, %r14
movq %r9, %rcx
shrq $0x38, %rcx
xorq (%r12,%rcx,8), %rax
movl %r14d, %edx
andl %r10d, %edx
movl %ebp, %ecx
shrl $0x8, %ecx
andl %r10d, %ecx
leaq 0xf87(%rip), %r9        # 0x2800
movq (%r9,%rcx,8), %rcx
leaq 0x77c(%rip), %r9        # 0x2000
xorq (%r9,%rdx,8), %rcx
movl %ebx, %edx
movq %rbx, %r12
shrl $0xd, %edx
movl $0x7f8, %r9d            # imm = 0x7F8
andl %r9d, %edx
leaq 0x1760(%rip), %r9       # 0x3000
xorq (%rdx,%r9), %rcx
movl %esi, %edx
movq %rsi, %r9
shrl $0x18, %edx
leaq 0x1f4d(%rip), %rsi      # 0x3800
xorq (%rsi,%rdx,8), %rcx
movq %r15, %rdx
movq %r15, %rbx
shrq $0x20, %rdx
andl %r10d, %edx
leaq 0x2735(%rip), %rsi      # 0x4000
xorq (%rsi,%rdx,8), %rcx
movq %r13, %rdx
shrq $0x28, %rdx
andl %r10d, %edx
leaq 0x2f20(%rip), %rsi      # 0x4800
xorq (%rsi,%rdx,8), %rcx
movq %r8, %rdx
movq %r8, %r13
shrq $0x30, %rdx
andl %r10d, %edx
leaq 0x3708(%rip), %rsi      # 0x5000
xorq (%rsi,%rdx,8), %rcx
movq %rdi, %rdx
shrq $0x38, %rdx
leaq 0x3ef6(%rip), %rsi      # 0x5800
xorq (%rsi,%rdx,8), %rcx
movl %edi, %esi
movq %rdi, -0x40(%rsp)
andl %r10d, %esi
movl %r14d, %edx
shrl $0x8, %edx
andl %r10d, %edx
leaq 0xed8(%rip), %r8        # 0x2800
movq (%r8,%rdx,8), %rdx
leaq 0x6cd(%rip), %r8        # 0x2000
xorq (%r8,%rsi,8), %rdx
movl %ebp, %esi
shrl $0xd, %esi
movl $0x7f8, %r8d            # imm = 0x7F8
andl %r8d, %esi
leaq 0x16b4(%rip), %r8       # 0x3000
xorq (%rsi,%r8), %rdx
movl %r12d, %esi
shrl $0x18, %esi
leaq 0x1ea3(%rip), %r8       # 0x3800
xorq (%r8,%rsi,8), %rdx
movq %r9, %rsi
movq %r9, %r15
shrq $0x20, %rsi
andl %r10d, %esi
leaq 0x268b(%rip), %r8       # 0x4000
xorq (%r8,%rsi,8), %rdx
movq %rbx, -0x50(%rsp)
movq %rbx, %rsi
shrq $0x28, %rsi
andl %r10d, %esi
leaq 0x2e71(%rip), %r8       # 0x4800
xorq (%r8,%rsi,8), %rdx
movq -0x58(%rsp), %r9
movq %r9, %rsi
shrq $0x30, %rsi
andl %r10d, %esi
leaq 0x3657(%rip), %r8       # 0x5000
xorq (%r8,%rsi,8), %rdx
movq %r13, %r8
movq %r13, -0x48(%rsp)
movq %r13, %rsi
shrq $0x38, %rsi
leaq 0x3e3d(%rip), %r13      # 0x5800
xorq (%r13,%rsi,8), %rdx
movl %r8d, %r13d
andl %r10d, %r13d
movl %edi, %esi
shrl $0x8, %esi
andl %r10d, %esi
leaq 0xe23(%rip), %rdi       # 0x2800
movq (%rdi,%rsi,8), %rsi
leaq 0x618(%rip), %rdi       # 0x2000
xorq (%rdi,%r13,8), %rsi
movl %r14d, %r8d
shrl $0xd, %r8d
movl $0x7f8, %edi            # imm = 0x7F8
andl %edi, %r8d
leaq 0x15fe(%rip), %rdi      # 0x3000
xorq (%r8,%rdi), %rsi
movq %rbp, -0x38(%rsp)
movl %ebp, %r8d
shrl $0x18, %r8d
leaq 0x1de7(%rip), %rdi      # 0x3800
xorq (%rdi,%r8,8), %rsi
movq %r12, %r8
shrq $0x20, %r8
andl %r10d, %r8d
leaq 0x25d2(%rip), %rdi      # 0x4000
xorq (%rdi,%r8,8), %rsi
movq %r15, %r8
shrq $0x28, %r8
andl %r10d, %r8d
leaq 0x2dbd(%rip), %rdi      # 0x4800
xorq (%rdi,%r8,8), %rsi
shrq $0x30, %rbx
andl %r10d, %ebx
leaq 0x35ab(%rip), %rdi      # 0x5000
xorq (%rdi,%rbx,8), %rsi
movq %r9, %rdi
movq %r9, %r8
shrq $0x38, %r8
leaq 0x3d96(%rip), %r9       # 0x5800
xorq (%r9,%r8,8), %rsi
movl %edi, %r9d
andl %r10d, %r9d
movq -0x48(%rsp), %r13
movl %r13d, %r8d
shrl $0x8, %r8d
andl %r10d, %r8d
leaq 0xd76(%rip), %rdi       # 0x2800
movq (%rdi,%r8,8), %r8
leaq 0x56b(%rip), %rdi       # 0x2000
xorq (%rdi,%r9,8), %r8
movq -0x40(%rsp), %rbx
movl %ebx, %r9d
shrl $0xd, %r9d
movl $0x7f8, %edi            # imm = 0x7F8
andl %edi, %r9d
leaq 0x154c(%rip), %rdi      # 0x3000
xorq (%r9,%rdi), %r8
movl %r14d, %r9d
shrl $0x18, %r9d
leaq 0x1d3a(%rip), %rdi      # 0x3800
xorq (%rdi,%r9,8), %r8
shrq $0x20, %rbp
andl %r10d, %ebp
leaq 0x2528(%rip), %rdi      # 0x4000
xorq (%rdi,%rbp,8), %r8
movq %r12, %r9
shrq $0x28, %r9
andl %r10d, %r9d
leaq 0x2d13(%rip), %rdi      # 0x4800
xorq (%rdi,%r9,8), %r8
movq %r15, %r9
movq %r15, %rbp
shrq $0x30, %r9
andl %r10d, %r9d
leaq 0x34fb(%rip), %rdi      # 0x5000
xorq (%rdi,%r9,8), %r8
movq -0x50(%rsp), %r15
movq %r15, %r9
shrq $0x38, %r9
leaq 0x3ce4(%rip), %rdi      # 0x5800
xorq (%rdi,%r9,8), %r8
andl %r10d, %r15d
movq -0x58(%rsp), %r9
shrl $0x8, %r9d
andl %r10d, %r9d
leaq 0xcca(%rip), %rdi       # 0x2800
movq (%rdi,%r9,8), %r9
leaq 0x4bf(%rip), %rdi       # 0x2000
xorq (%rdi,%r15,8), %r9
movl %r13d, %r15d
shrl $0xd, %r15d
movl $0x7f8, %edi            # imm = 0x7F8
andl %edi, %r15d
leaq 0x14a5(%rip), %rdi      # 0x3000
xorq (%r15,%rdi), %r9
movl %ebx, %r15d
shrl $0x18, %r15d
leaq 0x1c93(%rip), %rdi      # 0x3800
xorq (%rdi,%r15,8), %r9
movq -0x8(%rsp), %rdi
shrq $0x20, %r14
andl %r10d, %r14d
leaq 0x247c(%rip), %rbx      # 0x4000
xorq (%rbx,%r14,8), %r9
movq -0x38(%rsp), %r15
shrq $0x28, %r15
andl %r10d, %r15d
leaq 0x2c65(%rip), %rbx      # 0x4800
xorq (%rbx,%r15,8), %r9
shrq $0x30, %r12
andl %r10d, %r12d
leaq 0x3453(%rip), %r10      # 0x5000
xorq (%r10,%r12,8), %r9
movq %rbp, %r15
shrq $0x38, %r15
leaq 0x3c41(%rip), %r10      # 0x5800
xorq (%r10,%r15,8), %r9
leaq 0x4436(%rip), %r10      # 0x6000
xorq (%rdi,%r10), %r11
cmpq $0x58, %rdi
je 0x1c01
movq -0x30(%rsp), %r10
movq %r10, -0x20(%rsp)
movq %rax, -0x38(%rsp)
movq %rcx, -0x18(%rsp)
movq %rdx, -0x40(%rsp)
movq %rsi, -0x48(%rsp)
movq %r8, -0x58(%rsp)
movq %r9, -0x50(%rsp)
movq %r11, -0x28(%rsp)
addq $0x8, %rdi
cmpq $0x60, %rdi
jne 0x1650
movq -0x10(%rsp), %rdi
movq %r11, (%rdi)
movq -0x30(%rsp), %r10
movq %r10, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %rdx, 0x20(%rdi)
movq %rsi, 0x28(%rdi)
movq %r8, 0x30(%rdi)
movq %r9, 0x38(%rdi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop