// File: /workspace/github_cpp_makefile_star2_O3/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/misc/md5fa.c
// Function: md5_one
static void md5_one(const char *fn)
{
	MD5_CTX md5_one, md5_all;
	int l, i, k;
	gzFile fp;
	kseq_t *seq;
	unsigned char unordered[16], digest[16];

	for (l = 0; l < 16; ++l) unordered[l] = 0;
	fp = strcmp(fn, "-")? gzopen(fn, "r") : gzdopen(fileno(stdin), "r");
	if (fp == 0) {
		fprintf(stderr, "md5fa: %s: No such file or directory\n", fn);
		exit(1);
	}
	
	MD5Init(&md5_all);
	seq = kseq_init(fp);
	while ((l = kseq_read(seq)) >= 0) {
		for (i = k = 0; i < seq->seq.l; ++i) {
			if (islower(seq->seq.s[i])) seq->seq.s[k++] = toupper(seq->seq.s[i]);
			else if (isupper(seq->seq.s[i])) seq->seq.s[k++] = seq->seq.s[i];
		}
		MD5Init(&md5_one);
		MD5Update(&md5_one, (unsigned char*)seq->seq.s, k);
		MD5Final(digest, &md5_one);
		for (l = 0; l < 16; ++l) {
			printf("%c%c", HEX_STR[digest[l]>>4&0xf], HEX_STR[digest[l]&0xf]);
			unordered[l] ^= digest[l];
		}
		printf("  %s  %s\n", fn, seq->name.s);
		MD5Update(&md5_all, (unsigned char*)seq->seq.s, k);
	}
	MD5Final(digest, &md5_all);
	kseq_destroy(seq);
	for (l = 0; l < 16; ++l)
		printf("%c%c", HEX_STR[digest[l]>>4&0xf], HEX_STR[digest[l]&0xf]);
	printf("  %s  >ordered\n", fn);
	for (l = 0; l < 16; ++l)
		printf("%c%c", HEX_STR[unordered[l]>>4&0xf], HEX_STR[unordered[l]&0xf]);
	printf("  %s  >unordered\n", fn);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %r13
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
cmpb $0x2d, (%rdi)
jne 0x1b7b
cmpb $0x0, 0x1(%r13)
je 0x2157
leaq 0x14a0(%rip), %rsi      # 0x3022
movq %r13, %rdi
callq 0x10f0
movq %rax, %r12
testq %rax, %rax
je 0x21ac
leaq 0x58(%rsp), %rdi
callq 0x124c
movl $0x1, %edi
movl $0x70, %esi
callq 0x1080
movq %rax, %r14
movl $0x1, %edi
movl $0x20, %esi
callq 0x1080
movq %rax, %r15
movq %r12, 0x18(%rax)
movl $0x1000, %edi           # imm = 0x1000
callq 0x10d0
movq %rax, (%r15)
movq %r15, 0x68(%r14)
leaq 0x18(%r14), %rax
movq %rax, 0x38(%rsp)
leaq 0x1466(%rip), %rbx      # 0x304f
movq $0x0, 0x8(%rsp)
xorl %eax, %eax
movq %r13, 0x10(%rsp)
movq %r14, 0x18(%rsp)
testl %eax, %eax
jne 0x1c75
movl 0x8(%r15), %ecx
movl 0xc(%r15), %eax
cmpl $0x0, 0x10(%r15)
je 0x1c19
cmpl %eax, %ecx
jge 0x2063
cmpl %eax, %ecx
jl 0x1c51
movl $0x0, 0x8(%r15)
movq (%r15), %rsi
movq 0x18(%r15), %rdi
movl $0x1000, %edx           # imm = 0x1000
callq 0x1090
movl %eax, 0xc(%r15)
cmpl $0xfff, %eax            # imm = 0xFFF
jg 0x1c51
movl $0x1, 0x10(%r15)
testl %eax, %eax
je 0x2063
movq (%r15), %rdx
movslq 0x8(%r15), %rsi
leal 0x1(%rsi), %ecx
movl %ecx, 0x8(%r15)
movzbl (%rdx,%rsi), %edx
movl %edx, 0x4(%rsp)
cmpl $0x40, %edx
je 0x1c71
cmpl $0x3e, %edx
jne 0x1c0a
movl %edx, 0x60(%r14)
xorl %eax, %eax
movq %rax, 0x48(%r14)
movq %rax, 0x30(%r14)
movq %rax, 0x18(%r14)
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
leaq 0x4(%rsp), %rcx
callq 0x21b4
testl %eax, %eax
js 0x2179
cmpl $0xa, 0x4(%rsp)
je 0x1cb8
movq %r15, %rdi
movl $0xa, %esi
movq 0x38(%rsp), %rdx
xorl %ecx, %ecx
callq 0x21b4
cmpl $0x0, 0x10(%r15)
sete %cl
movl 0xc(%r15), %r12d
cmpl %r12d, 0x8(%r15)
setl %al
orb %al, %cl
testb $0x1, %cl
je 0x1de2
testb $0x1, %al
jne 0x1d12
movl $0x0, 0x8(%r15)
movq (%r15), %rsi
movq 0x18(%r15), %rdi
movl $0x1000, %edx           # imm = 0x1000
callq 0x1090
movl %eax, %r12d
movl %eax, 0xc(%r15)
cmpl $0xfff, %eax            # imm = 0xFFF
jg 0x1d12
movl $0x1, 0x10(%r15)
testl %r12d, %r12d
je 0x1de2
movq (%r15), %rax
movslq 0x8(%r15), %rcx
leal 0x1(%rcx), %ebp
movl %ebp, 0x8(%r15)
movzbl (%rax,%rcx), %r13d
movl %r13d, 0x4(%rsp)
cmpl $0x2b, %r13d
je 0x1df5
cmpl $0x3e, %r13d
je 0x1dec
cmpl $0x40, %r13d
je 0x1dec
callq 0x1110
movq (%rax), %rax
cmpw $0x0, (%rax,%r13,2)
jns 0x1dc8
movq 0x18(%rsp), %rbp
movq 0x30(%rbp), %r14
movq 0x40(%rbp), %rax
leaq 0x1(%r14), %r12
cmpq 0x38(%rbp), %r12
jb 0x1db8
movq %r12, %rcx
shrq %rcx
orq %r12, %rcx
movq %rcx, %rdx
shrq $0x2, %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x4, %rcx
orq %rdx, %rcx
movq %rcx, %rdx
shrq $0x8, %rdx
orq %rcx, %rdx
movq %rdx, %rsi
shrq $0x10, %rsi
orq %rdx, %rsi
incq %rsi
movq %rsi, 0x38(%rbp)
movq %rax, %rdi
callq 0x10e0
movq %rax, 0x40(%rbp)
movb 0x4(%rsp), %r13b
movq %r12, 0x30(%rbp)
movb %r13b, (%rax,%r14)
movl 0x8(%r15), %ebp
movl 0xc(%r15), %r12d
cmpl %r12d, %ebp
setl %al
cmpl $0x0, 0x10(%r15)
je 0x1cd6
cmpl %r12d, %ebp
jl 0x1cd6
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
jmp 0x1df5
movq 0x18(%rsp), %rax
movl %r13d, 0x60(%rax)
movq 0x18(%rsp), %r14
movq 0x30(%r14), %r13
movq 0x40(%r14), %rdx
movb $0x0, (%rdx,%r13)
cmpl $0x2b, 0x4(%rsp)
movq %rdx, 0x8(%rsp)
jne 0x1f4e
movq 0x38(%r14), %rsi
cmpq %rsi, 0x50(%r14)
jae 0x1e32
movq %rsi, 0x50(%r14)
movq 0x58(%r14), %rdi
callq 0x10e0
movq %rax, 0x58(%r14)
movl 0x8(%r15), %ecx
movl 0xc(%r15), %eax
cmpl $0x0, 0x10(%r15)
je 0x1e49
cmpl %eax, %ecx
jge 0x205e
cmpl %eax, %ecx
jl 0x1e81
movl $0x0, 0x8(%r15)
movq (%r15), %rsi
movq 0x18(%r15), %rdi
movl $0x1000, %edx           # imm = 0x1000
callq 0x1090
movl %eax, 0xc(%r15)
cmpl $0xfff, %eax            # imm = 0xFFF
jg 0x1e81
movl $0x1, 0x10(%r15)
testl %eax, %eax
je 0x205e
movq (%r15), %rdx
movslq 0x8(%r15), %rsi
leal 0x1(%rsi), %ecx
movl %ecx, 0x8(%r15)
movzbl (%rdx,%rsi), %edx
movl %edx, 0x4(%rsp)
cmpl $0xa, %edx
jne 0x1e3a
jmp 0x1ebe
addl $-0x21, %edi
cmpl $0x5e, %edi
ja 0x1ebe
movq 0x58(%r14), %rax
leaq 0x1(%rdx), %rcx
movq %rcx, 0x48(%r14)
movb %sil, (%rax,%rdx)
movl 0x8(%r15), %ecx
movl 0xc(%r15), %eax
cmpl %eax, %ecx
setl %dl
cmpl $0x0, 0x10(%r15)
je 0x1ece
cmpl %eax, %ecx
jge 0x1f2c
testb $0x1, %dl
jne 0x1f03
movl $0x0, 0x8(%r15)
movq (%r15), %rsi
movq 0x18(%r15), %rdi
movl $0x1000, %edx           # imm = 0x1000
callq 0x1090
movl %eax, 0xc(%r15)
cmpl $0xfff, %eax            # imm = 0xFFF
jg 0x1f03
movl $0x1, 0x10(%r15)
testl %eax, %eax
je 0x1f2c
movq (%r15), %rdx
movslq 0x8(%r15), %rsi
leal 0x1(%rsi), %ecx
movl %ecx, 0x8(%r15)
movb (%rdx,%rsi), %sil
movzbl %sil, %edi
movl %edi, 0x4(%rsp)
movq 0x48(%r14), %rdx
cmpq %r13, %rdx
jb 0x1e9e
jmp 0x1f30
movq 0x48(%r14), %rdx
movq 0x58(%r14), %rax
movb $0x0, (%rax,%rdx)
movl $0x0, 0x60(%r14)
cmpq %rdx, %r13
movq 0x8(%rsp), %rdx
jne 0x2179
testl %r13d, %r13d
js 0x2193
testq %r13, %r13
je 0x1fb2
xorl %r14d, %r14d
callq 0x1110
movq 0x8(%rsp), %rdx
movq %rax, %rbp
xorl %r15d, %r15d
movq (%rbp), %rcx
movb (%rdx,%r14), %al
movsbq %al, %r12
movzwl (%rcx,%r12,2), %ecx
btl $0x9, %ecx
jb 0x1f8e
btl $0x8, %ecx
jb 0x1f9f
jmp 0x1fa8
callq 0x1030
movq 0x8(%rsp), %rdx
movq (%rax), %rax
movb (%rax,%r12,4), %al
movslq %r15d, %rcx
incl %r15d
movb %al, (%rdx,%rcx)
incq %r14
cmpq %r14, %r13
jne 0x1f6f
jmp 0x1fb5
xorl %r15d, %r15d
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
movq %rdx, %r12
callq 0x124c
movq %r14, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x125f
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x1a7b
xorl %r14d, %r14d
leaq 0x105d(%rip), %r12      # 0x304a
movzbl 0x20(%rsp,%r14), %eax
movl %eax, %ecx
shrl $0x4, %ecx
movsbl (%rcx,%rbx), %esi
andl $0xf, %eax
movsbl (%rax,%rbx), %edx
movq %r12, %rdi
xorl %eax, %eax
callq 0x1060
movb 0x20(%rsp,%r14), %al
xorb %al, 0x40(%rsp,%r14)
incq %r14
cmpq $0x10, %r14
jne 0x1fed
movq 0x18(%rsp), %r14
movq 0x10(%r14), %rdx
leaq 0x1030(%rip), %rdi      # 0x3060
movq 0x10(%rsp), %r13
movq %r13, %rsi
xorl %eax, %eax
callq 0x1060
leaq 0x58(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl %r15d, %edx
callq 0x125f
movq 0x68(%r14), %r15
movl 0x60(%r14), %eax
jmp 0x1bfe
movq 0x10(%rsp), %r13
leaq 0x20(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x1a7b
testq %r14, %r14
je 0x20bd
movq 0x10(%r14), %rdi
callq 0x1040
movq 0x28(%r14), %rdi
callq 0x1040
movq 0x8(%rsp), %rdi
callq 0x1040
movq 0x58(%r14), %rdi
callq 0x1040
movq 0x68(%r14), %r15
testq %r15, %r15
je 0x20b5
movq (%r15), %rdi
callq 0x1040
movq %r15, %rdi
callq 0x1040
movq %r14, %rdi
callq 0x1040
leaq 0xf86(%rip), %r14       # 0x304a
xorl %r15d, %r15d
movzbl 0x20(%rsp,%r15), %eax
movl %eax, %ecx
shrl $0x4, %ecx
movsbl (%rcx,%rbx), %esi
andl $0xf, %eax
movsbl (%rax,%rbx), %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x1060
incq %r15
cmpq $0x10, %r15
jne 0x20c7
leaq 0xf73(%rip), %rdi       # 0x306a
movq %r13, %rsi
xorl %eax, %eax
callq 0x1060
leaq 0xf42(%rip), %r14       # 0x304a
xorl %r15d, %r15d
movzbl 0x40(%rsp,%r15), %eax
movl %eax, %ecx
shrl $0x4, %ecx
movsbl (%rcx,%rbx), %esi
andl $0xf, %eax
movsbl (%rax,%rbx), %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x1060
incq %r15
cmpq $0x10, %r15
jne 0x210b
leaq 0xf3f(%rip), %rdi       # 0x307a
movq %r13, %rsi
xorl %eax, %eax
callq 0x1060
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2e7a(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
callq 0x10c0
leaq 0xeb5(%rip), %rsi       # 0x3022
movl %eax, %edi
callq 0x1050
jmp 0x1b8a
leaq 0x20(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x1a7b
movq 0x40(%r14), %rax
movq %rax, 0x8(%rsp)
jmp 0x21a2
leaq 0x20(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x1a7b
movq 0x10(%rsp), %r13
jmp 0x2077
movq %r13, %rdi
callq 0x1130