// File: /workspace/github_cpp_makefile_star2_O1/s0sasaki[P]ExecutableBlockchain/sha256.cpp
// Function: SHA256::transform(unsigned char const*, unsigned int)
void SHA256::transform(const unsigned char *message, unsigned int block_nb)
{
    uint32 w[64];
    uint32 wv[8];
    uint32 t1, t2;
    const unsigned char *sub_block;
    int i;
    int j;
    for (i = 0; i < (int) block_nb; i++) {
        sub_block = message + (i << 6);
        for (j = 0; j < 16; j++) {
            SHA2_PACK32(&sub_block[j << 2], &w[j]);
        }
        for (j = 16; j < 64; j++) {
            w[j] =  SHA256_F4(w[j -  2]) + w[j -  7] + SHA256_F3(w[j - 15]) + w[j - 16];
        }
        for (j = 0; j < 8; j++) {
            wv[j] = m_h[j];
        }
        for (j = 0; j < 64; j++) {
            t1 = wv[7] + SHA256_F2(wv[4]) + SHA2_CH(wv[4], wv[5], wv[6])
                 + sha256_k[j] + w[j];
            t2 = SHA256_F1(wv[0]) + SHA2_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++) {
            m_h[j] += wv[j];
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, -0x58(%rbp)
testl %edx, %edx
jle 0x5565
leaq 0x88(%rdi), %rax
movq %rax, -0x70(%rbp)
movl %edx, %eax
movq %rax, -0x68(%rbp)
addq $0x3, -0x58(%rbp)
xorl %eax, %eax
leaq 0x1e35(%rip), %r8       # 0x7200
xorl %ecx, %ecx
movq %rdi, -0x60(%rbp)
movq %rcx, -0x78(%rbp)
movq %rax, -0x80(%rbp)
cltq
addq -0x58(%rbp), %rax
xorl %ecx, %ecx
movl -0x3(%rax,%rcx,4), %edx
bswapl %edx
movl %edx, -0x180(%rbp,%rcx,4)
incq %rcx
cmpq $0x10, %rcx
jne 0x53e1
movl $0x10, %eax
movl -0x188(%rbp,%rax,4), %ecx
movl %ecx, %edx
roll $0xf, %edx
movl %ecx, %esi
roll $0xd, %esi
xorl %edx, %esi
shrl $0xa, %ecx
xorl %esi, %ecx
addl -0x19c(%rbp,%rax,4), %ecx
movl -0x1bc(%rbp,%rax,4), %edx
movl %edx, %esi
roll $0x19, %esi
movl %edx, %r9d
roll $0xe, %r9d
xorl %esi, %r9d
shrl $0x3, %edx
xorl %r9d, %edx
addl -0x1c0(%rbp,%rax,4), %ecx
addl %edx, %ecx
movl %ecx, -0x180(%rbp,%rax,4)
incq %rax
cmpq $0x40, %rax
jne 0x53fc
movq -0x70(%rbp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movaps %xmm1, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movl -0x34(%rbp), %ecx
movl -0x40(%rbp), %r10d
movl -0x3c(%rbp), %r9d
movl -0x38(%rbp), %eax
movl -0x50(%rbp), %r15d
movl -0x4c(%rbp), %r12d
movl -0x48(%rbp), %esi
movl -0x44(%rbp), %ebx
xorl %r14d, %r14d
movl %eax, %r13d
movl %r9d, %eax
movl %r10d, %r9d
movq %r8, %rdi
movl %r10d, %r8d
roll $0x1a, %r8d
movl %ebx, %r10d
movl %esi, %ebx
movl %r9d, %edx
roll $0x15, %edx
movl %r12d, %esi
movl %r9d, %r11d
roll $0x7, %r11d
xorl %r8d, %edx
movq %rdi, %r8
xorl %edx, %r11d
addl %ecx, %r11d
movl %eax, %ecx
xorl %r13d, %ecx
andl %r9d, %ecx
addl (%r14,%rdi), %r11d
xorl %r13d, %ecx
addl %ecx, %r11d
addl -0x180(%rbp,%r14), %r11d
movl %r15d, %r12d
movl %r15d, %ecx
roll $0x1e, %ecx
movl %r15d, %edx
roll $0x13, %edx
xorl %ecx, %edx
movl %r15d, %ecx
roll $0xa, %ecx
xorl %edx, %ecx
movl %ebx, %edx
xorl %esi, %edx
andl %r15d, %edx
movl %ebx, %r15d
andl %esi, %r15d
xorl %edx, %r15d
addl %ecx, %r15d
addl %r11d, %r10d
addl %r11d, %r15d
addq $0x4, %r14
movl %r13d, %ecx
cmpq $0x100, %r14            # imm = 0x100
jne 0x5482
movl %r13d, -0x34(%rbp)
movl %r10d, -0x40(%rbp)
movl %r9d, -0x3c(%rbp)
movl %eax, -0x38(%rbp)
movl %r15d, -0x50(%rbp)
movl %r12d, -0x4c(%rbp)
movl %esi, -0x48(%rbp)
movl %ebx, -0x44(%rbp)
xorl %eax, %eax
movq -0x60(%rbp), %rdi
movl -0x50(%rbp,%rax,4), %ecx
addl %ecx, 0x88(%rdi,%rax,4)
incq %rax
cmpq $0x8, %rax
jne 0x5539
movq -0x78(%rbp), %rcx
incq %rcx
movq -0x80(%rbp), %rax
addl $0x40, %eax
cmpq -0x68(%rbp), %rcx
jne 0x53d1
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop