// File: /workspace/github_c_makefile_star2_O1/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 $0x118, %rsp            # imm = 0x118
movl %edx, 0x14(%rsp)
movq %rsi, %rax
movq %rsi, 0x20(%rsp)
subl 0x2c(%r8), %eax
jb 0x6a94
movq %r8, %rbx
movl 0x40(%r8), %edx
cmpl 0x4(%r8), %edx
jg 0x6a94
movq 0x68(%rbx), %rdx
movl $0x4e, 0x4(%rsp)
testq %rdx, %rdx
movq %rcx, 0x18(%rsp)
je 0x61af
cmpl 0x58(%rbx), %eax
jae 0x61af
movl %eax, %eax
movsbl (%rdx,%rax), %eax
movl %eax, 0x4(%rsp)
movl 0x44(%rbx), %r14d
incl %r14d
cmpl 0x20(%rsp), %r14d
jae 0x6237
movl $0x19999998, %ebp       # imm = 0x19999998
leaq 0x37ff5(%rip), %r15     # 0x3e1be
imull $0xcccccccd, %r14d, %eax # imm = 0xCCCCCCCD
addl %ebp, %eax
rorl %eax
cmpl %ebp, %eax
ja 0x61f9
movl 0x4(%rbx), %eax
movl 0x40(%rbx), %edx
subl %edx, %eax
cmpl $0xa, %eax
jl 0x61f9
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 0x6211
movl %r14d, %ecx
subl 0x2c(%rbx), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %ecx
jmp 0x6216
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 0x61c9
imull $0xcccccccd, 0x20(%rsp), %eax # imm = 0xCCCCCCCD
rorl %eax
cmpl $0x19999999, %eax       # imm = 0x19999999
ja 0x6272
movl 0x4(%rbx), %eax
movl 0x40(%rbx), %edx
subl %edx, %eax
cmpl $0xa, %eax
jl 0x6272
movq 0x20(%rsp), %rax
leal 0x1(%rax), %r8d
leaq 0x37f59(%rip), %rcx     # 0x3e1be
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq *0x80(%rbx)
movslq 0x4(%rsp), %rax
leaq 0x49b62(%rip), %rcx     # 0x4fde0
movzbl (%rcx,%rax), %edx
movq 0x38(%rbx), %rcx
leaq 0x58(%rsp), %r8
movl 0x14(%rsp), %edi
movq 0x18(%rsp), %rsi
callq 0x10aa9
xorl %eax, %eax
movl 0x64(%rsp,%rax,4), %ecx
leal (%rax,%rcx,4), %ecx
movl %ecx, 0x40(%rsp,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x629b
movl $0x1, %eax
movl $0x2, %ecx
movl %ecx, %edx
movl %edx, %esi
leal -0x1(%rsi), %edx
movl 0x40(%rsp,%rdx,4), %edi
addl $-0x2, %esi
movl 0x40(%rsp,%rsi,4), %r8d
cmpl %r8d, %edi
jle 0x62df
movl %r8d, 0x40(%rsp,%rdx,4)
movl %edi, 0x40(%rsp,%rsi,4)
cmpl $0x1, %edx
jg 0x62bb
incl %eax
incl %ecx
cmpl $0x4, %eax
jne 0x62b9
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
cvtss2sd 0xb4(%rsp,%rcx), %xmm0
movsd %xmm0, 0x8(%rsp)
addl %r13d, %eax
xorps %xmm0, %xmm0
cvtss2sd 0xb4(%rsp,%rax,4), %xmm0
movsd %xmm0, 0x28(%rsp)
leal (,%r13,8), %eax
leal (%rax,%rax,2), %eax
xorps %xmm0, %xmm0
cvtss2sd 0xb4(%rsp,%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
leaq 0x37e71(%rip), %r14     # 0x3e1c2
movsbl (%r15,%r14), %ebp
movl 0x4(%rsp), %edi
callq 0x3170
cmpl %ebp, %eax
je 0x6377
movsd 0x8(%rsp), %xmm0
addsd 0x37ca7(%rip), %xmm0    # 0x3e018
movsd %xmm0, 0x8(%rsp)
movsd 0x28(%rsp), %xmm0
addsd 0x37c8b(%rip), %xmm0    # 0x3e010
movsd %xmm0, 0x28(%rsp)
movsbl (%r13,%r14), %ebp
movl 0x4(%rsp), %edi
callq 0x3170
cmpl %ebp, %eax
je 0x63b4
movsd 0x38(%rsp), %xmm2
addsd 0x37c6c(%rip), %xmm2    # 0x3e018
movsd 0x8(%rsp), %xmm0
jmp 0x63c0
movsd 0x8(%rsp), %xmm0
movsd 0x38(%rsp), %xmm2
movsd 0x28(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x63ec
ucomisd %xmm0, %xmm2
jbe 0x63ec
movl $0x10000, %r14d         # imm = 0x10000
movl %r15d, %ecx
shll %cl, %r14d
minsd %xmm2, %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0x642a
ucomisd %xmm2, %xmm1
jbe 0x640e
ucomisd %xmm2, %xmm0
jbe 0x640e
movl $0x10000, %r14d         # imm = 0x10000
movl %r13d, %ecx
shll %cl, %r14d
minsd %xmm1, %xmm0
subsd %xmm2, %xmm0
jmp 0x642a
movl $0x1, %r14d
movl %r13d, %ecx
shll %cl, %r14d
btsl %r15d, %r14d
shll $0x10, %r14d
minsd %xmm2, %xmm0
subsd %xmm1, %xmm0
addsd 0x37bee(%rip), %xmm0    # 0x3e020
cvttsd2si %xmm0, %r15d
orl %r15d, %r14d
movq %rbx, %rdi
callq *0xc0(%rbx)
movl %eax, %ebp
shrl $0x10, %r14d
andl $0xf, %r14d
leaq 0x37d73(%rip), %rax     # 0x3e1c7
movsbl (%r14,%rax), %r14d
andl $0xfffe, %r15d          # imm = 0xFFFE
imulq $0x1999999a, %r15, %rsi # imm = 0x1999999A
shrq $0x20, %rsi
cmpl $0x3, %esi
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 0x6518
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 0x64f5
incl %r8d
shlq $0x3, %rax
leaq (%rax,%rax,2), %rax
movq %rax, 0x28(%rsp)
xorl %r9d, %r9d
movl %r8d, 0x34(%rsp)
cmpl $0x0, 0x14(%rsp)
movq %r9, 0x8(%rsp)
jle 0x6a06
xorl %r14d, %r14d
movl 0x10(%rbp,%r14), %r13d
subl 0x48(%rbx), %r13d
testl %r9d, %r9d
je 0x65aa
movl $0x2a, %r15d
cmpl 0xc(%rbp,%r14), %r9d
jg 0x6792
cmpl $0x0, 0x4c(%rbx)
je 0x666d
movq (%rbp,%r14), %rdi
movl 0x8(%rbp,%r14), %esi
addl %r9d, %esi
movq %r9, %r12
callq 0xe7c4
movsbl %al, %r15d
cmpl $0x0, 0x54(%rbx)
je 0x66aa
movq (%rbp,%r14), %rdi
movl 0x8(%rbp,%r14), %esi
addl %r12d, %esi
callq 0xe929
cmpb $0x2d, %al
movq %r12, %r9
je 0x6603
jmp 0x6792
movl 0x14(%rbp,%r14), %eax
testb $0x1, %al
jne 0x6628
cmpl $0x1, 0x4c(%rbx)
jne 0x665b
movq (%rbp,%r14), %rdi
movl 0x8(%rbp,%r14), %esi
callq 0xe7c4
movq 0x8(%rsp), %r9
testb %al, %al
je 0x665b
movsbl %al, %r15d
cmpl $0x0, 0x54(%rbx)
je 0x6792
movq (%rbp,%r14), %rdi
movl 0x8(%rbp,%r14), %esi
callq 0xe929
movq 0x8(%rsp), %r9
cmpb $0x2d, %al
jne 0x6792
movq (%rbp,%r14), %rax
xorl %ecx, %ecx
movabsq $0x1000000000, %rdx     # imm = 0x1000000000
testq %rdx, 0x8(%rax)
sete %cl
leal 0x2c(,%rcx,2), %r15d
jmp 0x6792
movl $0x2a, %r15d
testb $0x8, %al
je 0x6792
movq (%rbp,%r14), %rax
xorl %ecx, %ecx
movabsq $0x1000000000, %rdx     # imm = 0x1000000000
testq %rdx, 0x8(%rax)
sete %cl
leal 0x3c(,%rcx,2), %r15d
jmp 0x6792
cmpl $0x0, 0x64(%rbx)
je 0x66b2
movq (%rbp,%r14), %rax
movslq 0x8(%rbp,%r14), %rcx
jmp 0x6687
cmpl $0x0, 0x64(%rbx)
je 0x6746
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 0x6792
movq 0x30(%rax), %rax
movsbl (%rax,%rcx), %r15d
jmp 0x6792
movq %r12, %r9
jmp 0x6792
movq (%rbp,%r14), %rax
movq 0x8(%rax), %r12
movq %r12, %rcx
shrq $0x30, %rcx
shlq $0x2, %rcx
addq 0x30(%rax), %rcx
leaq 0x49a0f(%rip), %rax     # 0x500e0
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 0x6792
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 0x6792
xorl %eax, %eax
movabsq $0x1000000000, %rcx     # imm = 0x1000000000
testq %rcx, %r12
sete %al
leal 0x2c(,%rax,2), %r15d
jmp 0x6792
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 0x49959(%rip), %rcx     # 0x500e0
movq (%rcx), %rcx
andl $0xf, %eax
movsbl (%rcx,%rax), %r15d
addl $0x2, %r13d
cmpl $0x3, %r13d
jl 0x69f7
cmpl (%rbx), %r13d
jge 0x69f7
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 0x67ed
movq %rbx, %rdi
callq *0xc0(%rbx)
movl %eax, %r12d
movl 0x50(%rbx), %eax
cmpq $0x4, %rax
ja 0x6917
leaq 0x3783f(%rip), %rcx     # 0x3e040
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movq (%rbp,%r14), %rax
movzwl 0xa(%rax), %eax
andl $0xfe, %eax
imulq $0x1999999a, %rax, %rsi # imm = 0x1999999A
shrq $0x20, %rsi
cmpl $0x3, %esi
movl $0x3, %eax
cmovael %eax, %esi
jmp 0x6973
movq (%rbp,%r14), %rdi
movl 0x8(%rbp,%r14), %esi
callq 0xe83b
movq %rbx, %rdi
testb %al, %al
je 0x691f
movsbl %al, %eax
jmp 0x6952
movq %rbx, %rdi
jmp 0x687a
movq (%rbp,%r14), %rdi
movl 0x8(%rbp,%r14), %esi
callq 0xe7c4
addb $-0x30, %al
movq %rbx, %rdi
cmpb $0x5, %al
jae 0x687a
movzbl %al, %esi
jmp 0x68bf
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 0x49835(%rip), %rcx     # 0x500f0
movsbl (%rcx,%rax), %esi
addl $0x5, %esi
jmp 0x6975
movq %rbx, %rdi
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 0x6975
movq %rbx, %rbp
movl %r15d, %ebx
jmp 0x6984
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
cltq
imulq $0x66666667, %rax, %rsi # imm = 0x66666667
movq %rsi, %rax
shrq $0x3f, %rax
sarq $0x22, %rsi
addl %eax, %esi
cmpl $0x3, %esi
movl $0x3, %eax
cmovgel %eax, %esi
incl %esi
movl %r15d, %ebx
movq %rdi, %rbp
callq *0xa8(%rdi)
orl %eax, %r12d
movq %rbp, %rdi
movl %r12d, 0x38(%rsp)
movl %r12d, %esi
callq *0x90(%rbp)
movq 0x88(%rbp), %rax
movq %rax, 0x50(%rsp)
movl 0x40(%rbp), %r12d
movq 0x18(%rsp), %rax
movq (%rax,%r14), %rax
movabsq $0x1000000000, %rcx     # imm = 0x1000000000
testq %rcx, 0x8(%rax)
jne 0x69c7
movl %ebx, %edi
callq 0x3170
jmp 0x69ce
movl %ebx, %edi
callq 0x35b0
movq %rbp, %rbx
movq %rbp, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq *0x50(%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 0x6540
testl %r9d, %r9d
jne 0x6a2f
cmpl $0x2a, 0x4(%rsp)
je 0x6a2f
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 0x6a76
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 0x652d
movq 0x20(%rsp), %rax
movl %eax, 0x44(%rbx)
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq