// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/md5-1.2/src/des56.c
// Function: buildtables
static void buildtables( void )
{
	register int i, j;
	register word32 v;
	word32 wC_K[64], wD_K[64];
	word32 hKS_C[28], lKS_D[28];
	int Smap[64];
	word32 wP[32];

#if USG
#  define	ZERO(array)	memset((char *)(array), '\0', sizeof(array))
#else
# if BSD
#  define	ZERO(array)	bzero((char *)(array), sizeof(array))
# else 
#  define	ZERO(array)	{ register word32 *p = (word32 *)(array); \
				  i = sizeof(array) / sizeof(*p); \
				  do { *p++ = 0; } while(--i > 0); \
				}
# endif 
#endif 


	/* Invert permuted-choice-1 (key => C,D) */

	ZERO(wC_K);
	ZERO(wD_K);
	v = 1;
	for(j = 28; --j >= 0; ) {
		wC_K[ bK_C[j] - 1 ] = wD_K[ bK_D[j] - 1 ] = v;
		v += v; 	/* (i.e. v <<= 1) */
	}

	for(i = 0; i < 64; i++) {
	    int t = 8 >> (i & 3);
	    for(j = 0; j < 16; j++) {
		if(j & t) {
		    wC_K4[i >> 3][j] |= wC_K[i];
		    wD_K4[i >> 3][j] |= wD_K[i];
		    if(j < 8) {
			wC_K3[i >> 3][j] |= wC_K[i + 3];
			wD_K3[i >> 3][j] |= wD_K[i + 3];
		    }
		}
	    }
	    /* Generate the sequence 0,1,2,3, 8,9,10,11, ..., 56,57,58,59. */
	    if(t == 1) i += 4;
	}

	/* Invert permuted-choice-2 */

	ZERO(hKS_C);
	ZERO(lKS_D);
	v = 1;
	for(i = 24; (i -= 6) >= 0; ) {
	    j = i+5;
	    do {
		hKS_C[ bCD_KS[j] - 1 ] = lKS_D[ bCD_KS[j+24] - 28 - 1 ] = v;
		v += v; 	/* Like v <<= 1 but may be faster */
	    } while(--j >= i);
	    v <<= 2;		/* Keep byte aligned */
	}

	for(i = 0; i < 28; i++) {
	    v = 8 >> (i & 3);
	    for(j = 0; j < 16; j++) {
		if(j & v) {
		    hKS_C4[i >> 2][j] |= hKS_C[i];
		    lKS_D4[i >> 2][j] |= lKS_D[i];
		}
	    }
	}

	/* Initial permutation */

	for(i = 0; i <= 0x55; i++) {
	    v = 0;
	    if(i & 64) v =  (word32) 1 << 24;
	    if(i & 16) v |= (word32) 1 << 16;
	    if(i & 4)  v |= (word32) 1 << 8;
	    if(i & 1)  v |= 1;
	    wL_I8[i] = v;
	}

	/* Final permutation */

	for(i = 0; i < 16; i++) {
	    v = 0;
	    if(i & 1) v = (word32) 1 << 24;
	    if(i & 2) v |= (word32) 1 << 16;
	    if(i & 4) v |= (word32) 1 << 8;
	    if(i & 8) v |= (word32) 1;
	    wO_L4[i] = v;
	}

	/* Funny bit rearrangement on second index into S tables */

	for(i = 0; i < 64; i++) {
		Smap[i] = (i & 0x20) | (i & 1) << 4 | (i & 0x1e) >> 1;
	}

	/* Invert permutation P into mask indexed by R bit number */

	v = 1;
	for(i = 32; --i >= 0; ) {
		wP[ P[i] - 1 ] = v;
		v += v;
	}

	/* Build bit-mask versions of S tables, indexed in natural bit order */

	for(i = 0; i < 8; i++) {
	    for(j = 0; j < 64; j++) {
		int k, t;

		t = S[i][ Smap[j] ];
		for(k = 0; k < 4; k++) {
		    if(t & 8)
			wPS[i][j] |= wP[4*i + k];
		    t += t;
		}
	    }
	}
}

// Assembly:
subq $0x788, %rsp            # imm = 0x788
leaq 0x570(%rsp), %rax
movq %rax, -0x58(%rsp)
movl $0x40, 0x784(%rsp)
movq -0x58(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x58(%rsp)
movq $0x0, (%rax)
movl 0x784(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x784(%rsp)
cmpl $0x0, %eax
jg 0x4f5abf
leaq 0x370(%rsp), %rax
movq %rax, -0x60(%rsp)
movl $0x40, 0x784(%rsp)
movq -0x60(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x60(%rsp)
movq $0x0, (%rax)
movl 0x784(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x784(%rsp)
cmpl $0x0, %eax
jg 0x4f5b05
movq $0x1, 0x778(%rsp)
movl $0x1c, 0x780(%rsp)
movl 0x780(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x780(%rsp)
cmpl $0x0, %eax
jl 0x4f5bc2
movq 0x778(%rsp), %rcx
movslq 0x780(%rsp), %rdx
leaq 0x14c059(%rip), %rax    # 0x641bd0
movzbl (%rax,%rdx), %eax
subl $0x1, %eax
cltq
movq %rcx, 0x370(%rsp,%rax,8)
movslq 0x780(%rsp), %rdx
leaq 0x14c059(%rip), %rax    # 0x641bf0
movzbl (%rax,%rdx), %eax
subl $0x1, %eax
cltq
movq %rcx, 0x570(%rsp,%rax,8)
movq 0x778(%rsp), %rax
addq 0x778(%rsp), %rax
movq %rax, 0x778(%rsp)
jmp 0x4f5b4a
movl $0x0, 0x784(%rsp)
cmpl $0x40, 0x784(%rsp)
jge 0x4f5d65
movl 0x784(%rsp), %ecx
andl $0x3, %ecx
movl $0x8, %eax
sarl %cl, %eax
movl %eax, -0x64(%rsp)
movl $0x0, 0x780(%rsp)
cmpl $0x10, 0x780(%rsp)
jge 0x4f5d35
movl 0x780(%rsp), %eax
andl -0x64(%rsp), %eax
cmpl $0x0, %eax
je 0x4f5d1d
movslq 0x784(%rsp), %rax
movq 0x570(%rsp,%rax,8), %rdx
movl 0x784(%rsp), %eax
sarl $0x3, %eax
movslq %eax, %rcx
leaq 0x14da6f(%rip), %rax    # 0x6436b0
shlq $0x7, %rcx
addq %rcx, %rax
movslq 0x780(%rsp), %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movslq 0x784(%rsp), %rax
movq 0x370(%rsp,%rax,8), %rdx
movl 0x784(%rsp), %eax
sarl $0x3, %eax
movslq %eax, %rcx
leaq 0x14e034(%rip), %rax    # 0x643cb0
shlq $0x7, %rcx
addq %rcx, %rax
movslq 0x780(%rsp), %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
cmpl $0x8, 0x780(%rsp)
jge 0x4f5d1b
movl 0x784(%rsp), %eax
addl $0x3, %eax
cltq
movq 0x570(%rsp,%rax,8), %rdx
movl 0x784(%rsp), %eax
sarl $0x3, %eax
movslq %eax, %rcx
leaq 0x14ddeb(%rip), %rax    # 0x643ab0
shlq $0x6, %rcx
addq %rcx, %rax
movslq 0x780(%rsp), %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl 0x784(%rsp), %eax
addl $0x3, %eax
cltq
movq 0x370(%rsp,%rax,8), %rdx
movl 0x784(%rsp), %eax
sarl $0x3, %eax
movslq %eax, %rcx
leaq 0x14e3ac(%rip), %rax    # 0x6440b0
shlq $0x6, %rcx
addq %rcx, %rax
movslq 0x780(%rsp), %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x4f5d1d
jmp 0x4f5d1f
movl 0x780(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x780(%rsp)
jmp 0x4f5bfb
cmpl $0x1, -0x64(%rsp)
jne 0x4f5d4d
movl 0x784(%rsp), %eax
addl $0x4, %eax
movl %eax, 0x784(%rsp)
jmp 0x4f5d4f
movl 0x784(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x784(%rsp)
jmp 0x4f5bcd
leaq 0x290(%rsp), %rax
movq %rax, -0x70(%rsp)
movl $0x1c, 0x784(%rsp)
movq -0x70(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x70(%rsp)
movq $0x0, (%rax)
movl 0x784(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x784(%rsp)
cmpl $0x0, %eax
jg 0x4f5d7d
leaq 0x1b0(%rsp), %rax
movq %rax, -0x78(%rsp)
movl $0x1c, 0x784(%rsp)
movq -0x78(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x78(%rsp)
movq $0x0, (%rax)
movl 0x784(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x784(%rsp)
cmpl $0x0, %eax
jg 0x4f5dc3
movq $0x1, 0x778(%rsp)
movl $0x18, 0x784(%rsp)
movl 0x784(%rsp), %eax
subl $0x6, %eax
movl %eax, 0x784(%rsp)
cmpl $0x0, %eax
jl 0x4f5ed2
movl 0x784(%rsp), %eax
addl $0x5, %eax
movl %eax, 0x780(%rsp)
movq 0x778(%rsp), %rcx
movl 0x780(%rsp), %eax
addl $0x18, %eax
movslq %eax, %rdx
leaq 0x14bdc1(%rip), %rax    # 0x641c10
movzbl (%rax,%rdx), %eax
subl $0x1c, %eax
subl $0x1, %eax
cltq
movq %rcx, 0x1b0(%rsp,%rax,8)
movslq 0x780(%rsp), %rdx
leaq 0x14bd9e(%rip), %rax    # 0x641c10
movzbl (%rax,%rdx), %eax
subl $0x1, %eax
cltq
movq %rcx, 0x290(%rsp,%rax,8)
movq 0x778(%rsp), %rax
addq 0x778(%rsp), %rax
movq %rax, 0x778(%rsp)
movl 0x780(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x780(%rsp)
cmpl 0x784(%rsp), %eax
jge 0x4f5e33
movq 0x778(%rsp), %rax
shlq $0x2, %rax
movq %rax, 0x778(%rsp)
jmp 0x4f5e08
movl $0x0, 0x784(%rsp)
cmpl $0x1c, 0x784(%rsp)
jge 0x4f5fdb
movl 0x784(%rsp), %ecx
andl $0x3, %ecx
movl $0x8, %eax
sarl %cl, %eax
cltq
movq %rax, 0x778(%rsp)
movl $0x0, 0x780(%rsp)
cmpl $0x10, 0x780(%rsp)
jge 0x4f5fc3
movslq 0x780(%rsp), %rax
andq 0x778(%rsp), %rax
cmpq $0x0, %rax
je 0x4f5fab
movslq 0x784(%rsp), %rax
movq 0x290(%rsp,%rax,8), %rdx
movl 0x784(%rsp), %eax
sarl $0x2, %eax
movslq %eax, %rcx
leaq 0x14e357(%rip), %rax    # 0x6442b0
shlq $0x7, %rcx
addq %rcx, %rax
movslq 0x780(%rsp), %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movslq 0x784(%rsp), %rax
movq 0x1b0(%rsp,%rax,8), %rdx
movl 0x784(%rsp), %eax
sarl $0x2, %eax
movslq %eax, %rcx
leaq 0x14e69c(%rip), %rax    # 0x644630
shlq $0x7, %rcx
addq %rcx, %rax
movslq 0x780(%rsp), %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x4f5fad
movl 0x780(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x780(%rsp)
jmp 0x4f5f11
jmp 0x4f5fc5
movl 0x784(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x784(%rsp)
jmp 0x4f5edd
movl $0x0, 0x784(%rsp)
cmpl $0x55, 0x784(%rsp)
jg 0x4f60b9
movq $0x0, 0x778(%rsp)
movl 0x784(%rsp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x4f601b
movq $0x1000000, 0x778(%rsp) # imm = 0x1000000
movl 0x784(%rsp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x4f6040
movq 0x778(%rsp), %rax
orq $0x10000, %rax          # imm = 0x10000
movq %rax, 0x778(%rsp)
movl 0x784(%rsp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x4f6065
movq 0x778(%rsp), %rax
orq $0x100, %rax            # imm = 0x100
movq %rax, 0x778(%rsp)
movl 0x784(%rsp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4f6088
movq 0x778(%rsp), %rax
orq $0x1, %rax
movq %rax, 0x778(%rsp)
movq 0x778(%rsp), %rdx
movslq 0x784(%rsp), %rcx
leaq 0x14e911(%rip), %rax    # 0x6449b0
movq %rdx, (%rax,%rcx,8)
movl 0x784(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x784(%rsp)
jmp 0x4f5fe6
movl $0x0, 0x784(%rsp)
cmpl $0x10, 0x784(%rsp)
jge 0x4f6197
movq $0x0, 0x778(%rsp)
movl 0x784(%rsp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4f60f9
movq $0x1000000, 0x778(%rsp) # imm = 0x1000000
movl 0x784(%rsp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x4f611e
movq 0x778(%rsp), %rax
orq $0x10000, %rax          # imm = 0x10000
movq %rax, 0x778(%rsp)
movl 0x784(%rsp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x4f6143
movq 0x778(%rsp), %rax
orq $0x100, %rax            # imm = 0x100
movq %rax, 0x778(%rsp)
movl 0x784(%rsp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x4f6166
movq 0x778(%rsp), %rax
orq $0x1, %rax
movq %rax, 0x778(%rsp)
movq 0x778(%rsp), %rdx
movslq 0x784(%rsp), %rcx
leaq 0x14fae3(%rip), %rax    # 0x645c60
movq %rdx, (%rax,%rcx,8)
movl 0x784(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x784(%rsp)
jmp 0x4f60c4
movl $0x0, 0x784(%rsp)
cmpl $0x40, 0x784(%rsp)
jge 0x4f61f5
movl 0x784(%rsp), %ecx
andl $0x20, %ecx
movl 0x784(%rsp), %eax
andl $0x1, %eax
shll $0x4, %eax
orl %eax, %ecx
movl 0x784(%rsp), %eax
andl $0x1e, %eax
sarl %eax
orl %eax, %ecx
movslq 0x784(%rsp), %rax
movl %ecx, 0xb0(%rsp,%rax,4)
movl 0x784(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x784(%rsp)
jmp 0x4f61a2
movq $0x1, 0x778(%rsp)
movl $0x20, 0x784(%rsp)
movl 0x784(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x784(%rsp)
cmpl $0x0, %eax
jl 0x4f6261
movq 0x778(%rsp), %rcx
movslq 0x784(%rsp), %rdx
leaq 0x14ba07(%rip), %rax    # 0x641c40
movzbl (%rax,%rdx), %eax
subl $0x1, %eax
cltq
movq %rcx, -0x50(%rsp,%rax,8)
movq 0x778(%rsp), %rax
addq 0x778(%rsp), %rax
movq %rax, 0x778(%rsp)
jmp 0x4f620c
movl $0x0, 0x784(%rsp)
cmpl $0x8, 0x784(%rsp)
jge 0x4f6360
movl $0x0, 0x780(%rsp)
cmpl $0x40, 0x780(%rsp)
jge 0x4f6348
movslq 0x784(%rsp), %rcx
leaq 0x14b9be(%rip), %rax    # 0x641c60
shlq $0x6, %rcx
addq %rcx, %rax
movslq 0x780(%rsp), %rcx
movslq 0xb0(%rsp,%rcx,4), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x80(%rsp)
movl $0x0, -0x7c(%rsp)
cmpl $0x4, -0x7c(%rsp)
jge 0x4f6330
movl -0x80(%rsp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x4f6317
movl 0x784(%rsp), %eax
shll $0x2, %eax
addl -0x7c(%rsp), %eax
cltq
movq -0x50(%rsp,%rax,8), %rdx
movslq 0x784(%rsp), %rcx
leaq 0x14e960(%rip), %rax    # 0x644c60
shlq $0x9, %rcx
addq %rcx, %rax
movslq 0x780(%rsp), %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl -0x80(%rsp), %eax
addl -0x80(%rsp), %eax
movl %eax, -0x80(%rsp)
movl -0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rsp)
jmp 0x4f62c9
jmp 0x4f6332
movl 0x780(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x780(%rsp)
jmp 0x4f6285
jmp 0x4f634a
movl 0x784(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x784(%rsp)
jmp 0x4f626c
addq $0x788, %rsp            # imm = 0x788
retq
nopl (%rax,%rax)