// File: /workspace/github_cpp_makefile_star2_O1/attractivechaos[P]udb2/stb/./stb.h
// Function: stb__sha1
static void stb__sha1(stb_uchar *chunk, stb_uint h[5])
{
   int i;
   stb_uint a,b,c,d,e;
   stb_uint w[80];

   for (i=0; i < 16; ++i)
      w[i] = stb_big32(&chunk[i*4]);
   for (i=16; i < 80; ++i) {
      stb_uint t;
      t = w[i-3] ^ w[i-8] ^ w[i-14] ^ w[i-16];
      w[i] = (t + t) | (t >> 31);
   }

   a = h[0];
   b = h[1];
   c = h[2];
   d = h[3];
   e = h[4];

   #define STB__SHA1(k,f)                                            \
   {                                                                 \
      stb_uint temp = (a << 5) + (a >> 27) + (f) + e + (k) + w[i];  \
      e = d;                                                       \
      d = c;                                                     \
      c = (b << 30) + (b >> 2);                               \
      b = a;                                              \
      a = temp;                                    \
   }

   i=0;
   for (; i < 20; ++i) STB__SHA1(0x5a827999, d ^ (b & (c ^ d))       );
   for (; i < 40; ++i) STB__SHA1(0x6ed9eba1, b ^ c ^ d               );
   for (; i < 60; ++i) STB__SHA1(0x8f1bbcdc, (b & c) + (d & (b ^ c)) );
   for (; i < 80; ++i) STB__SHA1(0xca62c1d6, b ^ c ^ d               );

   #undef STB__SHA1

   h[0] += a;
   h[1] += b;
   h[2] += c;
   h[3] += d;
   h[4] += e;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc0, %rsp
xorl %eax, %eax
movl (%rdi,%rax,4), %ecx
bswapl %ecx
movl %ecx, -0x80(%rsp,%rax,4)
incq %rax
cmpq $0x10, %rax
jne 0xa625
movl $0x10, %eax
movl -0xa0(%rsp,%rax,4), %ecx
xorl -0x8c(%rsp,%rax,4), %ecx
xorl -0xb8(%rsp,%rax,4), %ecx
xorl -0xc0(%rsp,%rax,4), %ecx
roll %ecx
movl %ecx, -0x80(%rsp,%rax,4)
incq %rax
cmpq $0x50, %rax
jne 0xa63c
movl (%rsi), %r8d
movl 0x4(%rsi), %edi
movl 0x8(%rsi), %edx
movl 0xc(%rsi), %ecx
movl 0x10(%rsi), %eax
xorl %r14d, %r14d
movl %r8d, %ebp
movl %edi, %ebx
movl %edx, %r11d
movl %ecx, %r10d
movl %eax, %r9d
movl %r9d, %r15d
movl %r10d, %r9d
movl %r11d, %r10d
movl %ebx, %r11d
movl %ebp, %ebx
roll $0x5, %ebp
addl %r15d, %ebp
movl %r10d, %r15d
xorl %r9d, %r15d
andl %r11d, %r15d
xorl %r9d, %r15d
addl %ebp, %r15d
movl -0x80(%rsp,%r14,4), %r12d
leal (%r12,%r15), %ebp
addl $0x5a827999, %ebp       # imm = 0x5A827999
roll $0x1e, %r11d
incq %r14
cmpq $0x14, %r14
jne 0xa687
movl $0x14, %r14d
movl %r9d, %r15d
movl %r10d, %r9d
movl %r11d, %r10d
movl %ebx, %r11d
movl %ebp, %ebx
roll $0x5, %ebp
movl %r10d, %r12d
xorl %r9d, %r12d
xorl %r11d, %r12d
addl %r15d, %r12d
addl %ebp, %r12d
movl -0x80(%rsp,%r14,4), %r15d
leal (%r15,%r12), %ebp
addl $0x6ed9eba1, %ebp       # imm = 0x6ED9EBA1
roll $0x1e, %r11d
incq %r14
cmpq $0x28, %r14
jne 0xa6cc
movl $0x28, %r14d
movl %r9d, %r15d
movl %r10d, %r9d
movl %r11d, %r10d
movl %ebx, %r11d
movl %ebp, %ebx
roll $0x5, %ebp
movl %r11d, %r12d
andl %r10d, %r12d
addl %r15d, %r12d
movl %r11d, %r15d
xorl %r10d, %r15d
andl %r9d, %r15d
addl %r12d, %r15d
addl %ebp, %r15d
movl -0x80(%rsp,%r14,4), %r12d
leal (%r12,%r15), %ebp
addl $0x8f1bbcdc, %ebp       # imm = 0x8F1BBCDC
roll $0x1e, %r11d
incq %r14
cmpq $0x3c, %r14
jne 0xa70e
movl $0x3c, %r14d
movl %r9d, %r15d
movl %r10d, %r9d
movl %r11d, %r10d
movl %ebx, %r11d
movl %ebp, %ebx
roll $0x5, %ebp
movl %r10d, %r12d
xorl %r9d, %r12d
xorl %r11d, %r12d
addl %r15d, %r12d
addl %ebp, %r12d
movl -0x80(%rsp,%r14,4), %r15d
leal (%r15,%r12), %ebp
addl $0xca62c1d6, %ebp       # imm = 0xCA62C1D6
roll $0x1e, %r11d
incq %r14
cmpq $0x50, %r14
jne 0xa759
addl %r8d, %ebp
movl %ebp, (%rsi)
addl %edi, %ebx
movl %ebx, 0x4(%rsi)
addl %edx, %r11d
movl %r11d, 0x8(%rsi)
addl %ecx, %r10d
movl %r10d, 0xc(%rsi)
addl %eax, %r9d
movl %r9d, 0x10(%rsi)
addq $0xc0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq