// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bcftools/mut.c
// Function: bcf_trio_prep
uint32_t *bcf_trio_prep(int is_x, int is_son)
{
	int i, j, k, n, map[10];
	uint32_t *ret;
	ret = calloc(MAX_GENO, 4);
	for (i = 0, k = 0; i < 4; ++i)
		for (j = i; j < 4; ++j)
			map[k++] = 1<<i|1<<j;
	for (i = 0, n = 1; i < 10; ++i) { // father
		if (is_x && seq_bitcnt[map[i]] != 1) continue;
		if (is_x && is_son) {
			for (j = 0; j < 10; ++j) // mother
				for (k = 0; k < 10; ++k) // child
					if (seq_bitcnt[map[k]] == 1 && (map[j]&map[k]))
						ret[n++] = j<<16 | i<<8 | k;
		} else {
			for (j = 0; j < 10; ++j) // mother
				for (k = 0; k < 10; ++k) // child
					if ((map[i]&map[k]) && (map[j]&map[k]) && ((map[i]|map[j])&map[k]) == map[k])
						ret[n++] = j<<16 | i<<8 | k;
		}
	}
	ret[0] = n - 1;
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebp
movl %edi, %ebx
movl $0x167, %edi            # imm = 0x167
movl $0x4, %esi
callq 0x2260
xorl %edx, %edx
movl $0x3, %esi
movdqa 0x1088(%rip), %xmm0     # 0x19030
movdqa 0x3b40(%rip), %xmm1     # 0x1baf0
pshufd $0xf5, %xmm1, %xmm2     # xmm2 = xmm1[1,1,3,3]
pcmpeqd %xmm3, %xmm3
movdqa 0x3b3f(%rip), %xmm4     # 0x1bb00
pshufd $0xf5, %xmm4, %xmm5     # xmm5 = xmm4[1,1,3,3]
xorl %ecx, %ecx
xorl %edi, %edi
movslq %edi, %r8
testb %dl, %dl
jne 0x17fde
movl $0x1, %r9d
shll %cl, %r9d
movl %r9d, (%rsp,%r8,4)
movq %rsi, %xmm6
pshufd $0x44, %xmm6, %xmm7     # xmm7 = xmm6[0,1,0,1]
pxor %xmm0, %xmm7
movdqa %xmm1, %xmm8
pcmpgtd %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
movdqa %xmm2, %xmm9
pcmpeqd %xmm6, %xmm9
pand %xmm8, %xmm9
pxor %xmm3, %xmm9
pextrw $0x4, %xmm9, %r9d
testb $0x1, %r9b
je 0x18029
movl $0x3, %r9d
shll %cl, %r9d
movl %r9d, 0x4(%rsp,%r8,4)
movdqa %xmm4, %xmm8
pcmpgtd %xmm7, %xmm8
pcmpeqd %xmm5, %xmm6
pand %xmm8, %xmm6
pxor %xmm3, %xmm6
pextrw $0x0, %xmm6, %r9d
testb $0x1, %r9b
je 0x1805a
movl $0x5, %r9d
shll %cl, %r9d
movl %r9d, 0x8(%rsp,%r8,4)
pextrw $0x4, %xmm6, %r9d
testb $0x1, %r9b
je 0x18074
movl $0x9, %r9d
shll %cl, %r9d
movl %r9d, 0xc(%rsp,%r8,4)
addl %esi, %edi
incl %edi
incl %ecx
decq %rsi
cmpl $0x4, %ecx
jne 0x17fca
testl %ebx, %ebx
setne %cl
testl %ebp, %ebp
setne %dl
andb %cl, %dl
movl $0x1, %ecx
xorl %esi, %esi
leaq 0x8370(%rip), %rdi      # 0x20410
xorl %r8d, %r8d
testl %ebx, %ebx
je 0x180fc
movslq (%rsp,%r8,4), %r9
cmpb $0x1, (%r9,%rdi)
jne 0x1814c
testb %dl, %dl
je 0x180fc
movq %rsi, %r9
xorl %r10d, %r10d
xorl %r11d, %r11d
movslq (%rsp,%r11,4), %r14
cmpb $0x1, (%r14,%rdi)
jne 0x180e1
testl %r14d, (%rsp,%r10,4)
je 0x180e1
movslq %ecx, %r14
incl %ecx
leal (%r9,%r11), %ebp
movl %ebp, (%rax,%r14,4)
incq %r11
cmpq $0xa, %r11
jne 0x180c3
incq %r10
addq $0x10000, %r9           # imm = 0x10000
cmpq $0xa, %r10
jne 0x180c0
jmp 0x1814c
movl (%rsp,%r8,4), %r9d
movq %rsi, %r10
xorl %r11d, %r11d
xorl %r14d, %r14d
movl (%rsp,%r14,4), %ebp
testl %r9d, %ebp
je 0x18133
movl (%rsp,%r11,4), %r15d
testl %ebp, %r15d
je 0x18133
orl %r9d, %r15d
notl %r15d
testl %r15d, %ebp
jne 0x18133
movslq %ecx, %r15
incl %ecx
leal (%r10,%r14), %ebp
movl %ebp, (%rax,%r15,4)
incq %r14
cmpq $0xa, %r14
jne 0x18109
incq %r11
addq $0x10000, %r10          # imm = 0x10000
cmpq $0xa, %r11
jne 0x18106
incq %r8
addq $0x100, %rsi            # imm = 0x100
cmpq $0xa, %r8
jne 0x180a3
decl %ecx
movl %ecx, (%rax)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq