// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/aezv4/aesni/encrypt.c
// Function: blake2b_compress
static void blake2b_compress(blake2b_ctx *ctx, int last)
{
    const uint8_t sigma[12][16] = {
        { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
        { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 },
        { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 },
        { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 },
        { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 },
        { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 },
        { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 },
        { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 },
        { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 },
        { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 },
        { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
        { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }
    };
    int i;
    uint64_t v[16], m[16];
    
    for (i = 0; i < 8; i++) {
        v[i] = ctx->h[i];
        v[i + 8] = blake2b_iv[i];
    }
    
    v[12] ^= ctx->t[0];
    v[13] ^= ctx->t[1];
    if (last)
        v[14] = ~v[14];
    
    for (i = 0; i < 16; i++)
        m[i] = B2B_GET64(&ctx->b[8 * i]);
    
    for (i = 0; i < 12; i++) {
        B2B_G( 0, 4,  8, 12, m[sigma[i][ 0]], m[sigma[i][ 1]]);
        B2B_G( 1, 5,  9, 13, m[sigma[i][ 2]], m[sigma[i][ 3]]);
        B2B_G( 2, 6, 10, 14, m[sigma[i][ 4]], m[sigma[i][ 5]]);
        B2B_G( 3, 7, 11, 15, m[sigma[i][ 6]], m[sigma[i][ 7]]);
        B2B_G( 0, 5, 10, 15, m[sigma[i][ 8]], m[sigma[i][ 9]]);
        B2B_G( 1, 6, 11, 12, m[sigma[i][10]], m[sigma[i][11]]);
        B2B_G( 2, 7,  8, 13, m[sigma[i][12]], m[sigma[i][13]]);
        B2B_G( 3, 4,  9, 14, m[sigma[i][14]], m[sigma[i][15]]);
    }
    
    for( i = 0; i < 8; ++i )
        ctx->h[i] ^= v[i] ^ v[i + 8];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
vmovups 0x80(%rdi), %ymm0
vmovdqu 0xa0(%rdi), %ymm1
vmovups %ymm0, -0x50(%rsp)
vmovdqu %ymm1, -0x30(%rsp)
vmovups 0xeb2(%rip), %ymm0      # 0x4110
vmovups %ymm0, 0x10(%rsp)
vmovups 0xe84(%rip), %ymm0      # 0x40f0
vmovups %ymm0, -0x10(%rsp)
vmovdqa 0x10(%rsp), %xmm0
vpxor 0xc0(%rdi), %xmm0, %xmm0
vmovdqa %xmm0, 0x10(%rsp)
testl %esi, %esi
je 0x328f
notq 0x20(%rsp)
xorl %eax, %eax
vmovdqu (%rdi,%rax,8), %ymm0
vpmovqb %ymm0, %xmm1
vpsrlq $0x8, %ymm0, %ymm2
vpmovqb %ymm2, %xmm2
vpsrlq $0x10, %ymm0, %ymm3
vpmovqb %ymm3, %xmm3
vpsrlq $0x18, %ymm0, %ymm4
vpmovqb %ymm4, %xmm4
vpsrlq $0x20, %ymm0, %ymm5
vpmovqb %ymm5, %xmm5
vpsrlq $0x28, %ymm0, %ymm6
vpmovqb %ymm6, %xmm6
vpsrlq $0x30, %ymm0, %ymm7
vpmovqb %ymm7, %xmm7
vpsrlq $0x38, %ymm0, %ymm0
vpmovqb %ymm0, %xmm0
vpmovzxbq %xmm1, %ymm1    # ymm1 = xmm1[0],zero,zero,zero,zero,zero,zero,zero,xmm1[1],zero,zero,zero,zero,zero,zero,zero,xmm1[2],zero,zero,zero,zero,zero,zero,zero,xmm1[3],zero,zero,zero,zero,zero,zero,zero
vpmovzxbq %xmm2, %ymm2    # ymm2 = xmm2[0],zero,zero,zero,zero,zero,zero,zero,xmm2[1],zero,zero,zero,zero,zero,zero,zero,xmm2[2],zero,zero,zero,zero,zero,zero,zero,xmm2[3],zero,zero,zero,zero,zero,zero,zero
vpsllq $0x8, %ymm2, %ymm2
vpor %ymm1, %ymm2, %ymm1
vpmovzxbq %xmm3, %ymm2    # ymm2 = xmm3[0],zero,zero,zero,zero,zero,zero,zero,xmm3[1],zero,zero,zero,zero,zero,zero,zero,xmm3[2],zero,zero,zero,zero,zero,zero,zero,xmm3[3],zero,zero,zero,zero,zero,zero,zero
vpsllq $0x10, %ymm2, %ymm2
vpmovzxbq %xmm4, %ymm3    # ymm3 = xmm4[0],zero,zero,zero,zero,zero,zero,zero,xmm4[1],zero,zero,zero,zero,zero,zero,zero,xmm4[2],zero,zero,zero,zero,zero,zero,zero,xmm4[3],zero,zero,zero,zero,zero,zero,zero
vpsllq $0x18, %ymm3, %ymm3
vpternlogq $0xfe, %ymm2, %ymm1, %ymm3
vpmovzxbq %xmm5, %ymm1    # ymm1 = xmm5[0],zero,zero,zero,zero,zero,zero,zero,xmm5[1],zero,zero,zero,zero,zero,zero,zero,xmm5[2],zero,zero,zero,zero,zero,zero,zero,xmm5[3],zero,zero,zero,zero,zero,zero,zero
vpsllq $0x20, %ymm1, %ymm1
vpmovzxbq %xmm6, %ymm2    # ymm2 = xmm6[0],zero,zero,zero,zero,zero,zero,zero,xmm6[1],zero,zero,zero,zero,zero,zero,zero,xmm6[2],zero,zero,zero,zero,zero,zero,zero,xmm6[3],zero,zero,zero,zero,zero,zero,zero
vpsllq $0x28, %ymm2, %ymm2
vpternlogq $0xfe, %ymm1, %ymm3, %ymm2
vpmovzxbq %xmm7, %ymm1    # ymm1 = xmm7[0],zero,zero,zero,zero,zero,zero,zero,xmm7[1],zero,zero,zero,zero,zero,zero,zero,xmm7[2],zero,zero,zero,zero,zero,zero,zero,xmm7[3],zero,zero,zero,zero,zero,zero,zero
vpsllq $0x30, %ymm1, %ymm1
vpmovzxbq %xmm0, %ymm0    # ymm0 = xmm0[0],zero,zero,zero,zero,zero,zero,zero,xmm0[1],zero,zero,zero,zero,zero,zero,zero,xmm0[2],zero,zero,zero,zero,zero,zero,zero,xmm0[3],zero,zero,zero,zero,zero,zero,zero
vpsllq $0x38, %ymm0, %ymm0
vpternlogq $0x96, %ymm1, %ymm2, %ymm0
vmovdqu %ymm0, 0x50(%rsp,%rax,8)
addq $0x4, %rax
cmpq $0x10, %rax
jne 0x3291
movq %rdi, 0x38(%rsp)
movq -0x50(%rsp), %rcx
movq -0x48(%rsp), %rax
movq -0x30(%rsp), %r12
movq 0x10(%rsp), %r15
movq -0x10(%rsp), %r10
movq -0x28(%rsp), %r14
movq 0x18(%rsp), %r13
movq -0x8(%rsp), %rdx
movq -0x40(%rsp), %rsi
movq -0x20(%rsp), %rdi
movq %rdi, -0x78(%rsp)
movq 0x20(%rsp), %rbx
movq (%rsp), %r8
movq -0x38(%rsp), %r9
movq -0x18(%rsp), %rdi
movq %rdi, -0x70(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, -0x68(%rsp)
movl $0xf, %edi
movq 0x8(%rsp), %r11
movq %rbx, 0x40(%rsp)
addq %r12, %rcx
leaq 0xd58(%rip), %rbp       # 0x4130
movzbl -0xf(%rdi,%rbp), %ebp
addq 0x50(%rsp,%rbp,8), %rcx
xorq %rcx, %r15
rorxq $0x20, %r15, %r15
addq %r15, %r10
xorq %r10, %r12
rorxq $0x18, %r12, %rbx
addq %rbx, %rcx
leaq 0xd2f(%rip), %rbp       # 0x4130
movzbl -0xe(%rdi,%rbp), %r12d
addq 0x50(%rsp,%r12,8), %rcx
xorq %rcx, %r15
rorxq $0x10, %r15, %r15
movq %r15, -0x58(%rsp)
addq %r15, %r10
addq %r14, %rax
movzbl -0xd(%rdi,%rbp), %r15d
movq %rbp, %r12
addq 0x50(%rsp,%r15,8), %rax
xorq %r10, %rbx
movq %rbx, 0x48(%rsp)
xorq %rax, %r13
rorxq $0x20, %r13, %r15
addq %r15, %rdx
xorq %rdx, %r14
movq %rdi, %rbp
rorxq $0x18, %r14, %rdi
addq %rdi, %rax
movq %r12, %r14
movzbl -0xc(%rbp,%r12), %r12d
addq 0x50(%rsp,%r12,8), %rax
xorq %rax, %r15
rorxq $0x10, %r15, %rbx
movq %rbx, -0x60(%rsp)
addq %rbx, %rdx
xorq %rdx, %rdi
movq -0x78(%rsp), %rbx
addq %rbx, %rsi
movzbl -0xb(%rbp,%r14), %r15d
movq %r14, %r13
addq 0x50(%rsp,%r15,8), %rsi
rorxq $0x3f, %rdi, %r12
movq 0x40(%rsp), %rdi
xorq %rsi, %rdi
rorxq $0x20, %rdi, %rdi
addq %rdi, %r8
xorq %r8, %rbx
rorxq $0x18, %rbx, %r14
addq %r14, %rsi
movzbl -0xa(%rbp,%r13), %r15d
addq 0x50(%rsp,%r15,8), %rsi
xorq %rsi, %rdi
rorxq $0x10, %rdi, %rdi
movq %rdi, -0x78(%rsp)
addq %rdi, %r8
xorq %r8, %r14
movq -0x70(%rsp), %r15
addq %r15, %r9
movzbl -0x9(%rbp,%r13), %edi
addq 0x50(%rsp,%rdi,8), %r9
rorxq $0x3f, %r14, %rbx
movq -0x68(%rsp), %rdi
xorq %r9, %rdi
rorxq $0x20, %rdi, %rdi
addq %rdi, %r11
xorq %r11, %r15
rorxq $0x18, %r15, %r14
addq %r14, %r9
movzbl -0x8(%rbp,%r13), %r15d
addq 0x50(%rsp,%r15,8), %r9
xorq %r9, %rdi
rorxq $0x10, %rdi, %r15
addq %r15, %r11
xorq %r11, %r14
addq %r12, %rcx
movzbl -0x7(%rbp,%r13), %edi
addq 0x50(%rsp,%rdi,8), %rcx
rorxq $0x3f, %r14, %rdi
xorq %rcx, %r15
rorxq $0x20, %r15, %r14
movq %r14, -0x68(%rsp)
addq %r14, %r8
xorq %r8, %r12
rorxq $0x18, %r12, %r14
movq %r14, -0x70(%rsp)
addq %r14, %rcx
movzbl -0x6(%rbp,%r13), %r14d
addq 0x50(%rsp,%r14,8), %rcx
addq %rbx, %rax
movzbl -0x5(%rbp,%r13), %r14d
movq %r13, %r15
addq 0x50(%rsp,%r14,8), %rax
movq -0x58(%rsp), %r14
xorq %rax, %r14
rorxq $0x20, %r14, %r14
movq %r14, -0x58(%rsp)
addq %r14, %r11
xorq %r11, %rbx
rorxq $0x18, %rbx, %r13
addq %r13, %rax
movzbl -0x4(%rbp,%r15), %r14d
addq 0x50(%rsp,%r14,8), %rax
addq %rdi, %rsi
movzbl -0x3(%rbp,%r15), %r14d
addq 0x50(%rsp,%r14,8), %rsi
movq -0x60(%rsp), %rbx
xorq %rsi, %rbx
rorxq $0x20, %rbx, %rbx
movq %rbx, -0x60(%rsp)
addq %rbx, %r10
xorq %r10, %rdi
rorxq $0x18, %rdi, %r12
addq %r12, %rsi
movq %r15, %rbx
movzbl -0x2(%rbp,%r15), %edi
addq 0x50(%rsp,%rdi,8), %rsi
rorxq $0x3f, 0x48(%rsp), %rdi
addq %rdi, %r9
movzbl -0x1(%rbp,%r15), %r15d
movq %rbx, %r14
addq 0x50(%rsp,%r15,8), %r9
movq -0x78(%rsp), %rbx
xorq %r9, %rbx
rorxq $0x20, %rbx, %rbx
addq %rbx, %rdx
xorq %rdx, %rdi
rorxq $0x18, %rdi, %rdi
addq %rdi, %r9
movzbl (%rbp,%r14), %r14d
addq 0x50(%rsp,%r14,8), %r9
movq -0x68(%rsp), %r14
xorq %rcx, %r14
rorxq $0x10, %r14, %r14
movq %r14, -0x68(%rsp)
addq %r14, %r8
movq -0x70(%rsp), %r14
xorq %r8, %r14
rorxq $0x3f, %r14, %r14
movq -0x58(%rsp), %r15
xorq %rax, %r15
rorxq $0x10, %r15, %r15
addq %r15, %r11
xorq %r11, %r13
rorxq $0x3f, %r13, %r13
movq %r13, -0x78(%rsp)
movq -0x60(%rsp), %r13
xorq %rsi, %r13
rorxq $0x10, %r13, %r13
addq %r13, %r10
xorq %r10, %r12
rorxq $0x3f, %r12, %r12
movq %r12, -0x70(%rsp)
xorq %r9, %rbx
rorxq $0x10, %rbx, %rbx
addq %rbx, %rdx
xorq %rdx, %rdi
rorxq $0x3f, %rdi, %r12
movq %rbp, %rdi
addq $0x10, %rdi
cmpq $0xcf, %rdi
jne 0x33c9
movq %rcx, -0x50(%rsp)
movq %r12, -0x30(%rsp)
movq %r15, 0x10(%rsp)
movq %r10, -0x10(%rsp)
movq %rax, -0x48(%rsp)
movq %r14, -0x28(%rsp)
movq %r13, 0x18(%rsp)
movq %rdx, -0x8(%rsp)
movq %rsi, -0x40(%rsp)
movq -0x78(%rsp), %rax
movq %rax, -0x20(%rsp)
movq %rbx, 0x20(%rsp)
movq %r8, (%rsp)
movq %r9, -0x38(%rsp)
movq -0x70(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %r11, 0x8(%rsp)
xorl %eax, %eax
movq 0x38(%rsp), %rcx
vmovdqu -0x10(%rsp,%rax,8), %ymm0
vmovdqu 0x80(%rcx,%rax,8), %ymm1
vpternlogq $0x96, -0x50(%rsp,%rax,8), %ymm0, %ymm1
vmovdqu %ymm1, 0x80(%rcx,%rax,8)
addq $0x4, %rax
cmpq $0x8, %rax
jne 0x3709
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
vzeroupper
retq