// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_maqcns.c
// Function: bam_maqcns_glfgen
glf1_t *bam_maqcns_glfgen(int _n, const bam_pileup1_t *pl, uint8_t ref_base, bam_maqcns_t *bm)
{
	glf_call_aux_t *b;
	int i, j, k, w[8], c, n;
	glf1_t *g = (glf1_t*)calloc(1, sizeof(glf1_t));
	float p[16], min_p = 1e30;
	uint64_t rms;

	g->ref_base = ref_base;
	if (_n == 0) return g;

	// construct aux array
	if (bm->aux->max < _n) {
		bm->aux->max = _n;
		kroundup32(bm->aux->max);
		bm->aux->info = (uint32_t*)realloc(bm->aux->info, 4 * bm->aux->max);
	}
	for (i = n = 0; i < _n; ++i) {
		const bam_pileup1_t *p = pl + i;
		uint32_t q, x = 0, qq;
		if (p->is_del || (p->b->core.flag&BAM_FUNMAP)) continue;
		q = (uint32_t)bam1_qual(p->b)[p->qpos];
		x |= (uint32_t)bam1_strand(p->b) << 18 | q << 8 | p->b->core.qual;
		if (p->b->core.qual < q) q = p->b->core.qual;
		x |= q << 24;
		qq = bam1_seqi(bam1_seq(p->b), p->qpos);
		q = bam_nt16_nt4_table[qq? qq : ref_base];
		if (!p->is_del && q < 4) x |= 1 << 21 | q << 16;
		bm->aux->info[n++] = x;
	}
	ks_introsort(uint32_t, n, bm->aux->info);
	// generate esum and fsum
	b = (glf_call_aux_t*)calloc(1, sizeof(glf_call_aux_t));
	for (k = 0; k != 8; ++k) w[k] = 0;
	rms = 0;
	for (j = n - 1; j >= 0; --j) { // calculate esum and fsum
		uint32_t info = bm->aux->info[j];
		int tmp;
		if (info>>24 < 4 && (info>>8&0x3f) != 0) info = 4<<24 | (info&0xffffff);
		k = info>>16&7;
		if (info>>24 > 0) {
			b->esum[k&3] += bm->fk[w[k]] * (info>>24);
			b->fsum[k&3] += bm->fk[w[k]];
			if (w[k] < 0xff) ++w[k];
			++b->c[k&3];
		}
		tmp = (int)(info&0xff) < bm->cap_mapQ? (int)(info&0xff) : bm->cap_mapQ;
		rms += tmp * tmp;
	}
	b->rms_mapQ = (uint8_t)(sqrt((double)rms / n) + .499);
	// rescale ->c[]
	for (j = c = 0; j != 4; ++j) c += b->c[j];
	if (c > 255) {
		for (j = 0; j != 4; ++j) b->c[j] = (int)(254.0 * b->c[j] / c + 0.5);
		for (j = c = 0; j != 4; ++j) c += b->c[j];
	}
	if (!bm->is_soap) {
		// generate likelihood
		for (j = 0; j != 4; ++j) {
			// homozygous
			float tmp1, tmp3;
			int tmp2, bar_e;
			for (k = 0, tmp1 = tmp3 = 0.0, tmp2 = 0; k != 4; ++k) {
				if (j == k) continue;
				tmp1 += b->esum[k]; tmp2 += b->c[k]; tmp3 += b->fsum[k];
			}
			if (tmp2) {
				bar_e = (int)(tmp1 / tmp3 + 0.5);
				if (bar_e < 4) bar_e = 4; // should not happen
				if (bar_e > 63) bar_e = 63;
				p[j<<2|j] = tmp1 + bm->coef[bar_e<<16|c<<8|tmp2];
			} else p[j<<2|j] = 0.0; // all the bases are j
			// heterozygous
			for (k = j + 1; k < 4; ++k) {
				for (i = 0, tmp2 = 0, tmp1 = tmp3 = 0.0; i != 4; ++i) {
					if (i == j || i == k) continue;
					tmp1 += b->esum[i]; tmp2 += b->c[i]; tmp3 += b->fsum[i];
				}
				if (tmp2) {
					bar_e = (int)(tmp1 / tmp3 + 0.5);
					if (bar_e < 4) bar_e = 4;
					if (bar_e > 63) bar_e = 63;
					p[j<<2|k] = p[k<<2|j] = -4.343 * bm->lhet[b->c[j]<<8|b->c[k]] + tmp1 + bm->coef[bar_e<<16|c<<8|tmp2];
				} else p[j<<2|k] = p[k<<2|j] = -4.343 * bm->lhet[b->c[j]<<8|b->c[k]]; // all the bases are either j or k
			}
			//
			for (k = 0; k != 4; ++k)
				if (p[j<<2|k] < 0.0) p[j<<2|k] = 0.0;
		}

		{ // fix p[k<<2|k]
			float max1, max2, min1, min2;
			int max_k, min_k;
			max_k = min_k = -1;
			max1 = max2 = -1.0; min1 = min2 = 1e30;
			for (k = 0; k < 4; ++k) {
				if (b->esum[k] > max1) {
					max2 = max1; max1 = b->esum[k]; max_k = k;
				} else if (b->esum[k] > max2) max2 = b->esum[k];
			}
			for (k = 0; k < 4; ++k) {
				if (p[k<<2|k] < min1) {
					min2 = min1; min1 = p[k<<2|k]; min_k = k;
				} else if (p[k<<2|k] < min2) min2 = p[k<<2|k];
			}
			if (max1 > max2 && (min_k != max_k || min1 + 1.0 > min2))
				p[max_k<<2|max_k] = min1 > 1.0? min1 - 1.0 : 0.0;
		}
	} else { // apply the SOAP model
		// generate likelihood
		for (j = 0; j != 4; ++j) {
			float tmp;
			// homozygous
			for (k = 0, tmp = 0.0; k != 4; ++k)
				if (j != k) tmp += b->esum[k];
			p[j<<2|j] = tmp;
			// heterozygous
			for (k = j + 1; k < 4; ++k) {
				for (i = 0, tmp = 0.0; i != 4; ++i)
					if (i != j && i != k) tmp += b->esum[i];
				p[j<<2|k] = p[k<<2|j] = -4.343 * bm->lhet[b->c[j]<<8|b->c[k]] + tmp;
			}
		}
	}

	// convert necessary information to glf1_t
	g->ref_base = ref_base; g->max_mapQ = b->rms_mapQ;
	g->depth = n > 16777215? 16777215 : n;
	for (j = 0; j != 4; ++j)
		for (k = j; k < 4; ++k)
			if (p[j<<2|k] < min_p) min_p = p[j<<2|k];
	g->min_lk = min_p > 255.0? 255 : (int)(min_p + 0.5);
	for (j = c = 0; j != 4; ++j)
		for (k = j; k < 4; ++k)
			g->lk[c++] = p[j<<2|k]-min_p > 255.0? 255 : (int)(p[j<<2|k]-min_p + 0.5);

	free(b);
	return g;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r14
movl %edi, %r12d
movl $0x1, %edi
movl $0x10, %esi
callq 0x3530
movb (%rax), %dl
movl %ebp, %ecx
andb $0xf, %cl
andb $-0x10, %dl
orb %cl, %dl
movq %rax, 0x8(%rsp)
movb %dl, (%rax)
testl %r12d, %r12d
je 0x7a70
movb %dl, 0x7(%rsp)
movq 0x38(%r15), %rax
cmpl %r12d, (%rax)
jge 0x72aa
leal -0x1(%r12), %ecx
movl %ecx, %edx
sarl %edx
orl %ecx, %edx
movl %edx, %ecx
sarl $0x2, %ecx
orl %edx, %ecx
movl %ecx, %edx
sarl $0x4, %edx
orl %ecx, %edx
movl %edx, %ecx
sarl $0x8, %ecx
orl %edx, %ecx
movl %ecx, %edx
sarl $0x10, %edx
orl %ecx, %edx
leal 0x1(%rdx), %ecx
movl %ecx, (%rax)
movq 0x8(%rax), %rdi
leal 0x4(,%rdx,4), %eax
movslq %eax, %rsi
callq 0x3610
movq 0x38(%r15), %rcx
movq %rax, 0x8(%rcx)
testl %r12d, %r12d
jle 0x73cb
movzbl %bpl, %eax
movl %r12d, %ecx
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rdx
xorl %esi, %esi
leaq 0x28095(%rip), %rdi     # 0x2f360
xorl %r8d, %r8d
xorl %ebp, %ebp
testb $0x1, 0x14(%r14,%r8)
jne 0x73bc
movq (%r14,%r8), %r9
movq 0x8(%r9), %rcx
movq %rcx, %r11
shrq $0x20, %r11
testb $0x4, %r11b
jne 0x73bc
movq %rcx, %r12
shrq $0x30, %r12
shlq $0x2, %r12
addq 0x30(%r9), %r12
movl %ecx, %r10d
shrl $0x18, %r10d
addq %r12, %r10
movl 0x10(%r9), %r9d
movl %r9d, %r12d
incl %r12d
shrl $0x1f, %r12d
addl %r12d, %r9d
incl %r9d
sarl %r9d
movslq %r9d, %r9
addq %r10, %r9
movslq 0x8(%r14,%r8), %r12
movzbl (%r12,%r9), %r9d
andl $0x10, %r11d
shll $0xe, %r11d
movl %r9d, %r13d
shll $0x8, %r13d
orl %r11d, %r13d
shrl $0x10, %ecx
movzbl %cl, %r11d
cmpl %r9d, %r11d
cmovbl %r11d, %r9d
movl %r12d, %ebx
shrl $0x1f, %ebx
addl %r12d, %ebx
movl %ebx, %ecx
sarl %ecx
movslq %ecx, %rcx
movzbl (%rcx,%r10), %r10d
shll $0x18, %r9d
andl $0x3e, %ebx
subl %ebx, %r12d
shll $0x2, %r12d
movb $0x4, %cl
subb %r12b, %cl
shrl %cl, %r10d
orl %r13d, %r9d
andl $0xf, %r10d
cmovel %eax, %r10d
movzbl (%r10,%rdi), %ecx
movl %ecx, %r10d
shll $0x10, %r10d
addl $0x200000, %r10d        # imm = 0x200000
cmpl $0x4, %ecx
cmovael %esi, %r10d
orl %r9d, %r10d
orl %r11d, %r10d
movq 0x38(%r15), %rcx
movq 0x8(%rcx), %rcx
movslq %ebp, %r9
incl %ebp
movl %r10d, (%rcx,%r9,4)
addq $0x18, %r8
cmpq %r8, %rdx
jne 0x72d0
jmp 0x73cd
xorl %ebp, %ebp
movslq %ebp, %r12
movq 0x38(%r15), %rax
movq 0x8(%rax), %rsi
movq %r12, %rdi
callq 0x672c
movl $0x1, %edi
movl $0x34, %esi
callq 0x3530
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x60(%rsp)
xorpd %xmm1, %xmm1
xorps %xmm0, %xmm0
testl %r12d, %r12d
jle 0x750f
movq 0x38(%r15), %rax
movq 0x8(%rax), %rax
movl 0xc(%r15), %ecx
movl %ebp, %edx
incq %rdx
xorl %esi, %esi
movl $0x4000000, %edi        # imm = 0x4000000
movl -0x8(%rax,%rdx,4), %r9d
movl %r9d, %r8d
andl $0xffffff, %r8d         # imm = 0xFFFFFF
orl %edi, %r8d
testl $0x3f00, %r9d           # imm = 0x3F00
cmovel %r9d, %r8d
cmpl %edi, %r9d
cmovael %r9d, %r8d
cmpl $0x1000000, %r8d        # imm = 0x1000000
jb 0x74cf
movl %r8d, %ebx
shrl $0x18, %ebx
movl %r8d, %r9d
shrl $0x10, %r9d
movl %r9d, %r10d
andl $0x7, %r10d
movq 0x20(%r15), %r12
movslq 0x50(%rsp,%r10,4), %r11
andl $0x3, %r9d
movsd (%r12,%r11,8), %xmm0
xorps %xmm2, %xmm2
cvtsi2sd %ebx, %xmm2
xorps %xmm3, %xmm3
cvtss2sd (%r14,%r9,4), %xmm3
mulsd %xmm0, %xmm2
addsd %xmm3, %xmm2
cvtsd2ss %xmm2, %xmm2
movss %xmm2, (%r14,%r9,4)
xorps %xmm2, %xmm2
cvtss2sd 0x10(%r14,%r9,4), %xmm2
addsd %xmm0, %xmm2
xorps %xmm0, %xmm0
cvtsd2ss %xmm2, %xmm0
movss %xmm0, 0x10(%r14,%r9,4)
cmpq $0xfe, %r11
jg 0x74ca
incl %r11d
movl %r11d, 0x50(%rsp,%r10,4)
incl 0x20(%r14,%r9,4)
movzbl %r8b, %r8d
cmpl %ecx, %r8d
cmovgel %ecx, %r8d
imull %r8d, %r8d
addq %r8, %rsi
decq %rdx
cmpq $0x1, %rdx
jg 0x7427
movq %rsi, %xmm2
punpckldq 0x1cf35(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x1cf3d(%rip), %xmm2    # 0x24440
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
xorps %xmm2, %xmm2
cvtsi2sd %ebp, %xmm2
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x7526
sqrtsd %xmm0, %xmm0
jmp 0x752b
callq 0x3660
addsd 0x1cf6d(%rip), %xmm0    # 0x244a0
cvttsd2si %xmm0, %eax
movzbl %al, %eax
movl %eax, 0x30(%r14)
xorl %eax, %eax
movl $0x8, %ecx
addl (%r14,%rcx,4), %eax
incq %rcx
cmpq $0xc, %rcx
jne 0x7545
cmpl $0x100, %eax            # imm = 0x100
jl 0x75af
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
xorl %eax, %eax
movsd 0x1cf3e(%rip), %xmm1    # 0x244a8
movsd 0x1cf26(%rip), %xmm2    # 0x24498
movl 0x20(%r14,%rax,4), %ecx
xorps %xmm3, %xmm3
cvtsi2sd %rcx, %xmm3
mulsd %xmm1, %xmm3
divsd %xmm0, %xmm3
addsd %xmm2, %xmm3
cvttsd2si %xmm3, %ecx
movl %ecx, 0x20(%r14,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x7572
xorl %ecx, %ecx
xorl %eax, %eax
addl 0x20(%r14,%rcx,4), %eax
incq %rcx
cmpq $0x4, %rcx
jne 0x75a1
cmpl $0x0, 0x10(%r15)
je 0x7697
movl $0x1, %eax
xorl %ecx, %ecx
movsd 0x1cebf(%rip), %xmm0    # 0x24488
xorpd %xmm1, %xmm1
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x75da
addss (%r14,%rdx,4), %xmm1
incq %rdx
cmpq $0x4, %rdx
jne 0x75cf
leal (,%rcx,4), %edx
movl %ecx, %esi
orl %edx, %esi
movslq %esi, %rdx
movss %xmm1, 0x10(%rsp,%rdx,4)
cmpq $0x2, %rcx
ja 0x7682
leaq (,%rcx,4), %rdx
movq 0x30(%r15), %rsi
movl 0x20(%r14,%rcx,4), %edi
shll $0x8, %edi
movq %rax, %r8
xorps %xmm1, %xmm1
xorl %r9d, %r9d
cmpq %r9, %rcx
sete %r10b
cmpq %r9, %r8
sete %r11b
orb %r10b, %r11b
jne 0x7637
addss (%r14,%r9,4), %xmm1
incq %r9
cmpq $0x4, %r9
jne 0x761e
movl 0x20(%r14,%r8,4), %r9d
orl %edi, %r9d
cvtss2sd %xmm1, %xmm1
movsd (%rsi,%r9,8), %xmm2
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
xorps %xmm1, %xmm1
cvtsd2ss %xmm2, %xmm1
leaq (%rcx,%r8,4), %r9
movss %xmm1, 0x10(%rsp,%r9,4)
movq %r8, %r9
orq %rdx, %r9
movss %xmm1, 0x10(%rsp,%r9,4)
incq %r8
cmpq $0x4, %r8
jne 0x7618
incq %rcx
incq %rax
cmpq $0x4, %rcx
jne 0x75c9
jmp 0x796e
shll $0x8, %eax
movl $0x1, %ecx
xorl %r8d, %r8d
movsd 0x1cdde(%rip), %xmm0    # 0x24488
movsd 0x1cde6(%rip), %xmm1    # 0x24498
movl $0x4, %edx
movl $0x3f, %esi
xorpd %xmm2, %xmm2
movq %r8, %rdi
xorl %r9d, %r9d
xorl %r8d, %r8d
xorps %xmm3, %xmm3
xorps %xmm4, %xmm4
cmpq %r9, %rdi
je 0x76e6
addss (%r14,%r9,4), %xmm4
addl 0x20(%r14,%r9,4), %r8d
addss 0x10(%r14,%r9,4), %xmm3
incq %r9
cmpq $0x4, %r9
jne 0x76cf
testl %r8d, %r8d
je 0x773f
xorps %xmm5, %xmm5
cvtss2sd %xmm4, %xmm5
divss %xmm3, %xmm4
xorps %xmm3, %xmm3
cvtss2sd %xmm4, %xmm3
addsd %xmm1, %xmm3
cvttsd2si %xmm3, %r9d
cmpl $0x5, %r9d
cmovll %edx, %r9d
cmpl $0x3f, %r9d
cmovgel %esi, %r9d
movq 0x28(%r15), %r10
shll $0x10, %r9d
orl %eax, %r8d
orl %r9d, %r8d
movslq %r8d, %r8
addsd (%r10,%r8,8), %xmm5
xorps %xmm3, %xmm3
cvtsd2ss %xmm5, %xmm3
jmp 0x7742
xorps %xmm3, %xmm3
leal (,%rdi,4), %r8d
movl %edi, %r9d
orl %r8d, %r9d
movslq %r9d, %r8
movss %xmm3, 0x10(%rsp,%r8,4)
cmpq $0x2, %rdi
ja 0x785e
leaq (,%rdi,4), %r8
movq %rcx, %r9
xorps %xmm4, %xmm4
xorl %r11d, %r11d
xorl %r10d, %r10d
xorps %xmm3, %xmm3
cmpq %r11, %rdi
sete %bl
cmpq %r11, %r9
sete %r12b
orb %bl, %r12b
jne 0x779f
addss (%r14,%r11,4), %xmm3
addl 0x20(%r14,%r11,4), %r10d
addss 0x10(%r14,%r11,4), %xmm4
incq %r11
cmpq $0x4, %r11
jne 0x777b
testl %r10d, %r10d
je 0x7814
movaps %xmm3, %xmm5
divss %xmm4, %xmm5
xorps %xmm4, %xmm4
cvtss2sd %xmm5, %xmm4
addsd %xmm1, %xmm4
cvttsd2si %xmm4, %r11d
cmpl $0x5, %r11d
cmovll %edx, %r11d
cmpl $0x3f, %r11d
cmovgel %esi, %r11d
movq 0x28(%r15), %rbx
movq 0x30(%r15), %r12
movl 0x20(%r14,%rdi,4), %r13d
shll $0x8, %r13d
orl 0x20(%r14,%r9,4), %r13d
xorps %xmm4, %xmm4
cvtss2sd %xmm3, %xmm4
movsd (%r12,%r13,8), %xmm3
mulsd %xmm0, %xmm3
addsd %xmm4, %xmm3
shll $0x10, %r11d
orl %eax, %r10d
orl %r11d, %r10d
movslq %r10d, %r10
addsd (%rbx,%r10,8), %xmm3
jmp 0x7830
movq 0x30(%r15), %r10
movl 0x20(%r14,%rdi,4), %r11d
shll $0x8, %r11d
orl 0x20(%r14,%r9,4), %r11d
movsd (%r10,%r11,8), %xmm3
mulsd %xmm0, %xmm3
cvtsd2ss %xmm3, %xmm3
movq %r9, %r10
shlq $0x4, %r10
leaq (%r10,%rdi,4), %r10
movss %xmm3, 0x10(%rsp,%r10)
leaq (%r9,%r8), %r10
movss %xmm3, 0x10(%rsp,%r10,4)
incq %r9
cmpq $0x4, %r9
jne 0x776f
leaq 0x1(%rdi), %r8
shll $0x2, %edi
xorl %r9d, %r9d
movl %r9d, %r10d
orl %edi, %r10d
movslq %r10d, %r10
ucomiss 0x10(%rsp,%r10,4), %xmm2
jbe 0x7882
movl $0x0, 0x10(%rsp,%r10,4)
incl %r9d
cmpl $0x4, %r9d
jne 0x7868
incq %rcx
cmpq $0x4, %r8
jne 0x76c0
movss 0x1cc20(%rip), %xmm0    # 0x244c0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movaps %xmm0, %xmm1
movaps %xmm1, %xmm2
movss (%r14,%rcx,4), %xmm3
ucomiss %xmm1, %xmm3
jbe 0x78c2
movaps %xmm3, %xmm1
movaps %xmm2, %xmm0
movl %ecx, %eax
jmp 0x78cd
movaps %xmm2, %xmm1
ucomiss %xmm0, %xmm3
jbe 0x78cd
movaps %xmm3, %xmm0
incq %rcx
cmpq $0x4, %rcx
jne 0x78aa
movss 0x1cbe6(%rip), %xmm2    # 0x244c4
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leaq 0x10(%rsp), %rdx
xorl %esi, %esi
movaps %xmm2, %xmm3
movaps %xmm3, %xmm4
movss (%rdx), %xmm5
ucomiss %xmm5, %xmm3
jbe 0x7903
movaps %xmm5, %xmm3
movaps %xmm4, %xmm2
movl %esi, %ecx
jmp 0x790e
movaps %xmm4, %xmm3
ucomiss %xmm5, %xmm2
jbe 0x790e
movaps %xmm5, %xmm2
incq %rsi
addq $0x14, %rdx
cmpq $0x4, %rsi
jne 0x78ed
ucomiss %xmm0, %xmm1
jbe 0x796e
cmpl %eax, %ecx
jne 0x7940
xorps %xmm0, %xmm0
cvtss2sd %xmm3, %xmm0
addsd 0x1cb3d(%rip), %xmm0    # 0x24470
xorps %xmm1, %xmm1
cvtss2sd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x796e
movss 0x1cb78(%rip), %xmm0    # 0x244c0
addss %xmm3, %xmm0
movss 0x1cb74(%rip), %xmm1    # 0x244c8
cmpltss %xmm3, %xmm1
andps %xmm0, %xmm1
leal (,%rax,4), %ecx
orl %eax, %ecx
movslq %ecx, %rax
movss %xmm1, 0x10(%rsp,%rax,4)
movq 0x8(%rsp), %rdx
movb 0x7(%rsp), %al
movb %al, (%rdx)
movb 0x30(%r14), %cl
movl $0xffffff, %eax         # imm = 0xFFFFFF
cmpl %eax, %ebp
cmovll %ebp, %eax
movb %cl, 0x1(%rdx)
movzbl 0xc(%rdx), %ecx
shll $0x8, %eax
orl %eax, %ecx
movl %ecx, 0xc(%rdx)
movss 0x1cb26(%rip), %xmm0    # 0x244c4
leaq 0x10(%rsp), %rcx
xorl %edx, %edx
movq $-0x4, %rsi
movaps %xmm0, %xmm1
movss 0x10(%rcx,%rsi,4), %xmm0
minss %xmm1, %xmm0
incq %rsi
movq %rdx, %rdi
addq %rsi, %rdi
jne 0x79ac
incq %rdx
addq $0x14, %rcx
cmpq $0x4, %rdx
jne 0x79a5
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
addsd 0x1cab8(%rip), %xmm1    # 0x24498
cvttsd2si %xmm1, %edx
movl $0xff, %ecx
andl %ecx, %edx
ucomiss 0x1cada(%rip), %xmm0    # 0x244cc
cmoval %ecx, %edx
orl %eax, %edx
movq 0x8(%rsp), %rax
movl %edx, 0xc(%rax)
addq $0x2, %rax
leaq 0x10(%rsp), %rdx
xorl %esi, %esi
movss 0x1caba(%rip), %xmm1    # 0x244cc
movsd 0x1ca7e(%rip), %xmm2    # 0x24498
xorl %edi, %edi
movslq %edi, %rdi
leaq (%rax,%rdi), %r9
xorl %r8d, %r8d
movss (%rdx,%r8,4), %xmm3
subss %xmm0, %xmm3
ucomiss %xmm1, %xmm3
cvtss2sd %xmm3, %xmm3
addsd %xmm2, %xmm3
cvttsd2si %xmm3, %r10d
cmoval %ecx, %r10d
movb %r10b, (%r9,%r8)
leaq (%rsi,%r8), %r10
incq %r10
incq %r8
cmpq $0x4, %r10
jne 0x7a26
incq %rsi
addq %r8, %rdi
addq $0x14, %rdx
cmpq $0x4, %rsi
jne 0x7a1c
movq %r14, %rdi
callq 0x32c0
movq 0x8(%rsp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq