// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/omdsha256k256n104tau160v2/ref/sha256.c
// Function: sha256_comp
void sha256_comp (hashblock res, const hashblock hash, const void *in)
	{
	uint32_t a,b,c,d,e,f,g,h,s0,s1,T1,T2;
	uint32_t    H[8];
	uint32_t	X[16],l;
	int i;
	const unsigned char *data=in;

	for (i = 0; i < SHA256_DIGEST_LENGTH/4; i++) {
	   HOST_c2l(hash, H[i]);
	}

	a = H[0];	b = H[1];	c = H[2];	d = H[3];
	e = H[4];	f = H[5];	g = H[6];	h = H[7];

	for (i=0;i<16;i++)
		{
		HOST_c2l(data,l); T1 = X[i] = l;
		T1 += h + Sigma1(e) + Ch(e,f,g) + K256[i];
		T2 = Sigma0(a) + Maj(a,b,c);
		h = g;
		g = f;
		f = e;
		e = d + T1;
		d = c;	c = b;	b = a;	a = T1 + T2;
		}

	for (;i<64;i++)
		{
		s0 = X[(i+1)&0x0f];	s0 = sigma0(s0);
		s1 = X[(i+14)&0x0f];	s1 = sigma1(s1);

		T1 = X[i&0xf] += s0 + s1 + X[(i+9)&0xf];
		T1 += h + Sigma1(e) + Ch(e,f,g) + K256[i];
		T2 = Sigma0(a) + Maj(a,b,c);
		h = g;	g = f;	f = e;	e = d + T1;
		d = c;	c = b;	b = a;	a = T1 + T2;
		}

	H[0] += a;	H[1] += b;	H[2] += c;	H[3] += d;
	H[4] += e;	H[5] += f;	H[6] += g;	H[7] += h;

	for (i = 0; i < SHA256_DIGEST_LENGTH/4; i++) {
	   HOST_l2c(H[i], res);
	}
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, -0x80(%rsp)
movl $0x0, -0x78(%rsp)
cmpl $0x8, -0x78(%rsp)
jge 0x252d
movq 0x28(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rsp)
movzbl (%rax), %eax
shlq $0x18, %rax
movl %eax, %ecx
movslq -0x78(%rsp), %rax
movl %ecx, -0x30(%rsp,%rax,4)
movq 0x28(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rsp)
movzbl (%rax), %eax
movl %eax, %edx
shlq $0x10, %rdx
movslq -0x78(%rsp), %rax
movl -0x30(%rsp,%rax,4), %ecx
orq %rdx, %rcx
movl %ecx, -0x30(%rsp,%rax,4)
movq 0x28(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rsp)
movzbl (%rax), %eax
movl %eax, %edx
shlq $0x8, %rdx
movslq -0x78(%rsp), %rax
movl -0x30(%rsp,%rax,4), %ecx
orq %rdx, %rcx
movl %ecx, -0x30(%rsp,%rax,4)
movq 0x28(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rsp)
movzbl (%rax), %eax
movl %eax, %edx
movslq -0x78(%rsp), %rax
movl -0x30(%rsp,%rax,4), %ecx
orq %rdx, %rcx
movl %ecx, -0x30(%rsp,%rax,4)
movl -0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rsp)
jmp 0x2475
movl -0x30(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl -0x2c(%rsp), %eax
movl %eax, 0x18(%rsp)
movl -0x28(%rsp), %eax
movl %eax, 0x14(%rsp)
movl -0x24(%rsp), %eax
movl %eax, 0x10(%rsp)
movl -0x20(%rsp), %eax
movl %eax, 0xc(%rsp)
movl -0x1c(%rsp), %eax
movl %eax, 0x8(%rsp)
movl -0x18(%rsp), %eax
movl %eax, 0x4(%rsp)
movl -0x14(%rsp), %eax
movl %eax, (%rsp)
movl $0x0, -0x78(%rsp)
cmpl $0x10, -0x78(%rsp)
jge 0x273d
movq -0x80(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x80(%rsp)
movzbl (%rax), %eax
shlq $0x18, %rax
movl %eax, -0x74(%rsp)
movq -0x80(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x80(%rsp)
movzbl (%rax), %eax
movl %eax, %ecx
shlq $0x10, %rcx
movl -0x74(%rsp), %eax
orq %rcx, %rax
movl %eax, -0x74(%rsp)
movq -0x80(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x80(%rsp)
movzbl (%rax), %eax
movl %eax, %ecx
shlq $0x8, %rcx
movl -0x74(%rsp), %eax
orq %rcx, %rax
movl %eax, -0x74(%rsp)
movq -0x80(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x80(%rsp)
movzbl (%rax), %eax
movl %eax, %ecx
movl -0x74(%rsp), %eax
orq %rcx, %rax
movl %eax, -0x74(%rsp)
movl -0x74(%rsp), %eax
movslq -0x78(%rsp), %rcx
movl %eax, -0x70(%rsp,%rcx,4)
movl %eax, -0xc(%rsp)
movl (%rsp), %eax
movl 0xc(%rsp), %ecx
shll $0x1a, %ecx
movl 0xc(%rsp), %edx
andl $-0x1, %edx
shrl $0x6, %edx
orl %edx, %ecx
movl 0xc(%rsp), %edx
shll $0x15, %edx
movl 0xc(%rsp), %esi
andl $-0x1, %esi
shrl $0xb, %esi
orl %esi, %edx
xorl %edx, %ecx
movl 0xc(%rsp), %edx
shll $0x7, %edx
movl 0xc(%rsp), %esi
andl $-0x1, %esi
shrl $0x19, %esi
orl %esi, %edx
xorl %edx, %ecx
addl %ecx, %eax
movl 0xc(%rsp), %ecx
andl 0x8(%rsp), %ecx
movl 0xc(%rsp), %edx
xorl $-0x1, %edx
andl 0x4(%rsp), %edx
xorl %edx, %ecx
addl %ecx, %eax
movslq -0x78(%rsp), %rdx
leaq 0x9c4(%rip), %rcx       # 0x3040
addl (%rcx,%rdx,4), %eax
addl -0xc(%rsp), %eax
movl %eax, -0xc(%rsp)
movl 0x1c(%rsp), %eax
shll $0x1e, %eax
movl 0x1c(%rsp), %ecx
andl $-0x1, %ecx
shrl $0x2, %ecx
orl %ecx, %eax
movl 0x1c(%rsp), %ecx
shll $0x13, %ecx
movl 0x1c(%rsp), %edx
andl $-0x1, %edx
shrl $0xd, %edx
orl %edx, %ecx
xorl %ecx, %eax
movl 0x1c(%rsp), %ecx
shll $0xa, %ecx
movl 0x1c(%rsp), %edx
andl $-0x1, %edx
shrl $0x16, %edx
orl %edx, %ecx
xorl %ecx, %eax
movl 0x1c(%rsp), %ecx
andl 0x18(%rsp), %ecx
movl 0x1c(%rsp), %edx
andl 0x14(%rsp), %edx
xorl %edx, %ecx
movl 0x18(%rsp), %edx
andl 0x14(%rsp), %edx
xorl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x10(%rsp)
movl 0x4(%rsp), %eax
movl %eax, (%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x4(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x8(%rsp)
movl 0x10(%rsp), %eax
addl -0xc(%rsp), %eax
movl %eax, 0xc(%rsp)
movl 0x14(%rsp), %eax
movl %eax, 0x10(%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x18(%rsp)
movl -0xc(%rsp), %eax
addl -0x10(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl -0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rsp)
jmp 0x2574
jmp 0x273f
cmpl $0x40, -0x78(%rsp)
jge 0x2931
movl -0x78(%rsp), %eax
addl $0x1, %eax
andl $0xf, %eax
cltq
movl -0x70(%rsp,%rax,4), %eax
movl %eax, -0x4(%rsp)
movl -0x4(%rsp), %eax
shll $0x19, %eax
movl -0x4(%rsp), %ecx
andl $-0x1, %ecx
shrl $0x7, %ecx
orl %ecx, %eax
movl -0x4(%rsp), %ecx
shll $0xe, %ecx
movl -0x4(%rsp), %edx
andl $-0x1, %edx
shrl $0x12, %edx
orl %edx, %ecx
xorl %ecx, %eax
movl -0x4(%rsp), %ecx
shrl $0x3, %ecx
xorl %ecx, %eax
movl %eax, -0x4(%rsp)
movl -0x78(%rsp), %eax
addl $0xe, %eax
andl $0xf, %eax
cltq
movl -0x70(%rsp,%rax,4), %eax
movl %eax, -0x8(%rsp)
movl -0x8(%rsp), %eax
shll $0xf, %eax
movl -0x8(%rsp), %ecx
andl $-0x1, %ecx
shrl $0x11, %ecx
orl %ecx, %eax
movl -0x8(%rsp), %ecx
shll $0xd, %ecx
movl -0x8(%rsp), %edx
andl $-0x1, %edx
shrl $0x13, %edx
orl %edx, %ecx
xorl %ecx, %eax
movl -0x8(%rsp), %ecx
shrl $0xa, %ecx
xorl %ecx, %eax
movl %eax, -0x8(%rsp)
movl -0x4(%rsp), %eax
addl -0x8(%rsp), %eax
movl -0x78(%rsp), %ecx
addl $0x9, %ecx
andl $0xf, %ecx
movslq %ecx, %rcx
addl -0x70(%rsp,%rcx,4), %eax
movl -0x78(%rsp), %ecx
andl $0xf, %ecx
movslq %ecx, %rcx
addl -0x70(%rsp,%rcx,4), %eax
movl %eax, -0x70(%rsp,%rcx,4)
movl %eax, -0xc(%rsp)
movl (%rsp), %eax
movl 0xc(%rsp), %ecx
shll $0x1a, %ecx
movl 0xc(%rsp), %edx
andl $-0x1, %edx
shrl $0x6, %edx
orl %edx, %ecx
movl 0xc(%rsp), %edx
shll $0x15, %edx
movl 0xc(%rsp), %esi
andl $-0x1, %esi
shrl $0xb, %esi
orl %esi, %edx
xorl %edx, %ecx
movl 0xc(%rsp), %edx
shll $0x7, %edx
movl 0xc(%rsp), %esi
andl $-0x1, %esi
shrl $0x19, %esi
orl %esi, %edx
xorl %edx, %ecx
addl %ecx, %eax
movl 0xc(%rsp), %ecx
andl 0x8(%rsp), %ecx
movl 0xc(%rsp), %edx
xorl $-0x1, %edx
andl 0x4(%rsp), %edx
xorl %edx, %ecx
addl %ecx, %eax
movslq -0x78(%rsp), %rdx
leaq 0x7d0(%rip), %rcx       # 0x3040
addl (%rcx,%rdx,4), %eax
addl -0xc(%rsp), %eax
movl %eax, -0xc(%rsp)
movl 0x1c(%rsp), %eax
shll $0x1e, %eax
movl 0x1c(%rsp), %ecx
andl $-0x1, %ecx
shrl $0x2, %ecx
orl %ecx, %eax
movl 0x1c(%rsp), %ecx
shll $0x13, %ecx
movl 0x1c(%rsp), %edx
andl $-0x1, %edx
shrl $0xd, %edx
orl %edx, %ecx
xorl %ecx, %eax
movl 0x1c(%rsp), %ecx
shll $0xa, %ecx
movl 0x1c(%rsp), %edx
andl $-0x1, %edx
shrl $0x16, %edx
orl %edx, %ecx
xorl %ecx, %eax
movl 0x1c(%rsp), %ecx
andl 0x18(%rsp), %ecx
movl 0x1c(%rsp), %edx
andl 0x14(%rsp), %edx
xorl %edx, %ecx
movl 0x18(%rsp), %edx
andl 0x14(%rsp), %edx
xorl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x10(%rsp)
movl 0x4(%rsp), %eax
movl %eax, (%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x4(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x8(%rsp)
movl 0x10(%rsp), %eax
addl -0xc(%rsp), %eax
movl %eax, 0xc(%rsp)
movl 0x14(%rsp), %eax
movl %eax, 0x10(%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x18(%rsp)
movl -0xc(%rsp), %eax
addl -0x10(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl -0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rsp)
jmp 0x273f
movl 0x1c(%rsp), %eax
addl -0x30(%rsp), %eax
movl %eax, -0x30(%rsp)
movl 0x18(%rsp), %eax
addl -0x2c(%rsp), %eax
movl %eax, -0x2c(%rsp)
movl 0x14(%rsp), %eax
addl -0x28(%rsp), %eax
movl %eax, -0x28(%rsp)
movl 0x10(%rsp), %eax
addl -0x24(%rsp), %eax
movl %eax, -0x24(%rsp)
movl 0xc(%rsp), %eax
addl -0x20(%rsp), %eax
movl %eax, -0x20(%rsp)
movl 0x8(%rsp), %eax
addl -0x1c(%rsp), %eax
movl %eax, -0x1c(%rsp)
movl 0x4(%rsp), %eax
addl -0x18(%rsp), %eax
movl %eax, -0x18(%rsp)
movl (%rsp), %eax
addl -0x14(%rsp), %eax
movl %eax, -0x14(%rsp)
movl $0x0, -0x78(%rsp)
cmpl $0x8, -0x78(%rsp)
jge 0x2a48
movslq -0x78(%rsp), %rax
movl -0x30(%rsp,%rax,4), %eax
shrl $0x18, %eax
andl $0xff, %eax
movb %al, %cl
movq 0x30(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x30(%rsp)
movb %cl, (%rax)
movslq -0x78(%rsp), %rax
movl -0x30(%rsp,%rax,4), %eax
shrl $0x10, %eax
andl $0xff, %eax
movb %al, %cl
movq 0x30(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x30(%rsp)
movb %cl, (%rax)
movslq -0x78(%rsp), %rax
movl -0x30(%rsp,%rax,4), %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq 0x30(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x30(%rsp)
movb %cl, (%rax)
movslq -0x78(%rsp), %rax
movl -0x30(%rsp,%rax,4), %eax
andl $0xff, %eax
movb %al, %cl
movq 0x30(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x30(%rsp)
movb %cl, (%rax)
movl -0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rsp)
jmp 0x2998
addq $0x38, %rsp
retq
nopl (%rax)