// File: /workspace/github_c_makefile_star2_O0/janmojzis[P]mcencrypt/crypto_hash_sha512.c
// Function: blocks
static void blocks(unsigned long long *z, const unsigned char *m, unsigned long long n) {

    unsigned long long b[8], a[8], w[80], t;
    long long i, j;

    for (i = 0; i < 8; ++i) a[i] = z[i];
  
    while (n >= 128) { 
        for (i =  0; i < 16; ++i) w[i] = load64_bigendian(m + 8 * i);
        for (i = 16; i < 80; ++i) w[i] = (sigma1(w[i - 2]) + w[i - 7] + sigma0(w[i - 15]) + w[i - 16]) & 0xffffffffffffffffULL;

        for (i = 0; i < 80; ++i) {
            for (j = 0; j < 8; ++j) b[j] = a[j];
            t = a[7] + Sigma1(a[4]) + Ch(a[4], a[5], a[6]) + K[i] + w[i];
            b[7] = t + Sigma0(a[0]) + Maj(a[0], a[1], a[2]);
            b[3] += t;
            for (j = 0; j < 8; ++j) a[(j + 1) % 8] = b[j] & 0xffffffffffffffffULL;
        }
    
        for (i = 0; i < 8; ++i) { a[i] += z[i]; a[i] &= 0xffffffffffffffffULL; z[i] = a[i]; }
    
        m += 128;
        n -= 128;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x330(%rbp)
cmpq $0x8, -0x330(%rbp)
jge 0x993e
movq -0x8(%rbp), %rax
movq -0x330(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x330(%rbp), %rax
movq %rcx, -0xa0(%rbp,%rax,8)
movq -0x330(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x330(%rbp)
jmp 0x9902
jmp 0x9940
cmpq $0x80, -0x18(%rbp)
jb 0x9ca3
movq $0x0, -0x330(%rbp)
cmpq $0x10, -0x330(%rbp)
jge 0x99a0
movq -0x10(%rbp), %rdi
movq -0x330(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
callq 0x9d00
movq %rax, %rcx
movq -0x330(%rbp), %rax
movq %rcx, -0x320(%rbp,%rax,8)
movq -0x330(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x330(%rbp)
jmp 0x9959
movq $0x10, -0x330(%rbp)
cmpq $0x50, -0x330(%rbp)
jge 0x9a4a
movq -0x330(%rbp), %rax
subq $0x2, %rax
movq -0x320(%rbp,%rax,8), %rdi
callq 0x9d50
movq -0x330(%rbp), %rcx
subq $0x7, %rcx
addq -0x320(%rbp,%rcx,8), %rax
movq %rax, -0x340(%rbp)
movq -0x330(%rbp), %rax
subq $0xf, %rax
movq -0x320(%rbp,%rax,8), %rdi
callq 0x9da0
movq -0x340(%rbp), %rcx
addq %rax, %rcx
movq -0x330(%rbp), %rax
subq $0x10, %rax
addq -0x320(%rbp,%rax,8), %rcx
andq $-0x1, %rcx
movq -0x330(%rbp), %rax
movq %rcx, -0x320(%rbp,%rax,8)
movq -0x330(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x330(%rbp)
jmp 0x99ab
movq $0x0, -0x330(%rbp)
cmpq $0x50, -0x330(%rbp)
jge 0x9bfa
movq $0x0, -0x338(%rbp)
cmpq $0x8, -0x338(%rbp)
jge 0x9aa7
movq -0x338(%rbp), %rax
movq -0xa0(%rbp,%rax,8), %rcx
movq -0x338(%rbp), %rax
movq %rcx, -0x60(%rbp,%rax,8)
movq -0x338(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x338(%rbp)
jmp 0x9a6e
movq -0x68(%rbp), %rax
movq %rax, -0x360(%rbp)
movq -0x80(%rbp), %rdi
callq 0x9df0
movq %rax, %rcx
movq -0x360(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x358(%rbp)
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
callq 0x9e50
movq %rax, %rcx
movq -0x358(%rbp), %rax
addq %rcx, %rax
movq -0x330(%rbp), %rdx
leaq 0x5625(%rip), %rcx      # 0xf120
addq (%rcx,%rdx,8), %rax
movq -0x330(%rbp), %rcx
addq -0x320(%rbp,%rcx,8), %rax
movq %rax, -0x328(%rbp)
movq -0x328(%rbp), %rax
movq %rax, -0x350(%rbp)
movq -0xa0(%rbp), %rdi
callq 0x9e80
movq %rax, %rcx
movq -0x350(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x348(%rbp)
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
callq 0x9ee0
movq %rax, %rcx
movq -0x348(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x328(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x338(%rbp)
cmpq $0x8, -0x338(%rbp)
jge 0x9be1
movq -0x338(%rbp), %rax
movq -0x60(%rbp,%rax,8), %rax
andq $-0x1, %rax
movq %rax, -0x368(%rbp)
movq -0x338(%rbp), %rax
addq $0x1, %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq -0x368(%rbp), %rax
movq %rax, -0xa0(%rbp,%rdx,8)
movq -0x338(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x338(%rbp)
jmp 0x9b88
jmp 0x9be3
movq -0x330(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x330(%rbp)
jmp 0x9a55
movq $0x0, -0x330(%rbp)
cmpq $0x8, -0x330(%rbp)
jge 0x9c82
movq -0x8(%rbp), %rax
movq -0x330(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x330(%rbp), %rax
addq -0xa0(%rbp,%rax,8), %rcx
movq %rcx, -0xa0(%rbp,%rax,8)
movq -0x330(%rbp), %rax
movq -0xa0(%rbp,%rax,8), %rcx
andq $-0x1, %rcx
movq %rcx, -0xa0(%rbp,%rax,8)
movq -0x330(%rbp), %rax
movq -0xa0(%rbp,%rax,8), %rdx
movq -0x8(%rbp), %rax
movq -0x330(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x330(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x330(%rbp)
jmp 0x9c05
movq -0x10(%rbp), %rax
addq $0x80, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
subq $0x80, %rax
movq %rax, -0x18(%rbp)
jmp 0x9940
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
nopl (%rax)