// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/md5-1.2/src/des56.c
// Function: fsetkey
void fsetkey(char key[8], keysched *ks)
{
	register int i;
	register word32 C, D;
	static int built = 0;

	if(!built) {
		buildtables();
		built = 1;
	}

	C = D = 0;
	for(i = 0; i < 8; i++) {
		register int v;

		v = key[i] >> 1;	/* Discard "parity" bit */
		C |= wC_K4[i][(v>>3) & 15] | wC_K3[i][v & 7];
		D |= wD_K4[i][(v>>3) & 15] | wD_K3[i][v & 7];
	}

	/*
	 * C and D now hold the suitably right-justified
	 * 28 permuted key bits each.
	 */
	for(i = 0; i < 16; i++) {
#ifdef CRAY
#define choice2(x, v)  x[6][v&15] | x[5][(v>>4)&15] | x[4][(v>>8)&15] | \
		    x[3][(v>>12)&15] | x[2][(v>>16)&15] | x[1][(v>>20)&15] | \
		    x[0][(v>>24)&15]
#else
		register word32 *ap;

#  define choice2(x, v)  ( \
		    ap = &(x)[0][0], \
		    ap[16*6 + (v&15)] | \
		    ap[16*5 + ((v>>4)&15)]  | ap[16*4 + ((v>>8)&15)]  | \
		    ap[16*3 + ((v>>12)&15)] | ap[16*2 + ((v>>16)&15)] | \
		    ap[16*1 + ((v>>20)&15)] | ap[16*0 + ((v>>24)&15)] )
#endif 


		/* 28-bit left circular shift */
		C <<= preshift[i];
		C = ((C >> 28) & 3) | (C & (((word32)1<<28) - 1));
		ks->KS[i].h = choice2(hKS_C4, C);

		D <<= preshift[i];
		D = ((D >> 28) & 3) | (D & (((word32)1<<28) - 1));
		ks->KS[i].l = choice2(lKS_D4, D);
	}
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
cmpl $0x0, 0x14df3b(%rip)    # 0x6436a0
jne 0x4f5776
callq 0x4f5aa0
movl $0x1, 0x14df2a(%rip)    # 0x6436a0
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x0, 0x24(%rsp)
cmpl $0x8, 0x24(%rsp)
jge 0x4f585d
movq 0x30(%rsp), %rax
movslq 0x24(%rsp), %rcx
movsbl (%rax,%rcx), %eax
sarl %eax
movl %eax, 0xc(%rsp)
movslq 0x24(%rsp), %rcx
leaq 0x14def5(%rip), %rax    # 0x6436b0
shlq $0x7, %rcx
addq %rcx, %rax
movl 0xc(%rsp), %ecx
sarl $0x3, %ecx
andl $0xf, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq 0x24(%rsp), %rdx
leaq 0x14e2d1(%rip), %rcx    # 0x643ab0
shlq $0x6, %rdx
addq %rdx, %rcx
movl 0xc(%rsp), %edx
andl $0x7, %edx
movslq %edx, %rdx
orq (%rcx,%rdx,8), %rax
orq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movslq 0x24(%rsp), %rcx
leaq 0x14e4a6(%rip), %rax    # 0x643cb0
shlq $0x7, %rcx
addq %rcx, %rax
movl 0xc(%rsp), %ecx
sarl $0x3, %ecx
andl $0xf, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq 0x24(%rsp), %rdx
leaq 0x14e882(%rip), %rcx    # 0x6440b0
shlq $0x6, %rdx
addq %rdx, %rcx
movl 0xc(%rsp), %edx
andl $0x7, %edx
movslq %edx, %rdx
orq (%rcx,%rdx,8), %rax
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x4f5790
movl $0x0, 0x24(%rsp)
cmpl $0x10, 0x24(%rsp)
jge 0x4f5a95
movslq 0x24(%rsp), %rcx
leaq 0x14c344(%rip), %rax    # 0x641bc0
movzbl (%rax,%rcx), %ecx
movq 0x18(%rsp), %rax
movl %ecx, %ecx
shlq %cl, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
shrq $0x1c, %rax
andq $0x3, %rax
movq 0x18(%rsp), %rcx
andq $0xfffffff, %rcx        # imm = 0xFFFFFFF
orq %rcx, %rax
movq %rax, 0x18(%rsp)
leaq 0x14e9f9(%rip), %rax    # 0x6442b0
movq %rax, (%rsp)
movq (%rsp), %rax
movq 0x18(%rsp), %rcx
andq $0xf, %rcx
addq $0x60, %rcx
movq (%rax,%rcx,8), %rcx
movq (%rsp), %rax
movq 0x18(%rsp), %rdx
shrq $0x4, %rdx
andq $0xf, %rdx
addq $0x50, %rdx
orq (%rax,%rdx,8), %rcx
movq (%rsp), %rax
movq 0x18(%rsp), %rdx
shrq $0x8, %rdx
andq $0xf, %rdx
addq $0x40, %rdx
orq (%rax,%rdx,8), %rcx
movq (%rsp), %rax
movq 0x18(%rsp), %rdx
shrq $0xc, %rdx
andq $0xf, %rdx
addq $0x30, %rdx
orq (%rax,%rdx,8), %rcx
movq (%rsp), %rax
movq 0x18(%rsp), %rdx
shrq $0x10, %rdx
andq $0xf, %rdx
addq $0x20, %rdx
orq (%rax,%rdx,8), %rcx
movq (%rsp), %rax
movq 0x18(%rsp), %rdx
shrq $0x14, %rdx
andq $0xf, %rdx
addq $0x10, %rdx
orq (%rax,%rdx,8), %rcx
movq (%rsp), %rax
movq 0x18(%rsp), %rdx
shrq $0x18, %rdx
andq $0xf, %rdx
addq $0x0, %rdx
orq (%rax,%rdx,8), %rcx
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movslq 0x24(%rsp), %rcx
leaq 0x14c23a(%rip), %rax    # 0x641bc0
movzbl (%rax,%rcx), %ecx
movq 0x10(%rsp), %rax
movl %ecx, %ecx
shlq %cl, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
shrq $0x1c, %rax
andq $0x3, %rax
movq 0x10(%rsp), %rcx
andq $0xfffffff, %rcx        # imm = 0xFFFFFFF
orq %rcx, %rax
movq %rax, 0x10(%rsp)
leaq 0x14ec6f(%rip), %rax    # 0x644630
movq %rax, (%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
andq $0xf, %rcx
addq $0x60, %rcx
movq (%rax,%rcx,8), %rcx
movq (%rsp), %rax
movq 0x10(%rsp), %rdx
shrq $0x4, %rdx
andq $0xf, %rdx
addq $0x50, %rdx
orq (%rax,%rdx,8), %rcx
movq (%rsp), %rax
movq 0x10(%rsp), %rdx
shrq $0x8, %rdx
andq $0xf, %rdx
addq $0x40, %rdx
orq (%rax,%rdx,8), %rcx
movq (%rsp), %rax
movq 0x10(%rsp), %rdx
shrq $0xc, %rdx
andq $0xf, %rdx
addq $0x30, %rdx
orq (%rax,%rdx,8), %rcx
movq (%rsp), %rax
movq 0x10(%rsp), %rdx
shrq $0x10, %rdx
andq $0xf, %rdx
addq $0x20, %rdx
orq (%rax,%rdx,8), %rcx
movq (%rsp), %rax
movq 0x10(%rsp), %rdx
shrq $0x14, %rdx
andq $0xf, %rdx
addq $0x10, %rdx
orq (%rax,%rdx,8), %rcx
movq (%rsp), %rax
movq 0x10(%rsp), %rdx
shrq $0x18, %rdx
andq $0xf, %rdx
addq $0x0, %rdx
orq (%rax,%rdx,8), %rcx
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x4f5865
addq $0x38, %rsp
retq
nopw (%rax,%rax)