// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/samtools-0.1.18/bam_md.c
// Function: bam_prob_realn_core
int bam_prob_realn_core(bam1_t *b, const char *ref, int flag)
{
	int k, i, bw, x, y, yb, ye, xb, xe, apply_baq = flag&1, extend_baq = flag>>1&1;
	uint32_t *cigar = bam1_cigar(b);
	bam1_core_t *c = &b->core;
	kpa_par_t conf = kpa_par_def;
	uint8_t *bq = 0, *zq = 0, *qual = bam1_qual(b);
	if ((c->flag & BAM_FUNMAP) || b->core.l_qseq == 0) return -1; // do nothing
	// test if BQ or ZQ is present
	if ((bq = bam_aux_get(b, "BQ")) != 0) ++bq;
	if ((zq = bam_aux_get(b, "ZQ")) != 0 && *zq == 'Z') ++zq;
	if (bq && zq) { // remove the ZQ tag
		bam_aux_del(b, zq-1);
		zq = 0;
	}
	if (bq || zq) {
		if ((apply_baq && zq) || (!apply_baq && bq)) return -3; // in both cases, do nothing
		if (bq && apply_baq) { // then convert BQ to ZQ
			for (i = 0; i < c->l_qseq; ++i)
				qual[i] = qual[i] + 64 < bq[i]? 0 : qual[i] - ((int)bq[i] - 64);
			*(bq - 3) = 'Z';
		} else if (zq && !apply_baq) { // then convert ZQ to BQ
			for (i = 0; i < c->l_qseq; ++i)
				qual[i] += (int)zq[i] - 64;
			*(zq - 3) = 'B';
		}
		return 0;
	}
	// find the start and end of the alignment	
	x = c->pos, y = 0, yb = ye = xb = xe = -1;
	for (k = 0; k < c->n_cigar; ++k) {
		int op, l;
		op = cigar[k]&0xf; l = cigar[k]>>4;
		if (op == BAM_CMATCH || op == BAM_CEQUAL || op == BAM_CDIFF) {
			if (yb < 0) yb = y;
			if (xb < 0) xb = x;
			ye = y + l; xe = x + l;
			x += l; y += l;
		} else if (op == BAM_CSOFT_CLIP || op == BAM_CINS) y += l;
		else if (op == BAM_CDEL) x += l;
		else if (op == BAM_CREF_SKIP) return -1; // do nothing if there is a reference skip
	}
	// set bandwidth and the start and the end
	bw = 7;
	if (abs((xe - xb) - (ye - yb)) > bw)
		bw = abs((xe - xb) - (ye - yb)) + 3;
	conf.bw = bw;
	xb -= yb + bw/2; if (xb < 0) xb = 0;
	xe += c->l_qseq - ye + bw/2;
	if (xe - xb - c->l_qseq > bw)
		xb += (xe - xb - c->l_qseq - bw) / 2, xe -= (xe - xb - c->l_qseq - bw) / 2;
	{ // glocal
		uint8_t *s, *r, *q, *seq = bam1_seq(b), *bq;
		int *state;
		bq = calloc(c->l_qseq + 1, 1);
		memcpy(bq, qual, c->l_qseq);
		s = calloc(c->l_qseq, 1);
		for (i = 0; i < c->l_qseq; ++i) s[i] = bam_nt16_nt4_table[bam1_seqi(seq, i)];
		r = calloc(xe - xb, 1);
		for (i = xb; i < xe; ++i) {
			if (ref[i] == 0) { xe = i; break; }
			r[i-xb] = bam_nt16_nt4_table[bam_nt16_table[(int)ref[i]]];
		}
		state = calloc(c->l_qseq, sizeof(int));
		q = calloc(c->l_qseq, 1);
		kpa_glocal(r, xe-xb, s, c->l_qseq, qual, &conf, state, q);
		if (!extend_baq) { // in this block, bq[] is capped by base quality qual[]
			for (k = 0, x = c->pos, y = 0; k < c->n_cigar; ++k) {
				int op = cigar[k]&0xf, l = cigar[k]>>4;
				if (op == BAM_CMATCH || op == BAM_CEQUAL || op == BAM_CDIFF) {
					for (i = y; i < y + l; ++i) {
						if ((state[i]&3) != 0 || state[i]>>2 != x - xb + (i - y)) bq[i] = 0;
						else bq[i] = bq[i] < q[i]? bq[i] : q[i];
					}
					x += l; y += l;
				} else if (op == BAM_CSOFT_CLIP || op == BAM_CINS) y += l;
				else if (op == BAM_CDEL) x += l;
			}
			for (i = 0; i < c->l_qseq; ++i) bq[i] = qual[i] - bq[i] + 64; // finalize BQ
		} else { // in this block, bq[] is BAQ that can be larger than qual[] (different from the above!)
			uint8_t *left, *rght;
			left = calloc(c->l_qseq, 1); rght = calloc(c->l_qseq, 1);
			for (k = 0, x = c->pos, y = 0; k < c->n_cigar; ++k) {
				int op = cigar[k]&0xf, l = cigar[k]>>4;
				if (op == BAM_CMATCH || op == BAM_CEQUAL || op == BAM_CDIFF) {
					for (i = y; i < y + l; ++i)
						bq[i] = ((state[i]&3) != 0 || state[i]>>2 != x - xb + (i - y))? 0 : q[i];
					for (left[y] = bq[y], i = y + 1; i < y + l; ++i)
						left[i] = bq[i] > left[i-1]? bq[i] : left[i-1];
					for (rght[y+l-1] = bq[y+l-1], i = y + l - 2; i >= y; --i)
						rght[i] = bq[i] > rght[i+1]? bq[i] : rght[i+1];
					for (i = y; i < y + l; ++i)
						bq[i] = left[i] < rght[i]? left[i] : rght[i];
					x += l; y += l;
				} else if (op == BAM_CSOFT_CLIP || op == BAM_CINS) y += l;
				else if (op == BAM_CDEL) x += l;
			}
			for (i = 0; i < c->l_qseq; ++i) bq[i] = 64 + (qual[i] <= bq[i]? 0 : qual[i] - bq[i]); // finalize BQ
			free(left); free(rght);
		}
		if (apply_baq) {
			for (i = 0; i < c->l_qseq; ++i) qual[i] -= bq[i] - 64; // modify qual
			bam_aux_append(b, "ZQ", 'Z', c->l_qseq + 1, bq);
		} else bam_aux_append(b, "BQ", 'Z', c->l_qseq + 1, bq);
		free(bq); free(s); free(r); free(q); free(state);
	}
	return 0;
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq %rdi, 0x108(%rsp)
movq %rsi, 0x100(%rsp)
movl %edx, 0xfc(%rsp)
movl 0xfc(%rsp), %eax
andl $0x1, %eax
movl %eax, 0xd4(%rsp)
movl 0xfc(%rsp), %eax
sarl %eax
andl $0x1, %eax
movl %eax, 0xd0(%rsp)
movq 0x108(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x108(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x18, %rcx
andq $0xff, %rcx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0xc8(%rsp)
movq 0x108(%rsp), %rax
movq %rax, 0xc0(%rsp)
leaq 0x189e96(%rip), %rax    # 0x603dc0
movq (%rax), %rcx
movq %rcx, 0xb4(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0xbc(%rsp)
movq $0x0, 0xa8(%rsp)
movq $0x0, 0xa0(%rsp)
movq 0x108(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x108(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x30, %rcx
shll $0x2, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq 0x108(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x18, %rcx
andq $0xff, %rcx
movslq %ecx, %rcx
addq %rcx, %rax
movq 0x108(%rsp), %rcx
movl 0x10(%rcx), %ecx
addl $0x1, %ecx
sarl %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x98(%rsp)
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
andq $0xffff, %rax           # imm = 0xFFFF
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x479fe3
movq 0x108(%rsp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x479ff3
movl $0xffffffff, 0x114(%rsp) # imm = 0xFFFFFFFF
jmp 0x47b135
movq 0x108(%rsp), %rdi
leaq 0x1008f1(%rip), %rsi    # 0x57a8f3
callq 0x467810
movq %rax, 0xa8(%rsp)
cmpq $0x0, %rax
je 0x47a029
movq 0xa8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xa8(%rsp)
movq 0x108(%rsp), %rdi
leaq 0x1008be(%rip), %rsi    # 0x57a8f6
callq 0x467810
movq %rax, 0xa0(%rsp)
cmpq $0x0, %rax
je 0x47a06f
movq 0xa0(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x5a, %eax
jne 0x47a06f
movq 0xa0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xa0(%rsp)
cmpq $0x0, 0xa8(%rsp)
je 0x47a0aa
cmpq $0x0, 0xa0(%rsp)
je 0x47a0aa
movq 0x108(%rsp), %rdi
movq 0xa0(%rsp), %rsi
addq $-0x1, %rsi
callq 0x467a40
movq $0x0, 0xa0(%rsp)
cmpq $0x0, 0xa8(%rsp)
jne 0x47a0c4
cmpq $0x0, 0xa0(%rsp)
je 0x47a27b
cmpl $0x0, 0xd4(%rsp)
je 0x47a0d9
cmpq $0x0, 0xa0(%rsp)
jne 0x47a0ee
cmpl $0x0, 0xd4(%rsp)
jne 0x47a0fe
cmpq $0x0, 0xa8(%rsp)
je 0x47a0fe
movl $0xfffffffd, 0x114(%rsp) # imm = 0xFFFFFFFD
jmp 0x47b135
cmpq $0x0, 0xa8(%rsp)
je 0x47a1e6
cmpl $0x0, 0xd4(%rsp)
je 0x47a1e6
movl $0x0, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
movq 0xc0(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x47a1d5
movq 0x98(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
addl $0x40, %eax
movq 0xa8(%rsp), %rcx
movslq 0xf4(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jge 0x47a175
xorl %eax, %eax
movl %eax, 0x3c(%rsp)
jmp 0x47a1a6
movq 0x98(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movq 0xa8(%rsp), %rcx
movslq 0xf4(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
subl $0x40, %ecx
subl %ecx, %eax
movl %eax, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
movb %al, %dl
movq 0x98(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47a126
movq 0xa8(%rsp), %rax
movb $0x5a, -0x3(%rax)
jmp 0x47a26b
cmpq $0x0, 0xa0(%rsp)
je 0x47a269
cmpl $0x0, 0xd4(%rsp)
jne 0x47a269
movl $0x0, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
movq 0xc0(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x47a25d
movq 0xa0(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %esi
subl $0x40, %esi
movq 0x98(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %edx
addl %esi, %edx
movb %dl, (%rax,%rcx)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47a206
movq 0xa0(%rsp), %rax
movb $0x42, -0x3(%rax)
jmp 0x47a26b
movl $0x0, 0x114(%rsp)
jmp 0x47b135
movq 0xc0(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0xec(%rsp)
movl $0x0, 0xe8(%rsp)
movl $0xffffffff, 0xd8(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0xdc(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0xe0(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0xe4(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0xf8(%rsp)
movl 0xf8(%rsp), %eax
movq 0xc0(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x30, %rcx
cmpl %ecx, %eax
jge 0x47a454
movq 0xc8(%rsp), %rax
movslq 0xf8(%rsp), %rcx
movl (%rax,%rcx,4), %eax
andl $0xf, %eax
movl %eax, 0x94(%rsp)
movq 0xc8(%rsp), %rax
movslq 0xf8(%rsp), %rcx
movl (%rax,%rcx,4), %eax
shrl $0x4, %eax
movl %eax, 0x90(%rsp)
cmpl $0x0, 0x94(%rsp)
je 0x47a34a
cmpl $0x7, 0x94(%rsp)
je 0x47a34a
cmpl $0x8, 0x94(%rsp)
jne 0x47a3d0
cmpl $0x0, 0xe4(%rsp)
jge 0x47a362
movl 0xe8(%rsp), %eax
movl %eax, 0xe4(%rsp)
cmpl $0x0, 0xdc(%rsp)
jge 0x47a37a
movl 0xec(%rsp), %eax
movl %eax, 0xdc(%rsp)
movl 0xe8(%rsp), %eax
addl 0x90(%rsp), %eax
movl %eax, 0xe0(%rsp)
movl 0xec(%rsp), %eax
addl 0x90(%rsp), %eax
movl %eax, 0xd8(%rsp)
movl 0x90(%rsp), %eax
addl 0xec(%rsp), %eax
movl %eax, 0xec(%rsp)
movl 0x90(%rsp), %eax
addl 0xe8(%rsp), %eax
movl %eax, 0xe8(%rsp)
jmp 0x47a43c
cmpl $0x4, 0x94(%rsp)
je 0x47a3e4
cmpl $0x1, 0x94(%rsp)
jne 0x47a3fb
movl 0x90(%rsp), %eax
addl 0xe8(%rsp), %eax
movl %eax, 0xe8(%rsp)
jmp 0x47a43a
cmpl $0x2, 0x94(%rsp)
jne 0x47a41c
movl 0x90(%rsp), %eax
addl 0xec(%rsp), %eax
movl %eax, 0xec(%rsp)
jmp 0x47a438
cmpl $0x3, 0x94(%rsp)
jne 0x47a436
movl $0xffffffff, 0x114(%rsp) # imm = 0xFFFFFFFF
jmp 0x47b135
jmp 0x47a438
jmp 0x47a43a
jmp 0x47a43c
jmp 0x47a43e
movl 0xf8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf8(%rsp)
jmp 0x47a2cf
movl $0x7, 0xf0(%rsp)
movl 0xd8(%rsp), %eax
subl 0xdc(%rsp), %eax
movl 0xe0(%rsp), %ecx
subl 0xe4(%rsp), %ecx
subl %ecx, %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cmpl 0xf0(%rsp), %eax
jle 0x47a4bc
movl 0xd8(%rsp), %eax
subl 0xdc(%rsp), %eax
movl 0xe0(%rsp), %ecx
subl 0xe4(%rsp), %ecx
subl %ecx, %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
addl $0x3, %eax
movl %eax, 0xf0(%rsp)
movl 0xf0(%rsp), %eax
movl %eax, 0xbc(%rsp)
movl 0xe4(%rsp), %ecx
movl 0xf0(%rsp), %eax
movl $0x2, %esi
cltd
idivl %esi
addl %eax, %ecx
movl 0xdc(%rsp), %eax
subl %ecx, %eax
movl %eax, 0xdc(%rsp)
cmpl $0x0, 0xdc(%rsp)
jge 0x47a507
movl $0x0, 0xdc(%rsp)
movq 0xc0(%rsp), %rax
movl 0x10(%rax), %eax
subl 0xe0(%rsp), %eax
movl %eax, 0x38(%rsp)
movl 0xf0(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl 0x38(%rsp), %eax
addl %ecx, %eax
addl 0xd8(%rsp), %eax
movl %eax, 0xd8(%rsp)
movl 0xd8(%rsp), %eax
subl 0xdc(%rsp), %eax
movq 0xc0(%rsp), %rcx
subl 0x10(%rcx), %eax
cmpl 0xf0(%rsp), %eax
jle 0x47a5d4
movl 0xd8(%rsp), %eax
subl 0xdc(%rsp), %eax
movq 0xc0(%rsp), %rcx
subl 0x10(%rcx), %eax
subl 0xf0(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
addl 0xdc(%rsp), %eax
movl %eax, 0xdc(%rsp)
movl 0xd8(%rsp), %eax
subl 0xdc(%rsp), %eax
movq 0xc0(%rsp), %rcx
subl 0x10(%rcx), %eax
subl 0xf0(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl 0xd8(%rsp), %eax
subl %ecx, %eax
movl %eax, 0xd8(%rsp)
movq 0x108(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x108(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x30, %rcx
shll $0x2, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq 0x108(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x18, %rcx
andq $0xff, %rcx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x70(%rsp)
movq 0xc0(%rsp), %rax
movl 0x10(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x32f50
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0xc0(%rsp), %rax
movslq 0x10(%rax), %rdx
callq 0x33ca0
movq 0xc0(%rsp), %rax
movslq 0x10(%rax), %rdi
movl $0x1, %esi
callq 0x32f50
movq %rax, 0x88(%rsp)
movl $0x0, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
movq 0xc0(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x47a71d
movq 0x70(%rsp), %rax
movq %rax, 0x28(%rsp)
movl 0xf4(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq 0x28(%rsp), %rax
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x34(%rsp)
movl 0xf4(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl 0x34(%rsp), %eax
movl $0x1, %ecx
subl %edx, %ecx
shll $0x2, %ecx
sarl %cl, %eax
andl $0xf, %eax
movslq %eax, %rcx
leaq 0x1894bf(%rip), %rax    # 0x603bb0
movb (%rax,%rcx), %dl
movq 0x88(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47a682
movl 0xd8(%rsp), %eax
subl 0xdc(%rsp), %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x32f50
movq %rax, 0x80(%rsp)
movl 0xdc(%rsp), %eax
movl %eax, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
cmpl 0xd8(%rsp), %eax
jge 0x47a7eb
movq 0x100(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x47a78b
movl 0xf4(%rsp), %eax
movl %eax, 0xd8(%rsp)
jmp 0x47a7eb
movq 0x100(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movsbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x1890e7(%rip), %rax    # 0x603890
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x1893fa(%rip), %rax    # 0x603bb0
movb (%rax,%rcx), %dl
movq 0x80(%rsp), %rax
movl 0xf4(%rsp), %ecx
subl 0xdc(%rsp), %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47a74e
movq 0xc0(%rsp), %rax
movslq 0x10(%rax), %rdi
movl $0x4, %esi
callq 0x32f50
movq %rax, 0x60(%rsp)
movq 0xc0(%rsp), %rax
movslq 0x10(%rax), %rdi
movl $0x1, %esi
callq 0x32f50
movq %rax, 0x78(%rsp)
movq 0x80(%rsp), %rdi
movl 0xd8(%rsp), %esi
subl 0xdc(%rsp), %esi
movq 0x88(%rsp), %rdx
movq 0xc0(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x98(%rsp), %r8
movq 0x60(%rsp), %r10
movq 0x78(%rsp), %rax
leaq 0xb4(%rsp), %r9
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x48c220
cmpl $0x0, 0xd0(%rsp)
jne 0x47ab0c
movl $0x0, 0xf8(%rsp)
movq 0xc0(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0xec(%rsp)
movl $0x0, 0xe8(%rsp)
movl 0xf8(%rsp), %eax
movq 0xc0(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x30, %rcx
cmpl %ecx, %eax
jge 0x47aa99
movq 0xc8(%rsp), %rax
movslq 0xf8(%rsp), %rcx
movl (%rax,%rcx,4), %eax
andl $0xf, %eax
movl %eax, 0x5c(%rsp)
movq 0xc8(%rsp), %rax
movslq 0xf8(%rsp), %rcx
movl (%rax,%rcx,4), %eax
shrl $0x4, %eax
movl %eax, 0x58(%rsp)
cmpl $0x0, 0x5c(%rsp)
je 0x47a914
cmpl $0x7, 0x5c(%rsp)
je 0x47a914
cmpl $0x8, 0x5c(%rsp)
jne 0x47aa42
movl 0xe8(%rsp), %eax
movl %eax, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
movl 0xe8(%rsp), %ecx
addl 0x58(%rsp), %ecx
cmpl %ecx, %eax
jge 0x47aa1c
movq 0x60(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movl (%rax,%rcx,4), %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x47a989
movq 0x60(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movl (%rax,%rcx,4), %eax
sarl $0x2, %eax
movl 0xec(%rsp), %ecx
subl 0xdc(%rsp), %ecx
movl 0xf4(%rsp), %edx
subl 0xe8(%rsp), %edx
addl %edx, %ecx
cmpl %ecx, %eax
je 0x47a99c
movq 0x68(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x47aa04
movq 0x68(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movq 0x78(%rsp), %rcx
movslq 0xf4(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jge 0x47a9d9
movq 0x68(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x24(%rsp)
jmp 0x47a9ee
movq 0x78(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
movb %al, %dl
movq 0x68(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x47aa06
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47a922
movl 0x58(%rsp), %eax
addl 0xec(%rsp), %eax
movl %eax, 0xec(%rsp)
movl 0x58(%rsp), %eax
addl 0xe8(%rsp), %eax
movl %eax, 0xe8(%rsp)
jmp 0x47aa81
cmpl $0x4, 0x5c(%rsp)
je 0x47aa50
cmpl $0x1, 0x5c(%rsp)
jne 0x47aa64
movl 0x58(%rsp), %eax
addl 0xe8(%rsp), %eax
movl %eax, 0xe8(%rsp)
jmp 0x47aa7f
cmpl $0x2, 0x5c(%rsp)
jne 0x47aa7d
movl 0x58(%rsp), %eax
addl 0xec(%rsp), %eax
movl %eax, 0xec(%rsp)
jmp 0x47aa7f
jmp 0x47aa81
jmp 0x47aa83
movl 0xf8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf8(%rsp)
jmp 0x47a8a8
movl $0x0, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
movq 0xc0(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x47ab07
movq 0x98(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movq 0x68(%rsp), %rcx
movslq 0xf4(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
subl %ecx, %eax
addl $0x40, %eax
movb %al, %dl
movq 0x68(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47aaa4
jmp 0x47b02b
movq 0xc0(%rsp), %rax
movslq 0x10(%rax), %rdi
movl $0x1, %esi
callq 0x32f50
movq %rax, 0x50(%rsp)
movq 0xc0(%rsp), %rax
movslq 0x10(%rax), %rdi
movl $0x1, %esi
callq 0x32f50
movq %rax, 0x48(%rsp)
movl $0x0, 0xf8(%rsp)
movq 0xc0(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0xec(%rsp)
movl $0x0, 0xe8(%rsp)
movl 0xf8(%rsp), %eax
movq 0xc0(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x30, %rcx
cmpl %ecx, %eax
jge 0x47af69
movq 0xc8(%rsp), %rax
movslq 0xf8(%rsp), %rcx
movl (%rax,%rcx,4), %eax
andl $0xf, %eax
movl %eax, 0x44(%rsp)
movq 0xc8(%rsp), %rax
movslq 0xf8(%rsp), %rcx
movl (%rax,%rcx,4), %eax
shrl $0x4, %eax
movl %eax, 0x40(%rsp)
cmpl $0x0, 0x44(%rsp)
je 0x47abd6
cmpl $0x7, 0x44(%rsp)
je 0x47abd6
cmpl $0x8, 0x44(%rsp)
jne 0x47af12
movl 0xe8(%rsp), %eax
movl %eax, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
movl 0xe8(%rsp), %ecx
addl 0x40(%rsp), %ecx
cmpl %ecx, %eax
jge 0x47ac94
movq 0x60(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movl (%rax,%rcx,4), %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x47ac4b
movq 0x60(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movl (%rax,%rcx,4), %eax
sarl $0x2, %eax
movl 0xec(%rsp), %ecx
subl 0xdc(%rsp), %ecx
movl 0xf4(%rsp), %edx
subl 0xe8(%rsp), %edx
addl %edx, %ecx
cmpl %ecx, %eax
je 0x47ac53
xorl %eax, %eax
movl %eax, 0x20(%rsp)
jmp 0x47ac68
movq 0x78(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x20(%rsp)
movl 0x20(%rsp), %eax
movb %al, %dl
movq 0x68(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47abe4
movq 0x68(%rsp), %rax
movslq 0xe8(%rsp), %rcx
movb (%rax,%rcx), %dl
movq 0x50(%rsp), %rax
movslq 0xe8(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0xe8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
movl 0xe8(%rsp), %ecx
addl 0x40(%rsp), %ecx
cmpl %ecx, %eax
jge 0x47ad67
movq 0x68(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movq 0x50(%rsp), %rcx
movl 0xf4(%rsp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jle 0x47ad21
movq 0x68(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x1c(%rsp)
jmp 0x47ad3b
movq 0x50(%rsp), %rax
movl 0xf4(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movb %al, %dl
movq 0x50(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47acc5
movq 0x68(%rsp), %rax
movl 0xe8(%rsp), %ecx
addl 0x40(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq 0x48(%rsp), %rax
movl 0xe8(%rsp), %ecx
addl 0x40(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl 0xe8(%rsp), %eax
addl 0x40(%rsp), %eax
subl $0x2, %eax
movl %eax, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
cmpl 0xe8(%rsp), %eax
jl 0x47ae4a
movq 0x68(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movq 0x48(%rsp), %rcx
movl 0xf4(%rsp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jle 0x47ae04
movq 0x68(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x18(%rsp)
jmp 0x47ae1e
movq 0x48(%rsp), %rax
movl 0xf4(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x18(%rsp)
movl 0x18(%rsp), %eax
movb %al, %dl
movq 0x48(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0xf4(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47adae
movl 0xe8(%rsp), %eax
movl %eax, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
movl 0xe8(%rsp), %ecx
addl 0x40(%rsp), %ecx
cmpl %ecx, %eax
jge 0x47aeec
movq 0x50(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movq 0x48(%rsp), %rcx
movslq 0xf4(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jge 0x47aeab
movq 0x50(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x14(%rsp)
jmp 0x47aec0
movq 0x48(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
movb %al, %dl
movq 0x68(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47ae58
movl 0x40(%rsp), %eax
addl 0xec(%rsp), %eax
movl %eax, 0xec(%rsp)
movl 0x40(%rsp), %eax
addl 0xe8(%rsp), %eax
movl %eax, 0xe8(%rsp)
jmp 0x47af51
cmpl $0x4, 0x44(%rsp)
je 0x47af20
cmpl $0x1, 0x44(%rsp)
jne 0x47af34
movl 0x40(%rsp), %eax
addl 0xe8(%rsp), %eax
movl %eax, 0xe8(%rsp)
jmp 0x47af4f
cmpl $0x2, 0x44(%rsp)
jne 0x47af4d
movl 0x40(%rsp), %eax
addl 0xec(%rsp), %eax
movl %eax, 0xec(%rsp)
jmp 0x47af4f
jmp 0x47af51
jmp 0x47af53
movl 0xf8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf8(%rsp)
jmp 0x47ab6a
movl $0x0, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
movq 0xc0(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x47b017
movq 0x98(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movq 0x68(%rsp), %rcx
movslq 0xf4(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jg 0x47afbd
xorl %eax, %eax
movl %eax, 0x10(%rsp)
jmp 0x47afe8
movq 0x98(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movq 0x68(%rsp), %rcx
movslq 0xf4(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
subl %ecx, %eax
movl %eax, 0x10(%rsp)
movl 0x10(%rsp), %eax
addl $0x40, %eax
movb %al, %dl
movq 0x68(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47af74
movq 0x50(%rsp), %rdi
callq 0x34078
movq 0x48(%rsp), %rdi
callq 0x34078
cmpl $0x0, 0xd4(%rsp)
je 0x47b0c6
movl $0x0, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
movq 0xc0(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x47b098
movq 0x68(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %esi
subl $0x40, %esi
movq 0x98(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movzbl (%rax,%rcx), %edx
subl %esi, %edx
movb %dl, (%rax,%rcx)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x47b044
movq 0x108(%rsp), %rdi
movq 0xc0(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movq 0x68(%rsp), %r8
leaq 0xff83c(%rip), %rsi     # 0x57a8f6
movl $0x5a, %edx
callq 0x467640
jmp 0x47b0f2
movq 0x108(%rsp), %rdi
movq 0xc0(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movq 0x68(%rsp), %r8
leaq 0xff80b(%rip), %rsi     # 0x57a8f3
movl $0x5a, %edx
callq 0x467640
movq 0x68(%rsp), %rdi
callq 0x34078
movq 0x88(%rsp), %rdi
callq 0x34078
movq 0x80(%rsp), %rdi
callq 0x34078
movq 0x78(%rsp), %rdi
callq 0x34078
movq 0x60(%rsp), %rdi
callq 0x34078
movl $0x0, 0x114(%rsp)
movl 0x114(%rsp), %eax
addq $0x118, %rsp            # imm = 0x118
retq
nopw %cs:(%rax,%rax)