// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7d8, %rsp            # imm = 0x7D8
movq %rdi, %r14
cmpb $0x0, 0x18c35d(%rip)    # 0x4ca040
jne 0x33e16e
movq %rsi, 0x8(%rsp)
leaq 0x5d0(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x173a0
leaq 0x3d0(%rsp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x173a0
movl $0x1, %eax
movl $0x1d, %ecx
leaq 0xb2b39(%rip), %rdx     # 0x3f0860
leaq 0xb2b52(%rip), %rsi     # 0x3f0880
movzbl -0x2(%rcx,%rdx), %edi
movq %rax, 0x3c8(%rsp,%rdi,8)
movzbl -0x2(%rcx,%rsi), %edi
movq %rax, 0x5c8(%rsp,%rdi,8)
addq %rax, %rax
decq %rcx
cmpq $0x1, %rcx
ja 0x33dd2e
xorl %edx, %edx
leaq 0x18c2f3(%rip), %rax    # 0x4ca050
leaq 0x18c8ec(%rip), %rsi    # 0x4ca650
leaq 0x18c6e5(%rip), %rdi    # 0x4ca450
leaq 0x18ccde(%rip), %r8     # 0x4caa50
movl %edx, %ecx
andl $0x3, %ecx
movl $0x8, %r9d
shrl %cl, %r9d
movslq %edx, %r10
movl %r10d, %r11d
sarl $0x3, %r11d
movslq %r11d, %r11
leal 0x3(%r10), %ebp
movslq %ebp, %r15
movq %r11, %r12
shlq $0x6, %r12
shlq $0x7, %r11
xorl %r13d, %r13d
testl %r13d, %r9d
je 0x33dde5
movq 0x5d0(%rsp,%r10,8), %rbp
leaq (%r11,%r13,8), %rbx
orq %rbp, (%rax,%rbx)
movq 0x3d0(%rsp,%r10,8), %rbp
orq %rbp, (%rsi,%rbx)
cmpq $0x7, %r13
ja 0x33dde5
movq 0x5d0(%rsp,%r15,8), %rbx
leaq (%r12,%r13,8), %rbp
orq %rbx, (%rdi,%rbp)
movq 0x3d0(%rsp,%r15,8), %rbx
orq %rbx, (%r8,%rbp)
incq %r13
cmpq $0x10, %r13
jne 0x33dda2
leal 0x4(%rdx), %r9d
cmpl $0x3, %ecx
cmovnel %edx, %r9d
leal 0x1(%r9), %edx
cmpl $0x3f, %r9d
jl 0x33dd72
leaq 0xf0(%rsp), %rdi
movl $0xe0, %edx
xorl %esi, %esi
callq 0x173a0
leaq 0x10(%rsp), %rdi
movl $0xe0, %edx
xorl %esi, %esi
callq 0x173a0
movl $0x1, %esi
movl $0x18, %eax
movl $0x12, %edx
leaq 0xb2a8d(%rip), %rcx     # 0x3f08cf
xorl %r8d, %r8d
movq %rsi, %rdi
movzbl (%rcx,%r8), %esi
movq %rdi, -0xd8(%rsp,%rsi,8)
movzbl -0x18(%rcx,%r8), %esi
movq %rdi, 0xe8(%rsp,%rsi,8)
leaq (%rdi,%rdi), %rsi
leaq (%rax,%r8), %r9
decq %r9
decq %r8
cmpq %rdx, %r9
ja 0x33de45
shlq $0x3, %rdi
leaq -0x6(%rdx), %r8
addq $-0x6, %rax
addq $-0x6, %rcx
movq %rdi, %rsi
cmpq $0x5, %rdx
movq %r8, %rdx
ja 0x33de42
xorl %eax, %eax
leaq 0x18cdb5(%rip), %rdx    # 0x4cac50
leaq 0x18d12e(%rip), %rsi    # 0x4cafd0
movq %rax, %rdi
shlq $0x5, %rdi
andq $-0x80, %rdi
movl %eax, %ecx
andb $0x3, %cl
movl $0x8, %r8d
shrl %cl, %r8d
xorl %ecx, %ecx
testl %ecx, %r8d
je 0x33dedb
movq 0xf0(%rsp,%rax,8), %r9
leaq (%rdi,%rcx,8), %r10
orq %r9, (%rdx,%r10)
movq 0x10(%rsp,%rax,8), %r9
orq %r9, (%rsi,%r10)
incq %rcx
cmpq $0x10, %rcx
jne 0x33debd
incq %rax
cmpq $0x1c, %rax
jne 0x33dea2
movdqa 0x23b7b(%rip), %xmm5    # 0x361a70
xorl %eax, %eax
movdqa 0x23b81(%rip), %xmm0    # 0x361a80
movdqa 0xb2899(%rip), %xmm6    # 0x3f07a0
pshufd $0xf5, %xmm6, %xmm7     # xmm7 = xmm6[1,1,3,3]
movdqa 0xb289c(%rip), %xmm1    # 0x3f07b0
movdqa 0xb28a4(%rip), %xmm2    # 0x3f07c0
movdqa 0xb28ac(%rip), %xmm3    # 0x3f07d0
movdqa 0xb28b3(%rip), %xmm8    # 0x3f07e0
leaq 0x18d41c(%rip), %rcx    # 0x4cb350
movdqa 0x23b54(%rip), %xmm4    # 0x361a90
movdqa %xmm5, %xmm9
pxor %xmm0, %xmm9
movdqa %xmm6, %xmm10
pcmpgtd %xmm9, %xmm10
pshufd $0xf5, %xmm9, %xmm9     # xmm9 = xmm9[1,1,3,3]
pcmpeqd %xmm7, %xmm9
pand %xmm10, %xmm9
pandn %xmm1, %xmm9
movdqa %xmm5, %xmm10
psllq $0xc, %xmm10
pand %xmm2, %xmm10
movdqa %xmm5, %xmm11
psllq $0x6, %xmm11
pand %xmm3, %xmm11
movdqa %xmm5, %xmm12
pand %xmm8, %xmm12
por %xmm10, %xmm12
por %xmm11, %xmm12
por %xmm9, %xmm12
movdqa %xmm12, (%rax,%rcx)
paddq %xmm4, %xmm5
addq $0x10, %rax
cmpq $0x2b0, %rax            # imm = 0x2B0
jne 0x33df3c
movdqa 0x23ab4(%rip), %xmm5    # 0x361a70
xorl %eax, %eax
movdqa 0xb282a(%rip), %xmm6    # 0x3f07f0
pshufd $0xf5, %xmm6, %xmm7     # xmm7 = xmm6[1,1,3,3]
leaq 0x18e62e(%rip), %rcx    # 0x4cc600
movdqa %xmm5, %xmm8
psllq $0x18, %xmm8
pand %xmm1, %xmm8
movdqa %xmm5, %xmm9
psllq $0xf, %xmm9
pand %xmm2, %xmm9
por %xmm8, %xmm9
movdqa %xmm5, %xmm8
psllq $0x6, %xmm8
pand %xmm3, %xmm8
por %xmm9, %xmm8
movdqa %xmm5, %xmm9
pxor %xmm0, %xmm9
pshufd $0xf5, %xmm9, %xmm10    # xmm10 = xmm9[1,1,3,3]
pcmpeqd %xmm7, %xmm10
pcmpgtd %xmm6, %xmm9
pshufd $0xa0, %xmm9, %xmm11    # xmm11 = xmm9[0,0,2,2]
pand %xmm10, %xmm11
pshufd $0xf5, %xmm9, %xmm9     # xmm9 = xmm9[1,1,3,3]
por %xmm11, %xmm9
psubq %xmm9, %xmm8
movdqa %xmm8, (%rax,%rcx)
paddq %xmm4, %xmm5
addq $0x10, %rax
cmpq $0x80, %rax
jne 0x33dfd2
movdqa 0xb279d(%rip), %xmm0    # 0x3f0800
xorl %eax, %eax
movdqa 0xb27a3(%rip), %xmm1    # 0x3f0810
movdqa 0xb27ab(%rip), %xmm2    # 0x3f0820
movdqa 0xb27b3(%rip), %xmm3    # 0x3f0830
movdqa 0xb27bb(%rip), %xmm4    # 0x3f0840
movdqa %xmm0, %xmm5
pand %xmm1, %xmm5
movdqa %xmm0, %xmm6
pslld $0x4, %xmm6
pand %xmm2, %xmm6
por %xmm5, %xmm6
movdqa %xmm0, %xmm5
psrld $0x1, %xmm5
pand %xmm3, %xmm5
por %xmm6, %xmm5
movdqa %xmm5, 0x2d0(%rsp,%rax,4)
addq $0x4, %rax
paddd %xmm4, %xmm0
cmpq $0x40, %rax
jne 0x33e085
movl $0x1, %eax
movl $0x21, %ecx
leaq 0xb29f9(%rip), %rdx     # 0x3f0ad0
movzbl -0x2(%rcx,%rdx), %esi
movq %rax, 0x1c8(%rsp,%rsi,8)
addq %rax, %rax
decq %rcx
cmpq $0x1, %rcx
ja 0x33e0d7
leaq 0x1d0(%rsp), %rax
xorl %ecx, %ecx
leaq 0xb27cf(%rip), %rdx     # 0x3f08d0
leaq 0x18d4f8(%rip), %rsi    # 0x4cb600
movq %rcx, %rdi
shlq $0x6, %rdi
addq %rdx, %rdi
movq %rcx, %r8
shlq $0x9, %r8
addq %rsi, %r8
xorl %r9d, %r9d
movslq 0x2d0(%rsp,%r9,4), %r10
movzbl (%r10,%rdi), %r10d
leaq (%r8,%r9,8), %r11
xorl %r15d, %r15d
testb $0x8, %r10b
je 0x33e140
movq (%rax,%r15,8), %rbx
orq %rbx, (%r11)
addl %r10d, %r10d
incq %r15
cmpq $0x4, %r15
jne 0x33e133
incq %r9
cmpq $0x40, %r9
jne 0x33e11f
incq %rcx
addq $0x20, %rax
cmpq $0x8, %rcx
jne 0x33e108
movb $0x1, 0x18bed7(%rip)    # 0x4ca040
movq 0x8(%rsp), %rsi
xorl %ecx, %ecx
leaq 0x18bed9(%rip), %rdx    # 0x4ca050
leaq 0x18c2d2(%rip), %r15    # 0x4ca450
leaq 0x18c4cb(%rip), %rdi    # 0x4ca650
leaq 0x18c8c4(%rip), %r8     # 0x4caa50
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %eax, %eax
movb (%r14), %r11b
sarb %r11b
movzbl %r11b, %r11d
movl %r11d, %ebx
andl $0x78, %ebx
addq %r9, %rbx
andl $0x7, %r11d
leaq (%rcx,%r11,8), %r11
orq (%rdx,%rbx), %r10
orq (%r15,%r11), %r10
orq (%rdi,%rbx), %rax
orq (%r8,%r11), %rax
incq %r14
subq $-0x80, %r9
addq $0x40, %rcx
cmpq $0x200, %rcx            # imm = 0x200
jne 0x33e194
addq $0x8, %rsi
xorl %edx, %edx
leaq 0xb2670(%rip), %r15     # 0x3f0850
movl $0xfffffff, %edi        # imm = 0xFFFFFFF
leaq 0x18ca64(%rip), %r8     # 0x4cac50
leaq 0x18cddd(%rip), %r9     # 0x4cafd0
movb (%rdx,%r15), %cl
shlq %cl, %r10
movl %r10d, %ebx
shrl $0x1c, %ebx
andl $0x3, %ebx
movq %r10, %r11
andq %rdi, %r11
orq %rbx, %r11
movl %r11d, %ebx
andl $0xf, %ebx
movl %r10d, %r14d
shrl %r14d
andl $0x78, %r14d
movq 0x280(%r8,%r14), %r14
orq 0x300(%r8,%rbx,8), %r14
movl %r10d, %ebx
shrl $0x5, %ebx
andl $0x78, %ebx
orq 0x200(%r8,%rbx), %r14
movl %r10d, %ebx
shrl $0x9, %ebx
andl $0x78, %ebx
orq 0x180(%r8,%rbx), %r14
movl %r10d, %ebx
shrl $0xd, %ebx
andl $0x78, %ebx
orq 0x100(%r8,%rbx), %r14
movl %r10d, %ebx
shrl $0x11, %ebx
andl $0x78, %ebx
orq 0x80(%r8,%rbx), %r14
shrl $0x15, %r10d
andl $0x78, %r10d
orq (%r10,%r8), %r14
shlq %cl, %rax
movq %r14, -0x8(%rsi)
movl %eax, %r10d
shrl $0x1c, %r10d
andl $0x3, %r10d
movq %rax, %rcx
andq %rdi, %rcx
orq %r10, %rcx
movl %ecx, %ebx
andl $0xf, %ebx
movl %eax, %r10d
shrl %r10d
andl $0x78, %r10d
movq 0x280(%r9,%r10), %r10
orq 0x300(%r9,%rbx,8), %r10
movl %eax, %ebx
shrl $0x5, %ebx
andl $0x78, %ebx
orq 0x200(%r9,%rbx), %r10
movl %eax, %ebx
shrl $0x9, %ebx
andl $0x78, %ebx
orq 0x180(%r9,%rbx), %r10
movl %eax, %ebx
shrl $0xd, %ebx
andl $0x78, %ebx
orq 0x100(%r9,%rbx), %r10
movl %eax, %ebx
shrl $0x11, %ebx
andl $0x78, %ebx
orq 0x80(%r9,%rbx), %r10
shrl $0x15, %eax
andl $0x78, %eax
orq (%rax,%r9), %r10
movq %r10, (%rsi)
incq %rdx
addq $0x10, %rsi
movq %r11, %r10
movq %rcx, %rax
cmpq $0x10, %rdx
jne 0x33e1f3
addq $0x7d8, %rsp            # imm = 0x7D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq