// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/phase.c
// Function: phase
static int phase(phaseg_t *g, const char *chr, int vpos, uint64_t *cns, nseq_t *hash)
{
	int i, j, n_seqs = kh_size(hash), n_masked = 0, min_pos;
	khint_t k;
	frag_t **seqs;
	int8_t *path, *sitemask;
	uint64_t *pcnt, *regmask;

	if (vpos == 0) return 0;
	i = clean_seqs(vpos, hash); // i is true if hash has an element with its vpos >= vpos
	min_pos = i? cns[vpos]>>32 : 0x7fffffff;
	if (vpos == 1) {
		printf("PS\t%s\t%d\t%d\n", chr, (int)(cns[0]>>32) + 1, (int)(cns[0]>>32) + 1);
		printf("M0\t%s\t%d\t%d\t%c\t%c\t%d\t0\t0\t0\t0\n//\n", chr, (int)(cns[0]>>32) + 1, (int)(cns[0]>>32) + 1,
			"ACGTX"[cns[0]&3], "ACGTX"[cns[0]>>16&3], g->vpos_shift + 1);
		for (k = 0; k < kh_end(hash); ++k) {
			if (kh_exist(hash, k)) {
				frag_t *f = &kh_val(hash, k);
				if (f->vpos) continue;
				f->flip = 0;
				if (f->seq[0] == 0) f->phased = 0;
				else f->phased = 1, f->phase = f->seq[0] - 1;
			}
		}
		dump_aln(g, min_pos, hash);
		++g->vpos_shift;
		return 1;
	}
	{ // phase
		int **cnt;
		uint64_t *mask;
		printf("PS\t%s\t%d\t%d\n", chr, (int)(cns[0]>>32) + 1, (int)(cns[vpos-1]>>32) + 1);
		sitemask = calloc(vpos, 1);
		cnt = count_all(g->k, vpos, hash);
		path = dynaprog(g->k, vpos, cnt);
		for (i = 0; i < vpos; ++i) free(cnt[i]);
		free(cnt);
		pcnt = fragphase(vpos, path, hash, 0); // do not fix chimeras when masking
		mask = genmask(vpos, pcnt, &n_masked);
		regmask = calloc(n_masked, 8);
		for (i = 0; i < n_masked; ++i) {
			regmask[i] = cns[mask[i]>>32]>>32<<32 | cns[(uint32_t)mask[i]]>>32;
			for (j = mask[i]>>32; j <= (int32_t)mask[i]; ++j)
				sitemask[j] = 1;
		}
		free(mask);
		if (g->flag & FLAG_FIX_CHIMERA) {
			free(pcnt);
			pcnt = fragphase(vpos, path, hash, 1);
		}
	}
	for (i = 0; i < n_masked; ++i)
		printf("FL\t%s\t%d\t%d\n", chr, (int)(regmask[i]>>32) + 1, (int)regmask[i] + 1);
	for (i = 0; i < vpos; ++i) {
		uint64_t x = pcnt[i];
		int8_t c[2];
		c[0] = (cns[i]&0xffff)>>2 == 0? 4 : (cns[i]&3);
		c[1] = (cns[i]>>16&0xffff)>>2 == 0? 4 : (cns[i]>>16&3);
		printf("M%d\t%s\t%d\t%d\t%c\t%c\t%d\t%d\t%d\t%d\t%d\n", sitemask[i]+1, chr, (int)(cns[0]>>32) + 1, (int)(cns[i]>>32) + 1, "ACGTX"[c[path[i]]], "ACGTX"[c[1-path[i]]],
			i + g->vpos_shift + 1, (int)(x&0xffff), (int)(x>>16&0xffff), (int)(x>>32&0xffff), (int)(x>>48&0xffff));
	}
	free(path); free(pcnt); free(regmask); free(sitemask);
	seqs = calloc(n_seqs, sizeof(void*));
	for (k = 0, i = 0; k < kh_end(hash); ++k) 
		if (kh_exist(hash, k) && kh_val(hash, k).vpos < vpos && !kh_val(hash, k).single)
			seqs[i++] = &kh_val(hash, k);
	n_seqs = i;
	ks_introsort_rseq(n_seqs, seqs);
	for (i = 0; i < n_seqs; ++i) {
		frag_t *f = seqs[i];
		printf("EV\t0\t%s\t%d\t40\t%dM\t*\t0\t0\t", chr, f->vpos + 1 + g->vpos_shift, f->vlen);
		for (j = 0; j < f->vlen; ++j) {
			uint32_t c = cns[f->vpos + j];
			if (f->seq[j] == 0) putchar('N');
			else putchar("ACGT"[f->seq[j] == 1? (c&3) : (c>>16&3)]);
		}
		printf("\t*\tYP:i:%d\tYF:i:%d\tYI:i:%d\tYO:i:%d\tYS:i:%d\n", f->phase, f->flip, f->in, f->out, f->beg+1);
	}
	free(seqs);
	printf("//\n");
	fflush(stdout);
	g->vpos_shift += vpos;
	dump_aln(g, min_pos, hash);
	return vpos;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
testl %edx, %edx
je 0x197ca
movq %rcx, %r9
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, 0x38(%rsp)
movslq 0x4(%r8), %rax
movq %rax, 0x80(%rsp)
movl (%r8), %eax
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
testl %eax, %eax
movq %r8, 0x28(%rsp)
movq %rsi, 0x58(%rsp)
movq %r12, 0x18(%rsp)
movq %rcx, 0x40(%rsp)
je 0x196aa
xorl %r15d, %r15d
xorl %ebx, %ebx
xorl %r9d, %r9d
movl %r9d, %r10d
movq 0x10(%r8), %rdx
movl %ebx, %esi
shrl $0x4, %esi
movl (%rdx,%rsi,4), %edi
leal (%rbx,%rbx), %ecx
andl $0x1e, %ecx
movl %edi, %r9d
shrl %cl, %r9d
testb $0x3, %r9b
je 0x19581
movl %r10d, %r9d
jmp 0x19678
movq 0x20(%r8), %rbp
imulq $0x114, %rbx, %r14      # imm = 0x114
movl $0x1, %r9d
cmpl %r12d, 0x100(%rbp,%r14)
jge 0x19678
movl %r10d, 0x8(%rsp)
addq %rbp, %r14
movq 0x10c(%r14), %r9
movl %r9d, %r12d
andl $0xffff, %r12d          # imm = 0xFFFF
je 0x195d8
movzwl %r9w, %r10d
leaq (%r15,%rbp), %r13
xorl %r11d, %r11d
cmpb $0x0, (%r13,%r11)
jne 0x195dd
incq %r11
cmpq %r11, %r10
jne 0x195c6
jmp 0x195e0
xorl %r12d, %r12d
jmp 0x195e5
movl %r11d, %r12d
movq 0x28(%rsp), %r8
movzwl %r9w, %r9d
addq %r15, %rbp
testq %r9, %r9
jle 0x19605
leaq -0x1(%r9), %r13
cmpb $0x0, -0x1(%rbp,%r9)
movq %r13, %r9
je 0x195ec
incl %r13d
jmp 0x19608
xorl %r13d, %r13d
subl %r12d, %r13d
jle 0x1965d
testl %r12d, %r12d
je 0x19628
movl %r12d, %esi
addq %r14, %rsi
movl %r13d, %edx
movq %r14, %rdi
callq 0x34e0
movq 0x28(%rsp), %r8
addl %r12d, 0x100(%r14)
movzwl %r13w, %eax
movq 0x10c(%r14), %rcx
movq $-0x20000, %rdx         # imm = 0xFFFE0000
andq %rdx, %rcx
xorl %edx, %edx
cmpl $0x1, %eax
sete %dl
shll $0x10, %edx
orl %eax, %edx
orq %rcx, %rdx
movq %rdx, 0x10c(%r14)
jmp 0x1966e
movl %eax, %eax
cmpq %rax, %rbx
je 0x1966e
btsl %ecx, %edi
movl %edi, (%rdx,%rsi,4)
decl 0x4(%r8)
movl 0x8(%rsp), %r9d
movq 0x18(%rsp), %r12
incq %rbx
movl (%r8), %eax
addq $0x114, %r15            # imm = 0x114
cmpq %rax, %rbx
jb 0x19558
testl %r9d, %r9d
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movq 0x58(%rsp), %r14
movq 0x40(%rsp), %r9
je 0x196aa
movslq %r12d, %rax
movl 0x4(%r9,%rax,8), %ebp
movl 0x4(%r9), %edx
incl %edx
cmpl $0x1, %r12d
jne 0x197dc
leaq 0x279ad(%rip), %rdi     # 0x4106e
xorl %ebx, %ebx
movq %r14, %rsi
movl %edx, %ecx
xorl %eax, %eax
movq %r9, %r15
callq 0x3060
movq (%r15), %rax
movq %rax, %rcx
shrq $0x20, %rcx
incl %ecx
movl %eax, %edx
andl $0x3, %edx
leaq 0x279b2(%rip), %rsi     # 0x4109c
movsbl (%rdx,%rsi), %r8d
shrl $0x10, %eax
andl $0x3, %eax
movsbl (%rax,%rsi), %r9d
movq 0x38(%rsp), %rax
movl 0x14(%rax), %r10d
incl %r10d
subq $0x8, %rsp
leaq 0x2796a(%rip), %rdi     # 0x4107b
movq %r14, %rsi
movl %ecx, %edx
xorl %eax, %eax
pushq %r10
callq 0x3060
addq $0x10, %rsp
movq 0x28(%rsp), %rdx
cmpl $0x0, (%rdx)
je 0x197b8
movl $0x86, %eax
xorl %r8d, %r8d
movq 0x10(%rdx), %rcx
movl %r8d, %esi
shrl $0x4, %esi
movl (%rcx,%rsi,4), %esi
movl %ebx, %ecx
andb $0x1e, %cl
shrl %cl, %esi
testb $0x3, %sil
jne 0x197a5
movq 0x20(%rdx), %rcx
cmpl $0x0, -0xc(%rcx,%rax,2)
jne 0x197a5
movq (%rcx,%rax,2), %rsi
movq %rsi, %rdi
andq $-0x20001, %rdi         # imm = 0xFFFDFFFF
movq %rdi, (%rcx,%rax,2)
movzbl -0x10c(%rcx,%rax,2), %edi
andq $-0xa0001, %rsi         # imm = 0xFFF5FFFF
testq %rdi, %rdi
je 0x197a1
orq $0x80000, %rsi          # imm = 0x80000
movq %rsi, (%rcx,%rax,2)
notl %edi
andl $0x1, %edi
shll $0x12, %edi
andq $-0x60001, %rsi         # imm = 0xFFF9FFFF
orq %rdi, %rsi
movq %rsi, (%rcx,%rax,2)
incq %r8
movl (%rdx), %ecx
addq $0x8a, %rax
addl $0x2, %ebx
cmpq %rcx, %r8
jb 0x19739
movq 0x38(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1a571
incl 0x14(%rbx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, 0x6c(%rsp)
movslq %r12d, %r15
movl -0x4(%r9,%r15,8), %ecx
incl %ecx
leaq 0x2787d(%rip), %rdi     # 0x4106e
movq %r14, %rsi
xorl %eax, %eax
callq 0x3060
movl $0x1, %esi
movq %r15, %rdi
callq 0x3610
movq %rax, 0x78(%rsp)
movq 0x38(%rsp), %rax
movslq 0x4(%rax), %rdi
movl $0x1, %esi
movq %rdi, 0x30(%rsp)
callq 0x3610
movq %r12, %rbx
movq %rax, %r12
movl $0x8, %esi
movq %r15, 0x70(%rsp)
movq %r15, %rdi
callq 0x3610
movq %rax, 0x8(%rsp)
movl %ebx, %r15d
testl %ebx, %ebx
jle 0x19878
movl $0x1, %eax
movq 0x30(%rsp), %rcx
shll %cl, %eax
movslq %eax, %r14
xorl %ebx, %ebx
movl $0x4, %esi
movq %r14, %rdi
callq 0x3610
movq 0x8(%rsp), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
cmpq %rbx, %r15
jne 0x1985a
movq %r15, 0x60(%rsp)
movq 0x28(%rsp), %rdx
cmpl $0x0, (%rdx)
je 0x19a3c
movq 0x30(%rsp), %rcx
movl %ecx, %eax
movl $0x2, %esi
subq %rcx, %rsi
decq %rcx
movq %rcx, 0x48(%rsp)
xorl %edi, %edi
movq 0x10(%rdx), %rcx
movl %edi, %r8d
shrl $0x4, %r8d
movl (%rcx,%r8,4), %r8d
leal (%rdi,%rdi), %ecx
shrl %cl, %r8d
testb $0x3, %r8b
jne 0x19a27
movq 0x20(%rdx), %r9
imulq $0x114, %rdi, %r10      # imm = 0x114
movq 0x18(%rsp), %rcx
cmpl %ecx, 0x100(%r9,%r10)
jge 0x19a27
movq %r10, %r8
addq %r9, %r8
movq %r8, 0x20(%rsp)
movq 0x10c(%r8), %rcx
btl $0x10, %ecx
jb 0x19a27
cmpw $0x1, %cx
jne 0x1991b
orq $0x10000, %rcx          # imm = 0x10000
movq 0x20(%rsp), %r8
movq %rcx, 0x10c(%r8)
jmp 0x19a27
testl $0xfffe, %ecx           # imm = 0xFFFE
je 0x19a27
addq %rsi, %r9
movl $0x1, %r10d
movq %rsi, 0x50(%rsp)
testl %eax, %eax
jle 0x1995d
movq 0x48(%rsp), %rcx
xorl %r11d, %r11d
cmpq %rcx, %r10
jge 0x1994a
xorl %ebx, %ebx
jmp 0x1994e
movb (%r9,%r11), %bl
movb %bl, (%r12,%r11)
incq %r11
decq %rcx
cmpq %r11, %rax
jne 0x19941
movq 0x30(%rsp), %rcx
cmpb $0x0, -0x1(%r12,%rcx)
je 0x19a02
cmpl $0x0, 0x30(%rsp)
jle 0x1998c
xorl %r11d, %r11d
xorl %ecx, %ecx
cmpb $0x1, (%r12,%r11)
adcl $0x0, %ecx
incq %r11
cmpq %r11, %rax
jne 0x1997a
jmp 0x1998e
xorl %ecx, %ecx
movl %eax, %r11d
subl %ecx, %r11d
cmpl $0x2, %r11d
jl 0x19a02
movq 0x20(%rsp), %rdx
movslq 0x100(%rdx), %r11
movq 0x8(%rsp), %rdx
leaq (%rdx,%r10,8), %rbx
movq (%rbx,%r11,8), %r11
xorl %ebx, %ebx
xorl %r14d, %r14d
testl %eax, %eax
jle 0x199f4
xorl %ebp, %ebp
xorl %r15d, %r15d
movzbl (%r12,%r14), %r13d
leal -0x1(%r13), %esi
xorl %r8d, %r8d
btl %r15d, %ebx
setb %r8b
xorl %edx, %edx
testl %r13d, %r13d
sete %dl
cmovnel %esi, %r8d
addl %edx, %r15d
addl %ebp, %ebp
orl %r8d, %ebp
incq %r14
cmpq %r14, %rax
jne 0x199c1
movl %ebp, %r14d
incl (%r11,%r14,4)
incl %ebx
movl %ebx, %edx
shrl %cl, %edx
testl %edx, %edx
je 0x199b5
incq %r10
movq 0x20(%rsp), %rcx
movzwl 0x10c(%rcx), %ecx
incq %r9
cmpq %rcx, %r10
movq 0x28(%rsp), %rdx
movq 0x50(%rsp), %rsi
jb 0x19935
incq %rdi
movl (%rdx), %ecx
addq $0x114, %rsi            # imm = 0x114
cmpq %rcx, %rdi
jb 0x198a4
movq %r12, %rdi
callq 0x3350
movq 0x38(%rsp), %rax
movb 0x4(%rax), %al
leal -0x1(%rax), %ecx
movl $0x1, %r14d
shll %cl, %r14d
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %eax, %ecx
shll %cl, %r15d
movl $0x4, %esi
movq %r14, %rdi
callq 0x3610
movq %rax, %r12
movl $0x4, %esi
movq %r14, %rdi
callq 0x3610
movq %rax, 0x48(%rsp)
movl $0x8, %esi
movq 0x70(%rsp), %rdi
callq 0x3610
movq %rax, 0x20(%rsp)
notl %r15d
movq %r12, 0x50(%rsp)
cmpl $0x0, 0x18(%rsp)
movq 0x8(%rsp), %rcx
jle 0x19b29
xorl %r13d, %r13d
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rbx
movq %rax, %r12
movq (%rcx,%r13,8), %rbp
movl $0x1, %esi
movq %r14, %rdi
callq 0x3610
movq 0x20(%rsp), %rcx
movq %rax, (%rcx,%r13,8)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %edx, %edx
movl %ecx, %esi
andl %r15d, %esi
movl %edx, %edi
shrl %edi
movl (%rbx,%rdi,4), %edi
movl (%rbp,%rsi,4), %r8d
andl $-0x2, %esi
addl (%rbp,%rdx,4), %r8d
movl (%rbx,%rsi,2), %esi
cmpl %esi, %edi
cmovgl %edi, %esi
setle (%rax,%rdx)
addl %r8d, %esi
movl %esi, (%r12,%rdx,4)
incq %rdx
decl %ecx
cmpq %rdx, %r14
jne 0x19ade
incq %r13
movq %rbx, %rax
movq %r12, %rbx
cmpq 0x60(%rsp), %r13
movq 0x8(%rsp), %rcx
jne 0x19aba
movl $0x1, %esi
movq 0x70(%rsp), %rdi
callq 0x3610
movq %rax, 0x30(%rsp)
xorl %ecx, %ecx
xorl %eax, %eax
xorl %edx, %edx
movl (%r12,%rcx,4), %esi
cmpl %edx, %esi
cmovgl %esi, %edx
cmovgl %ecx, %eax
incq %rcx
cmpq %rcx, %r14
jne 0x19b43
movq 0x18(%rsp), %r14
testl %r14d, %r14d
movq 0x60(%rsp), %r12
movq 0x20(%rsp), %r13
jle 0x19bd2
leaq 0x1(%r12), %rcx
xorl %edx, %edx
xorl %esi, %esi
xorl %r8d, %r8d
testl %edx, %edx
sete %dil
setne %r8b
movl %eax, %r9d
andl $0x1, %r9d
xorl %r9d, %r8d
movq 0x30(%rsp), %r9
movb %r8b, -0x2(%r9,%rcx)
movq -0x10(%r13,%rcx,8), %r8
movl %eax, %r9d
cmpb $0x0, (%r8,%r9)
je 0x19bae
notl %eax
andl %r15d, %eax
movb %dil, %sil
movl %esi, %edx
shrl %eax
decq %rcx
cmpq $0x1, %rcx
jg 0x19b72
testl %r14d, %r14d
jle 0x19bd2
xorl %ebx, %ebx
movq (%r13,%rbx,8), %rdi
callq 0x3350
incq %rbx
cmpq %rbx, %r12
jne 0x19bc0
movq 0x50(%rsp), %rdi
callq 0x3350
movq 0x48(%rsp), %rdi
callq 0x3350
movq %r13, %rdi
callq 0x3350
testl %r14d, %r14d
movq 0x8(%rsp), %r15
jle 0x19c0b
xorl %ebx, %ebx
movq (%r15,%rbx,8), %rdi
callq 0x3350
incq %rbx
cmpq %rbx, %r12
jne 0x19bfa
movq %r15, %rdi
callq 0x3350
xorl %r15d, %r15d
movl %r14d, %edi
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
xorl %ecx, %ecx
callq 0x1a7c7
movq %rax, %r13
testl %r14d, %r14d
jle 0x19d60
leal -0x1(%r14), %ebp
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
xorl %ecx, %ecx
xorl %r14d, %r14d
xorl %eax, %eax
xorl %r15d, %r15d
xorl %ebx, %ebx
xorl %r12d, %r12d
xorl %edx, %edx
movl %ebp, 0x20(%rsp)
movslq %ecx, %rsi
movq (%r13,%rsi,8), %rdi
movl %edi, %r8d
movl $0xffff, %r10d          # imm = 0xFFFF
andl %r10d, %r8d
movl %edi, %esi
shrl $0x10, %esi
movq %rdi, %r9
shrq $0x20, %r9
andl %r10d, %r9d
shrq $0x30, %rdi
leal (%rsi,%rdi), %r10d
leal (%r8,%r9), %r11d
negl %r11d
subl $0x1, %r10d
cmovbl %r11d, %r10d
subl %r9d, %edi
movl $0x0, %r9d
cmovbl %r9d, %edi
subl %r8d, %esi
cmovbl %r9d, %esi
addl %edx, %esi
addl %edi, %esi
addl %r10d, %esi
movl %ecx, %edi
testl %esi, %esi
jg 0x19cb4
movl %ebx, %edi
setle %r8b
testl %edx, %edx
cmovel %edi, %ebx
cmpl %ebp, %ecx
sete %dl
orb %r8b, %dl
cmpb $0x1, %dl
jne 0x19d2e
cmpl $0x3, %r14d
jl 0x19d2e
cmpl %eax, %r15d
jne 0x19d0d
movq %r15, %rbp
movq %r13, %r15
leal (%rax,%rax), %r13d
testl %eax, %eax
movl $0x4, %eax
cmovel %eax, %r13d
leal (,%r13,8), %eax
movslq %eax, %rsi
movq %r12, %rdi
callq 0x3720
movq %rax, %r12
movl %r13d, %eax
movq %r15, %r13
movq %rbp, %r15
movl 0x20(%rsp), %ebp
movq %rbx, %rcx
shlq $0x20, %rcx
movl 0x8(%rsp), %esi
movslq %esi, %rdx
orq %rcx, %rdx
movslq %r15d, %rcx
incl %r15d
movq %rdx, (%r12,%rcx,8)
xorl %edx, %edx
movl %esi, %ecx
jmp 0x19d4c
movl %esi, %edx
testl %esi, %esi
jg 0x19d36
xorl %edx, %edx
movl %ecx, %edi
cmpl %r14d, %esi
jg 0x19d41
movl 0x8(%rsp), %edi
cmpl %r14d, %edx
cmovgl %edx, %r14d
movl %edi, 0x8(%rsp)
testl %edx, %edx
cmovel %edx, %r14d
incl %ecx
cmpl 0x18(%rsp), %ecx
jl 0x19c57
jmp 0x19d63
xorl %r12d, %r12d
movslq %r15d, %r14
movl $0x8, %esi
movq %r14, %rdi
callq 0x3610
movq %rax, %rbp
movl %r15d, %ebx
testl %r14d, %r14d
movq 0x58(%rsp), %r14
movq 0x40(%rsp), %rsi
movq 0x78(%rsp), %rdi
jle 0x19ddc
xorl %eax, %eax
movq (%r12,%rax,8), %rcx
movl %ecx, %edx
shrq $0x20, %rcx
movl 0x4(%rsi,%rcx,8), %ecx
shlq $0x20, %rcx
movl 0x4(%rsi,%rdx,8), %edx
orq %rcx, %rdx
movq %rdx, (%rbp,%rax,8)
movq (%r12,%rax,8), %rcx
movq %rcx, %rdx
shrq $0x20, %rdx
cmpl %ecx, %edx
jg 0x19dd4
sarq $0x20, %rcx
decq %rcx
movb $0x1, 0x1(%rdi,%rcx)
movslq (%r12,%rax,8), %rdx
incq %rcx
cmpq %rdx, %rcx
jl 0x19dc3
incq %rax
cmpq %rbx, %rax
jne 0x19d8f
movq %r12, %rdi
callq 0x3350
movq 0x38(%rsp), %rax
testb $0x1, (%rax)
je 0x19e12
movq %r13, %rdi
callq 0x3350
movq 0x18(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
movl $0x1, %ecx
callq 0x1a7c7
movq %rax, %r13
testl %r15d, %r15d
jle 0x19e46
leaq 0x27284(%rip), %r12     # 0x410a2
xorl %r15d, %r15d
movq (%rbp,%r15,8), %rcx
movq %rcx, %rdx
shrq $0x20, %rdx
incl %edx
incl %ecx
movq %r12, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x3060
incq %r15
cmpq %r15, %rbx
jne 0x19e21
movq %rbp, 0x20(%rsp)
cmpl $0x0, 0x18(%rsp)
movq 0x38(%rsp), %r10
movq 0x40(%rsp), %rdx
movq 0x78(%rsp), %r12
jle 0x19f5d
xorl %eax, %eax
movq %r13, 0x8(%rsp)
movq (%r13,%rax,8), %rbx
movq (%rdx,%rax,8), %r8
movl %r8d, %ecx
andb $0x3, %cl
testl $0xfffc, %r8d           # imm = 0xFFFC
movzbl %cl, %ecx
movl $0x4, %esi
cmovel %esi, %ecx
movb %cl, 0x16(%rsp)
movl %r8d, %ecx
shrl $0x10, %ecx
andb $0x3, %cl
testl $0xfffc0000, %r8d       # imm = 0xFFFC0000
movzbl %cl, %ecx
cmovel %esi, %ecx
movb %cl, 0x17(%rsp)
movsbl (%r12,%rax), %esi
incl %esi
movl 0x4(%rdx), %ecx
incl %ecx
shrq $0x20, %r8
incl %r8d
movq 0x30(%rsp), %rdx
movsbq (%rdx,%rax), %rdx
movsbq 0x16(%rsp,%rdx), %rdi
leaq 0x271c7(%rip), %r11     # 0x4109c
movsbl (%rdi,%r11), %r9d
leaq 0x16(%rsp), %rdi
subq %rdx, %rdi
movsbq 0x1(%rdi), %rdx
movsbl (%rdx,%r11), %r11d
leaq 0x1(%rax), %r13
movl 0x14(%r10), %edx
leal (%rax,%rdx), %ebp
incl %ebp
movl %ebx, %r15d
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %r15d
movl %ebx, %r10d
shrl $0x10, %r10d
movq %rbx, %r14
shrq $0x20, %r14
andl %eax, %r14d
shrq $0x30, %rbx
leaq 0x2718f(%rip), %rdi     # 0x410af
movq 0x58(%rsp), %rdx
xorl %eax, %eax
pushq %rbx
pushq %r14
pushq %r10
pushq %r15
pushq %rbp
pushq %r11
callq 0x3060
movq 0x90(%rsp), %rcx
movq 0x70(%rsp), %rdx
movq 0x68(%rsp), %r10
addq $0x30, %rsp
movq %r13, %rax
cmpq %r13, %rcx
movq 0x8(%rsp), %r13
jne 0x19e6c
movq 0x30(%rsp), %rdi
callq 0x3350
movq %r13, %rdi
callq 0x3350
movq 0x20(%rsp), %rdi
callq 0x3350
movq %r12, %rdi
callq 0x3350
movl $0x8, %esi
movq 0x80(%rsp), %rdi
callq 0x3610
movq %rax, %r14
movq 0x28(%rsp), %r10
movl (%r10), %eax
testq %rax, %rax
je 0x1a008
movq 0x10(%r10), %rdx
movl $0x100, %esi            # imm = 0x100
xorl %edi, %edi
xorl %r8d, %r8d
xorl %ebx, %ebx
movq 0x18(%rsp), %r11
movl %r8d, %ecx
shrl $0x4, %ecx
movl (%rdx,%rcx,4), %r9d
movl %edi, %ecx
andb $0x1e, %cl
shrl %cl, %r9d
testb $0x3, %r9b
jne 0x19ff4
movq 0x20(%r10), %rcx
cmpl %r11d, (%rcx,%rsi)
jge 0x19ff4
testb $0x1, 0xe(%rcx,%rsi)
jne 0x19ff4
addq %rsi, %rcx
addq $-0x100, %rcx
movslq %ebx, %r9
incl %ebx
movq %rcx, (%r14,%r9,8)
incq %r8
addq $0x114, %rsi            # imm = 0x114
addl $0x2, %edi
cmpq %r8, %rax
jne 0x19fb8
jmp 0x1a00a
xorl %ebx, %ebx
movslq %ebx, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1809f
testl %r15d, %r15d
jle 0x1a103
movl %ebx, %ebx
leaq 0x24198(%rip), %rbp     # 0x3e1c2
xorl %r15d, %r15d
movq (%r14,%r15,8), %r12
movl 0x100(%r12), %eax
movq 0x38(%rsp), %rcx
movl 0x14(%rcx), %ecx
leal (%rax,%rcx), %edx
incl %edx
movzwl 0x10c(%r12), %ecx
leaq 0x2707c(%rip), %rdi     # 0x410d2
movq 0x58(%rsp), %rsi
xorl %eax, %eax
callq 0x3060
movq 0x10c(%r12), %r8
testw %r8w, %r8w
je 0x1a0be
xorl %r13d, %r13d
movzbl (%r12,%r13), %ecx
testl %ecx, %ecx
je 0x1a0a0
movslq 0x100(%r12), %rax
addq %r13, %rax
movq 0x40(%rsp), %rdx
movl (%rdx,%rax,8), %eax
cmpl $0x1, %ecx
je 0x1a097
shrl $0x10, %eax
andl $0x3, %eax
movsbl (%rax,%rbp), %edi
jmp 0x1a0a5
movl $0x4e, %edi
callq 0x31e0
incq %r13
movq 0x10c(%r12), %r8
movzwl %r8w, %eax
cmpq %rax, %r13
jb 0x1a073
movl %r8d, %edx
movl %r8d, %esi
shrl $0x12, %esi
andl $0x1, %esi
shrl $0x11, %edx
andl $0x1, %edx
movq %r8, %rax
shrq $0x20, %rax
movzwl %ax, %ecx
shrq $0x30, %r8
movl 0x104(%r12), %r9d
incl %r9d
leaq 0x26ffb(%rip), %rdi     # 0x410eb
xorl %eax, %eax
callq 0x3060
incq %r15
cmpq %rbx, %r15
jne 0x1a02d
movq %r14, %rdi
callq 0x3350
leaq 0x28fdf(%rip), %rdi     # 0x430f1
callq 0x3150
movq 0x34eda(%rip), %rax     # 0x4eff8
movq (%rax), %rdi
callq 0x3800
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rax
addl %eax, 0x14(%rdi)
movl 0x6c(%rsp), %esi
movq 0x28(%rsp), %rdx
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1a571