// File: /workspace/github_c_makefile_star2_O0/MartinDrab[P]netpipe/sha2.c
// Function: sha512_transf
void sha512_transf(sha512_ctx *ctx, const unsigned char *message,
                   unsigned int block_nb)
{
    uint64 w[80];
    uint64 wv[8];
    uint64 t1, t2;
    const unsigned char *sub_block;
    int i, j;

    for (i = 0; i < (int) block_nb; i++) {
        sub_block = message + (i << 7);

#ifndef UNROLL_LOOPS
        for (j = 0; j < 16; j++) {
            PACK64(&sub_block[j << 3], &w[j]);
        }

        for (j = 16; j < 80; j++) {
            SHA512_SCR(j);
        }

        for (j = 0; j < 8; j++) {
            wv[j] = ctx->h[j];
        }

        for (j = 0; j < 80; j++) {
            t1 = wv[7] + SHA512_F2(wv[4]) + CH(wv[4], wv[5], wv[6])
                + sha512_k[j] + w[j];
            t2 = SHA512_F1(wv[0]) + MAJ(wv[0], wv[1], wv[2]);
            wv[7] = wv[6];
            wv[6] = wv[5];
            wv[5] = wv[4];
            wv[4] = wv[3] + t1;
            wv[3] = wv[2];
            wv[2] = wv[1];
            wv[1] = wv[0];
            wv[0] = t1 + t2;
        }

        for (j = 0; j < 8; j++) {
            ctx->h[j] += wv[j];
        }
#else
        PACK64(&sub_block[  0], &w[ 0]); PACK64(&sub_block[  8], &w[ 1]);
        PACK64(&sub_block[ 16], &w[ 2]); PACK64(&sub_block[ 24], &w[ 3]);
        PACK64(&sub_block[ 32], &w[ 4]); PACK64(&sub_block[ 40], &w[ 5]);
        PACK64(&sub_block[ 48], &w[ 6]); PACK64(&sub_block[ 56], &w[ 7]);
        PACK64(&sub_block[ 64], &w[ 8]); PACK64(&sub_block[ 72], &w[ 9]);
        PACK64(&sub_block[ 80], &w[10]); PACK64(&sub_block[ 88], &w[11]);
        PACK64(&sub_block[ 96], &w[12]); PACK64(&sub_block[104], &w[13]);
        PACK64(&sub_block[112], &w[14]); PACK64(&sub_block[120], &w[15]);

        SHA512_SCR(16); SHA512_SCR(17); SHA512_SCR(18); SHA512_SCR(19);
        SHA512_SCR(20); SHA512_SCR(21); SHA512_SCR(22); SHA512_SCR(23);
        SHA512_SCR(24); SHA512_SCR(25); SHA512_SCR(26); SHA512_SCR(27);
        SHA512_SCR(28); SHA512_SCR(29); SHA512_SCR(30); SHA512_SCR(31);
        SHA512_SCR(32); SHA512_SCR(33); SHA512_SCR(34); SHA512_SCR(35);
        SHA512_SCR(36); SHA512_SCR(37); SHA512_SCR(38); SHA512_SCR(39);
        SHA512_SCR(40); SHA512_SCR(41); SHA512_SCR(42); SHA512_SCR(43);
        SHA512_SCR(44); SHA512_SCR(45); SHA512_SCR(46); SHA512_SCR(47);
        SHA512_SCR(48); SHA512_SCR(49); SHA512_SCR(50); SHA512_SCR(51);
        SHA512_SCR(52); SHA512_SCR(53); SHA512_SCR(54); SHA512_SCR(55);
        SHA512_SCR(56); SHA512_SCR(57); SHA512_SCR(58); SHA512_SCR(59);
        SHA512_SCR(60); SHA512_SCR(61); SHA512_SCR(62); SHA512_SCR(63);
        SHA512_SCR(64); SHA512_SCR(65); SHA512_SCR(66); SHA512_SCR(67);
        SHA512_SCR(68); SHA512_SCR(69); SHA512_SCR(70); SHA512_SCR(71);
        SHA512_SCR(72); SHA512_SCR(73); SHA512_SCR(74); SHA512_SCR(75);
        SHA512_SCR(76); SHA512_SCR(77); SHA512_SCR(78); SHA512_SCR(79);

        wv[0] = ctx->h[0]; wv[1] = ctx->h[1];
        wv[2] = ctx->h[2]; wv[3] = ctx->h[3];
        wv[4] = ctx->h[4]; wv[5] = ctx->h[5];
        wv[6] = ctx->h[6]; wv[7] = ctx->h[7];

        j = 0;

        do {
            SHA512_EXP(0,1,2,3,4,5,6,7,j); j++;
            SHA512_EXP(7,0,1,2,3,4,5,6,j); j++;
            SHA512_EXP(6,7,0,1,2,3,4,5,j); j++;
            SHA512_EXP(5,6,7,0,1,2,3,4,j); j++;
            SHA512_EXP(4,5,6,7,0,1,2,3,j); j++;
            SHA512_EXP(3,4,5,6,7,0,1,2,j); j++;
            SHA512_EXP(2,3,4,5,6,7,0,1,j); j++;
            SHA512_EXP(1,2,3,4,5,6,7,0,j); j++;
        } while (j < 80);

        ctx->h[0] += wv[0]; ctx->h[1] += wv[1];
        ctx->h[2] += wv[2]; ctx->h[3] += wv[3];
        ctx->h[4] += wv[4]; ctx->h[5] += wv[5];
        ctx->h[6] += wv[6]; ctx->h[7] += wv[7];
#endif /* !UNROLL_LOOPS */
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x2fc(%rbp)
movl -0x2fc(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x9e11
movq -0x10(%rbp), %rax
movl -0x2fc(%rbp), %ecx
shll $0x7, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x2f8(%rbp)
movl $0x0, -0x300(%rbp)
cmpl $0x10, -0x300(%rbp)
jge 0x9a25
movq -0x2f8(%rbp), %rax
movl -0x300(%rbp), %ecx
shll $0x3, %ecx
movslq %ecx, %rcx
movzbl 0x7(%rax,%rcx), %eax
movl %eax, %ecx
movq -0x2f8(%rbp), %rax
movl -0x300(%rbp), %edx
shll $0x3, %edx
movslq %edx, %rdx
movzbl 0x6(%rax,%rdx), %eax
shlq $0x8, %rax
orq %rax, %rcx
movq -0x2f8(%rbp), %rax
movl -0x300(%rbp), %edx
shll $0x3, %edx
movslq %edx, %rdx
movzbl 0x5(%rax,%rdx), %eax
shlq $0x10, %rax
orq %rax, %rcx
movq -0x2f8(%rbp), %rax
movl -0x300(%rbp), %edx
shll $0x3, %edx
movslq %edx, %rdx
movzbl 0x4(%rax,%rdx), %eax
shlq $0x18, %rax
orq %rax, %rcx
movq -0x2f8(%rbp), %rax
movl -0x300(%rbp), %edx
shll $0x3, %edx
movslq %edx, %rdx
movzbl 0x3(%rax,%rdx), %eax
shlq $0x20, %rax
orq %rax, %rcx
movq -0x2f8(%rbp), %rax
movl -0x300(%rbp), %edx
shll $0x3, %edx
movslq %edx, %rdx
movzbl 0x2(%rax,%rdx), %eax
shlq $0x28, %rax
orq %rax, %rcx
movq -0x2f8(%rbp), %rax
movl -0x300(%rbp), %edx
shll $0x3, %edx
movslq %edx, %rdx
movzbl 0x1(%rax,%rdx), %eax
shlq $0x30, %rax
orq %rax, %rcx
movq -0x2f8(%rbp), %rax
movl -0x300(%rbp), %edx
shll $0x3, %edx
movslq %edx, %rdx
movzbl (%rax,%rdx), %eax
shlq $0x38, %rax
orq %rax, %rcx
movslq -0x300(%rbp), %rax
movq %rcx, -0x2a0(%rbp,%rax,8)
movl -0x300(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x300(%rbp)
jmp 0x9903
movl $0x10, -0x300(%rbp)
cmpl $0x50, -0x300(%rbp)
jge 0x9b8a
movl -0x300(%rbp), %eax
subl $0x2, %eax
cltq
movq -0x2a0(%rbp,%rax,8), %rcx
shrq $0x13, %rcx
movl -0x300(%rbp), %eax
subl $0x2, %eax
cltq
movq -0x2a0(%rbp,%rax,8), %rax
shlq $0x2d, %rax
orq %rax, %rcx
movl -0x300(%rbp), %eax
subl $0x2, %eax
cltq
movq -0x2a0(%rbp,%rax,8), %rax
shrq $0x3d, %rax
movl -0x300(%rbp), %edx
subl $0x2, %edx
movslq %edx, %rdx
movq -0x2a0(%rbp,%rdx,8), %rdx
shlq $0x3, %rdx
orq %rdx, %rax
xorq %rax, %rcx
movl -0x300(%rbp), %eax
subl $0x2, %eax
cltq
movq -0x2a0(%rbp,%rax,8), %rax
shrq $0x6, %rax
xorq %rax, %rcx
movl -0x300(%rbp), %eax
subl $0x7, %eax
cltq
addq -0x2a0(%rbp,%rax,8), %rcx
movl -0x300(%rbp), %eax
subl $0xf, %eax
cltq
movq -0x2a0(%rbp,%rax,8), %rax
shrq %rax
movl -0x300(%rbp), %edx
subl $0xf, %edx
movslq %edx, %rdx
movq -0x2a0(%rbp,%rdx,8), %rdx
shlq $0x3f, %rdx
orq %rdx, %rax
movl -0x300(%rbp), %edx
subl $0xf, %edx
movslq %edx, %rdx
movq -0x2a0(%rbp,%rdx,8), %rdx
shrq $0x8, %rdx
movl -0x300(%rbp), %esi
subl $0xf, %esi
movslq %esi, %rsi
movq -0x2a0(%rbp,%rsi,8), %rsi
shlq $0x38, %rsi
orq %rsi, %rdx
xorq %rdx, %rax
movl -0x300(%rbp), %edx
subl $0xf, %edx
movslq %edx, %rdx
movq -0x2a0(%rbp,%rdx,8), %rdx
shrq $0x7, %rdx
xorq %rdx, %rax
addq %rax, %rcx
movl -0x300(%rbp), %eax
subl $0x10, %eax
cltq
addq -0x2a0(%rbp,%rax,8), %rcx
movslq -0x300(%rbp), %rax
movq %rcx, -0x2a0(%rbp,%rax,8)
movl -0x300(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x300(%rbp)
jmp 0x9a2f
movl $0x0, -0x300(%rbp)
cmpl $0x8, -0x300(%rbp)
jge 0x9bd0
movq -0x8(%rbp), %rax
movslq -0x300(%rbp), %rcx
movq 0x108(%rax,%rcx,8), %rcx
movslq -0x300(%rbp), %rax
movq %rcx, -0x2e0(%rbp,%rax,8)
movl -0x300(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x300(%rbp)
jmp 0x9b94
movl $0x0, -0x300(%rbp)
cmpl $0x50, -0x300(%rbp)
jge 0x9dad
movq -0x2a8(%rbp), %rax
movq -0x2c0(%rbp), %rcx
shrq $0xe, %rcx
movq -0x2c0(%rbp), %rdx
shlq $0x32, %rdx
orq %rdx, %rcx
movq -0x2c0(%rbp), %rdx
shrq $0x12, %rdx
movq -0x2c0(%rbp), %rsi
shlq $0x2e, %rsi
orq %rsi, %rdx
xorq %rdx, %rcx
movq -0x2c0(%rbp), %rdx
shrq $0x29, %rdx
movq -0x2c0(%rbp), %rsi
shlq $0x17, %rsi
orq %rsi, %rdx
xorq %rdx, %rcx
addq %rcx, %rax
movq -0x2c0(%rbp), %rcx
andq -0x2b8(%rbp), %rcx
movq -0x2c0(%rbp), %rdx
xorq $-0x1, %rdx
andq -0x2b0(%rbp), %rdx
xorq %rdx, %rcx
addq %rcx, %rax
movslq -0x300(%rbp), %rdx
leaq 0x9bba(%rip), %rcx      # 0x13830
addq (%rcx,%rdx,8), %rax
movslq -0x300(%rbp), %rcx
addq -0x2a0(%rbp,%rcx,8), %rax
movq %rax, -0x2e8(%rbp)
movq -0x2e0(%rbp), %rax
shrq $0x1c, %rax
movq -0x2e0(%rbp), %rcx
shlq $0x24, %rcx
orq %rcx, %rax
movq -0x2e0(%rbp), %rcx
shrq $0x22, %rcx
movq -0x2e0(%rbp), %rdx
shlq $0x1e, %rdx
orq %rdx, %rcx
xorq %rcx, %rax
movq -0x2e0(%rbp), %rcx
shrq $0x27, %rcx
movq -0x2e0(%rbp), %rdx
shlq $0x19, %rdx
orq %rdx, %rcx
xorq %rcx, %rax
movq -0x2e0(%rbp), %rcx
andq -0x2d8(%rbp), %rcx
movq -0x2e0(%rbp), %rdx
andq -0x2d0(%rbp), %rdx
xorq %rdx, %rcx
movq -0x2d8(%rbp), %rdx
andq -0x2d0(%rbp), %rdx
xorq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x2f0(%rbp)
movq -0x2b0(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movq -0x2b8(%rbp), %rax
movq %rax, -0x2b0(%rbp)
movq -0x2c0(%rbp), %rax
movq %rax, -0x2b8(%rbp)
movq -0x2c8(%rbp), %rax
addq -0x2e8(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movq -0x2d0(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movq -0x2d8(%rbp), %rax
movq %rax, -0x2d0(%rbp)
movq -0x2e0(%rbp), %rax
movq %rax, -0x2d8(%rbp)
movq -0x2e8(%rbp), %rax
addq -0x2f0(%rbp), %rax
movq %rax, -0x2e0(%rbp)
movl -0x300(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x300(%rbp)
jmp 0x9bda
movl $0x0, -0x300(%rbp)
cmpl $0x8, -0x300(%rbp)
jge 0x9dfb
movslq -0x300(%rbp), %rax
movq -0x2e0(%rbp,%rax,8), %rdx
movq -0x8(%rbp), %rax
movslq -0x300(%rbp), %rcx
addq 0x108(%rax,%rcx,8), %rdx
movq %rdx, 0x108(%rax,%rcx,8)
movl -0x300(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x300(%rbp)
jmp 0x9db7
jmp 0x9dfd
movl -0x2fc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2fc(%rbp)
jmp 0x98d0
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
nopw (%rax,%rax)