// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/samtools-0.1.18/bam_md.c
// Function: bam_fillmd1_core
void bam_fillmd1_core(bam1_t *b, char *ref, int flag, int max_nm)
{
	uint8_t *seq = bam1_seq(b);
	uint32_t *cigar = bam1_cigar(b);
	bam1_core_t *c = &b->core;
	int i, x, y, u = 0;
	kstring_t *str;
	int32_t old_nm_i = -1, nm = 0;

	str = (kstring_t*)calloc(1, sizeof(kstring_t));
	for (i = y = 0, x = c->pos; i < c->n_cigar; ++i) {
		int j, l = cigar[i]>>4, op = cigar[i]&0xf;
		if (op == BAM_CMATCH || op == BAM_CEQUAL || op == BAM_CDIFF) {
			for (j = 0; j < l; ++j) {
				int z = y + j;
				int c1 = bam1_seqi(seq, z), c2 = bam_nt16_table[(int)ref[x+j]];
				if (ref[x+j] == 0) break; // out of boundary
				if ((c1 == c2 && c1 != 15 && c2 != 15) || c1 == 0) { // a match
					if (flag&USE_EQUAL) seq[z/2] &= (z&1)? 0xf0 : 0x0f;
					++u;
				} else {
					kputw(u, str); kputc(ref[x+j], str);
					u = 0; ++nm;
				}
			}
			if (j < l) break;
			x += l; y += l;
		} else if (op == BAM_CDEL) {
			kputw(u, str); kputc('^', str);
			for (j = 0; j < l; ++j) {
				if (ref[x+j] == 0) break;
				kputc(ref[x+j], str);
			}
			u = 0;
			if (j < l) break;
			x += l; nm += l;
		} else if (op == BAM_CINS || op == BAM_CSOFT_CLIP) {
			y += l;
			if (op == BAM_CINS) nm += l;
		} else if (op == BAM_CREF_SKIP) {
			x += l;
		}
	}
	kputw(u, str);
	// apply max_nm
	if (max_nm > 0 && nm >= max_nm) {
		for (i = y = 0, x = c->pos; i < c->n_cigar; ++i) {
			int j, l = cigar[i]>>4, op = cigar[i]&0xf;
			if (op == BAM_CMATCH || op == BAM_CEQUAL || op == BAM_CDIFF) {
				for (j = 0; j < l; ++j) {
					int z = y + j;
					int c1 = bam1_seqi(seq, z), c2 = bam_nt16_table[(int)ref[x+j]];
					if (ref[x+j] == 0) break; // out of boundary
					if ((c1 == c2 && c1 != 15 && c2 != 15) || c1 == 0) { // a match
						seq[z/2] |= (z&1)? 0x0f : 0xf0;
						bam1_qual(b)[z] = 0;
					}
				}
				if (j < l) break;
				x += l; y += l;
			} else if (op == BAM_CDEL || op == BAM_CREF_SKIP) x += l;
			else if (op == BAM_CINS || op == BAM_CSOFT_CLIP) y += l;
		}
	}
	// update NM
	if (flag & UPDATE_NM) {
		uint8_t *old_nm = bam_aux_get(b, "NM");
		if (c->flag & BAM_FUNMAP) return;
		if (old_nm) old_nm_i = bam_aux2i(old_nm);
		if (!old_nm) bam_aux_append(b, "NM", 'i', 4, (uint8_t*)&nm);
		else if (nm != old_nm_i) {
			fprintf(stderr, "[bam_fillmd1] different NM for read '%s': %d -> %d\n", bam1_qname(b), old_nm_i, nm);
			bam_aux_del(b, old_nm);
			bam_aux_append(b, "NM", 'i', 4, (uint8_t*)&nm);
		}
	}
	// update MD
	if (flag & UPDATE_MD) {
		uint8_t *old_md = bam_aux_get(b, "MD");
		if (c->flag & BAM_FUNMAP) return;
		if (!old_md) bam_aux_append(b, "MD", 'Z', str->l + 1, (uint8_t*)str->s);
		else {
			int is_diff = 0;
			if (strlen((char*)old_md+1) == str->l) {
				for (i = 0; i < str->l; ++i)
					if (toupper(old_md[i+1]) != toupper(str->s[i]))
						break;
				if (i < str->l) is_diff = 1;
			} else is_diff = 1;
			if (is_diff) {
				fprintf(stderr, "[bam_fillmd1] different MD for read '%s': '%s' -> '%s'\n", bam1_qname(b), old_md+1, str->s);
				bam_aux_del(b, old_md);
				bam_aux_append(b, "MD", 'Z', str->l + 1, (uint8_t*)str->s);
			}
		}
	}
	// drop all tags but RG
	if (flag&DROP_TAG) {
		uint8_t *q = bam_aux_get(b, "RG");
		bam_aux_drop_other(b, q);
	}
	// reduce the resolution of base quality
	if (flag&BIN_QUAL) {
		uint8_t *qual = bam1_qual(b);
		for (i = 0; i < b->core.l_qseq; ++i)
			if (qual[i] >= 3) qual[i] = qual[i]/10*10 + 7;
	}
	free(str->s); free(str);
}

// Assembly:
subq $0xe8, %rsp
movq %rdi, 0xe0(%rsp)
movq %rsi, 0xd8(%rsp)
movl %edx, 0xd4(%rsp)
movl %ecx, 0xd0(%rsp)
movq 0xe0(%rsp), %rax
movq 0x30(%rax), %rax
movq 0xe0(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x30, %rcx
shll $0x2, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq 0xe0(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x18, %rcx
andq $0xff, %rcx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0xc8(%rsp)
movq 0xe0(%rsp), %rax
movq 0x30(%rax), %rax
movq 0xe0(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x18, %rcx
andq $0xff, %rcx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0xc0(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0xb8(%rsp)
movl $0x0, 0xa8(%rsp)
movl $0xffffffff, 0x9c(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x98(%rsp)
movl $0x1, %edi
movl $0x18, %esi
callq 0x32f50
movq %rax, 0xa0(%rsp)
movl $0x0, 0xac(%rsp)
movl $0x0, 0xb4(%rsp)
movq 0xb8(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0xb0(%rsp)
movl 0xb4(%rsp), %eax
movq 0xb8(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x30, %rcx
cmpl %ecx, %eax
jge 0x478df1
movq 0xc0(%rsp), %rax
movslq 0xb4(%rsp), %rcx
movl (%rax,%rcx,4), %eax
shrl $0x4, %eax
movl %eax, 0x90(%rsp)
movq 0xc0(%rsp), %rax
movslq 0xb4(%rsp), %rcx
movl (%rax,%rcx,4), %eax
andl $0xf, %eax
movl %eax, 0x8c(%rsp)
cmpl $0x0, 0x8c(%rsp)
je 0x478a3b
cmpl $0x7, 0x8c(%rsp)
je 0x478a3b
cmpl $0x8, 0x8c(%rsp)
jne 0x478c6e
movl $0x0, 0x94(%rsp)
movl 0x94(%rsp), %eax
cmpl 0x90(%rsp), %eax
jge 0x478c2a
movl 0xac(%rsp), %eax
addl 0x94(%rsp), %eax
movl %eax, 0x88(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0x30(%rsp)
movl 0x88(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq 0x30(%rsp), %rax
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x3c(%rsp)
movl 0x88(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl 0x3c(%rsp), %eax
movl $0x1, %ecx
subl %edx, %ecx
shll $0x2, %ecx
sarl %cl, %eax
andl $0xf, %eax
movl %eax, 0x84(%rsp)
movq 0xd8(%rsp), %rax
movl 0xb0(%rsp), %ecx
addl 0x94(%rsp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x18ada3(%rip), %rax    # 0x603890
movzbl (%rax,%rcx), %eax
movl %eax, 0x80(%rsp)
movq 0xd8(%rsp), %rax
movl 0xb0(%rsp), %ecx
addl 0x94(%rsp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x478b1f
jmp 0x478c2a
movl 0x84(%rsp), %eax
cmpl 0x80(%rsp), %eax
jne 0x478b43
cmpl $0xf, 0x84(%rsp)
je 0x478b43
cmpl $0xf, 0x80(%rsp)
jne 0x478b4d
cmpl $0x0, 0x84(%rsp)
jne 0x478bb8
movl 0xd4(%rsp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x478ba5
movl 0x88(%rsp), %ecx
andl $0x1, %ecx
movl $0xf, %esi
movl $0xf0, %eax
cmpl $0x0, %ecx
cmovnel %eax, %esi
movq 0xc8(%rsp), %rax
movq %rax, 0x28(%rsp)
movl 0x88(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq 0x28(%rsp), %rax
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
andl %esi, %edx
movb %dl, (%rax,%rcx)
movl 0xa8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa8(%rsp)
jmp 0x478c12
movl 0xa8(%rsp), %edi
movq 0xa0(%rsp), %rsi
callq 0x479540
movq 0xd8(%rsp), %rax
movl 0xb0(%rsp), %ecx
addl 0x94(%rsp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %edi
movq 0xa0(%rsp), %rsi
callq 0x479770
movl $0x0, 0xa8(%rsp)
movl 0x98(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x98(%rsp)
jmp 0x478c14
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x478a46
movl 0x94(%rsp), %eax
cmpl 0x90(%rsp), %eax
jge 0x478c3f
jmp 0x478df1
movl 0x90(%rsp), %eax
addl 0xb0(%rsp), %eax
movl %eax, 0xb0(%rsp)
movl 0x90(%rsp), %eax
addl 0xac(%rsp), %eax
movl %eax, 0xac(%rsp)
jmp 0x478dd9
cmpl $0x2, 0x8c(%rsp)
jne 0x478d6a
movl 0xa8(%rsp), %edi
movq 0xa0(%rsp), %rsi
callq 0x479540
movq 0xa0(%rsp), %rsi
movl $0x5e, %edi
callq 0x479770
movl $0x0, 0x94(%rsp)
movl 0x94(%rsp), %eax
cmpl 0x90(%rsp), %eax
jge 0x478d1e
movq 0xd8(%rsp), %rax
movl 0xb0(%rsp), %ecx
addl 0x94(%rsp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x478ce1
jmp 0x478d1e
movq 0xd8(%rsp), %rax
movl 0xb0(%rsp), %ecx
addl 0x94(%rsp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %edi
movq 0xa0(%rsp), %rsi
callq 0x479770
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x478cad
movl $0x0, 0xa8(%rsp)
movl 0x94(%rsp), %eax
cmpl 0x90(%rsp), %eax
jge 0x478d3e
jmp 0x478df1
movl 0x90(%rsp), %eax
addl 0xb0(%rsp), %eax
movl %eax, 0xb0(%rsp)
movl 0x90(%rsp), %eax
addl 0x98(%rsp), %eax
movl %eax, 0x98(%rsp)
jmp 0x478dd7
cmpl $0x1, 0x8c(%rsp)
je 0x478d7e
cmpl $0x4, 0x8c(%rsp)
jne 0x478db4
movl 0x90(%rsp), %eax
addl 0xac(%rsp), %eax
movl %eax, 0xac(%rsp)
cmpl $0x1, 0x8c(%rsp)
jne 0x478db2
movl 0x90(%rsp), %eax
addl 0x98(%rsp), %eax
movl %eax, 0x98(%rsp)
jmp 0x478dd5
cmpl $0x3, 0x8c(%rsp)
jne 0x478dd3
movl 0x90(%rsp), %eax
addl 0xb0(%rsp), %eax
movl %eax, 0xb0(%rsp)
jmp 0x478dd5
jmp 0x478dd7
jmp 0x478dd9
jmp 0x478ddb
movl 0xb4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb4(%rsp)
jmp 0x4789c0
movl 0xa8(%rsp), %edi
movq 0xa0(%rsp), %rsi
callq 0x479540
cmpl $0x0, 0xd0(%rsp)
jle 0x4790ec
movl 0x98(%rsp), %eax
cmpl 0xd0(%rsp), %eax
jl 0x4790ec
movl $0x0, 0xac(%rsp)
movl $0x0, 0xb4(%rsp)
movq 0xb8(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0xb0(%rsp)
movl 0xb4(%rsp), %eax
movq 0xb8(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x30, %rcx
cmpl %ecx, %eax
jge 0x4790ea
movq 0xc0(%rsp), %rax
movslq 0xb4(%rsp), %rcx
movl (%rax,%rcx,4), %eax
shrl $0x4, %eax
movl %eax, 0x78(%rsp)
movq 0xc0(%rsp), %rax
movslq 0xb4(%rsp), %rcx
movl (%rax,%rcx,4), %eax
andl $0xf, %eax
movl %eax, 0x74(%rsp)
cmpl $0x0, 0x74(%rsp)
je 0x478ebb
cmpl $0x7, 0x74(%rsp)
je 0x478ebb
cmpl $0x8, 0x74(%rsp)
jne 0x47908c
movl $0x0, 0x7c(%rsp)
movl 0x7c(%rsp), %eax
cmpl 0x78(%rsp), %eax
jge 0x479057
movl 0xac(%rsp), %eax
addl 0x7c(%rsp), %eax
movl %eax, 0x70(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x70(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq 0x18(%rsp), %rax
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, 0x24(%rsp)
movl 0x70(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl 0x24(%rsp), %eax
movl $0x1, %ecx
subl %edx, %ecx
shll $0x2, %ecx
sarl %cl, %eax
andl $0xf, %eax
movl %eax, 0x6c(%rsp)
movq 0xd8(%rsp), %rax
movl 0xb0(%rsp), %ecx
addl 0x7c(%rsp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x18a93e(%rip), %rax    # 0x603890
movzbl (%rax,%rcx), %eax
movl %eax, 0x68(%rsp)
movq 0xd8(%rsp), %rax
movl 0xb0(%rsp), %ecx
addl 0x7c(%rsp), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x478f7e
jmp 0x479057
movl 0x6c(%rsp), %eax
cmpl 0x68(%rsp), %eax
jne 0x478f96
cmpl $0xf, 0x6c(%rsp)
je 0x478f96
cmpl $0xf, 0x68(%rsp)
jne 0x478fa1
cmpl $0x0, 0x6c(%rsp)
jne 0x479045
movl 0x70(%rsp), %ecx
andl $0x1, %ecx
movl $0xf0, %esi
movl $0xf, %eax
cmpl $0x0, %ecx
cmovnel %eax, %esi
movq 0xc8(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x70(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq 0x10(%rsp), %rax
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq 0xe0(%rsp), %rax
movq 0x30(%rax), %rax
movq 0xe0(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x30, %rcx
shll $0x2, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq 0xe0(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x18, %rcx
andq $0xff, %rcx
movslq %ecx, %rcx
addq %rcx, %rax
movq 0xe0(%rsp), %rcx
movl 0x10(%rcx), %ecx
addl $0x1, %ecx
sarl %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movslq 0x70(%rsp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x479047
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7c(%rsp)
jmp 0x478ec3
movl 0x7c(%rsp), %eax
cmpl 0x78(%rsp), %eax
jge 0x479066
jmp 0x4790ea
movl 0x78(%rsp), %eax
addl 0xb0(%rsp), %eax
movl %eax, 0xb0(%rsp)
movl 0x78(%rsp), %eax
addl 0xac(%rsp), %eax
movl %eax, 0xac(%rsp)
jmp 0x4790d2
cmpl $0x2, 0x74(%rsp)
je 0x47909a
cmpl $0x3, 0x74(%rsp)
jne 0x4790ae
movl 0x78(%rsp), %eax
addl 0xb0(%rsp), %eax
movl %eax, 0xb0(%rsp)
jmp 0x4790d0
cmpl $0x1, 0x74(%rsp)
je 0x4790bc
cmpl $0x4, 0x74(%rsp)
jne 0x4790ce
movl 0x78(%rsp), %eax
addl 0xac(%rsp), %eax
movl %eax, 0xac(%rsp)
jmp 0x4790d0
jmp 0x4790d2
jmp 0x4790d4
movl 0xb4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb4(%rsp)
jmp 0x478e4f
jmp 0x4790ec
movl 0xd4(%rsp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x479203
movq 0xe0(%rsp), %rdi
leaq 0xfe270(%rip), %rsi     # 0x57737e
callq 0x467810
movq %rax, 0x60(%rsp)
movq 0xb8(%rsp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
andq $0xffff, %rax           # imm = 0xFFFF
andl $0x4, %eax
cmpl $0x0, %eax
je 0x47913b
jmp 0x479535
cmpq $0x0, 0x60(%rsp)
je 0x479154
movq 0x60(%rsp), %rdi
callq 0x468890
movl %eax, 0x9c(%rsp)
cmpq $0x0, 0x60(%rsp)
jne 0x479184
movq 0xe0(%rsp), %rdi
leaq 0xfe213(%rip), %rsi     # 0x57737e
movl $0x69, %edx
movl $0x4, %ecx
leaq 0x98(%rsp), %r8
callq 0x467640
jmp 0x479201
movl 0x98(%rsp), %eax
cmpl 0x9c(%rsp), %eax
je 0x4791ff
movq 0x182e2d(%rip), %rax    # 0x5fbfc8
movq (%rax), %rdi
movq 0xe0(%rsp), %rax
movq 0x30(%rax), %rdx
movl 0x9c(%rsp), %ecx
movl 0x98(%rsp), %r8d
leaq 0x1016c4(%rip), %rsi    # 0x57a884
movb $0x0, %al
callq 0x33960
movq 0xe0(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x467a40
movq 0xe0(%rsp), %rdi
leaq 0xfe196(%rip), %rsi     # 0x57737e
movl $0x69, %edx
movl $0x4, %ecx
leaq 0x98(%rsp), %r8
callq 0x467640
jmp 0x479201
jmp 0x479203
movl 0xd4(%rsp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x4793f0
movq 0xe0(%rsp), %rdi
leaq 0x101693(%rip), %rsi    # 0x57a8b8
callq 0x467810
movq %rax, 0x58(%rsp)
movq 0xb8(%rsp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
andq $0xffff, %rax           # imm = 0xFFFF
andl $0x4, %eax
cmpl $0x0, %eax
je 0x479252
jmp 0x479535
cmpq $0x0, 0x58(%rsp)
jne 0x479295
movq 0xe0(%rsp), %rdi
movq 0xa0(%rsp), %rax
movq (%rax), %rax
addq $0x1, %rax
movl %eax, %ecx
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %r8
leaq 0x101632(%rip), %rsi    # 0x57a8b8
movl $0x5a, %edx
callq 0x467640
jmp 0x4793ee
movl $0x0, 0x54(%rsp)
movq 0x58(%rsp), %rdi
addq $0x1, %rdi
callq 0x30e70
movq 0xa0(%rsp), %rcx
cmpq (%rcx), %rax
jne 0x479358
movl $0x0, 0xb4(%rsp)
movslq 0xb4(%rsp), %rax
movq 0xa0(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x479339
movq 0x58(%rsp), %rax
movl 0xb4(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %edi
callq 0x2fd00
movl %eax, 0xc(%rsp)
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0xb4(%rsp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x2fd00
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
je 0x479324
jmp 0x479339
jmp 0x479326
movl 0xb4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb4(%rsp)
jmp 0x4792c7
movslq 0xb4(%rsp), %rax
movq 0xa0(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x479356
movl $0x1, 0x54(%rsp)
jmp 0x479360
movl $0x1, 0x54(%rsp)
cmpl $0x0, 0x54(%rsp)
je 0x4793ec
movq 0x182c56(%rip), %rax    # 0x5fbfc8
movq (%rax), %rdi
movq 0xe0(%rsp), %rax
movq 0x30(%rax), %rdx
movq 0x58(%rsp), %rcx
addq $0x1, %rcx
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %r8
leaq 0x10151e(%rip), %rsi    # 0x57a8bb
movb $0x0, %al
callq 0x33960
movq 0xe0(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x467a40
movq 0xe0(%rsp), %rdi
movq 0xa0(%rsp), %rax
movq (%rax), %rax
addq $0x1, %rax
movl %eax, %ecx
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %r8
leaq 0x1014d6(%rip), %rsi    # 0x57a8b8
movl $0x5a, %edx
callq 0x467640
jmp 0x4793ee
jmp 0x4793f0
movl 0xd4(%rsp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x47942a
movq 0xe0(%rsp), %rdi
leaq 0xfdfca(%rip), %rsi     # 0x5773d8
callq 0x467810
movq %rax, 0x48(%rsp)
movq 0xe0(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x467be0
movl 0xd4(%rsp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x479517
movq 0xe0(%rsp), %rax
movq 0x30(%rax), %rax
movq 0xe0(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x30, %rcx
shll $0x2, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq 0xe0(%rsp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x18, %rcx
andq $0xff, %rcx
movslq %ecx, %rcx
addq %rcx, %rax
movq 0xe0(%rsp), %rcx
movl 0x10(%rcx), %ecx
addl $0x1, %ecx
sarl %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x40(%rsp)
movl $0x0, 0xb4(%rsp)
movl 0xb4(%rsp), %eax
movq 0xe0(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x479515
movq 0x40(%rsp), %rax
movslq 0xb4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x3, %eax
jl 0x479500
movq 0x40(%rsp), %rax
movslq 0xb4(%rsp), %rcx
movzbl (%rax,%rcx), %eax
movl $0xa, %ecx
cltd
idivl %ecx
imull $0xa, %eax, %eax
addl $0x7, %eax
movb %al, %dl
movq 0x40(%rsp), %rax
movslq 0xb4(%rsp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x479502
movl 0xb4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb4(%rsp)
jmp 0x4794a5
jmp 0x479517
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x34078
movq 0xa0(%rsp), %rdi
callq 0x34078
addq $0xe8, %rsp
retq
nopl (%rax)