// File: /workspace/github_cpp_makefile_star2_O1/zhjw1998[P]Merkle-Tree/src/../include/picosha2.h
// Function: void picosha2::detail::hash256_block<unsigned long*, unsigned char*>(unsigned long*, unsigned char*, unsigned char*)
void hash256_block(RaIter1 message_digest, RaIter2 first, RaIter2 last) {
    assert(first + 64 == last);
    static_cast<void>(last);  // for avoiding unused-variable warning
    word_t w[64];
    std::fill(w, w + 64, 0);
    for (std::size_t i = 0; i < 16; ++i) {
        w[i] = (static_cast<word_t>(mask_8bit(*(first + i * 4))) << 24) |
               (static_cast<word_t>(mask_8bit(*(first + i * 4 + 1))) << 16) |
               (static_cast<word_t>(mask_8bit(*(first + i * 4 + 2))) << 8) |
               (static_cast<word_t>(mask_8bit(*(first + i * 4 + 3))));
    }
    for (std::size_t i = 16; i < 64; ++i) {
        w[i] = mask_32bit(ssig1(w[i - 2]) + w[i - 7] + ssig0(w[i - 15]) +
                          w[i - 16]);
    }

    word_t a = *message_digest;
    word_t b = *(message_digest + 1);
    word_t c = *(message_digest + 2);
    word_t d = *(message_digest + 3);
    word_t e = *(message_digest + 4);
    word_t f = *(message_digest + 5);
    word_t g = *(message_digest + 6);
    word_t h = *(message_digest + 7);

    for (std::size_t i = 0; i < 64; ++i) {
        word_t temp1 = h + bsig1(e) + ch(e, f, g) + add_constant[i] + w[i];
        word_t temp2 = bsig0(a) + maj(a, b, c);
        h = g;
        g = f;
        f = e;
        e = mask_32bit(d + temp1);
        d = c;
        c = b;
        b = a;
        a = mask_32bit(temp1 + temp2);
    }
    *message_digest += a;
    *(message_digest + 1) += b;
    *(message_digest + 2) += c;
    *(message_digest + 3) += d;
    *(message_digest + 4) += e;
    *(message_digest + 5) += f;
    *(message_digest + 6) += g;
    *(message_digest + 7) += h;
    for (std::size_t i = 0; i < 8; ++i) {
        *(message_digest + i) = mask_32bit(*(message_digest + i));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
leaq 0x40(%rsi), %rax
cmpq %rdx, %rax
jne 0x44e6
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x50(%rsp), %rdi
xorl %r15d, %r15d
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x20c0
movl (%r14,%r15,4), %eax
bswapl %eax
movq %rax, 0x50(%rsp,%r15,8)
incq %r15
cmpq $0x10, %r15
jne 0x42ce
movl $0x10, %eax
movq 0x40(%rsp,%rax,8), %rcx
movq %rcx, %rdx
shrq $0x11, %rdx
movl %ecx, %esi
shll $0xf, %esi
orl %esi, %edx
movq %rcx, %rsi
shrq $0x13, %rsi
movl %ecx, %edi
shll $0xd, %edi
orl %edi, %esi
shrq $0xa, %rcx
xorl %esi, %ecx
xorl %edx, %ecx
movq -0x28(%rsp,%rax,8), %rdx
movq %rdx, %rsi
shrq $0x7, %rsi
movl %edx, %edi
shll $0x19, %edi
orl %edi, %esi
movq %rdx, %rdi
shrq $0x12, %rdi
movl %edx, %r8d
shll $0xe, %r8d
orl %r8d, %edi
shrq $0x3, %rdx
xorl %edi, %edx
xorl %esi, %edx
movl -0x30(%rsp,%rax,8), %esi
addl 0x18(%rsp,%rax,8), %esi
addl %ecx, %esi
addl %edx, %esi
movq %rsi, 0x50(%rsp,%rax,8)
incq %rax
cmpq $0x40, %rax
jne 0x42e7
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %r8
movq 0x20(%rbx), %rdx
movq 0x28(%rbx), %r15
movq 0x30(%rbx), %r14
movq %rbx, 0x48(%rsp)
movq 0x38(%rbx), %r11
xorl %r12d, %r12d
movq %r11, 0x40(%rsp)
movq %r14, 0x38(%rsp)
movq %r15, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rax, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movq %rdi, %rbx
movq %rax, %r9
movq %rdx, %r13
movq %r15, %r10
movq %r14, %rcx
movq %rdx, %rax
shrq $0x6, %rax
shll $0x1a, %edx
orl %edx, %eax
movq %r13, %rdx
shrq $0xb, %rdx
movl %r13d, %edi
shll $0x15, %edi
orl %edi, %edx
xorl %eax, %edx
movq %r13, %rax
shrq $0x19, %rax
movl %r13d, %edi
shll $0x7, %edi
orl %edi, %eax
xorl %edx, %eax
movl %r10d, %edx
andl %r13d, %edx
movl %r13d, %edi
notl %edi
andl %ecx, %edi
addl %edx, %r11d
addl %edi, %r11d
addl %eax, %r11d
leaq 0x2ff1(%rip), %rax      # 0x73f0
addl (%r12,%rax), %r11d
addl 0x50(%rsp,%r12), %r11d
movq %rsi, %rbp
movq %rbx, %rax
shrq $0x2, %rax
movl %ebx, %edx
shll $0x1e, %edx
orl %edx, %eax
movq %rbx, %rdx
shrq $0xd, %rdx
movl %ebx, %esi
shll $0x13, %esi
orl %esi, %edx
xorl %eax, %edx
movq %rbx, %rax
shrq $0x16, %rax
movl %ebx, %esi
shll $0xa, %esi
orl %esi, %eax
xorl %edx, %eax
movl %ebp, %edx
xorl %r9d, %edx
andl %ebx, %edx
movl %ebp, %edi
andl %r9d, %edi
xorl %edx, %edi
addl %eax, %edi
movl %r8d, %edx
addl %r11d, %edx
addl %r11d, %edi
addq $0x8, %r12
movq %r14, %r11
movq %r15, %r14
movq %r13, %r15
movq %rbp, %r8
movq %r9, %rsi
movq %rbx, %rax
cmpq $0x200, %r12            # imm = 0x200
jne 0x43a5
addq 0x8(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq %rdi, (%rsi)
addq 0x10(%rsp), %rbx
movq %rbx, 0x8(%rsi)
addq 0x18(%rsp), %r9
movq %r9, 0x10(%rsi)
addq 0x20(%rsp), %rbp
movq %rbp, 0x18(%rsi)
addq 0x28(%rsp), %rdx
movq %rdx, 0x20(%rsi)
addq 0x30(%rsp), %r13
movq %r13, 0x28(%rsi)
addq 0x38(%rsp), %r10
movq %r10, 0x30(%rsi)
addq 0x40(%rsp), %rcx
movq %rcx, 0x38(%rsi)
xorl %eax, %eax
movl $0x0, 0x4(%rsi,%rax,8)
incq %rax
cmpq $0x8, %rax
jne 0x44c3
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2d0d(%rip), %rdi      # 0x71fa
leaq 0x2d19(%rip), %rsi      # 0x720d
leaq 0x2ddd(%rip), %rcx      # 0x72d8
movl $0x5d, %edx
callq 0x20d0
nop