// File: /workspace/github_c_makefile_star2_O2/aerospike[P]aerospike-common/src/main/citrusleaf/cf_crypto.c
// Function: cf_SHA1ProcessMessageBlock
static void
cf_SHA1ProcessMessageBlock(cf_SHA1Context *context)
{
	const uint32_t K[] = {
			0x5A827999,
			0x6ED9EBA1,
			0x8F1BBCDC,
			0xCA62C1D6
	};

	int t;
	uint32_t temp;
	uint32_t W[80];
	uint32_t A, B, C, D, E;

	for (t = 0; t < 16; t++) {
		W[t] = (uint32_t)(context->Message_Block[t * 4]) << 24;
		W[t] |= (uint32_t)(context->Message_Block[t * 4 + 1]) << 16;
		W[t] |= context->Message_Block[t * 4 + 2] << 8;
		W[t] |= context->Message_Block[t * 4 + 3];
	}

	for (t = 16; t < 80; t++) {
		W[t] = cf_SHA1CircularShift(1,
				W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16]);
	}

	A = context->Intermediate_Hash[0];
	B = context->Intermediate_Hash[1];
	C = context->Intermediate_Hash[2];
	D = context->Intermediate_Hash[3];
	E = context->Intermediate_Hash[4];

	for (t = 0; t < 20; t++) {
		temp = cf_SHA1CircularShift(5, A) +
				((B & C) | ((~B) & D)) + E + W[t] + K[0];
		E = D;
		D = C;
		C = cf_SHA1CircularShift(30, B);
		B = A;
		A = temp;
	}

	for (t = 20; t < 40; t++) {
		temp = cf_SHA1CircularShift(5, A) + (B ^ C ^ D) + E + W[t] + K[1];
		E = D;
		D = C;
		C = cf_SHA1CircularShift(30, B);
		B = A;
		A = temp;
	}

	for (t = 40; t < 60; t++) {
		temp = cf_SHA1CircularShift(5, A) +
				((B & C) | (B & D) | (C & D)) + E + W[t] + K[2];
		E = D;
		D = C;
		C = cf_SHA1CircularShift(30, B);
		B = A;
		A = temp;
	}

	for (t = 60; t < 80; t++) {
		temp = cf_SHA1CircularShift(5, A) + (B ^ C ^ D) + E + W[t] + K[3];
		E = D;
		D = C;
		C = cf_SHA1CircularShift(30, B);
		B = A;
		A = temp;
	}

	context->Intermediate_Hash[0] += A;
	context->Intermediate_Hash[1] += B;
	context->Intermediate_Hash[2] += C;
	context->Intermediate_Hash[3] += D;
	context->Intermediate_Hash[4] += E;

	context->Message_Block_Index = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movabsq $-0x40, %rax
testq %rax, %rax
je 0x13b32
movl 0x5e(%rdi,%rax), %ecx
bswapl %ecx
movl %ecx, -0x40(%rsp,%rax)
addq $0x4, %rax
jmp 0x13b1d
movq $-0x100, %rax
testq %rax, %rax
je 0x13b69
movl 0xa0(%rsp,%rax), %ecx
xorl 0xb4(%rsp,%rax), %ecx
xorl 0x88(%rsp,%rax), %ecx
xorl 0x80(%rsp,%rax), %ecx
roll %ecx
movl %ecx, 0xc0(%rsp,%rax)
addq $0x4, %rax
jmp 0x13b39
movl (%rdi), %r8d
movl 0x4(%rdi), %esi
movl 0x8(%rdi), %edx
movl 0xc(%rdi), %ecx
movl 0x10(%rdi), %eax
movabsq $-0x50, %r11
movl %r8d, %r15d
movl %esi, %r9d
movl %edx, %r12d
movl %ecx, %ebp
movl %eax, %r10d
movl %ebp, %ebx
movl %r12d, %ebp
movl %r15d, %r14d
testq %r11, %r11
je 0x13bd6
movl %ebp, %r12d
movl %r14d, %r15d
movl -0x30(%rsp,%r11), %r13d
addq $0x4, %r11
xorl %ebx, %r12d
roll $0x5, %r15d
andl %r9d, %r12d
addl %r10d, %r15d
movl %ebx, %r10d
xorl %ebx, %r12d
addl %r12d, %r15d
movl %r9d, %r12d
movl %r14d, %r9d
leal 0x5a827999(%r13,%r15), %r15d
roll $0x1e, %r12d
jmp 0x13b90
movabsq $-0x50, %r12
movl %ebx, %r11d
movl %ebp, %ebx
movl %r14d, %r15d
testq %r12, %r12
je 0x13c21
movl %r15d, %r14d
movl %ebx, %ebp
movl 0x20(%rsp,%r12), %r13d
addq $0x4, %r12
roll $0x5, %r14d
xorl %r9d, %ebp
addl %r10d, %r14d
xorl %r11d, %ebp
movl %r11d, %r10d
addl %ebp, %r14d
movl %r9d, %ebp
movl %r15d, %r9d
leal 0x6ed9eba1(%r13,%r14), %r14d
roll $0x1e, %ebp
jmp 0x13be0
movabsq $-0x50, %r12
movl %r11d, %ebp
movl %ebx, %r11d
movl %r15d, %r14d
testq %r12, %r12
je 0x13c76
movl %ebp, %r15d
movl %ebp, %r13d
movl %r14d, %ebx
orl %r11d, %r15d
andl %r11d, %r13d
roll $0x5, %ebx
andl %r9d, %r15d
addl %r10d, %ebx
movl %ebp, %r10d
orl %r15d, %r13d
movl 0x70(%rsp,%r12), %r15d
addq $0x4, %r12
addl %r13d, %ebx
leal -0x70e44324(%r15,%rbx), %r15d
movl %r9d, %ebx
movl %r14d, %r9d
roll $0x1e, %ebx
jmp 0x13c2b
movabsq $-0x50, %r15
movl %ebp, %ebx
movl %r11d, %ebp
movl %r14d, %r12d
testq %r15, %r15
je 0x13cc6
movl %r12d, %r11d
movl %ebp, %r14d
movl 0xc0(%rsp,%r15), %r13d
addq $0x4, %r15
roll $0x5, %r11d
xorl %r9d, %r14d
addl %r10d, %r11d
xorl %ebx, %r14d
movl %ebx, %r10d
addl %r14d, %r11d
leal -0x359d3e2a(%r13,%r11), %r14d
movl %r9d, %r11d
movl %r12d, %r9d
roll $0x1e, %r11d
jmp 0x13c80
addl %r8d, %r12d
addl %esi, %r9d
addl %edx, %ebp
addl %ecx, %ebx
addl %eax, %r10d
movl %r12d, (%rdi)
movl %r9d, 0x4(%rdi)
movl %ebp, 0x8(%rdi)
movl %ebx, 0xc(%rdi)
movl %r10d, 0x10(%rdi)
andw $0x0, 0x1c(%rdi)
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop