// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/md5-1.2/src/des56.c
// Function: fencrypt
void
fencrypt(char block[8], int decrypt, keysched *ks)
{
	int i;
	register word32 L, R;
	register struct keystage *ksp;
	register word32 *ap;

	/* Initial permutation */

	L = R = 0;
	i = 7;
	ap = wL_I8;
	do {
		register int v;

		v = block[i];	/* Could optimize according to ENDIAN */
		L = ap[v & 0x55] | (L << 1);
		R = ap[(v >> 1) & 0x55] | (R << 1);
	} while(--i >= 0);

	if(decrypt) {
		ksp = &ks->KS[15];
	} else {
		ksp = &ks->KS[0];
	}

#ifdef CRAY
#  define PS(i,j)	wPS[i][j]
#else 
#  define PS(i,j)	ap[64*(i) + (j)]
	ap = &wPS[0][0];
#endif 

	i = 16;
	do {
		register word32 k, tR;

		tR = (R >> 15) | (R << 17);

		k = ksp->h;
		L ^= PS(0, ((tR >> 12) ^ (k >> 24)) & 63)
		   | PS(1, ((tR >> 8) ^ (k >> 16)) & 63)
		   | PS(2, ((tR >> 4) ^ (k >> 8)) & 63)
		   | PS(3, (tR ^ k) & 63);

		k = ksp->l;
		L ^= PS(4, ((R >> 11) ^ (k >> 24)) & 63)
		   | PS(5, ((R >> 7) ^ (k >> 16)) & 63)
		   | PS(6, ((R >> 3) ^ (k >> 8)) & 63)
		   | PS(7, ((tR >> 16) ^ k) & 63);

		tR = L;
		L = R;
		R = tR;


		if(decrypt)
			ksp--;
		else
			ksp++;
	} while(--i > 0);
	{
		register word32 t;

#ifdef CRAY
# define FP(k)	(wO_L4[ (L >> (k)) & 15 ] << 1 | wO_L4[ (R >> (k)) & 15 ])
#else 
# define FP(k)	(ap[ (L >> (k)) & 15 ] << 1 | ap[ (R >> (k)) & 15 ])

		ap = wO_L4;
#endif 

		t = FP(0) | (FP(8) | (FP(16) | (FP(24) << 2)) << 2) << 2;
		R = FP(4) | (FP(12) | (FP(20) | (FP(28) << 2)) << 2) << 2;
		L = t;
	}
	{
		register word32 t;
		register char *bp;

		bp = &block[7];
		t = R;
		*bp = t & 255;
		*--bp = (t >>= 8) & 255;
		*--bp = (t >>= 8) & 255;
		*--bp = (t >> 8) & 255;
		t = L;
		*--bp = t & 255;
		*--bp = (t >>= 8) & 255;
		*--bp = (t >>= 8) & 255;
		*--bp = (t >> 8) & 255;
	}
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq %rdx, -0x18(%rsp)
movq $0x0, -0x30(%rsp)
movq $0x0, -0x28(%rsp)
movl $0x7, -0x1c(%rsp)
leaq 0x14e611(%rip), %rax    # 0x6449b0
movq %rax, -0x40(%rsp)
movq -0x8(%rsp), %rax
movslq -0x1c(%rsp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x44(%rsp)
movq -0x40(%rsp), %rax
movl -0x44(%rsp), %ecx
andl $0x55, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq -0x28(%rsp), %rcx
shlq %rcx
orq %rcx, %rax
movq %rax, -0x28(%rsp)
movq -0x40(%rsp), %rax
movl -0x44(%rsp), %ecx
sarl %ecx
andl $0x55, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq -0x30(%rsp), %rcx
shlq %rcx
orq %rcx, %rax
movq %rax, -0x30(%rsp)
movl -0x1c(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rsp)
cmpl $0x0, %eax
jge 0x4f63a4
cmpl $0x0, -0xc(%rsp)
je 0x4f6427
movq -0x18(%rsp), %rax
addq $0xf0, %rax
movq %rax, -0x38(%rsp)
jmp 0x4f6431
movq -0x18(%rsp), %rax
movq %rax, -0x38(%rsp)
leaq 0x14e828(%rip), %rax    # 0x644c60
movq %rax, -0x40(%rsp)
movl $0x10, -0x1c(%rsp)
movq -0x30(%rsp), %rax
shrq $0xf, %rax
movq -0x30(%rsp), %rcx
shlq $0x11, %rcx
orq %rcx, %rax
movq %rax, -0x58(%rsp)
movq -0x38(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rsp)
movq -0x40(%rsp), %rax
movq -0x58(%rsp), %rcx
shrq $0xc, %rcx
movq -0x50(%rsp), %rdx
shrq $0x18, %rdx
xorq %rdx, %rcx
andq $0x3f, %rcx
addq $0x0, %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rsp), %rcx
movq -0x58(%rsp), %rdx
shrq $0x8, %rdx
movq -0x50(%rsp), %rsi
shrq $0x10, %rsi
xorq %rsi, %rdx
andq $0x3f, %rdx
addq $0x40, %rdx
orq (%rcx,%rdx,8), %rax
movq -0x40(%rsp), %rcx
movq -0x58(%rsp), %rdx
shrq $0x4, %rdx
movq -0x50(%rsp), %rsi
shrq $0x8, %rsi
xorq %rsi, %rdx
andq $0x3f, %rdx
addq $0x80, %rdx
orq (%rcx,%rdx,8), %rax
movq -0x40(%rsp), %rcx
movq -0x58(%rsp), %rdx
xorq -0x50(%rsp), %rdx
andq $0x3f, %rdx
addq $0xc0, %rdx
orq (%rcx,%rdx,8), %rax
xorq -0x28(%rsp), %rax
movq %rax, -0x28(%rsp)
movq -0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rsp)
movq -0x40(%rsp), %rax
movq -0x30(%rsp), %rcx
shrq $0xb, %rcx
movq -0x50(%rsp), %rdx
shrq $0x18, %rdx
xorq %rdx, %rcx
andq $0x3f, %rcx
addq $0x100, %rcx            # imm = 0x100
movq (%rax,%rcx,8), %rax
movq -0x40(%rsp), %rcx
movq -0x30(%rsp), %rdx
shrq $0x7, %rdx
movq -0x50(%rsp), %rsi
shrq $0x10, %rsi
xorq %rsi, %rdx
andq $0x3f, %rdx
addq $0x140, %rdx            # imm = 0x140
orq (%rcx,%rdx,8), %rax
movq -0x40(%rsp), %rcx
movq -0x30(%rsp), %rdx
shrq $0x3, %rdx
movq -0x50(%rsp), %rsi
shrq $0x8, %rsi
xorq %rsi, %rdx
andq $0x3f, %rdx
addq $0x180, %rdx            # imm = 0x180
orq (%rcx,%rdx,8), %rax
movq -0x40(%rsp), %rcx
movq -0x58(%rsp), %rdx
shrq $0x10, %rdx
xorq -0x50(%rsp), %rdx
andq $0x3f, %rdx
addq $0x1c0, %rdx            # imm = 0x1C0
orq (%rcx,%rdx,8), %rax
xorq -0x28(%rsp), %rax
movq %rax, -0x28(%rsp)
movq -0x28(%rsp), %rax
movq %rax, -0x58(%rsp)
movq -0x30(%rsp), %rax
movq %rax, -0x28(%rsp)
movq -0x58(%rsp), %rax
movq %rax, -0x30(%rsp)
cmpl $0x0, -0xc(%rsp)
je 0x4f65f3
movq -0x38(%rsp), %rax
addq $-0x10, %rax
movq %rax, -0x38(%rsp)
jmp 0x4f6601
movq -0x38(%rsp), %rax
addq $0x10, %rax
movq %rax, -0x38(%rsp)
jmp 0x4f6603
movl -0x1c(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rsp)
cmpl $0x0, %eax
jg 0x4f6445
leaq 0x14f642(%rip), %rax    # 0x645c60
movq %rax, -0x40(%rsp)
movq -0x40(%rsp), %rax
movq -0x28(%rsp), %rcx
shrq $0x0, %rcx
andq $0xf, %rcx
movq (%rax,%rcx,8), %rax
shlq %rax
movq -0x40(%rsp), %rcx
movq -0x30(%rsp), %rdx
shrq $0x0, %rdx
andq $0xf, %rdx
orq (%rcx,%rdx,8), %rax
movq -0x40(%rsp), %rcx
movq -0x28(%rsp), %rdx
shrq $0x8, %rdx
andq $0xf, %rdx
movq (%rcx,%rdx,8), %rcx
shlq %rcx
movq -0x40(%rsp), %rdx
movq -0x30(%rsp), %rsi
shrq $0x8, %rsi
andq $0xf, %rsi
orq (%rdx,%rsi,8), %rcx
movq -0x40(%rsp), %rdx
movq -0x28(%rsp), %rsi
shrq $0x10, %rsi
andq $0xf, %rsi
movq (%rdx,%rsi,8), %rdx
shlq %rdx
movq -0x40(%rsp), %rsi
movq -0x30(%rsp), %rdi
shrq $0x10, %rdi
andq $0xf, %rdi
orq (%rsi,%rdi,8), %rdx
movq -0x40(%rsp), %rsi
movq -0x28(%rsp), %rdi
shrq $0x18, %rdi
andq $0xf, %rdi
movq (%rsi,%rdi,8), %rsi
shlq %rsi
movq -0x40(%rsp), %rdi
movq -0x30(%rsp), %r8
shrq $0x18, %r8
andq $0xf, %r8
orq (%rdi,%r8,8), %rsi
shlq $0x2, %rsi
orq %rsi, %rdx
shlq $0x2, %rdx
orq %rdx, %rcx
shlq $0x2, %rcx
orq %rcx, %rax
movq %rax, -0x60(%rsp)
movq -0x40(%rsp), %rax
movq -0x28(%rsp), %rcx
shrq $0x4, %rcx
andq $0xf, %rcx
movq (%rax,%rcx,8), %rax
shlq %rax
movq -0x40(%rsp), %rcx
movq -0x30(%rsp), %rdx
shrq $0x4, %rdx
andq $0xf, %rdx
orq (%rcx,%rdx,8), %rax
movq -0x40(%rsp), %rcx
movq -0x28(%rsp), %rdx
shrq $0xc, %rdx
andq $0xf, %rdx
movq (%rcx,%rdx,8), %rcx
shlq %rcx
movq -0x40(%rsp), %rdx
movq -0x30(%rsp), %rsi
shrq $0xc, %rsi
andq $0xf, %rsi
orq (%rdx,%rsi,8), %rcx
movq -0x40(%rsp), %rdx
movq -0x28(%rsp), %rsi
shrq $0x14, %rsi
andq $0xf, %rsi
movq (%rdx,%rsi,8), %rdx
shlq %rdx
movq -0x40(%rsp), %rsi
movq -0x30(%rsp), %rdi
shrq $0x14, %rdi
andq $0xf, %rdi
orq (%rsi,%rdi,8), %rdx
movq -0x40(%rsp), %rsi
movq -0x28(%rsp), %rdi
shrq $0x1c, %rdi
andq $0xf, %rdi
movq (%rsi,%rdi,8), %rsi
shlq %rsi
movq -0x40(%rsp), %rdi
movq -0x30(%rsp), %r8
shrq $0x1c, %r8
andq $0xf, %r8
orq (%rdi,%r8,8), %rsi
shlq $0x2, %rsi
orq %rsi, %rdx
shlq $0x2, %rdx
orq %rdx, %rcx
shlq $0x2, %rcx
orq %rcx, %rax
movq %rax, -0x30(%rsp)
movq -0x60(%rsp), %rax
movq %rax, -0x28(%rsp)
movq -0x8(%rsp), %rax
addq $0x7, %rax
movq %rax, -0x70(%rsp)
movq -0x30(%rsp), %rax
movq %rax, -0x68(%rsp)
movq -0x68(%rsp), %rax
andq $0xff, %rax
movb %al, %cl
movq -0x70(%rsp), %rax
movb %cl, (%rax)
movq -0x68(%rsp), %rax
shrq $0x8, %rax
movq %rax, -0x68(%rsp)
andq $0xff, %rax
movb %al, %cl
movq -0x70(%rsp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0x70(%rsp)
movb %cl, -0x1(%rax)
movq -0x68(%rsp), %rax
shrq $0x8, %rax
movq %rax, -0x68(%rsp)
andq $0xff, %rax
movb %al, %cl
movq -0x70(%rsp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0x70(%rsp)
movb %cl, -0x1(%rax)
movq -0x68(%rsp), %rax
shrq $0x8, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x70(%rsp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0x70(%rsp)
movb %cl, -0x1(%rax)
movq -0x28(%rsp), %rax
movq %rax, -0x68(%rsp)
movq -0x68(%rsp), %rax
andq $0xff, %rax
movb %al, %cl
movq -0x70(%rsp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0x70(%rsp)
movb %cl, -0x1(%rax)
movq -0x68(%rsp), %rax
shrq $0x8, %rax
movq %rax, -0x68(%rsp)
andq $0xff, %rax
movb %al, %cl
movq -0x70(%rsp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0x70(%rsp)
movb %cl, -0x1(%rax)
movq -0x68(%rsp), %rax
shrq $0x8, %rax
movq %rax, -0x68(%rsp)
andq $0xff, %rax
movb %al, %cl
movq -0x70(%rsp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0x70(%rsp)
movb %cl, -0x1(%rax)
movq -0x68(%rsp), %rax
shrq $0x8, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x70(%rsp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0x70(%rsp)
movb %cl, -0x1(%rax)
retq
nopw %cs:(%rax,%rax)
nopl (%rax)