// File: /workspace/github_c_makefile_star2_O2/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
xorl %eax, %eax
leaq 0x116c(%rip), %rcx      # 0x40c0
cmpq $0x40, %rax
je 0x2f76
movq 0x80(%rdi,%rax), %rdx
movq %rdx, -0x50(%rsp,%rax)
movq (%rax,%rcx), %rdx
movq %rdx, -0x10(%rsp,%rax)
addq $0x8, %rax
jmp 0x2f54
movq 0x10(%rsp), %r10
movq 0x18(%rsp), %rax
testl %esi, %esi
je 0x2f89
notq 0x20(%rsp)
xorq 0xc0(%rdi), %r10
xorq 0xc8(%rdi), %rax
movq %rax, -0x80(%rsp)
xorl %eax, %eax
cmpq $0x10, %rax
je 0x2fb2
movq (%rdi,%rax,8), %rcx
movq %rcx, 0x50(%rsp,%rax,8)
incq %rax
jmp 0x2f9e
movq %rdi, 0x30(%rsp)
movq -0x50(%rsp), %rax
movq %rax, -0x68(%rsp)
movq -0x48(%rsp), %rax
movq %rax, -0x70(%rsp)
movq -0x30(%rsp), %r14
movq -0x10(%rsp), %rsi
movq -0x28(%rsp), %rdx
movq -0x8(%rsp), %r13
movq -0x40(%rsp), %rax
movq %rax, -0x78(%rsp)
movq -0x20(%rsp), %rbp
movq 0x20(%rsp), %r8
movq (%rsp), %rax
movq %rax, -0x60(%rsp)
movq -0x38(%rsp), %rcx
movq -0x18(%rsp), %rdi
movq 0x28(%rsp), %r11
movabsq $0xf, %rbx
movq 0x8(%rsp), %rax
movq %rax, -0x58(%rsp)
cmpq $0xcf, %rbx
je 0x3320
movq %r11, 0x38(%rsp)
movq -0x68(%rsp), %r11
addq %r14, %r11
leaq 0x10c0(%rip), %r9       # 0x4100
movq %rdi, %r15
movzbl -0xf(%rbx,%r9), %edi
addq 0x50(%rsp,%rdi,8), %r11
xorq %r11, %r10
rorxq $0x20, %r10, %rdi
addq %rdi, %rsi
xorq %rsi, %r14
rorxq $0x18, %r14, %r14
addq %r14, %r11
movzbl -0xe(%rbx,%r9), %r12d
addq 0x50(%rsp,%r12,8), %r11
xorq %r11, %rdi
rorxq $0x10, %rdi, %rax
movq %rax, 0x40(%rsp)
addq %rax, %rsi
movq %rsi, 0x48(%rsp)
xorq %rsi, %r14
rorxq $0x3f, %r14, %rax
movq %rax, -0x68(%rsp)
movq -0x70(%rsp), %rsi
addq %rdx, %rsi
movzbl -0xd(%rbx,%r9), %edi
addq 0x50(%rsp,%rdi,8), %rsi
movq -0x80(%rsp), %rax
xorq %rsi, %rax
rorxq $0x20, %rax, %rdi
movq %r13, %r12
addq %rdi, %r12
xorq %r12, %rdx
rorxq $0x18, %rdx, %r14
addq %r14, %rsi
movzbl -0xc(%rbx,%r9), %r13d
addq 0x50(%rsp,%r13,8), %rsi
xorq %rsi, %rdi
rorxq $0x10, %rdi, %rax
movq %rax, -0x70(%rsp)
addq %rax, %r12
xorq %r12, %r14
rorxq $0x3f, %r14, %r14
movq -0x78(%rsp), %rax
addq %rbp, %rax
movzbl -0xb(%rbx,%r9), %edi
addq 0x50(%rsp,%rdi,8), %rax
xorq %rax, %r8
rorxq $0x20, %r8, %rdx
movq -0x60(%rsp), %r10
addq %rdx, %r10
xorq %r10, %rbp
rorxq $0x18, %rbp, %rdi
addq %rdi, %rax
movzbl -0xa(%rbx,%r9), %r13d
addq 0x50(%rsp,%r13,8), %rax
xorq %rax, %rdx
rorxq $0x10, %rdx, %rdx
movq %rdx, -0x60(%rsp)
addq %rdx, %r10
xorq %r10, %rdi
rorxq $0x3f, %rdi, %rdx
addq %r15, %rcx
movq %r9, %r8
movzbl -0x9(%rbx,%r9), %edi
addq 0x50(%rsp,%rdi,8), %rcx
movq 0x38(%rsp), %rdi
xorq %rcx, %rdi
rorxq $0x20, %rdi, %r13
movq -0x58(%rsp), %r9
addq %r13, %r9
xorq %r9, %r15
rorxq $0x18, %r15, %rdi
addq %rdi, %rcx
movzbl -0x8(%rbx,%r8), %ebp
movq %r8, %r15
addq 0x50(%rsp,%rbp,8), %rcx
xorq %rcx, %r13
rorxq $0x10, %r13, %r13
addq %r13, %r9
xorq %r9, %rdi
addq %r14, %r11
movzbl -0x7(%rbx,%r8), %ebp
addq 0x50(%rsp,%rbp,8), %r11
xorq %r11, %r13
rorxq $0x20, %r13, %r8
movq %r8, -0x58(%rsp)
addq %r8, %r10
xorq %r10, %r14
rorxq $0x18, %r14, %r8
movq %r8, -0x78(%rsp)
addq %r8, %r11
movzbl -0x6(%rbx,%r15), %r14d
addq 0x50(%rsp,%r14,8), %r11
addq %rdx, %rsi
movzbl -0x5(%rbx,%r15), %r14d
addq 0x50(%rsp,%r14,8), %rsi
movq 0x40(%rsp), %r8
xorq %rsi, %r8
rorxq $0x20, %r8, %r8
movq %r8, -0x80(%rsp)
addq %r8, %r9
xorq %r9, %rdx
rorxq $0x18, %rdx, %rbp
addq %rbp, %rsi
movzbl -0x4(%rbx,%r15), %edx
addq 0x50(%rsp,%rdx,8), %rsi
rorxq $0x3f, %rdi, %rdi
addq %rdi, %rax
movzbl -0x3(%rbx,%r15), %edx
addq 0x50(%rsp,%rdx,8), %rax
movq -0x70(%rsp), %rdx
xorq %rax, %rdx
rorxq $0x20, %rdx, %r13
movq 0x48(%rsp), %r14
addq %r13, %r14
xorq %r14, %rdi
rorxq $0x18, %rdi, %rdi
addq %rdi, %rax
movzbl -0x2(%rbx,%r15), %r8d
addq 0x50(%rsp,%r8,8), %rax
movq -0x68(%rsp), %rdx
addq %rdx, %rcx
movzbl -0x1(%rbx,%r15), %r8d
addq 0x50(%rsp,%r8,8), %rcx
movq -0x60(%rsp), %r8
xorq %rcx, %r8
rorxq $0x20, %r8, %r8
addq %r8, %r12
xorq %r12, %rdx
rorxq $0x18, %rdx, %r15
addq %r15, %rcx
movq %r9, %rdx
leaq 0xe7d(%rip), %r9        # 0x4100
movzbl (%rbx,%r9), %r9d
addq 0x50(%rsp,%r9,8), %rcx
movq %rdx, %r9
movq %r11, -0x68(%rsp)
movq -0x58(%rsp), %rdx
xorq %r11, %rdx
rorxq $0x10, %rdx, %r11
addq %r11, %r10
movq %r10, -0x60(%rsp)
movq -0x78(%rsp), %rdx
xorq %r10, %rdx
rorxq $0x3f, %rdx, %rdx
movq %rsi, -0x70(%rsp)
movq -0x80(%rsp), %r10
xorq %rsi, %r10
rorxq $0x10, %r10, %r10
addq %r10, %r9
movq %r9, -0x58(%rsp)
xorq %r9, %rbp
rorxq $0x3f, %rbp, %rbp
movq %rax, -0x78(%rsp)
xorq %rax, %r13
rorxq $0x10, %r13, %rax
movq %rax, -0x80(%rsp)
addq %rax, %r14
movq %r14, %rsi
xorq %r14, %rdi
rorxq $0x3f, %rdi, %rdi
xorq %rcx, %r8
rorxq $0x10, %r8, %r8
addq %r8, %r12
movq %r12, %r13
xorq %r12, %r15
rorxq $0x3f, %r15, %r14
addq $0x10, %rbx
jmp 0x301f
movq -0x68(%rsp), %rax
movq %rax, -0x50(%rsp)
movq %r14, -0x30(%rsp)
movq %r10, 0x10(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x70(%rsp), %rax
movq %rax, -0x48(%rsp)
movq %rdx, -0x28(%rsp)
movq -0x80(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r13, -0x8(%rsp)
movq -0x78(%rsp), %rax
movq %rax, -0x40(%rsp)
movq %rbp, -0x20(%rsp)
movq %r8, 0x20(%rsp)
movq -0x60(%rsp), %rax
movq %rax, (%rsp)
movq %rcx, -0x38(%rsp)
movq %rdi, -0x18(%rsp)
movq %r11, 0x28(%rsp)
movq -0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
xorl %eax, %eax
movq 0x30(%rsp), %rdx
cmpq $0x8, %rax
je 0x33b1
movq -0x10(%rsp,%rax,8), %rcx
xorq -0x50(%rsp,%rax,8), %rcx
xorq %rcx, 0x80(%rdx,%rax,8)
incq %rax
jmp 0x3394
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop