// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bcftools/prob1.c
// Function: init_prior
static void init_prior(int type, double theta, int M, double *phi)
{
	int i;
	if (type == MC_PTYPE_COND2) {
		for (i = 0; i <= M; ++i)
			phi[i] = 2. * (i + 1) / (M + 1) / (M + 2);
	} else if (type == MC_PTYPE_FLAT) {
		for (i = 0; i <= M; ++i)
			phi[i] = 1. / (M + 1);
	} else {
		double sum;
		for (i = 0, sum = 0.; i < M; ++i)
			sum += (phi[i] = theta / (M - i));
		phi[M] = 1. - sum;
	}
}

// Assembly:
cmpl $0x2, %edi
je 0x100a8
cmpl $0x3, %edi
jne 0x1019d
testl %esi, %esi
js 0x100a7
leal 0x1(%rsi), %eax
cvtsi2sd %eax, %xmm1
movsd 0x906a(%rip), %xmm0     # 0x19078
divsd %xmm1, %xmm0
movd %esi, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
shrl %esi
andl $0x3fffffff, %esi       # imm = 0x3FFFFFFF
shlq $0x4, %rsi
addq $0x10, %rsi
movdqa 0x8fed(%rip), %xmm2     # 0x19020
xorl %eax, %eax
movdqa 0x8ff3(%rip), %xmm3     # 0x19030
pxor %xmm3, %xmm1
pcmpeqd %xmm4, %xmm4
movdqa 0x9003(%rip), %xmm5     # 0x19050
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm1, %xmm7
pcmpeqd %xmm1, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %ecx
notl %ecx
testb $0x1, %cl
je 0x10086
movsd %xmm0, (%rdx,%rax)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %ecx
testb $0x1, %cl
je 0x1009a
movsd %xmm0, 0x8(%rdx,%rax)
paddq %xmm5, %xmm2
addq $0x10, %rax
cmpq %rax, %rsi
jne 0x1004d
retq
testl %esi, %esi
js 0x100a7
leal 0x1(%rsi), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
leal 0x2(%rsi), %eax
cvtsi2sd %eax, %xmm1
movd %esi, %xmm2
pshufd $0x44, %xmm2, %xmm2     # xmm2 = xmm2[0,1,0,1]
shrl %esi
andl $0x3fffffff, %esi       # imm = 0x3FFFFFFF
shlq $0x4, %rsi
addq $0x10, %rsi
movdqa 0x8f42(%rip), %xmm3     # 0x19020
xorl %eax, %eax
movdqa 0x8f48(%rip), %xmm4     # 0x19030
pxor %xmm4, %xmm2
pcmpeqd %xmm5, %xmm5
movdqa 0x8f58(%rip), %xmm6     # 0x19050
movdqa %xmm3, %xmm7
pxor %xmm4, %xmm7
movdqa %xmm7, %xmm8
pcmpgtd %xmm2, %xmm8
pcmpeqd %xmm2, %xmm7
pshufd $0xf5, %xmm7, %xmm7     # xmm7 = xmm7[1,1,3,3]
pand %xmm8, %xmm7
pshufd $0xf5, %xmm8, %xmm8     # xmm8 = xmm8[1,1,3,3]
por %xmm7, %xmm8
movdqa %xmm3, %xmm7
psubq %xmm5, %xmm7
movd %xmm8, %ecx
notl %ecx
testb $0x1, %cl
je 0x10156
movd %xmm7, %ecx
addl %ecx, %ecx
xorps %xmm9, %xmm9
cvtsi2sd %rcx, %xmm9
divsd %xmm0, %xmm9
divsd %xmm1, %xmm9
movsd %xmm9, (%rdx,%rax)
pxor %xmm5, %xmm8
pextrw $0x4, %xmm8, %ecx
testb $0x1, %cl
je 0x10187
pshufd $0xee, %xmm7, %xmm7     # xmm7 = xmm7[2,3,2,3]
movd %xmm7, %ecx
addl %ecx, %ecx
xorps %xmm7, %xmm7
cvtsi2sd %rcx, %xmm7
divsd %xmm0, %xmm7
divsd %xmm1, %xmm7
movsd %xmm7, 0x8(%rdx,%rax)
paddq %xmm6, %xmm3
addq $0x10, %rax
cmpq %rax, %rsi
jne 0x100f8
jmp 0x100a7
testl %esi, %esi
jle 0x101cf
movl %esi, %eax
xorpd %xmm1, %xmm1
movq %rdx, %rcx
movq %rax, %rsi
xorps %xmm2, %xmm2
cvtsi2sd %esi, %xmm2
movapd %xmm0, %xmm3
divsd %xmm2, %xmm3
movsd %xmm3, (%rcx)
addsd %xmm3, %xmm1
addq $0x8, %rcx
decq %rsi
jne 0x101ad
jmp 0x101d6
movslq %esi, %rax
xorpd %xmm1, %xmm1
movsd 0x8e9a(%rip), %xmm0     # 0x19078
subsd %xmm1, %xmm0
movsd %xmm0, (%rdx,%rax,8)
retq