// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/sam.c
// Function: sam_parse1
int sam_parse1(kstring_t *s, bam_hdr_t *h, bam1_t *b)
{
#define _read_token(_p) (_p); for (; *(_p) && *(_p) != '\t'; ++(_p)); if (*(_p) != '\t') goto err_ret; *(_p)++ = 0
#define _read_token_aux(_p) (_p); for (; *(_p) && *(_p) != '\t'; ++(_p)); *(_p)++ = 0 // this is different in that it does not test *(_p)=='\t'
#define _get_mem(type_t, _x, _s, _l) ks_resize((_s), (_s)->l + (_l)); *(_x) = (type_t*)((_s)->s + (_s)->l); (_s)->l += (_l)
#define _parse_err(cond, msg) do { if ((cond) && hts_verbose >= 1) { fprintf(stderr, "[E::%s] " msg "\n", __func__); goto err_ret; } } while (0)
#define _parse_warn(cond, msg) if ((cond) && hts_verbose >= 2) fprintf(stderr, "[W::%s] " msg "\n", __func__)

	uint8_t *t;
	char *p = s->s, *q;
	int i;
	kstring_t str;
	bam1_core_t *c = &b->core;

	str.l = b->l_data = 0;
	str.s = (char*)b->data; str.m = b->m_data;
	memset(c, 0, 32);
	if (h->cigar_tab == 0) {
		h->cigar_tab = (uint8_t*)calloc(128, 1);
		for (i = 0; BAM_CIGAR_STR[i]; ++i)
			h->cigar_tab[(int)BAM_CIGAR_STR[i]] = i;
	}
	// qname
	q = _read_token(p);
	kputsn_(q, p - q, &str);
	c->l_qname = p - q;
	// flag
	c->flag = strtol(p, &p, 0);
	if (*p++ != '\t') goto err_ret; // malformated flag
	// chr
	q = _read_token(p);
	if (strcmp(q, "*")) {
		_parse_err(h->n_targets == 0, "missing SAM header");
		c->tid = bam_name2id(h, q);
		_parse_warn(c->tid < 0, "urecognized reference name; treated as unmapped");
	} else c->tid = -1;
	// pos
	c->pos = strtol(p, &p, 10) - 1;
	if (*p++ != '\t') goto err_ret;
	if (c->pos < 0 && c->tid >= 0) {
		_parse_warn(1, "mapped query cannot have zero coordinate; treated as unmapped");
		c->tid = -1;
	}
	if (c->tid < 0) c->flag |= BAM_FUNMAP;
	// mapq
	c->qual = strtol(p, &p, 10);
	if (*p++ != '\t') goto err_ret;
	// cigar
	if (*p != '*') {
		uint32_t *cigar;
		for (q = p, c->n_cigar = 0; *q && *q != '\t'; ++q)
			if (!isdigit(*q)) ++c->n_cigar;
		_get_mem(uint32_t, &cigar, &str, c->n_cigar<<2);
		for (i = 0, q = p; i < c->n_cigar; ++i, ++q) {
			int op;
			cigar[i] = strtol(q, &q, 10)<<BAM_CIGAR_SHIFT;
			op = (uint8_t)*q >= 128? -1 : h->cigar_tab[(int)*q];
			_parse_err(op < 0, "urecognized CIGAR operator");
			cigar[i] |= op;
		}
		p = q + 1;
		i = bam_cigar2rlen(c->n_cigar, cigar);
	} else {
		_parse_warn(!(c->flag&BAM_FUNMAP), "mapped query must have a CIGAR; treated as unmapped");
		c->flag |= BAM_FUNMAP;
		q = _read_token(p);
		i = 1;
	}
	c->bin = hts_reg2bin(c->pos, c->pos + i, 14, 5);
	// mate chr
	q = _read_token(p);
	if (strcmp(q, "=") == 0) c->mtid = c->tid;
	else if (strcmp(q, "*") == 0) c->mtid = -1;
	else c->mtid = bam_name2id(h, q);
	// mpos
	c->mpos = strtol(p, &p, 10) - 1;
	if (*p++ != '\t') goto err_ret;
	if (c->mpos < 0 && c->mtid >= 0) {
		_parse_warn(1, "mapped mate cannot have zero coordinate; treated as unmapped");
		c->mtid = -1;
	}
	// tlen
	c->isize = strtol(p, &p, 10);
	if (*p++ != '\t') goto err_ret;
	// seq
	q = _read_token(p);
	if (strcmp(q, "*")) {
		c->l_qseq = p - q - 1;
		i = bam_cigar2qlen(c->n_cigar, (uint32_t*)(str.s + c->l_qname));
		_parse_err(c->n_cigar && i != c->l_qseq, "CIGAR and query sequence are of different length");
		i = (c->l_qseq + 1) >> 1;
		_get_mem(uint8_t, &t, &str, i);
		memset(t, 0, i);
		for (i = 0; i < c->l_qseq; ++i)
			t[i>>1] |= seq_nt16_table[(int)q[i]] << ((~i&1)<<2);
	} else c->l_qseq = 0;
	// qual
	q = _read_token_aux(p);
	_get_mem(uint8_t, &t, &str, c->l_qseq);
	if (strcmp(q, "*")) {
		_parse_err(p - q - 1 != c->l_qseq, "SEQ and QUAL are of different length");
		for (i = 0; i < c->l_qseq; ++i) t[i] = q[i] - 33;
	} else memset(t, 0xff, c->l_qseq);
	// aux
	while (p < s->s + s->l) {
		uint8_t type;
		q = _read_token_aux(p); // FIXME: can be accelerated for long 'B' arrays
		_parse_err(p - q - 1 < 6, "incomplete aux field");
		kputsn_(q, 2, &str);
		q += 3; type = *q++; ++q; // q points to value
		if (type == 'A' || type == 'a' || type == 'c' || type == 'C') {
			kputc_('A', &str);
			kputc_(*q, &str);
		} else if (type == 'i' || type == 'I') {
			long x;
			x = strtol(q, &q, 10);
			if (x < 0) {
				if (x >= INT8_MIN) {
					kputc_('c', &str); kputc_(x, &str);
				} else if (x >= INT16_MIN) {
					int16_t y = x;
					kputc_('s', &str); kputsn_((char*)&y, 2, &str);
				} else {
					int32_t y = x;
					kputc_('i', &str); kputsn_(&y, 4, &str);
				}
			} else {
				if (x <= UINT8_MAX) {
					kputc_('C', &str); kputc_(x, &str);
				} else if (x <= UINT16_MAX) {
					uint16_t y = x;
					kputc_('S', &str); kputsn_(&y, 2, &str);
				} else {
					uint32_t y = x;
					kputc_('I', &str); kputsn_(&y, 4, &str);
				}
			}
		} else if (type == 'f') {
			float x;
			x = strtod(q, &q);
			kputc_('f', &str); kputsn_(&x, 4, &str);
		} else if (type == 'Z' || type == 'H') {
			kputc_('Z', &str);kputsn_(q, p - q, &str); // note that this include the trailing NULL
		} else if (type == 'B') {
			int32_t n;
			char *r;
			_parse_err(p - q - 1 < 3, "incomplete B-typed aux field");
			type = *q++; // q points to the first ',' following the typing byte
			for (r = q, n = 0; *r; ++r)
				if (*r == ',') ++n;
			kputc_('B', &str); kputc_(type, &str); kputsn_(&n, 4, &str);
			// FIXME: to evaluate which is faster: a) aligned array and then memmove(); b) unaligned array; c) kputsn_()
			if (type == 'c')      while (q + 1 < p) { int8_t   x = strtol(q + 1, &q, 0); kputc_(x, &str); }
			else if (type == 'C') while (q + 1 < p) { uint8_t  x = strtol(q + 1, &q, 0); kputc_(x, &str); }
			else if (type == 's') while (q + 1 < p) { int16_t  x = strtol(q + 1, &q, 0); kputsn_(&x, 2, &str); }
			else if (type == 'S') while (q + 1 < p) { uint16_t x = strtol(q + 1, &q, 0); kputsn_(&x, 2, &str); }
			else if (type == 'i') while (q + 1 < p) { int32_t  x = strtol(q + 1, &q, 0); kputsn_(&x, 4, &str); }
			else if (type == 'I') while (q + 1 < p) { uint32_t x = strtol(q + 1, &q, 0); kputsn_(&x, 4, &str); }
			else if (type == 'f') while (q + 1 < p) { float    x = strtod(q + 1, &q);    kputsn_(&x, 4, &str); }
			else _parse_err(1, "unrecognized type");
		} else _parse_err(1, "unrecognized type");
	}
	b->data = (uint8_t*)str.s; b->l_data = str.l; b->m_data = str.m;
	return 0;

#undef _parse_warn
#undef _parse_err
#undef _get_mem
#undef _read_token_aux
#undef _read_token
err_ret:
	b->data = (uint8_t*)str.s; b->l_data = str.l; b->m_data = str.m;
	return -2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r9
movq %rsi, %r12
movq %rdi, 0x30(%rsp)
movq 0x10(%rdi), %r13
movl $0x0, 0x20(%rdx)
movq $0x0, 0x38(%rsp)
movq 0x28(%rdx), %rax
movq %rax, 0x20(%rsp)
movq %rax, 0x48(%rsp)
movslq 0x24(%rdx), %rbx
movq %rbx, 0x40(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdx)
movups %xmm0, (%rdx)
cmpq $0x0, 0x18(%rsi)
movq %rdx, 0x8(%rsp)
jne 0x9fa2
movl $0x80, %edi
movl $0x1, %esi
callq 0x21f0
movq 0x8(%rsp), %r9
movq %rax, 0x18(%r12)
xorl %eax, %eax
leaq 0x4657(%rip), %rcx      # 0xe5e3
movsbq (%rax,%rcx), %rdx
movq 0x18(%r12), %rsi
movb %al, (%rsi,%rdx)
incq %rax
cmpq $0xa, %rax
jne 0x9f8c
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %r13, 0x10(%rsp)
leaq 0x1(%r13), %r14
movl $0x1000000, %r15d       # imm = 0x1000000
movq %rax, %rbp
movzbl -0x1(%r14), %ecx
testl %ecx, %ecx
je 0xa55b
cmpl $0x9, %ecx
je 0x9fdf
incq %r14
addq %rax, %rbp
addq $0x1000000, %r15        # imm = 0x1000000
jmp 0x9fbe
movq %r14, 0x28(%rsp)
movb $0x0, -0x1(%r14)
sarq $0x20, %rbp
cmpq %rbx, %rbp
jbe 0xa043
leaq -0x1(%rbp), %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x40(%rsp)
movq 0x20(%rsp), %rdi
callq 0x22e0
movq %rax, %rdi
movq %rax, 0x48(%rsp)
jmp 0xa048
movq 0x20(%rsp), %rdi
movq %rdi, 0x20(%rsp)
movq %r13, %rsi
movq %rbp, %rdx
callq 0x2240
movq %rbp, 0x38(%rsp)
shrl $0x18, %r15d
movq 0x8(%rsp), %rbx
movb %r15b, 0xb(%rbx)
leaq 0x28(%rsp), %r13
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2230
movq %rbx, %r9
movw %ax, 0xc(%rbx)
movq (%r13), %rax
cmpb $0x9, (%rax)
jne 0xa55b
leaq 0x1(%rax), %rsi
movq %rsi, 0x10(%rsp)
leaq 0x2(%rax), %r14
movzbl -0x1(%r14), %ecx
testl %ecx, %ecx
je 0xa55b
cmpl $0x9, %ecx
je 0xa0b4
incq %r14
jmp 0xa09d
movq %r14, 0x28(%rsp)
movb $0x0, -0x1(%r14)
cmpb $0x2a, (%rsi)
jne 0xa0c9
cmpb $0x0, 0x2(%rax)
je 0xa100
cmpl $0x0, (%r12)
leaq 0x814b(%rip), %rbx      # 0x12220
jne 0xa0e0
cmpl $0x0, (%rbx)
jg 0xa49a
movq %r12, %rdi
callq 0x8ef6
movq 0x8(%rsp), %r15
movl %eax, (%r15)
testl %eax, %eax
jns 0xa10a
cmpl $0x2, (%rbx)
jl 0xa10a
callq 0x2545
jmp 0xa10a
movl $0xffffffff, (%r9)      # imm = 0xFFFFFFFF
movq %r9, %r15
leaq 0x28(%rsp), %r13
movq %r14, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x2230
decl %eax
movl %eax, 0x4(%r15)
movq (%r13), %rcx
leaq 0x1(%rcx), %r14
movq %r14, (%r13)
cmpb $0x9, (%rcx)
movq %r15, %r9
jne 0xa55b
movl (%r9), %ecx
testl %eax, %eax
js 0xa14a
testl %ecx, %ecx
jns 0xa16a
jmp 0xa165
testl %ecx, %ecx
js 0xa165
leaq 0x80cb(%rip), %rax      # 0x12220
cmpl $0x2, (%rax)
jge 0xa6ac
movl $0xffffffff, (%r9)      # imm = 0xFFFFFFFF
orb $0x4, 0xc(%r9)
leaq 0x28(%rsp), %r13
movq %r14, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x2230
movq 0x8(%rsp), %r9
movq 0x8(%r9), %rcx
movzbl %al, %eax
shll $0x10, %eax
movq %rcx, %r15
andq $-0xff0001, %r15        # imm = 0xFF00FFFF
orq %rax, %r15
movq %r15, 0x8(%r9)
movq (%r13), %rax
cmpb $0x9, (%rax)
jne 0xa55b
movq %rax, 0x50(%rsp)
leaq 0x1(%rax), %r13
cmpb $0x2a, (%r13)
jne 0xa213
movabsq $0x400000000, %rbx      # imm = 0x400000000
btq $0x22, %rcx
jb 0xa3b8
leaq 0x8048(%rip), %rax      # 0x12220
cmpl $0x2, (%rax)
movq 0x50(%rsp), %r13
jl 0xa3bd
movq 0x7e0b(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
leaq 0x44c2(%rip), %rsi      # 0xe6b9
leaq 0x440c(%rip), %rdx      # 0xe60a
xorl %eax, %eax
callq 0x2220
movq 0x8(%rsp), %r9
movq 0x8(%r9), %r15
jmp 0xa3bd
movabsq $0x1000000000000, %rax  # imm = 0x1000000000000
decq %rax
movq %rax, 0x20(%rsp)
andq %rax, %r15
movq %r15, 0x8(%r9)
movq %r13, %r14
movzbl (%r14), %eax
testl %eax, %eax
je 0xa282
cmpl $0x9, %eax
je 0xa282
movsbq %al, %rbx
callq 0x2410
movq (%rax), %rax
testb $0x8, 0x1(%rax,%rbx,2)
jne 0xa27d
movq %r15, %rax
movabsq $-0x1000000000000, %rcx # imm = 0xFFFF000000000000
andq %rcx, %rax
movabsq $0x1000000000000, %rcx  # imm = 0x1000000000000
addq %rcx, %rax
andq 0x20(%rsp), %r15
orq %rax, %r15
movq 0x8(%rsp), %rax
movq %r15, 0x8(%rax)
incq %r14
jmp 0xa22f
shrq $0x30, %r15
leaq (,%r15,4), %rsi
addq %rbp, %rsi
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
callq 0xad7d
movq (%rbx), %rbp
movq 0x10(%rbx), %rdx
movq 0x8(%rsp), %r9
movq 0x8(%r9), %rax
movq %rax, %rcx
shrq $0x30, %rcx
leaq (,%rcx,4), %rcx
addq %rbp, %rcx
movq %rcx, (%rbx)
movq %r13, 0x10(%rsp)
movabsq $0x1000000000000, %rcx  # imm = 0x1000000000000
cmpq %rcx, %rax
movq %rdx, 0x20(%rsp)
jae 0xa2f1
movq 0x50(%rsp), %r13
addq $0x2, %r13
movq %r13, 0x28(%rsp)
xorl %eax, %eax
jmp 0xa3ee
addq %rdx, %rbp
xorl %ebx, %ebx
leaq 0x10(%rsp), %r14
leaq 0x7f1e(%rip), %r15      # 0x12220
movq %r13, %rdi
movq %r14, %rsi
movl $0xa, %edx
callq 0x2230
shll $0x4, %eax
movl %eax, (%rbp,%rbx,4)
movq 0x10(%rsp), %rsi
movsbq (%rsi), %rcx
testq %rcx, %rcx
js 0xa337
movq 0x18(%r12), %rdx
movzbl (%rdx,%rcx), %ecx
movq 0x8(%rsp), %r9
jmp 0xa34b
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0x0, (%r15)
movq 0x8(%rsp), %r9
jg 0xac8b
orl %eax, %ecx
movl %ecx, (%rbp,%rbx,4)
incq %rbx
leaq 0x1(%rsi), %r13
movq %r13, 0x10(%rsp)
movq 0x8(%r9), %rcx
movq %rcx, %rdx
shrq $0x30, %rdx
cmpq %rdx, %rbx
jb 0xa302
addq $0x2, %rsi
xorl %eax, %eax
movq %rsi, 0x28(%rsp)
movabsq $0x1000000000000, %rdi  # imm = 0x1000000000000
cmpq %rdi, %rcx
movq %rsi, %r13
jb 0xa3ee
xorl %esi, %esi
xorl %eax, %eax
movl (%rbp,%rsi,4), %edi
leal (%rdi,%rdi), %ecx
movl $0x3c1a7, %r8d          # imm = 0x3C1A7
shrl %cl, %r8d
shll $0x1e, %r8d
sarl $0x1f, %r8d
shrl $0x4, %edi
andl %r8d, %edi
addl %edi, %eax
incq %rsi
cmpq %rsi, %rdx
jne 0xa38e
jmp 0xa3ee
movq 0x50(%rsp), %r13
orq %rbx, %r15
movq %r15, 0x8(%r9)
addq $0x2, %r13
movzbl -0x1(%r13), %eax
testl %eax, %eax
je 0xa55b
cmpl $0x9, %eax
je 0xa3df
incq %r13
jmp 0xa3c8
movq %r13, 0x28(%rsp)
movb $0x0, -0x1(%r13)
movl $0x1, %eax
movslq 0x4(%r9), %r8
cltq
leaq (%r8,%rax), %r9
decq %r9
movl $0x1249, %esi           # imm = 0x1249
movl $0xe, %eax
movl $0x6, %r10d
movl $0xc, %edx
xorl %edi, %edi
movq %r8, %r11
movl %eax, %ecx
sarq %cl, %r11
movq %r9, %rbx
sarq %cl, %rbx
cmpq %rbx, %r11
je 0xa445
addq $0x3, %rax
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
movl %edx, %ecx
shll %cl, %r11d
addl %r11d, %esi
decl %r10d
addl $-0x3, %edx
cmpl $0x1, %r10d
ja 0xa412
jmp 0xa44b
addl %r11d, %esi
movzwl %si, %edi
movq 0x8(%rsp), %r9
movw %di, 0x8(%r9)
movq %r13, 0x10(%rsp)
leaq 0x1(%r13), %r14
movzbl -0x1(%r14), %eax
testl %eax, %eax
je 0xa55b
cmpl $0x9, %eax
je 0xa475
incq %r14
jmp 0xa45e
movq %r14, 0x28(%rsp)
movb $0x0, -0x1(%r14)
movzbl (%r13), %eax
cmpl $0x2a, %eax
je 0xa4a9
cmpl $0x3d, %eax
jne 0xa4b4
cmpb $0x0, 0x1(%r13)
jne 0xa4b4
movl (%r9), %eax
jmp 0xa4c4
callq 0x2564
movq 0x8(%rsp), %r9
jmp 0xa55b
cmpb $0x0, 0x1(%r13)
je 0xa6a2
movq %r12, %rdi
movq %r13, %rsi
callq 0x8ef6
movq 0x8(%rsp), %r9
movl %eax, 0x14(%r9)
leaq 0x28(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x2230
movq 0x8(%rsp), %r9
decl %eax
movl %eax, 0x18(%r9)
movq (%r12), %rcx
leaq 0x1(%rcx), %r14
movq %r14, (%r12)
cmpb $0x9, (%rcx)
jne 0xa55b
testl %eax, %eax
jns 0xa51c
cmpl $0x0, 0x14(%r9)
js 0xa51c
leaq 0x7d15(%rip), %rax      # 0x12220
cmpl $0x2, (%rax)
jge 0xac95
movl $0xffffffff, 0x14(%r9)  # imm = 0xFFFFFFFF
leaq 0x28(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x2230
movq 0x8(%rsp), %r9
movl %eax, 0x1c(%r9)
movq (%r12), %rbp
cmpb $0x9, (%rbp)
jne 0xa55b
xorl %r12d, %r12d
movzbl 0x1(%rbp,%r12), %eax
testl %eax, %eax
je 0xa55b
cmpl $0x9, %eax
je 0xa589
incq %r12
jmp 0xa547
movq 0x48(%rsp), %rax
movq %rax, 0x28(%r9)
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
movq 0x38(%rsp), %r15
movl %r15d, 0x20(%r9)
movl 0x40(%rsp), %ecx
movl %ecx, 0x24(%r9)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%r12,%rbp), %r13
addq $0x2, %r13
movq %r13, 0x28(%rsp)
movb $0x0, -0x1(%r13)
cmpb $0x2a, 0x1(%rbp)
movq 0x20(%rsp), %r11
jne 0xa5b0
cmpb $0x0, 0x2(%rbp)
je 0xa6bb
movl %r12d, 0x10(%r9)
movq 0x8(%r9), %rax
movq %rax, %rcx
shrq $0x30, %rcx
je 0xa625
movabsq $0x1000000000000, %rdx  # imm = 0x1000000000000
movl %eax, %esi
shrl $0x18, %esi
addq %rsi, %r11
xorl %r8d, %r8d
movl $0x3c1a7, %r9d          # imm = 0x3C1A7
xorl %r10d, %r10d
movl %r10d, %edi
movl (%r11,%r8,4), %esi
leal (%rsi,%rsi), %r10d
btl %r10d, %r9d
movl $0x0, %r10d
sbbl %r10d, %r10d
shrl $0x4, %esi
andl %r10d, %esi
leal (%rsi,%rdi), %r10d
incq %r8
cmpq %r8, %rcx
jne 0xa5df
cmpq %rdx, %rax
jb 0xa625
addl %edi, %esi
cmpl %r12d, %esi
je 0xa625
leaq 0x7c04(%rip), %rax      # 0x12220
cmpl $0x0, (%rax)
jg 0xacb8
leal 0x1(%r12), %eax
sarl %eax
movslq %eax, %r15
leaq 0x38(%rsp), %rbx
movq (%rbx), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0xad7d
movq (%rbx), %rax
movq 0x10(%rbx), %r14
addq %rax, %r14
addq %r15, %rax
movq %rax, (%rbx)
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x21b0
movq 0x8(%rsp), %r9
cmpl $0x0, 0x10(%r9)
jle 0xa6c3
xorl %eax, %eax
leaq 0x7bbc(%rip), %rdx      # 0x12230
xorl %esi, %esi
movsbq 0x1(%rbp,%rsi), %rcx
movb (%rdx,%rcx), %dil
movl %eax, %ecx
notb %cl
andb $0x4, %cl
shlb %cl, %dil
movl %esi, %ecx
shrl %ecx
orb %dil, (%r14,%rcx)
incq %rsi
movslq 0x10(%r9), %rcx
addb $0x4, %al
cmpq %rcx, %rsi
jl 0xa676
jmp 0xa6c3
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xa4c4
callq 0x2583
movq 0x8(%rsp), %r9
jmp 0xa15e
movl $0x0, 0x10(%r9)
leaq (%r12,%rbp), %rax
addq $0x3, %rax
movq %r13, 0x10(%rsp)
xorl %ebx, %ebx
movzbl -0x1(%rax), %ecx
testl %ecx, %ecx
je 0xa6e7
cmpl $0x9, %ecx
je 0xa6e7
incq %rax
incq %rbx
jmp 0xa6d2
movq %rax, 0x28(%rsp)
movb $0x0, -0x1(%rax)
movslq 0x10(%r9), %rsi
leaq 0x38(%rsp), %r14
addq (%r14), %rsi
movq %r14, %rdi
callq 0xad7d
movq 0x8(%rsp), %r9
movq (%r14), %r15
movq 0x10(%r14), %rsi
leaq (%rsi,%r15), %rdi
movslq 0x10(%r9), %rdx
addq %rdx, %r15
movq %r15, (%r14)
cmpb $0x2a, (%r13)
jne 0xa72d
cmpb $0x0, 0x3(%rbp,%r12)
je 0xa768
cmpq %rbx, %rdx
je 0xa742
leaq 0x7ae7(%rip), %rax      # 0x12220
cmpl $0x0, (%rax)
jg 0xaca4
testl %edx, %edx
movq 0x30(%rsp), %rbx
jle 0xa782
xorl %eax, %eax
movb (%r13), %cl
addb $-0x21, %cl
movb %cl, (%rdi,%rax)
incq %rax
movslq 0x10(%r9), %rcx
incq %r13
cmpq %rcx, %rax
jl 0xa74d
jmp 0xa782
movq %rsi, %rbx
movl $0xff, %esi
callq 0x21b0
movq %rbx, %rsi
movq 0x8(%rsp), %r9
movq 0x30(%rsp), %rbx
movq 0x28(%rsp), %r13
movq 0x10(%rbx), %rax
addq (%rbx), %rax
cmpq %rax, %r13
jae 0xac80
leaq 0x38(%rsp), %r12
leaq 0x401f(%rip), %rax      # 0xe7c2
movq %rax, 0x30(%rsp)
movq %r13, %r14
xorl %r15d, %r15d
movzbl (%r14,%r15), %eax
testl %eax, %eax
je 0xa7c1
cmpl $0x9, %eax
je 0xa7c1
incq %r15
jmp 0xa7ae
leaq (%r14,%r15), %r13
incq %r13
movq %r13, 0x28(%rsp)
movb $0x0, -0x1(%r13)
cmpq $0x5, %r15
jg 0xa7e8
leaq 0x7a41(%rip), %rax      # 0x12220
cmpl $0x0, (%rax)
jg 0xacae
movq %r14, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0xacfa
movzbl 0x3(%r14), %eax
leaq 0x5(%r14), %rbp
movq %rbp, 0x10(%rsp)
leal -0x41(%rax), %ecx
cmpl $0x22, %ecx
ja 0xa851
movabsq $0x500000005, %rdx      # imm = 0x500000005
btq %rcx, %rdx
jae 0xa851
movl $0x41, %edi
movq %r12, %rsi
callq 0xadd1
movsbl (%rbp), %edi
movq %r12, %rsi
callq 0xadd1
movq 0x10(%rbx), %rax
addq (%rbx), %rax
cmpq %rax, %r13
movq 0x8(%rsp), %r9
jb 0xa7a8
jmp 0xac76
movl %eax, %ecx
andb $-0x21, %cl
cmpb $0x49, %cl
jne 0xa889
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
movl $0xa, %edx
callq 0x2230
movq %rax, %r14
testq %rax, %rax
js 0xa8e5
cmpq $0xff, %r14
ja 0xa904
movl $0x43, %edi
jmp 0xa8f4
cmpl $0x59, %eax
leaq 0x10(%rsp), %rsi
jg 0xa8a3
cmpl $0x42, %eax
je 0xa936
cmpl $0x48, %eax
je 0xa8c9
jmp 0xa921
cmpl $0x5a, %eax
je 0xa8c9
cmpl $0x66, %eax
jne 0xa921
movq %rbp, %rdi
callq 0x20f0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
movl $0x66, %edi
jmp 0xaa6e
movl $0x5a, %edi
movq %r12, %rsi
callq 0xadd1
addl $-0x4, %r15d
movq %rbp, %rdi
movl %r15d, %esi
jmp 0xaa80
cmpq $-0x80, %r14
jb 0xaa30
movl $0x63, %edi
movq %r12, %rsi
callq 0xadd1
movl %r14d, %edi
jmp 0xa82f
cmpq $0xffff, %r14           # imm = 0xFFFF
ja 0xaa58
movw %r14w, 0x18(%rsp)
movl $0x53, %edi
jmp 0xaa44
leaq 0x78f8(%rip), %rax      # 0x12220
cmpl $0x0, (%rax)
jle 0xa837
jmp 0xacc2
movl $0x4, %eax
subq %r15, %rax
cmpq $-0x3, %rax
jl 0xa954
leaq 0x78d5(%rip), %rax      # 0x12220
cmpl $0x0, (%rax)
jg 0xacd8
leaq (%r14,%r15), %rax
movq %rax, 0x20(%rsp)
leaq 0x6(%r14), %rbp
movq %rbp, 0x10(%rsp)
movzbl 0x5(%r14), %r14d
movl $0x0, 0x18(%rsp)
xorl %eax, %eax
movq %rbp, %rcx
movzbl (%rcx), %edx
cmpl $0x2c, %edx
je 0xa986
testl %edx, %edx
jne 0xa988
jmp 0xa98d
incl %eax
incq %rcx
jmp 0xa978
movl %eax, 0x18(%rsp)
movl $0x42, %edi
movq %r12, %rsi
callq 0xadd1
movl %r14d, %edi
movq %r12, %rsi
callq 0xadd1
leaq 0x18(%rsp), %rdi
movl $0x4, %esi
movq %r12, %rdx
callq 0xacfa
cmpl $0x62, %r14d
jle 0xaa8d
cmpl $0x68, %r14d
jg 0xaaf5
cmpl $0x63, %r14d
je 0xaba6
cmpl $0x66, %r14d
jne 0xab91
cmpq $0x7, %r15
leaq 0x10(%rsp), %r14
movq 0x20(%rsp), %r15
jb 0xa837
incq %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0x20f0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1c(%rsp)
leaq 0x1c(%rsp), %rdi
movl $0x4, %esi
movq %r12, %rdx
callq 0xacfa
movq 0x10(%rsp), %rbp
cmpq %r15, %rbp
jb 0xa9f7
jmp 0xa837
cmpq $-0x8000, %r14          # imm = 0x8000
jb 0xaa64
movw %r14w, 0x18(%rsp)
movl $0x73, %edi
movq %r12, %rsi
callq 0xadd1
leaq 0x18(%rsp), %rdi
movl $0x2, %esi
jmp 0xaa80
movl %r14d, 0x18(%rsp)
movl $0x49, %edi
jmp 0xaa6e
movl %r14d, 0x18(%rsp)
movl $0x69, %edi
movq %r12, %rsi
callq 0xadd1
leaq 0x18(%rsp), %rdi
movl $0x4, %esi
movq %r12, %rdx
callq 0xacfa
jmp 0xa837
cmpl $0x43, %r14d
je 0xab53
cmpl $0x49, %r14d
je 0xac2d
cmpl $0x53, %r14d
jne 0xab91
cmpq $0x7, %r15
leaq 0x10(%rsp), %r14
movq 0x20(%rsp), %r15
jb 0xa837
incq %rbp
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2230
movw %ax, 0x1c(%rsp)
leaq 0x1c(%rsp), %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0xacfa
movq 0x10(%rsp), %rbp
cmpq %r15, %rbp
jb 0xaabf
jmp 0xa837
cmpl $0x69, %r14d
je 0xabe4
cmpl $0x73, %r14d
jne 0xab91
cmpq $0x7, %r15
leaq 0x10(%rsp), %r14
movq 0x20(%rsp), %r15
jb 0xa837
incq %rbp
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2230
movw %ax, 0x1c(%rsp)
leaq 0x1c(%rsp), %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0xacfa
movq 0x10(%rsp), %rbp
cmpq %r15, %rbp
jb 0xab1d
jmp 0xa837
cmpq $0x7, %r15
leaq 0x10(%rsp), %r14
movq 0x20(%rsp), %r15
jb 0xa837
incq %rbp
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2230
movzbl %al, %edi
movq %r12, %rsi
callq 0xadd1
movq 0x10(%rsp), %rbp
cmpq %r15, %rbp
jb 0xab67
jmp 0xa837
leaq 0x7688(%rip), %rax      # 0x12220
cmpl $0x0, (%rax)
jle 0xa837
jmp 0xaccc
cmpq $0x7, %r15
leaq 0x10(%rsp), %r14
movq 0x20(%rsp), %r15
jb 0xa837
incq %rbp
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2230
movsbl %al, %edi
movq %r12, %rsi
callq 0xadd1
movq 0x10(%rsp), %rbp
cmpq %r15, %rbp
jb 0xabba
jmp 0xa837
cmpq $0x7, %r15
leaq 0x10(%rsp), %r14
movq 0x20(%rsp), %r15
jb 0xa837
incq %rbp
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2230
movl %eax, 0x1c(%rsp)
leaq 0x1c(%rsp), %rdi
movl $0x4, %esi
movq %r12, %rdx
callq 0xacfa
movq 0x10(%rsp), %rbp
cmpq %r15, %rbp
jb 0xabf8
jmp 0xa837
cmpq $0x7, %r15
leaq 0x10(%rsp), %r14
movq 0x20(%rsp), %r15
jb 0xa837
incq %rbp
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2230
movl %eax, 0x1c(%rsp)
leaq 0x1c(%rsp), %rdi
movl $0x4, %esi
movq %r12, %rdx
callq 0xacfa
movq 0x10(%rsp), %rbp
cmpq %r15, %rbp
jb 0xac41
jmp 0xa837
movq 0x38(%rsp), %r15
movq 0x48(%rsp), %rsi
movq %rsi, 0x28(%r9)
xorl %eax, %eax
jmp 0xa56e
callq 0x25a2
jmp 0xa49f
callq 0x25c1
movq 0x8(%rsp), %r9
jmp 0xa514
callq 0x25ff
jmp 0xa49f
callq 0x263d
jmp 0xa49f
callq 0x25e0
jmp 0xa49f
callq 0x261e
jmp 0xa49f
leaq 0x3b15(%rip), %rax      # 0xe7e8
movq %rax, 0x30(%rsp)
movq 0x7319(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
leaq 0x3921(%rip), %rdx      # 0xe60a
movq 0x30(%rsp), %rsi
xorl %eax, %eax
callq 0x2220
jmp 0xa49f