// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_tview.c
// Function: tv_pl_func
int tv_pl_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *pl, void *data)
{
	extern unsigned char bam_nt16_table[256];
	tview_t *tv = (tview_t*)data;
	int i, j, c, rb, attr, max_ins = 0;
	uint32_t call = 0;
	if (pos < tv->left_pos || tv->ccol > tv->mcol) return 0; // out of screen
	// print referece
	rb = (tv->ref && pos - tv->left_pos < tv->l_ref)? tv->ref[pos - tv->left_pos] : 'N';
	for (i = tv->last_pos + 1; i < pos; ++i) {
		if (i%10 == 0 && tv->mcol - tv->ccol >= 10) tv->my_mvprintw(tv,0, tv->ccol, "%-d", i+1);
		c = tv->ref? tv->ref[i - tv->left_pos] : 'N';
		tv->my_mvaddch(tv,1, tv->ccol++, c);
	}
	if (pos%10 == 0 && tv->mcol - tv->ccol >= 10) tv->my_mvprintw(tv,0, tv->ccol, "%-d", pos+1);
	{ // call consensus
		bcf_callret1_t bcr;
		int qsum[4], a1, a2, tmp;
		double p[3], prior = 30;
		bcf_call_glfgen(n, pl, bam_nt16_table[rb], tv->bca, &bcr);
		for (i = 0; i < 4; ++i) qsum[i] = bcr.qsum[i]<<2 | i;
		for (i = 1; i < 4; ++i) // insertion sort
			for (j = i; j > 0 && qsum[j] > qsum[j-1]; --j)
				tmp = qsum[j], qsum[j] = qsum[j-1], qsum[j-1] = tmp;
		a1 = qsum[0]&3; a2 = qsum[1]&3;
		p[0] = bcr.p[a1*5+a1]; p[1] = bcr.p[a1*5+a2] + prior; p[2] = bcr.p[a2*5+a2];
		if ("ACGT"[a1] != toupper(rb)) p[0] += prior + 3;
		if ("ACGT"[a2] != toupper(rb)) p[2] += prior + 3;
		if (p[0] < p[1] && p[0] < p[2]) call = (1<<a1)<<16 | (int)((p[1]<p[2]?p[1]:p[2]) - p[0] + .499);
		else if (p[2] < p[1] && p[2] < p[0]) call = (1<<a2)<<16 | (int)((p[0]<p[1]?p[0]:p[1]) - p[2] + .499);
		else call = (1<<a1|1<<a2)<<16 | (int)((p[0]<p[2]?p[0]:p[2]) - p[1] + .499);
	}
	attr = tv->my_underline(tv);
	c = ",ACMGRSVTWYHKDBN"[call>>16&0xf];
	i = (call&0xffff)/10+1;
	if (i > 4) i = 4;
	attr |= tv->my_colorpair(tv,i);
	if (c == toupper(rb)) c = '.';
	tv->my_attron(tv,attr);
	tv->my_mvaddch(tv,2, tv->ccol, c);
	tv->my_attroff(tv,attr);
	if(tv->ins) {
		// calculate maximum insert
		for (i = 0; i < n; ++i) {
			const bam_pileup1_t *p = pl + i;
			if (p->indel > 0 && max_ins < p->indel) max_ins = p->indel;
		}
	}
	// core loop
	for (j = 0; j <= max_ins; ++j) {
		for (i = 0; i < n; ++i) {
			const bam_pileup1_t *p = pl + i;
			int row = TV_MIN_ALNROW + p->level - tv->row_shift;
			if (j == 0) {
				if (!p->is_del) {
					if (tv->base_for == TV_BASE_COLOR_SPACE && 
							(c = bam_aux_getCSi(p->b, p->qpos))) {
						// assume that if we found one color, we will be able to get the color error
						if (tv->is_dot && '-' == bam_aux_getCEi(p->b, p->qpos)) c = bam1_strand(p->b)? ',' : '.';
					} else {
						if (tv->show_name) {
							char *name = bam1_qname(p->b);
							c = (p->qpos + 1 >= p->b->core.l_qname)? ' ' : name[p->qpos];
						} else {
							c = bam_nt16_rev_table[bam1_seqi(bam1_seq(p->b), p->qpos)];
							if (tv->is_dot && toupper(c) == toupper(rb)) c = bam1_strand(p->b)? ',' : '.';
						}
					}
				} else c = p->is_refskip? (bam1_strand(p->b)? '<' : '>') : '*';
			} else { // padding
				if (j > p->indel) c = '*';
				else { // insertion
					if (tv->base_for ==  TV_BASE_NUCL) {
						if (tv->show_name) {
							char *name = bam1_qname(p->b);
							c = (p->qpos + j + 1 >= p->b->core.l_qname)? ' ' : name[p->qpos + j];
						} else {
							c = bam_nt16_rev_table[bam1_seqi(bam1_seq(p->b), p->qpos + j)];
							if (j == 0 && tv->is_dot && toupper(c) == toupper(rb)) c = bam1_strand(p->b)? ',' : '.';
						}
					} else {
						c = bam_aux_getCSi(p->b, p->qpos + j);
						if (tv->is_dot && '-' == bam_aux_getCEi(p->b, p->qpos + j)) c = bam1_strand(p->b)? ',' : '.';
					}
				}
			}
			if (row > TV_MIN_ALNROW && row < tv->mrow) {
				int x;
				attr = 0;
				if (((p->b->core.flag&BAM_FPAIRED) && !(p->b->core.flag&BAM_FPROPER_PAIR))
						|| (p->b->core.flag & BAM_FSECONDARY)) attr |= tv->my_underline(tv);
				if (tv->color_for == TV_COLOR_BASEQ) {
					x = bam1_qual(p->b)[p->qpos]/10 + 1;
					if (x > 4) x = 4;
					attr |= tv->my_colorpair(tv,x);
				} else if (tv->color_for == TV_COLOR_MAPQ) {
					x = p->b->core.qual/10 + 1;
					if (x > 4) x = 4;
					attr |= tv->my_colorpair(tv,x);
				} else if (tv->color_for == TV_COLOR_NUCL) {
					x = bam_nt16_nt4_table[bam1_seqi(bam1_seq(p->b), p->qpos)] + 5;
					attr |= tv->my_colorpair(tv,x);
				} else if(tv->color_for == TV_COLOR_COL) {
					x = 0;
					switch(bam_aux_getCSi(p->b, p->qpos)) {
						case '0': x = 0; break;
						case '1': x = 1; break;
						case '2': x = 2; break;
						case '3': x = 3; break;
						case '4': x = 4; break;
						default: x = bam_nt16_nt4_table[bam1_seqi(bam1_seq(p->b), p->qpos)]; break;
					}
					x+=5;
					attr |= tv->my_colorpair(tv,x);
				} else if(tv->color_for == TV_COLOR_COLQ) {
					x = bam_aux_getCQi(p->b, p->qpos);
					if(0 == x) x = bam1_qual(p->b)[p->qpos];
					x = x/10 + 1;
					if (x > 4) x = 4;
					attr |= tv->my_colorpair(tv,x);
				}
				tv->my_attron(tv,attr);
				tv->my_mvaddch(tv,row, tv->ccol, bam1_strand(p->b)? tolower(c) : toupper(c));
				tv->my_attroff(tv,attr);
			}
		}
		c = j? '*' : rb;
		if (c == '*') {
			attr = tv->my_colorpair(tv,8);
			tv->my_attron(tv,attr);
			tv->my_mvaddch(tv,1, tv->ccol++, c);
			tv->my_attroff(tv,attr);
		} else tv->my_mvaddch(tv,1, tv->ccol++, c);
	}
	tv->last_pos = pos;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movl %edx, 0x14(%rsp)
movq %rsi, %rax
movq %rsi, 0x20(%rsp)
subl 0x2c(%r8), %eax
jb 0x6eb1
movq %r8, %rbx
movl 0x40(%r8), %edx
cmpl 0x4(%r8), %edx
jg 0x6eb1
movq 0x68(%rbx), %rdx
movl $0x4e, 0x4(%rsp)
testq %rdx, %rdx
movq %rcx, 0x18(%rsp)
je 0x65e2
cmpl 0x58(%rbx), %eax
jae 0x65e2
movl %eax, %eax
movsbl (%rdx,%rax), %eax
movl %eax, 0x4(%rsp)
movl 0x44(%rbx), %r14d
incl %r14d
cmpl 0x20(%rsp), %r14d
jae 0x666a
movl $0x19999998, %ebp       # imm = 0x19999998
leaq 0x38be2(%rip), %r15     # 0x3f1de
imull $0xcccccccd, %r14d, %eax # imm = 0xCCCCCCCD
addl %ebp, %eax
rorl %eax
cmpl %ebp, %eax
ja 0x662c
movl 0x4(%rbx), %eax
movl 0x40(%rbx), %edx
subl %edx, %eax
cmpl $0xa, %eax
jl 0x662c
leal 0x1(%r14), %r8d
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rcx
xorl %eax, %eax
callq *0x80(%rbx)
movq 0x68(%rbx), %rax
testq %rax, %rax
je 0x6644
movl %r14d, %ecx
subl 0x2c(%rbx), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %ecx
jmp 0x6649
movl $0x4e, %ecx
movl 0x40(%rbx), %edx
leal 0x1(%rdx), %eax
movl %eax, 0x40(%rbx)
movq %rbx, %rdi
movl $0x1, %esi
callq *0x88(%rbx)
incl %r14d
cmpl %r14d, 0x20(%rsp)
jne 0x65fc
imull $0xcccccccd, 0x20(%rsp), %eax # imm = 0xCCCCCCCD
rorl %eax
cmpl $0x19999999, %eax       # imm = 0x19999999
ja 0x66a5
movl 0x4(%rbx), %eax
movl 0x40(%rbx), %edx
subl %edx, %eax
cmpl $0xa, %eax
jl 0x66a5
movq 0x20(%rsp), %rax
leal 0x1(%rax), %r8d
leaq 0x38b46(%rip), %rcx     # 0x3f1de
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq *0x80(%rbx)
movslq 0x4(%rsp), %rax
leaq 0x4a72f(%rip), %rcx     # 0x50de0
movzbl (%rcx,%rax), %edx
movq 0x38(%rbx), %rcx
leaq 0x68(%rsp), %r15
movl 0x14(%rsp), %edi
movq 0x18(%rsp), %rsi
movq %r15, %r8
callq 0x10e31
movdqu 0xc(%r15), %xmm0
pslld $0x2, %xmm0
por 0x3896e(%rip), %xmm0    # 0x3f050
movdqa %xmm0, 0x40(%rsp)
movl $0x1, %eax
xorl %ecx, %ecx
movl %eax, %edx
movl 0x40(%rsp,%rdx,4), %edx
movq %rcx, %rsi
movl %esi, %edi
movl 0x40(%rsp,%rdi,4), %r8d
cmpl %r8d, %edx
jle 0x6718
movl %r8d, 0x44(%rsp,%rsi,4)
movl %edx, 0x40(%rsp,%rdi,4)
decq %rsi
leal 0x2(%rsi), %edi
cmpl $0x1, %edi
jg 0x66f8
incl %eax
incq %rcx
cmpl $0x4, %eax
jne 0x66ef
movl 0x40(%rsp), %r15d
movl 0x44(%rsp), %r13d
andl $0x3, %r15d
andl $0x3, %r13d
leal (%r15,%r15,4), %eax
leal (,%r15,8), %ecx
leal (%rcx,%rcx,2), %ecx
xorps %xmm0, %xmm0
cvtss2sd 0xc4(%rsp,%rcx), %xmm0
movsd %xmm0, 0x8(%rsp)
addl %r13d, %eax
xorps %xmm0, %xmm0
cvtss2sd 0xc4(%rsp,%rax,4), %xmm0
movsd %xmm0, 0x28(%rsp)
leal (,%r13,8), %eax
leal (%rax,%rax,2), %eax
xorps %xmm0, %xmm0
cvtss2sd 0xc4(%rsp,%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
leaq 0x38a54(%rip), %r14     # 0x3f1e2
movsbl (%r15,%r14), %ebp
movl 0x4(%rsp), %edi
callq 0x3170
cmpl %ebp, %eax
je 0x67b4
movsd 0x8(%rsp), %xmm0
addsd 0x3887a(%rip), %xmm0    # 0x3f028
movsd %xmm0, 0x8(%rsp)
movsd 0x28(%rsp), %xmm0
addsd 0x3885e(%rip), %xmm0    # 0x3f020
movsd %xmm0, 0x28(%rsp)
movsbl (%r13,%r14), %ebp
movl 0x4(%rsp), %edi
callq 0x3170
cmpl %ebp, %eax
je 0x67f1
movsd 0x38(%rsp), %xmm2
addsd 0x3883f(%rip), %xmm2    # 0x3f028
movsd 0x8(%rsp), %xmm0
jmp 0x67fd
movsd 0x8(%rsp), %xmm0
movsd 0x38(%rsp), %xmm2
movsd 0x28(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x6829
ucomisd %xmm0, %xmm2
jbe 0x6829
movl $0x10000, %r14d         # imm = 0x10000
movl %r15d, %ecx
shll %cl, %r14d
minsd %xmm2, %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0x6867
ucomisd %xmm2, %xmm1
jbe 0x684b
ucomisd %xmm2, %xmm0
jbe 0x684b
movl $0x10000, %r14d         # imm = 0x10000
movl %r13d, %ecx
shll %cl, %r14d
minsd %xmm1, %xmm0
subsd %xmm2, %xmm0
jmp 0x6867
movl $0x1, %r14d
movl %r13d, %ecx
shll %cl, %r14d
btsl %r15d, %r14d
shll $0x10, %r14d
minsd %xmm2, %xmm0
subsd %xmm1, %xmm0
addsd 0x387c1(%rip), %xmm0    # 0x3f030
cvttsd2si %xmm0, %r15d
orl %r15d, %r14d
movq %rbx, %rdi
callq *0xc0(%rbx)
movl %eax, %ebp
shrl $0x10, %r14d
andl $0xf, %r14d
leaq 0x38956(%rip), %rax     # 0x3f1e7
movsbl (%r14,%rax), %r14d
movzwl %r15w, %eax
imull $0xcccd, %eax, %esi     # imm = 0xCCCD
shrl $0x13, %esi
cmpw $0x3, %si
movl $0x3, %eax
cmovael %eax, %esi
incl %esi
movq %rbx, %rdi
callq *0xa8(%rbx)
orl %eax, %ebp
movl 0x4(%rsp), %edi
callq 0x3170
cmpl %r14d, %eax
movl $0x2e, %r15d
cmovnel %r14d, %r15d
movq %rbx, %rdi
movl %ebp, %esi
callq *0x90(%rbx)
movl 0x40(%rbx), %edx
movq %rbx, %rdi
movl $0x2, %esi
movl %r15d, %ecx
callq *0x88(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq *0x98(%rbx)
cmpl $0x0, 0x5c(%rbx)
sete %al
movl 0x14(%rsp), %edx
testl %edx, %edx
setle %cl
movl $0x1, %r8d
orb %al, %cl
movl %edx, %eax
movq 0x18(%rsp), %rbp
jne 0x6951
leaq (,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
xorl %r8d, %r8d
movl %r8d, %esi
movl 0xc(%rbp,%rdx), %edi
cmpl %edi, %r8d
movl %edi, %r8d
cmovgl %esi, %r8d
testl %edi, %edi
cmovlel %esi, %r8d
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0x692e
incl %r8d
shlq $0x3, %rax
leaq (%rax,%rax,2), %rax
movq %rax, 0x28(%rsp)
xorl %r9d, %r9d
movl %r8d, 0x34(%rsp)
movq %rbx, 0x58(%rsp)
cmpl $0x0, 0x14(%rsp)
movq %r9, 0x8(%rsp)
jle 0x6e23
xorl %r14d, %r14d
movl 0x10(%rbp,%r14), %r13d
subl 0x48(%rbx), %r13d
testl %r9d, %r9d
je 0x69e8
movl $0x2a, %r15d
cmpl 0xc(%rbp,%r14), %r9d
jg 0x6bd0
cmpl $0x0, 0x4c(%rbx)
je 0x6aab
movq (%rbp,%r14), %rdi
movl 0x8(%rbp,%r14), %esi
addl %r9d, %esi
movq %r9, %r12
callq 0xeadc
movsbl %al, %r15d
cmpl $0x0, 0x54(%rbx)
je 0x6ae8
movq (%rbp,%r14), %rdi
movl 0x8(%rbp,%r14), %esi
addl %r12d, %esi
callq 0xec41
cmpb $0x2d, %al
movq %r12, %r9
je 0x6a41
jmp 0x6bd0
movl 0x14(%rbp,%r14), %eax
testb $0x1, %al
jne 0x6a66
cmpl $0x1, 0x4c(%rbx)
jne 0x6a99
movq (%rbp,%r14), %rdi
movl 0x8(%rbp,%r14), %esi
callq 0xeadc
movq 0x8(%rsp), %r9
testb %al, %al
je 0x6a99
movsbl %al, %r15d
cmpl $0x0, 0x54(%rbx)
je 0x6bd0
movq (%rbp,%r14), %rdi
movl 0x8(%rbp,%r14), %esi
callq 0xec41
movq 0x8(%rsp), %r9
cmpb $0x2d, %al
jne 0x6bd0
movq (%rbp,%r14), %rax
xorl %ecx, %ecx
movabsq $0x1000000000, %rdx     # imm = 0x1000000000
testq %rdx, 0x8(%rax)
sete %cl
leal 0x2c(,%rcx,2), %r15d
jmp 0x6bd0
movl $0x2a, %r15d
testb $0x8, %al
je 0x6bd0
movq (%rbp,%r14), %rax
xorl %ecx, %ecx
movabsq $0x1000000000, %rdx     # imm = 0x1000000000
testq %rdx, 0x8(%rax)
sete %cl
leal 0x3c(,%rcx,2), %r15d
jmp 0x6bd0
cmpl $0x0, 0x64(%rbx)
je 0x6af0
movq (%rbp,%r14), %rax
movslq 0x8(%rbp,%r14), %rcx
jmp 0x6ac5
cmpl $0x0, 0x64(%rbx)
je 0x6b84
movq (%rbp,%r14), %rax
movslq 0x8(%rbp,%r14), %rdx
movslq %r9d, %rcx
addq %rdx, %rcx
leal 0x1(%rcx), %edx
movzbl 0xb(%rax), %esi
movl $0x20, %r15d
cmpl %esi, %edx
jge 0x6bd0
movq 0x30(%rax), %rax
movsbl (%rax,%rcx), %r15d
jmp 0x6bd0
movq %r12, %r9
jmp 0x6bd0
movq (%rbp,%r14), %rax
movq 0x8(%rax), %r12
movq %r12, %rcx
shrq $0x30, %rcx
shlq $0x2, %rcx
addq 0x30(%rax), %rcx
leaq 0x4a5d1(%rip), %rax     # 0x510e0
movq (%rax), %rax
movl %r12d, %edx
shrl $0x18, %edx
addq %rcx, %rdx
movl 0x8(%rbp,%r14), %ecx
movl %ecx, %esi
sarl %esi
movslq %esi, %rsi
movzbl (%rsi,%rdx), %edx
shll $0x2, %ecx
notb %cl
andb $0x4, %cl
shrl %cl, %edx
andl $0xf, %edx
movsbl (%rax,%rdx), %r15d
cmpl $0x0, 0x54(%rbx)
je 0x6bd0
movl %r15d, %edi
callq 0x3170
movl %eax, %ebp
movl 0x4(%rsp), %edi
callq 0x3170
movq 0x8(%rsp), %r9
cmpl %eax, %ebp
movq 0x18(%rsp), %rbp
jne 0x6bd0
xorl %eax, %eax
movabsq $0x1000000000, %rcx     # imm = 0x1000000000
testq %rcx, %r12
sete %al
leal 0x2c(,%rax,2), %r15d
jmp 0x6bd0
movq (%rbp,%r14), %rax
movq 0x8(%rax), %rdx
movq %rdx, %rcx
shrq $0x30, %rcx
shlq $0x2, %rcx
addq 0x30(%rax), %rcx
shrl $0x18, %edx
addq %rcx, %rdx
movl 0x8(%rbp,%r14), %ecx
addl %r9d, %ecx
movl %ecx, %eax
sarl %eax
cltq
movzbl (%rax,%rdx), %eax
shll $0x2, %ecx
notb %cl
andb $0x4, %cl
shrl %cl, %eax
leaq 0x4a51b(%rip), %rcx     # 0x510e0
movq (%rcx), %rcx
andl $0xf, %eax
movsbl (%rcx,%rax), %r15d
addl $0x2, %r13d
cmpl $0x3, %r13d
jl 0x6e14
cmpl (%rbx), %r13d
jge 0x6e14
movq (%rbp,%r14), %rax
movq 0x8(%rax), %rax
movq %rax, %rcx
movabsq $0x300000000, %rdx      # imm = 0x300000000
andq %rdx, %rcx
movabsq $0x100000000, %rdx      # imm = 0x100000000
cmpq %rdx, %rcx
setne %cl
btq $0x28, %rax
setae %al
xorl %r12d, %r12d
testb %al, %cl
jne 0x6c2b
movq %rbx, %rdi
callq *0xc0(%rbx)
movl %eax, %r12d
movl 0x50(%rbx), %eax
cmpq $0x4, %rax
ja 0x6d30
leaq 0x38421(%rip), %rcx     # 0x3f060
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rbp,%r14), %rax
movzbl 0xa(%rax), %eax
jmp 0x6d16
movq (%rbp,%r14), %rdi
movl 0x8(%rbp,%r14), %esi
callq 0xeb53
testb %al, %al
je 0x6d38
movsbl %al, %eax
jmp 0x6d6b
movq (%rbp,%r14), %rdi
movl 0x8(%rbp,%r14), %esi
callq 0xeadc
leal -0x30(%rax), %ecx
cmpb $0x5, %cl
jae 0x6c96
addb $-0x2b, %al
movzbl %al, %esi
jmp 0x6d8d
movq (%rbp,%r14), %rax
movq 0x8(%rax), %rdx
movq %rdx, %rcx
shrq $0x30, %rcx
shlq $0x2, %rcx
addq 0x30(%rax), %rcx
shrl $0x18, %edx
addq %rcx, %rdx
movl 0x8(%rbp,%r14), %ecx
movl %ecx, %eax
sarl %eax
cltq
movzbl (%rax,%rdx), %eax
shll $0x2, %ecx
notb %cl
andb $0x4, %cl
shrl %cl, %eax
andl $0xf, %eax
leaq 0x4a419(%rip), %rcx     # 0x510f0
movsbl (%rcx,%rax), %esi
addl $0x5, %esi
jmp 0x6d8d
movq (%rbp,%r14), %rax
movq 0x8(%rax), %rcx
movq %rcx, %rdx
shrq $0x30, %rdx
shlq $0x2, %rdx
addq 0x30(%rax), %rdx
shrl $0x18, %ecx
movl 0x10(%rax), %eax
incl %eax
sarl %eax
cltq
addq %rcx, %rax
addq %rdx, %rax
movslq 0x8(%rbp,%r14), %rcx
movzbl (%rcx,%rax), %eax
imull $0xcd, %eax, %eax
shrl $0xb, %eax
cmpb $0x3, %al
movl $0x3, %ecx
cmovael %ecx, %eax
incb %al
movzbl %al, %esi
jmp 0x6d8d
movq %rbx, %rbp
movl %r15d, %ebx
jmp 0x6da1
movq (%rbp,%r14), %rax
movq 0x8(%rax), %rcx
movq %rcx, %rdx
shrq $0x30, %rdx
shlq $0x2, %rdx
addq 0x30(%rax), %rdx
shrl $0x18, %ecx
movl 0x10(%rax), %eax
incl %eax
sarl %eax
cltq
addq %rcx, %rax
addq %rdx, %rax
movslq 0x8(%rbp,%r14), %rcx
movzbl (%rcx,%rax), %eax
cwtl
imull $0x6667, %eax, %eax     # imm = 0x6667
movl %eax, %ecx
shrl $0x1f, %ecx
sarl $0x12, %eax
addl %ecx, %eax
cmpw $0x3, %ax
movl $0x3, %ecx
cmovgel %ecx, %eax
incl %eax
movswl %ax, %esi
movl %r15d, %ebx
movq 0x58(%rsp), %rbp
movq %rbp, %rdi
callq *0xa8(%rbp)
orl %eax, %r12d
movq %rbp, %rdi
movl %r12d, 0x38(%rsp)
movl %r12d, %esi
callq *0x90(%rbp)
movq 0x88(%rbp), %rax
movq %rax, 0x60(%rsp)
movl 0x40(%rbp), %r12d
movq 0x18(%rsp), %rax
movq (%rax,%r14), %rax
movabsq $0x1000000000, %rcx     # imm = 0x1000000000
testq %rcx, 0x8(%rax)
jne 0x6de4
movl %ebx, %edi
callq 0x3170
jmp 0x6deb
movl %ebx, %edi
callq 0x35b0
movq %rbp, %rbx
movq %rbp, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq *0x60(%rsp)
movq %rbp, %rdi
movl 0x38(%rsp), %esi
callq *0x98(%rbp)
movq 0x18(%rsp), %rbp
movq 0x8(%rsp), %r9
addq $0x18, %r14
cmpq %r14, 0x28(%rsp)
jne 0x697e
testl %r9d, %r9d
jne 0x6e4c
cmpl $0x2a, 0x4(%rsp)
je 0x6e4c
movl 0x40(%rbx), %edx
leal 0x1(%rdx), %eax
movl %eax, 0x40(%rbx)
movq %rbx, %rdi
movl $0x1, %esi
movl 0x4(%rsp), %ecx
callq *0x88(%rbx)
jmp 0x6e93
movq %rbx, %rdi
movl $0x8, %esi
callq *0xa8(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
movl %eax, %esi
callq *0x90(%rbx)
movl 0x40(%rbx), %edx
leal 0x1(%rdx), %eax
movl %eax, 0x40(%rbx)
movq %rbx, %rdi
movl $0x1, %esi
movl $0x2a, %ecx
callq *0x88(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
movq 0x18(%rsp), %rbp
callq *0x98(%rbx)
movl 0x34(%rsp), %r8d
movq 0x8(%rsp), %r9
incl %r9d
cmpl %r8d, %r9d
jne 0x696b
movq 0x20(%rsp), %rax
movl %eax, 0x44(%rbx)
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq