// File: /workspace/github_c_makefile_star2_O2/LoupVaillant[P]Monocypher-Utils/src/sha512.c
// Function: sha512_compress
static void sha512_compress(crypto_sha512_ctx *ctx)
{
    u64 *w = ctx->w;
    FOR(i,  0, 16) { w[i] = ctx->input[i]; }
    FOR(i, 16, 80) { w[i] = (lit_sigma1(w[i- 2]) + w[i- 7] +
                             lit_sigma0(w[i-15]) + w[i-16]); }

    u64 a = ctx->hash[0];    u64 b = ctx->hash[1];
    u64 c = ctx->hash[2];    u64 d = ctx->hash[3];
    u64 e = ctx->hash[4];    u64 f = ctx->hash[5];
    u64 g = ctx->hash[6];    u64 h = ctx->hash[7];
    FOR(i, 0, 80) {
        u64 t1 = big_sigma1(e) + ch (e, f, g) + h + K[i] + w[i];
        u64 t2 = big_sigma0(a) + maj(a, b, c);
        h = g;  g = f;  f = e;  e = d  + t1;
        d = c;  c = b;  b = a;  a = t1 + t2;
    }
    ctx->hash[0] += a;    ctx->hash[1] += b;
    ctx->hash[2] += c;    ctx->hash[3] += d;
    ctx->hash[4] += e;    ctx->hash[5] += f;
    ctx->hash[6] += g;    ctx->hash[7] += h;
}

// Assembly:
xorl %eax, %eax
cmpq $0x10, %rax
je 0x7dd0
movq 0x2c0(%rdi,%rax,8), %rcx
movq %rcx, (%rdi,%rax,8)
incq %rax
jmp 0x7db9
xorl %eax, %eax
cmpq $0x40, %rax
je 0x7e2a
movq 0x70(%rdi,%rax,8), %rcx
movq %rcx, %rdx
rolq $0x2d, %rdx
movq %rcx, %rsi
rolq $0x3, %rsi
xorq %rdx, %rsi
shrq $0x6, %rcx
xorq %rsi, %rcx
addq 0x48(%rdi,%rax,8), %rcx
movq 0x8(%rdi,%rax,8), %rdx
movq %rdx, %rsi
rorq %rsi
movq %rdx, %r8
rolq $0x38, %r8
xorq %rsi, %r8
shrq $0x7, %rdx
addq (%rdi,%rax,8), %rcx
xorq %r8, %rdx
addq %rdx, %rcx
movq %rcx, 0x80(%rdi,%rax,8)
incq %rax
jmp 0x7dd2
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x280(%rdi), %r11
movq 0x288(%rdi), %rax
movq 0x290(%rdi), %rdx
movq 0x298(%rdi), %r8
movq 0x2a0(%rdi), %r14
movq 0x2a8(%rdi), %rcx
movq 0x2b0(%rdi), %r10
movq 0x2b8(%rdi), %rsi
xorl %r12d, %r12d
leaq 0x21da(%rip), %rbp      # 0xa050
movq %r11, %r13
movq %rax, -0x38(%rsp)
movq %rdx, -0x30(%rsp)
movq %r8, -0x28(%rsp)
movq %r14, -0x20(%rsp)
movq %rcx, -0x18(%rsp)
movq %r10, -0x10(%rsp)
movq %rsi, -0x8(%rsp)
movq %r10, %r15
movq %rcx, %r10
movq %r14, %rcx
movq %rdx, %r9
movq %rax, %rdx
movq %r13, %rax
cmpq $0x280, %r12            # imm = 0x280
je 0x7f34
movq %rcx, %rbx
rolq $0x32, %rbx
movq %rcx, %r14
rolq $0x2e, %r14
movq %rcx, %r13
rolq $0x17, %r13
xorq %rbx, %r14
xorq %r14, %r13
movq %r10, %rbx
xorq %r15, %rbx
andq %rcx, %rbx
xorq %r15, %rbx
addq %rsi, %rbx
addq %r13, %rbx
addq (%r12,%rbp), %rbx
addq (%rdi,%r12), %rbx
movq %rax, %rsi
rolq $0x24, %rsi
movq %rax, %r14
rolq $0x1e, %r14
xorq %rsi, %r14
movq %rax, %rsi
rolq $0x19, %rsi
xorq %r14, %rsi
movq %r9, %r14
xorq %rdx, %r14
andq %rax, %r14
movq %r9, %r13
andq %rdx, %r13
xorq %r14, %r13
addq %rsi, %r13
movq %r8, %r14
addq %rbx, %r14
addq %rbx, %r13
addq $0x8, %r12
movq %r9, %r8
movq %r15, %rsi
jmp 0x7e9c
addq %r11, %rax
movq %rax, 0x280(%rdi)
addq -0x38(%rsp), %rdx
movq %rdx, 0x288(%rdi)
addq -0x30(%rsp), %r9
movq %r9, 0x290(%rdi)
addq -0x28(%rsp), %r8
movq %r8, 0x298(%rdi)
addq -0x20(%rsp), %rcx
movq %rcx, 0x2a0(%rdi)
addq -0x18(%rsp), %r10
movq %r10, 0x2a8(%rdi)
addq -0x10(%rsp), %r15
movq %r15, 0x2b0(%rdi)
addq -0x8(%rsp), %rsi
movq %rsi, 0x2b8(%rdi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq