// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/misc/hash/sha1.cpp
// Function: smooth::Hash::SHA1::Transform(unsigned char*)
S::Void S::Hash::SHA1::Transform(UnsignedByte *buffer)
{
	UnsignedInt32	 word[80];

	for (Int j =  0; j < 16; j++) word[j] = buffer[j * 4 + 0] * 0x1000000 + buffer[j * 4 + 1] * 0x10000 + buffer[j * 4 + 2] * 0x100 + buffer[j * 4 + 3];
	for (Int j = 16; j < 80; j++) word[j] = ROTATE_LEFT((word[j - 3] ^ word[j - 8] ^ word[j - 14] ^ word[j - 16]), 1);

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

	for (int m = 0; m < 80; m++)
	{
		UnsignedInt32	 f = 0;
		UnsignedInt32	 k = 0;

		if	(m <= 19) { f = (b & c) | ((~b) & d);	     k = 0x5a827999; }
		else if (m <= 39) { f = b ^ c ^ d;		     k = 0x6ed9eba1; }
		else if (m <= 59) { f = (b & c) | (b & d) | (c & d); k = 0x8f1bbcdc; }
		else		  { f = b ^ c ^ d;		     k = 0xca62c1d6; }

		UnsignedInt32	 temp = (ROTATE_LEFT(a, 5) + f + e + k + word[m]) & 0xFFFFFFFF;

		e = d;
		d = c;
		c = ROTATE_LEFT(b, 30);
		b = a;

		a = temp;
	}

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

	size += 64;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x188(%rbp)
movl $0x0, -0x154(%rbp)
cmpl $0x10, -0x154(%rbp)
jge 0x100712
movq -0x10(%rbp), %rax
movl -0x154(%rbp), %ecx
shll $0x2, %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %ecx
shll $0x18, %ecx
movq -0x10(%rbp), %rax
movl -0x154(%rbp), %edx
shll $0x2, %edx
addl $0x1, %edx
movslq %edx, %rdx
movzbl (%rax,%rdx), %eax
shll $0x10, %eax
addl %eax, %ecx
movq -0x10(%rbp), %rax
movl -0x154(%rbp), %edx
shll $0x2, %edx
addl $0x2, %edx
movslq %edx, %rdx
movzbl (%rax,%rdx), %eax
shll $0x8, %eax
addl %eax, %ecx
movq -0x10(%rbp), %rax
movl -0x154(%rbp), %edx
shll $0x2, %edx
addl $0x3, %edx
movslq %edx, %rdx
movzbl (%rax,%rdx), %eax
addl %eax, %ecx
movslq -0x154(%rbp), %rax
movl %ecx, -0x150(%rbp,%rax,4)
movl -0x154(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x154(%rbp)
jmp 0x100678
movl $0x10, -0x158(%rbp)
cmpl $0x50, -0x158(%rbp)
jge 0x1007e5
movl -0x158(%rbp), %eax
subl $0x3, %eax
cltq
movl -0x150(%rbp,%rax,4), %ecx
movl -0x158(%rbp), %eax
subl $0x8, %eax
cltq
xorl -0x150(%rbp,%rax,4), %ecx
movl -0x158(%rbp), %eax
subl $0xe, %eax
cltq
xorl -0x150(%rbp,%rax,4), %ecx
movl -0x158(%rbp), %eax
subl $0x10, %eax
cltq
xorl -0x150(%rbp,%rax,4), %ecx
shll %ecx
movl -0x158(%rbp), %eax
subl $0x3, %eax
cltq
movl -0x150(%rbp,%rax,4), %eax
movl -0x158(%rbp), %edx
subl $0x8, %edx
movslq %edx, %rdx
xorl -0x150(%rbp,%rdx,4), %eax
movl -0x158(%rbp), %edx
subl $0xe, %edx
movslq %edx, %rdx
xorl -0x150(%rbp,%rdx,4), %eax
movl -0x158(%rbp), %edx
subl $0x10, %edx
movslq %edx, %rdx
xorl -0x150(%rbp,%rdx,4), %eax
shrl $0x1f, %eax
orl %eax, %ecx
movslq -0x158(%rbp), %rax
movl %ecx, -0x150(%rbp,%rax,4)
movl -0x158(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x158(%rbp)
jmp 0x10071c
movq -0x188(%rbp), %rax
movl (%rax), %ecx
movl %ecx, -0x15c(%rbp)
movl 0x4(%rax), %ecx
movl %ecx, -0x160(%rbp)
movl 0x8(%rax), %ecx
movl %ecx, -0x164(%rbp)
movl 0xc(%rax), %ecx
movl %ecx, -0x168(%rbp)
movl 0x10(%rax), %eax
movl %eax, -0x16c(%rbp)
movl $0x0, -0x170(%rbp)
cmpl $0x50, -0x170(%rbp)
jge 0x1009af
movl $0x0, -0x174(%rbp)
movl $0x0, -0x178(%rbp)
cmpl $0x13, -0x170(%rbp)
jg 0x10087e
movl -0x160(%rbp), %eax
andl -0x164(%rbp), %eax
movl -0x160(%rbp), %ecx
xorl $-0x1, %ecx
andl -0x168(%rbp), %ecx
orl %ecx, %eax
movl %eax, -0x174(%rbp)
movl $0x5a827999, -0x178(%rbp) # imm = 0x5A827999
jmp 0x100914
cmpl $0x27, -0x170(%rbp)
jg 0x1008ab
movl -0x160(%rbp), %eax
xorl -0x164(%rbp), %eax
xorl -0x168(%rbp), %eax
movl %eax, -0x174(%rbp)
movl $0x6ed9eba1, -0x178(%rbp) # imm = 0x6ED9EBA1
jmp 0x100912
cmpl $0x3b, -0x170(%rbp)
jg 0x1008ee
movl -0x160(%rbp), %eax
andl -0x164(%rbp), %eax
movl -0x160(%rbp), %ecx
andl -0x168(%rbp), %ecx
orl %ecx, %eax
movl -0x164(%rbp), %ecx
andl -0x168(%rbp), %ecx
orl %ecx, %eax
movl %eax, -0x174(%rbp)
movl $0x8f1bbcdc, -0x178(%rbp) # imm = 0x8F1BBCDC
jmp 0x100910
movl -0x160(%rbp), %eax
xorl -0x164(%rbp), %eax
xorl -0x168(%rbp), %eax
movl %eax, -0x174(%rbp)
movl $0xca62c1d6, -0x178(%rbp) # imm = 0xCA62C1D6
jmp 0x100912
jmp 0x100914
movl -0x15c(%rbp), %eax
shll $0x5, %eax
movl -0x15c(%rbp), %ecx
shrl $0x1b, %ecx
orl %ecx, %eax
addl -0x174(%rbp), %eax
addl -0x16c(%rbp), %eax
addl -0x178(%rbp), %eax
movslq -0x170(%rbp), %rcx
addl -0x150(%rbp,%rcx,4), %eax
andl $-0x1, %eax
movl %eax, -0x17c(%rbp)
movl -0x168(%rbp), %eax
movl %eax, -0x16c(%rbp)
movl -0x164(%rbp), %eax
movl %eax, -0x168(%rbp)
movl -0x160(%rbp), %eax
shll $0x1e, %eax
movl -0x160(%rbp), %ecx
shrl $0x2, %ecx
orl %ecx, %eax
movl %eax, -0x164(%rbp)
movl -0x15c(%rbp), %eax
movl %eax, -0x160(%rbp)
movl -0x17c(%rbp), %eax
movl %eax, -0x15c(%rbp)
movl -0x170(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x170(%rbp)
jmp 0x100822
movq -0x188(%rbp), %rax
movl -0x15c(%rbp), %ecx
addl (%rax), %ecx
movl %ecx, (%rax)
movl -0x160(%rbp), %ecx
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movl -0x164(%rbp), %ecx
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
movl -0x168(%rbp), %ecx
addl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movl -0x16c(%rbp), %ecx
addl 0x10(%rax), %ecx
movl %ecx, 0x10(%rax)
movq 0x18(%rax), %rcx
addq $0x40, %rcx
movq %rcx, 0x18(%rax)
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)