// File: Computer-Kids-Club[P]screenshare-pro-backend/sha1.c
// Function: SHA1ProcessMessageBlock(SHA1Context*)
void SHA1ProcessMessageBlock(SHA1Context *context)
{
    const unsigned K[] =            /* Constants defined in SHA-1   */      
    {
        0x5A827999,
        0x6ED9EBA1,
        0x8F1BBCDC,
        0xCA62C1D6
    };
    int         t;                  /* Loop counter                 */
    unsigned    temp;               /* Temporary word value         */
    unsigned    W[80];              /* Word sequence                */
    unsigned    A, B, C, D, E;      /* Word buffers                 */

    /*
     *  Initialize the first 16 words in the array W
     */
    for(t = 0; t < 16; t++)
    {
        W[t] = ((unsigned) context->Message_Block[t * 4]) << 24;
        W[t] |= ((unsigned) context->Message_Block[t * 4 + 1]) << 16;
        W[t] |= ((unsigned) context->Message_Block[t * 4 + 2]) << 8;
        W[t] |= ((unsigned) context->Message_Block[t * 4 + 3]);
    }

    for(t = 16; t < 80; t++)
    {
       W[t] = SHA1CircularShift(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]);
    }

    A = context->Message_Digest[0];
    B = context->Message_Digest[1];
    C = context->Message_Digest[2];
    D = context->Message_Digest[3];
    E = context->Message_Digest[4];

    for(t = 0; t < 20; t++)
    {
        temp =  SHA1CircularShift(5,A) +
                ((B & C) | ((~B) & D)) + E + W[t] + K[0];
        temp &= 0xFFFFFFFF;
        E = D;
        D = C;
        C = SHA1CircularShift(30,B);
        B = A;
        A = temp;
    }

    for(t = 20; t < 40; t++)
    {
        temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[1];
        temp &= 0xFFFFFFFF;
        E = D;
        D = C;
        C = SHA1CircularShift(30,B);
        B = A;
        A = temp;
    }

    for(t = 40; t < 60; t++)
    {
        temp = SHA1CircularShift(5,A) +
               ((B & C) | (B & D) | (C & D)) + E + W[t] + K[2];
        temp &= 0xFFFFFFFF;
        E = D;
        D = C;
        C = SHA1CircularShift(30,B);
        B = A;
        A = temp;
    }

    for(t = 60; t < 80; t++)
    {
        temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[3];
        temp &= 0xFFFFFFFF;
        E = D;
        D = C;
        C = SHA1CircularShift(30,B);
        B = A;
        A = temp;
    }

    context->Message_Digest[0] =
                        (context->Message_Digest[0] + A) & 0xFFFFFFFF;
    context->Message_Digest[1] =
                        (context->Message_Digest[1] + B) & 0xFFFFFFFF;
    context->Message_Digest[2] =
                        (context->Message_Digest[2] + C) & 0xFFFFFFFF;
    context->Message_Digest[3] =
                        (context->Message_Digest[3] + D) & 0xFFFFFFFF;
    context->Message_Digest[4] =
                        (context->Message_Digest[4] + E) & 0xFFFFFFFF;

    context->Message_Block_Index = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq 0x188a(%rip), %rax      # 0x11590
movq %rax, -0x20(%rbp)
movq 0x1887(%rip), %rax      # 0x11598
movq %rax, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x10, -0x24(%rbp)
jge 0xfdcf
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
movzbl 0x1c(%rax,%rcx), %ecx
shll $0x18, %ecx
movslq -0x24(%rbp), %rax
movl %ecx, -0x170(%rbp,%rax,4)
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
shll $0x2, %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl 0x1c(%rax,%rcx), %ecx
shll $0x10, %ecx
movslq -0x24(%rbp), %rax
orl -0x170(%rbp,%rax,4), %ecx
movl %ecx, -0x170(%rbp,%rax,4)
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
shll $0x2, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movzbl 0x1c(%rax,%rcx), %ecx
shll $0x8, %ecx
movslq -0x24(%rbp), %rax
orl -0x170(%rbp,%rax,4), %ecx
movl %ecx, -0x170(%rbp,%rax,4)
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
shll $0x2, %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movzbl 0x1c(%rax,%rcx), %ecx
movslq -0x24(%rbp), %rax
orl -0x170(%rbp,%rax,4), %ecx
movl %ecx, -0x170(%rbp,%rax,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xfd1c
movl $0x10, -0x24(%rbp)
cmpl $0x50, -0x24(%rbp)
jge 0xfe7e
movl -0x24(%rbp), %eax
subl $0x3, %eax
cltq
movl -0x170(%rbp,%rax,4), %ecx
movl -0x24(%rbp), %eax
subl $0x8, %eax
cltq
xorl -0x170(%rbp,%rax,4), %ecx
movl -0x24(%rbp), %eax
subl $0xe, %eax
cltq
xorl -0x170(%rbp,%rax,4), %ecx
movl -0x24(%rbp), %eax
subl $0x10, %eax
cltq
xorl -0x170(%rbp,%rax,4), %ecx
shll %ecx
andl $-0x1, %ecx
movl -0x24(%rbp), %eax
subl $0x3, %eax
cltq
movl -0x170(%rbp,%rax,4), %eax
movl -0x24(%rbp), %edx
subl $0x8, %edx
movslq %edx, %rdx
xorl -0x170(%rbp,%rdx,4), %eax
movl -0x24(%rbp), %edx
subl $0xe, %edx
movslq %edx, %rdx
xorl -0x170(%rbp,%rdx,4), %eax
movl -0x24(%rbp), %edx
subl $0x10, %edx
movslq %edx, %rdx
xorl -0x170(%rbp,%rdx,4), %eax
shrl $0x1f, %eax
orl %eax, %ecx
movslq -0x24(%rbp), %rax
movl %ecx, -0x170(%rbp,%rax,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xfdd6
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x174(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x178(%rbp)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x17c(%rbp)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x180(%rbp)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x184(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x14, -0x24(%rbp)
jge 0xff7d
movl -0x174(%rbp), %eax
shll $0x5, %eax
andl $-0x1, %eax
movl -0x174(%rbp), %ecx
shrl $0x1b, %ecx
orl %ecx, %eax
movl -0x178(%rbp), %ecx
andl -0x17c(%rbp), %ecx
movl -0x178(%rbp), %edx
xorl $-0x1, %edx
andl -0x180(%rbp), %edx
orl %edx, %ecx
addl %ecx, %eax
addl -0x184(%rbp), %eax
movslq -0x24(%rbp), %rcx
addl -0x170(%rbp,%rcx,4), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
andl $-0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x180(%rbp), %eax
movl %eax, -0x184(%rbp)
movl -0x17c(%rbp), %eax
movl %eax, -0x180(%rbp)
movl -0x178(%rbp), %eax
shll $0x1e, %eax
andl $-0x1, %eax
movl -0x178(%rbp), %ecx
shrl $0x2, %ecx
orl %ecx, %eax
movl %eax, -0x17c(%rbp)
movl -0x174(%rbp), %eax
movl %eax, -0x178(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x174(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xfec5
movl $0x14, -0x24(%rbp)
cmpl $0x28, -0x24(%rbp)
jge 0x10031
movl -0x174(%rbp), %eax
shll $0x5, %eax
andl $-0x1, %eax
movl -0x174(%rbp), %ecx
shrl $0x1b, %ecx
orl %ecx, %eax
movl -0x178(%rbp), %ecx
xorl -0x17c(%rbp), %ecx
xorl -0x180(%rbp), %ecx
addl %ecx, %eax
addl -0x184(%rbp), %eax
movslq -0x24(%rbp), %rcx
addl -0x170(%rbp,%rcx,4), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
andl $-0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x180(%rbp), %eax
movl %eax, -0x184(%rbp)
movl -0x17c(%rbp), %eax
movl %eax, -0x180(%rbp)
movl -0x178(%rbp), %eax
shll $0x1e, %eax
andl $-0x1, %eax
movl -0x178(%rbp), %ecx
shrl $0x2, %ecx
orl %ecx, %eax
movl %eax, -0x17c(%rbp)
movl -0x174(%rbp), %eax
movl %eax, -0x178(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x174(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xff84
movl $0x28, -0x24(%rbp)
cmpl $0x3c, -0x24(%rbp)
jge 0x100fb
movl -0x174(%rbp), %eax
shll $0x5, %eax
andl $-0x1, %eax
movl -0x174(%rbp), %ecx
shrl $0x1b, %ecx
orl %ecx, %eax
movl -0x178(%rbp), %ecx
andl -0x17c(%rbp), %ecx
movl -0x178(%rbp), %edx
andl -0x180(%rbp), %edx
orl %edx, %ecx
movl -0x17c(%rbp), %edx
andl -0x180(%rbp), %edx
orl %edx, %ecx
addl %ecx, %eax
addl -0x184(%rbp), %eax
movslq -0x24(%rbp), %rcx
addl -0x170(%rbp,%rcx,4), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
andl $-0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x180(%rbp), %eax
movl %eax, -0x184(%rbp)
movl -0x17c(%rbp), %eax
movl %eax, -0x180(%rbp)
movl -0x178(%rbp), %eax
shll $0x1e, %eax
andl $-0x1, %eax
movl -0x178(%rbp), %ecx
shrl $0x2, %ecx
orl %ecx, %eax
movl %eax, -0x17c(%rbp)
movl -0x174(%rbp), %eax
movl %eax, -0x178(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x174(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x10038
movl $0x3c, -0x24(%rbp)
cmpl $0x50, -0x24(%rbp)
jge 0x101af
movl -0x174(%rbp), %eax
shll $0x5, %eax
andl $-0x1, %eax
movl -0x174(%rbp), %ecx
shrl $0x1b, %ecx
orl %ecx, %eax
movl -0x178(%rbp), %ecx
xorl -0x17c(%rbp), %ecx
xorl -0x180(%rbp), %ecx
addl %ecx, %eax
addl -0x184(%rbp), %eax
movslq -0x24(%rbp), %rcx
addl -0x170(%rbp,%rcx,4), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
andl $-0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x180(%rbp), %eax
movl %eax, -0x184(%rbp)
movl -0x17c(%rbp), %eax
movl %eax, -0x180(%rbp)
movl -0x178(%rbp), %eax
shll $0x1e, %eax
andl $-0x1, %eax
movl -0x178(%rbp), %ecx
shrl $0x2, %ecx
orl %ecx, %eax
movl %eax, -0x17c(%rbp)
movl -0x174(%rbp), %eax
movl %eax, -0x178(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x174(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x10102
movq -0x8(%rbp), %rax
movl (%rax), %ecx
addl -0x174(%rbp), %ecx
andl $-0x1, %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
addl -0x178(%rbp), %ecx
andl $-0x1, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl -0x17c(%rbp), %ecx
andl $-0x1, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %ecx
addl -0x180(%rbp), %ecx
andl $-0x1, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
addl -0x184(%rbp), %ecx
andl $-0x1, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x5c(%rax)
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop