// File: /workspace/github_c_makefile_star2_O0/sc932[P]ALE/src/ALElike.c
// Function: computeNormaliziedDepthGCParameters
void computeNormaliziedDepthGCParameters(double *depthNormalizer, long *depthNormalizerCount, double *negBinomParam_r, double *negBinomParam_p, double *negBinomParamZnorm_r, double avgDepth) {
	int j;
	for(j = 0; j < 101; j++){ // for each GCpct
        if(depthNormalizerCount[j] > 0){
            depthNormalizer[j] = depthNormalizer[j]/(double)depthNormalizerCount[j]; // now contains the avg depth for that GC
        }else{
            depthNormalizer[j] = avgDepth; // otherwise assume the given avg depth or the min whichever is greater.
        }
        if(depthNormalizer[j] < minAvgDepth){
            depthNormalizer[j] = minAvgDepth;
        }
        // through max likelihood/moment matching
        //negBinomParam_r[j] = negBinom_rFinder(depthNormalizer[j], depthNormalizer[j], depthsAtGC, depthNormalizerCount[j], 1000);
        // through constant r
        negBinomParam_r[j] = depthNormalizer[j];
        negBinomParam_p[j] = negBinom_pFinder(negBinomParam_r[j], depthNormalizer[j]);

        if((int)floor(negBinomParam_r[j]) < 2047){
            negBinomParamZnorm_r[j] = negBinomZ[(int)floor(negBinomParam_r[j])];
        }else{
            // not in lookup table, compute
            negBinomParamZnorm_r[j] = getNegBinomZnorm(negBinomParam_r[j]);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movsd %xmm0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x65, -0x34(%rbp)
jge 0x8133
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jle 0x802f
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
cvtsi2sdq (%rax,%rcx,8), %xmm1
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x8041
movsd -0x30(%rbp), %xmm0
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd 0x23a77(%rip), %xmm0    # 0x2bac8
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x806d
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd 0x23a60(%rip), %xmm0    # 0x2bac8
movsd %xmm0, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
callq 0x7da0
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x3560
cvttsd2si %xmm0, %eax
cmpl $0x7ff, %eax            # imm = 0x7FF
jge 0x8104
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x3560
cvttsd2si %xmm0, %eax
movslq %eax, %rcx
leaq 0x23cc0(%rip), %rax     # 0x2bdb0
movsd (%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x8123
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x4500
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x8125
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x7fe8
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)