// File: /workspace/github_cpp_makefile_star2_O3/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 0x54da
addq $0x88, %rdi
movl %edx, %eax
movq %rax, -0x68(%rbp)
addq $0x3, -0x58(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
movq %rdi, -0x60(%rbp)
movq %rcx, -0x70(%rbp)
movq %rax, -0x78(%rbp)
cltq
addq -0x58(%rbp), %rax
xorl %ecx, %ecx
movl -0x3(%rax,%rcx,4), %esi
bswapl %esi
movl %esi, -0x180(%rbp,%rcx,4)
incq %rcx
cmpq $0x10, %rcx
jne 0x5346
movl $0x10, %eax
movl -0x180(%rbp), %ecx
movl -0x1bc(%rbp,%rax,4), %esi
movl -0x188(%rbp,%rax,4), %r8d
movl %r8d, %r9d
roll $0xf, %r9d
movl %r8d, %r10d
roll $0xd, %r10d
xorl %r9d, %r10d
shrl $0xa, %r8d
xorl %r10d, %r8d
addl -0x19c(%rbp,%rax,4), %r8d
movl %esi, %r9d
roll $0x19, %r9d
movl %esi, %r10d
roll $0xe, %r10d
xorl %r9d, %r10d
movl %esi, %r9d
shrl $0x3, %r9d
xorl %r10d, %r9d
addl %ecx, %r9d
addl %r8d, %r9d
movl %r9d, -0x180(%rbp,%rax,4)
incq %rax
movl %esi, %ecx
cmpq $0x40, %rax
jne 0x5367
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movaps %xmm1, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movl -0x34(%rbp), %r13d
movl -0x40(%rbp), %r9d
movl -0x3c(%rbp), %r8d
movl -0x38(%rbp), %eax
movl -0x50(%rbp), %r14d
movl -0x4c(%rbp), %r15d
movl -0x48(%rbp), %ecx
movl -0x44(%rbp), %r11d
xorl %ebx, %ebx
leaq 0x1e00(%rip), %rdi      # 0x7200
movl %eax, %r12d
movl %r8d, %eax
movl %r9d, %r8d
movl %r9d, %edx
roll $0x1a, %edx
movl %r11d, %r9d
movl %ecx, %r11d
movl %r8d, %esi
roll $0x15, %esi
movl %r15d, %ecx
movl %r8d, %r10d
roll $0x7, %r10d
xorl %edx, %esi
xorl %esi, %r10d
addl %r13d, %r10d
movl %eax, %edx
xorl %r12d, %edx
andl %r8d, %edx
addl (%rbx,%rdi), %r10d
xorl %r12d, %edx
addl %edx, %r10d
addl -0x180(%rbp,%rbx), %r10d
movl %r14d, %r15d
movl %r14d, %edx
roll $0x1e, %edx
movl %r14d, %esi
roll $0x13, %esi
xorl %edx, %esi
movl %r14d, %edx
roll $0xa, %edx
xorl %esi, %edx
movl %r11d, %esi
xorl %ecx, %esi
andl %r14d, %esi
movl %r11d, %r14d
andl %ecx, %r14d
xorl %esi, %r14d
addl %edx, %r14d
addl %r10d, %r9d
addl %r10d, %r14d
addq $0x4, %rbx
movl %r12d, %r13d
cmpq $0x100, %rbx            # imm = 0x100
jne 0x5400
movl %r12d, -0x34(%rbp)
movl %r9d, -0x40(%rbp)
movl %r8d, -0x3c(%rbp)
movl %eax, -0x38(%rbp)
movl %r14d, -0x50(%rbp)
movl %r15d, -0x4c(%rbp)
movl %ecx, -0x48(%rbp)
movl %r11d, -0x44(%rbp)
xorl %eax, %eax
movq -0x60(%rbp), %rdi
movl -0x50(%rbp,%rax,4), %ecx
addl %ecx, (%rdi,%rax,4)
incq %rax
cmpq $0x8, %rax
jne 0x54b2
movq -0x70(%rbp), %rcx
incq %rcx
movq -0x78(%rbp), %rax
addl $0x40, %eax
cmpq -0x68(%rbp), %rcx
jne 0x5336
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq