// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
xorl %eax, %eax
cmpq $0x10, %rax
je 0x9504
movl (%rdi,%rax,4), %ecx
bswapl %ecx
movl %ecx, -0x70(%rsp,%rax,4)
incq %rax
jmp 0x94f0
movabsq $0x10, %rax
cmpq $0x50, %rax
je 0x9538
movl -0x90(%rsp,%rax,4), %ecx
xorl -0x7c(%rsp,%rax,4), %ecx
xorl -0xa8(%rsp,%rax,4), %ecx
xorl -0xb0(%rsp,%rax,4), %ecx
roll %ecx
movl %ecx, -0x70(%rsp,%rax,4)
incq %rax
jmp 0x950e
movl (%rsi), %r8d
movl 0x4(%rsi), %edi
movl 0x8(%rsi), %edx
movl 0xc(%rsi), %ecx
movl 0x10(%rsi), %eax
xorl %r15d, %r15d
movl %eax, -0x74(%rsp)
movl %eax, %r14d
movl %ecx, %r9d
movl %edx, %r10d
movl %edi, %r11d
movl %r8d, %ebx
cmpq $0x14, %r15
je 0x95a0
movl %ebx, %ebp
roll $0x5, %ebp
movl %r10d, %r12d
xorl %r9d, %r12d
andl %r11d, %r12d
xorl %r9d, %r12d
movl -0x70(%rsp,%r15,4), %r13d
addl %ebp, %r14d
addl %r12d, %r14d
leal (%r14,%r13), %ebp
addl $0x5a827999, %ebp       # imm = 0x5A827999
roll $0x1e, %r11d
incq %r15
movl %r9d, %r14d
movl %r10d, %r9d
movl %r11d, %r10d
movl %ebx, %r11d
movl %ebp, %ebx
jmp 0x955d
movabsq $0x14, %r15
cmpq $0x28, %r15
je 0x95ea
movl %ebx, %ebp
roll $0x5, %ebp
movl %r10d, %r12d
xorl %r9d, %r12d
xorl %r11d, %r12d
movl -0x70(%rsp,%r15,4), %r13d
addl %r12d, %r14d
addl %ebp, %r14d
leal (%r14,%r13), %ebp
addl $0x6ed9eba1, %ebp       # imm = 0x6ED9EBA1
roll $0x1e, %r11d
incq %r15
movl %r9d, %r14d
movl %r10d, %r9d
movl %r11d, %r10d
movl %ebx, %r11d
movl %ebp, %ebx
jmp 0x95aa
movabsq $0x28, %r15
cmpq $0x3c, %r15
je 0x963b
movl %ebx, %ebp
roll $0x5, %ebp
movl %r11d, %r12d
andl %r10d, %r12d
movl %r11d, %r13d
xorl %r10d, %r13d
andl %r9d, %r13d
movl -0x70(%rsp,%r15,4), %eax
addl %r12d, %r14d
addl %r13d, %r14d
addl %ebp, %r14d
addl %r14d, %eax
addl $0x8f1bbcdc, %eax       # imm = 0x8F1BBCDC
roll $0x1e, %r11d
incq %r15
movl %r9d, %r14d
movl %r10d, %r9d
movl %r11d, %r10d
movl %ebx, %r11d
movl %eax, %ebx
jmp 0x95f4
movabsq $0x3c, %r15
cmpq $0x50, %r15
je 0x9684
movl %ebx, %eax
roll $0x5, %eax
movl %r10d, %ebp
xorl %r9d, %ebp
xorl %r11d, %ebp
movl -0x70(%rsp,%r15,4), %r12d
addl %ebp, %r14d
addl %eax, %r14d
leal (%r12,%r14), %eax
addl $0xca62c1d6, %eax       # imm = 0xCA62C1D6
roll $0x1e, %r11d
incq %r15
movl %r9d, %r14d
movl %r10d, %r9d
movl %r11d, %r10d
movl %ebx, %r11d
movl %eax, %ebx
jmp 0x9645
addl %r8d, %ebx
movl %ebx, (%rsi)
addl %edi, %r11d
movl %r11d, 0x4(%rsi)
addl %edx, %r10d
movl %r10d, 0x8(%rsi)
addl %ecx, %r9d
movl %r9d, 0xc(%rsi)
addl -0x74(%rsp), %r14d
movl %r14d, 0x10(%rsi)
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq