// File: /workspace/github_c_makefile_star2_O0/hansvanstaveren[P]BigDeal/main.c
// Function: RMDhash
static byte *
RMDhash(byte *value, int length)
/*
 * Hashes value of length bytes using RIPEMD160
 *
 * Returns pointer to 20 bytes hashcode
 */
{
	dword         MDbuf[RMDdwords];		/* contains (A, B, C, D(, E)) */
	dword	      X[16];			/* current 16 word chunk      */
	static byte   hashcode[RMDbytes];	/* for final hash-value       */
	unsigned int  i;			/* counter                    */
	int	      nbytes;			/* bytes not yet processed    */

	/* initialize */
	MDinit(MDbuf);

	/* Process value in 16-word chunks */
	for (nbytes=length; nbytes>=64; nbytes-=64) {
		for (i=0; i<16; i++) {
			X[i] = BYTES_TO_DWORD(value);
			value += 4;
		}
		compress(MDbuf, X);
	}
		
	/* finish: */
	MDfinish(MDbuf, value, length, 0);

	for (i=0; i<RMDbytes; i+=4) {
		hashcode[i]   =  MDbuf[i>>2];        /* implicit cast to byte */
		hashcode[i+1] = (MDbuf[i>>2] >>  8); /*  extracts the 8 least */
		hashcode[i+2] = (MDbuf[i>>2] >> 16); /*  significant bits.    */
		hashcode[i+3] = (MDbuf[i>>2] >> 24);
	}

	return (byte *)hashcode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x22d0
movl -0xc(%rbp), %eax
movl %eax, -0x68(%rbp)
cmpl $0x40, -0x68(%rbp)
jl 0x6665
movl $0x0, -0x64(%rbp)
cmpl $0x10, -0x64(%rbp)
jae 0x664d
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %ecx
shll $0x18, %ecx
movq -0x8(%rbp), %rax
movzbl 0x2(%rax), %eax
shll $0x10, %eax
orl %eax, %ecx
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
shll $0x8, %eax
orl %eax, %ecx
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
orl %eax, %ecx
movl -0x64(%rbp), %eax
movl %ecx, -0x60(%rbp,%rax,4)
movq -0x8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x8(%rbp)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x65fb
leaq -0x20(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x2310
movl -0x68(%rbp), %eax
subl $0x40, %eax
movl %eax, -0x68(%rbp)
jmp 0x65ee
leaq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl -0xc(%rbp), %edx
xorl %ecx, %ecx
callq 0x5440
movl $0x0, -0x64(%rbp)
cmpl $0x14, -0x64(%rbp)
jae 0x6722
movl -0x64(%rbp), %eax
shrl $0x2, %eax
movl %eax, %eax
movl -0x20(%rbp,%rax,4), %eax
movb %al, %dl
movl -0x64(%rbp), %eax
movl %eax, %ecx
leaq 0x862e(%rip), %rax      # 0xecd0
movb %dl, (%rax,%rcx)
movl -0x64(%rbp), %eax
shrl $0x2, %eax
movl %eax, %eax
movl -0x20(%rbp,%rax,4), %eax
shrl $0x8, %eax
movb %al, %dl
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x8609(%rip), %rax      # 0xecd0
movb %dl, (%rax,%rcx)
movl -0x64(%rbp), %eax
shrl $0x2, %eax
movl %eax, %eax
movl -0x20(%rbp,%rax,4), %eax
shrl $0x10, %eax
movb %al, %dl
movl -0x64(%rbp), %eax
addl $0x2, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x85e4(%rip), %rax      # 0xecd0
movb %dl, (%rax,%rcx)
movl -0x64(%rbp), %eax
shrl $0x2, %eax
movl %eax, %eax
movl -0x20(%rbp,%rax,4), %eax
shrl $0x18, %eax
movb %al, %dl
movl -0x64(%rbp), %eax
addl $0x3, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x85bf(%rip), %rax      # 0xecd0
movb %dl, (%rax,%rcx)
movl -0x64(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x64(%rbp)
jmp 0x667e
leaq 0x85a7(%rip), %rax      # 0xecd0
addq $0x70, %rsp
popq %rbp
retq
nop