// File: /workspace/github_c_makefile_star2_O1/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 $0x48, %rsp
movq %rsi, %r15
movq %rdi, %r14
movq 0x10(%rdi), %r13
movq %r13, 0x18(%rsp)
movl $0x0, 0x20(%rdx)
movq $0x0, 0x28(%rsp)
movq 0x28(%rdx), %rdi
movq %rdi, 0x38(%rsp)
movslq 0x24(%rdx), %rbp
movq %rbp, 0x30(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdx)
movq %rdx, 0x10(%rsp)
movups %xmm0, (%rdx)
cmpq $0x0, 0x18(%rsi)
jne 0x9db0
movq %rdi, %rbx
movl $0x80, %edi
movl $0x1, %esi
callq 0x21f0
movq %rbx, %rdi
movq %rax, 0x18(%r15)
xorl %eax, %eax
leaq 0x47cc(%rip), %rcx      # 0xe567
movsbq (%rax,%rcx), %rdx
movq 0x18(%r15), %rsi
movb %al, (%rsi,%rdx)
incq %rax
cmpq $0xa, %rax
jne 0x9d9b
movq %r13, (%rsp)
movq 0x18(%rsp), %rax
movq %rax, %r12
subq %r13, %r12
incq %r12
movq %r12, %rbx
shlq $0x20, %rbx
shlq $0x18, %r12
movabsq $0x100000000, %rcx      # imm = 0x100000000
movzbl (%rax), %edx
testl %edx, %edx
je 0x9ec2
cmpl $0x9, %edx
je 0x9df6
incq %rax
addq %rcx, %rbx
addq $0x1000000, %r12        # imm = 0x1000000
jmp 0x9dd7
movq %r14, 0x8(%rsp)
leaq 0x1(%rax), %r14
movq %r14, 0x18(%rsp)
movb $0x0, (%rax)
sarq $0x20, %rbx
cmpq %rbp, %rbx
jbe 0x9e57
leaq -0x1(%rbx), %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, 0x30(%rsp)
callq 0x22e0
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x2240
movq %rbx, 0x28(%rsp)
shrl $0x18, %r12d
movq 0x10(%rsp), %rbp
movb %r12b, 0xb(%rbp)
leaq 0x18(%rsp), %r13
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2230
movw %ax, 0xc(%rbp)
movq (%r13), %rax
leaq 0x1(%rax), %r14
movq %r14, (%r13)
cmpb $0x9, (%rax)
jne 0xa296
movq %r14, (%rsp)
movq 0x18(%rsp), %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0xa291
cmpl $0x9, %ecx
je 0x9ed1
incq %rax
jmp 0x9ead
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rbp
jmp 0xa296
leaq 0x1(%rax), %r13
movq %r13, 0x18(%rsp)
movb $0x0, (%rax)
leaq 0x48e4(%rip), %rsi      # 0xe7c8
movq %r14, %rdi
callq 0x2200
testl %eax, %eax
je 0x9f28
cmpl $0x0, (%r15)
leaq 0x8325(%rip), %r12      # 0x12220
jne 0x9f08
cmpl $0x0, (%r12)
jg 0xa19c
movq %r15, %rdi
movq %r14, %rsi
callq 0x8ce7
movl %eax, (%rbp)
testl %eax, %eax
jns 0x9f2f
cmpl $0x2, (%r12)
jl 0x9f2f
callq 0x2545
jmp 0x9f2f
movl $0xffffffff, (%rbp)     # imm = 0xFFFFFFFF
leaq 0x18(%rsp), %r12
movq %r13, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x2230
decl %eax
movl %eax, 0x4(%rbp)
movq (%r12), %rcx
leaq 0x1(%rcx), %r14
movq %r14, (%r12)
cmpb $0x9, (%rcx)
jne 0xa296
testl %eax, %eax
jns 0x9f7f
cmpl $0x0, (%rbp)
js 0x9f7f
leaq 0x82b1(%rip), %rax      # 0x12220
cmpl $0x2, (%rax)
jge 0xa3b9
movl $0xffffffff, (%rbp)     # imm = 0xFFFFFFFF
cmpl $0x0, (%rbp)
jns 0x9f89
orb $0x4, 0xc(%rbp)
leaq 0x18(%rsp), %rbp
movq %r14, %rdi
movq %rbp, %rsi
movl $0xa, %edx
callq 0x2230
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rcx
movzbl %al, %edx
shll $0x10, %edx
movq %rcx, %rax
andq $-0xff0001, %rax        # imm = 0xFF00FFFF
orq %rdx, %rax
movq 0x10(%rsp), %rdx
movq %rax, 0x8(%rdx)
movq (%rbp), %r14
leaq 0x1(%r14), %r13
movq %r13, (%rbp)
movq 0x10(%rsp), %rbp
cmpb $0x9, (%r14)
jne 0xa296
cmpb $0x2a, (%r13)
jne 0xa02b
movabsq $0x400000000, %rbx      # imm = 0x400000000
btq $0x22, %rcx
jb 0xa005
leaq 0x8224(%rip), %rax      # 0x12220
cmpl $0x2, (%rax)
jge 0xa3af
orq %rbx, 0x8(%rbp)
movq %r13, (%rsp)
movq 0x18(%rsp), %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0xa291
cmpl $0x9, %ecx
je 0xa188
incq %rax
jmp 0xa012
movabsq $0x1000000000000, %rcx  # imm = 0x1000000000000
movq %r13, (%rsp)
decq %rcx
movq %rcx, 0x40(%rsp)
andq %rcx, %rax
movq %rax, 0x8(%rbp)
movq %r13, %rbp
movzbl (%rbp), %eax
testl %eax, %eax
je 0xa0a3
cmpl $0x9, %eax
je 0xa0a3
movsbq %al, %r12
callq 0x2410
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r12,2)
jne 0xa09e
movq 0x10(%rsp), %rdx
movq 0x8(%rdx), %rax
movq %rax, %rcx
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
andq %rsi, %rcx
movabsq $0x1000000000000, %rsi  # imm = 0x1000000000000
addq %rsi, %rcx
andq 0x40(%rsp), %rax
orq %rcx, %rax
movq %rax, 0x8(%rdx)
incq %rbp
jmp 0xa04b
movq %rbp, (%rsp)
movq 0x10(%rsp), %r12
movzwl 0xe(%r12), %eax
leaq (%rbx,%rax,4), %rsi
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0xac21
movq (%rbx), %rcx
movq 0x10(%rbx), %rbp
addq %rcx, %rbp
movq 0x8(%r12), %rdx
movq %rdx, %rax
shrq $0x30, %rax
leaq (%rcx,%rax,4), %rcx
movq %rcx, (%rbx)
movq %r13, (%rsp)
movb $0x1, %cl
movabsq $0x1000000000000, %rsi  # imm = 0x1000000000000
cmpq %rsi, %rdx
jb 0xa1b6
xorl %r12d, %r12d
leaq 0x811d(%rip), %rbx      # 0x12220
movq %r13, %rdi
movq %rsp, %rsi
movl $0xa, %edx
callq 0x2230
shll $0x4, %eax
movl %eax, (%rbp,%r12,4)
movq (%rsp), %r14
movsbq (%r14), %rcx
testq %rcx, %rcx
js 0xa132
movq 0x18(%r15), %rdx
movzbl (%rdx,%rcx), %ecx
jmp 0xa137
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testl %ecx, %ecx
setns %dl
cmpl $0x0, (%rbx)
setle %r13b
orb %dl, %r13b
je 0xa17c
orl %eax, %ecx
movl %ecx, (%rbp,%r12,4)
xorl %edx, %edx
testb %r13b, %r13b
je 0xa1fb
incq %r12
leaq 0x1(%r14), %r13
movq %r13, (%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rcx
movq %rcx, %rax
shrq $0x30, %rax
cmpq %rax, %r12
jb 0xa103
jmp 0xa1a6
callq 0x25a2
movl $0x8, %edx
jmp 0xa151
leaq 0x1(%rax), %rcx
movq %rcx, 0x18(%rsp)
movb $0x0, (%rax)
movl $0x1, %r12d
jmp 0xa212
callq 0x2564
jmp 0xa296
movabsq $0x1000000000000, %rdx  # imm = 0x1000000000000
cmpq %rdx, %rcx
setb %cl
addq $0x2, %r14
movq %r14, 0x18(%rsp)
xorl %edx, %edx
movl $0x0, %r12d
testb %cl, %cl
jne 0xa1fb
xorl %edx, %edx
xorl %esi, %esi
xorl %r12d, %r12d
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, %r12d
incq %rsi
cmpq %rsi, %rax
jne 0xa1d2
testl %edx, %edx
movq 0x10(%rsp), %rbp
je 0xa212
cmpl $0x8, %edx
je 0xa296
jmp 0xa2b2
movslq 0x4(%rbp), %r8
movslq %r12d, %rax
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 0xa26a
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 0xa237
jmp 0xa270
addl %r11d, %esi
movzwl %si, %edi
movw %di, 0x8(%rbp)
movq 0x18(%rsp), %r14
movq %r14, (%rsp)
movq %r14, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0xa291
cmpl $0x9, %ecx
je 0xa2c1
incq %rax
jmp 0xa280
movq %rax, 0x18(%rsp)
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
movq 0x38(%rsp), %rcx
movq %rcx, 0x28(%rbp)
movl 0x28(%rsp), %ecx
movl %ecx, 0x20(%rbp)
movl 0x30(%rsp), %ecx
movl %ecx, 0x24(%rbp)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1(%rax), %r12
movq %r12, 0x18(%rsp)
movb $0x0, (%rax)
leaq 0x43a6(%rip), %rsi      # 0xe67a
movq %r14, %rdi
callq 0x2200
testl %eax, %eax
je 0xa300
leaq 0x44e1(%rip), %rsi      # 0xe7c8
movq %r14, %rdi
callq 0x2200
testl %eax, %eax
je 0xa305
movq %r15, %rdi
movq %r14, %rsi
callq 0x8ce7
jmp 0xa30a
movl (%rbp), %eax
jmp 0xa30a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x14(%rbp)
leaq 0x18(%rsp), %r15
movq %r12, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x2230
decl %eax
movl %eax, 0x18(%rbp)
movq (%r15), %rcx
leaq 0x1(%rcx), %r14
movq %r14, (%r15)
cmpb $0x9, (%rcx)
jne 0xa296
testl %eax, %eax
jns 0xa35b
cmpl $0x0, 0x14(%rbp)
js 0xa35b
leaq 0x7ed5(%rip), %rax      # 0x12220
cmpl $0x2, (%rax)
jge 0xab86
movl $0xffffffff, 0x14(%rbp) # imm = 0xFFFFFFFF
leaq 0x18(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x2230
movl %eax, 0x1c(%rbp)
movq (%r15), %r14
leaq 0x1(%r14), %r12
movq %r12, (%r15)
cmpb $0x9, (%r14)
jne 0xa296
movq %r12, (%rsp)
movq 0x18(%rsp), %r15
movq %r15, %r13
notq %r13
xorl %ebp, %ebp
movzbl (%r15,%rbp), %eax
testl %eax, %eax
je 0xa502
cmpl $0x9, %eax
je 0xa3c3
incq %rbp
jmp 0xa398
callq 0x25c1
jmp 0xa005
callq 0x2583
jmp 0x9f78
leaq (%r15,%rbp), %rax
incq %rax
movq %rax, 0x18(%rsp)
movq %rax, 0x40(%rsp)
movb $0x0, -0x1(%rax)
leaq 0x43e9(%rip), %rsi      # 0xe7c8
movq %r12, %rdi
callq 0x2200
testl %eax, %eax
je 0xa50f
movabsq $0x1000000000000, %rax  # imm = 0x1000000000000
movl %r14d, %ecx
notl %ecx
addl %ebp, %ecx
addl %r15d, %ecx
movq 0x10(%rsp), %rdx
movl %ecx, 0x10(%rdx)
movq 0x8(%rdx), %rdx
xorl %ecx, %ecx
movq %rdx, %rsi
shrq $0x30, %rsi
je 0xa456
movl %edx, %edi
shrl $0x18, %edi
addq 0x38(%rsp), %rdi
xorl %r8d, %r8d
movl $0x3c1a7, %r9d          # imm = 0x3C1A7
xorl %ecx, %ecx
movl (%rdi,%r8,4), %r10d
leal (%r10,%r10), %r11d
btl %r11d, %r9d
movl $0x0, %r11d
sbbl %r11d, %r11d
shrl $0x4, %r10d
andl %r11d, %r10d
addl %r10d, %ecx
incq %r8
cmpq %r8, %rsi
jne 0xa42f
cmpq %rax, %rdx
jb 0xa480
negl %ecx
movl %r15d, %eax
subl %r14d, %eax
addq %rcx, %rax
addq %rbp, %rax
decq %rax
testl %eax, %eax
je 0xa480
leaq 0x7da9(%rip), %rax      # 0x12220
cmpl $0x0, (%rax)
jg 0xab9a
movl %r15d, %eax
subl %r14d, %eax
addl %ebp, %eax
sarl %eax
movslq %eax, %rbx
leaq 0x28(%rsp), %r14
movq (%r14), %rsi
addq %rbx, %rsi
movq %r14, %rdi
callq 0xac21
movq (%r14), %rax
movq %r14, %rcx
movq 0x10(%r14), %r14
addq %rax, %r14
addq %rbx, %rax
movq %rax, (%rcx)
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x21b0
movq 0x10(%rsp), %r8
cmpl $0x0, 0x10(%r8)
jle 0xa51b
xorl %eax, %eax
leaq 0x7d5b(%rip), %rdx      # 0x12230
xorl %esi, %esi
movsbq (%r12,%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(%r8), %rcx
addb $0x4, %al
cmpq %rcx, %rsi
jl 0xa4d7
jmp 0xa51b
addq %rbp, %r15
movq %r15, 0x18(%rsp)
jmp 0x9ec7
movq 0x10(%rsp), %rax
movl $0x0, 0x10(%rax)
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rcx
leaq 0x1(%rcx), %rax
addq %rcx, %r13
subq %rbp, %r13
movzbl -0x1(%rax), %ecx
testl %ecx, %ecx
je 0xa548
cmpl $0x9, %ecx
je 0xa548
incq %rax
incq %r13
jmp 0xa533
movq %rax, 0x18(%rsp)
movb $0x0, -0x1(%rax)
movq 0x10(%rsp), %rbx
movslq 0x10(%rbx), %rsi
leaq 0x28(%rsp), %r12
addq (%r12), %rsi
movq %r12, %rdi
callq 0xac21
movq (%r12), %rax
movq 0x10(%r12), %r14
addq %rax, %r14
movslq 0x10(%rbx), %rbx
addq %rbx, %rax
movq %rax, (%r12)
leaq 0x423f(%rip), %rsi      # 0xe7c8
movq 0x40(%rsp), %rdi
callq 0x2200
testl %eax, %eax
je 0xa5d6
cmpq %r13, %rbx
je 0xa5ac
leaq 0x7c7d(%rip), %rax      # 0x12220
cmpl $0x0, (%rax)
jg 0xab90
movq 0x10(%rsp), %rdx
cmpl $0x0, 0x10(%rdx)
jle 0xa5eb
xorl %eax, %eax
leaq (%r15,%rax), %rcx
movb 0x1(%rbp,%rcx), %cl
addb $-0x21, %cl
movb %cl, (%r14,%rax)
incq %rax
movslq 0x10(%rdx), %rcx
cmpq %rcx, %rax
jl 0xa5b9
jmp 0xa5eb
movq %r14, %rdi
movl $0xff, %esi
movq %rbx, %rdx
callq 0x21b0
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %r15
movq %rdx, %rbp
movq 0x8(%rsp), %rbx
movq 0x10(%rbx), %rax
addq (%rbx), %rax
cmpq %rax, %r15
jae 0xab7f
movq %r15, %r13
movq %r15, (%rsp)
movl $0x4, %ebp
movq %r15, %r14
leaq 0x28(%rsp), %rbx
movzbl (%r14), %eax
testl %eax, %eax
je 0xa631
cmpl $0x9, %eax
je 0xa631
incq %r14
decq %rbp
jmp 0xa61c
leaq 0x1(%r14), %r15
movq %r15, 0x18(%rsp)
movb $0x0, (%r14)
leaq -0x5(%rbp), %rax
cmpq $-0x6, %rax
jl 0xa658
leaq 0x7bd1(%rip), %rax      # 0x12220
cmpl $0x0, (%rax)
jg 0xa724
movq %r13, %rdi
movl $0x2, %esi
movq %rbx, %rdx
callq 0xaba4
leaq 0x4(%r13), %rax
movq %rax, (%rsp)
movzbl 0x3(%r13), %eax
leaq 0x5(%r13), %r12
movq %r12, (%rsp)
leal -0x41(%rax), %ecx
cmpl $0x22, %ecx
ja 0xa6ca
movabsq $0x500000005, %rdx      # imm = 0x500000005
btq %rcx, %rdx
jae 0xa6ca
movl $0x41, %edi
movq %rbx, %rsi
callq 0xac75
movsbl (%r12), %edi
movq %rbx, %rsi
callq 0xac75
movq 0x10(%rsp), %rbp
movq 0x8(%rsp), %rbx
xorl %r12d, %r12d
testl %r12d, %r12d
je 0xa5f8
jmp 0xab70
movl %eax, %ecx
andb $-0x21, %cl
cmpb $0x49, %cl
jne 0xa70c
movq %r12, %rdi
movq %rsp, %rsi
movl $0xa, %edx
callq 0x2230
movq %rax, %r14
testq %rax, %rax
js 0xa798
cmpq $0xff, %r14
movq 0x10(%rsp), %rbp
jg 0xa7c4
movl $0x43, %edi
jmp 0xa7ac
cmpl $0x59, %eax
jg 0xa73b
cmpl $0x42, %eax
je 0xa80b
cmpl $0x48, %eax
je 0xa777
jmp 0xa7e1
callq 0x2677
movl $0x8, %r12d
movq 0x10(%rsp), %rbp
movq 0x8(%rsp), %rbx
jmp 0xa6bc
cmpl $0x5a, %eax
je 0xa777
cmpl $0x66, %eax
jne 0xa7e1
movq %r12, %rdi
movq %rsp, %rsi
callq 0x20f0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20(%rsp)
movl $0x66, %edi
movq %rbx, %rsi
callq 0xac75
leaq 0x20(%rsp), %rdi
movl $0x4, %esi
jmp 0xa78b
movl $0x5a, %edi
movq %rbx, %rsi
callq 0xac75
negl %ebp
movq %r12, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0xaba4
jmp 0xa6af
cmpq $-0x80, %r14
movq 0x10(%rsp), %rbp
jl 0xa8f5
movl $0x63, %edi
movq %rbx, %rsi
callq 0xac75
movl %r14d, %edi
movq %rbx, %rsi
callq 0xac75
jmp 0xa6b4
cmpq $0xffff, %r14           # imm = 0xFFFF
jg 0xa91d
movw %r14w, 0x20(%rsp)
movl $0x53, %edi
jmp 0xa909
leaq 0x7a38(%rip), %rax      # 0x12220
cmpl $0x0, (%rax)
movq 0x10(%rsp), %rbp
movq 0x8(%rsp), %rbx
jle 0xa6b9
callq 0x2658
movl $0x8, %r12d
jmp 0xa6bc
cmpq $-0x3, %rbp
jl 0xa828
leaq 0x7a08(%rip), %rax      # 0x12220
cmpl $0x0, (%rax)
leaq 0x3f26(%rip), %rdi      # 0xe748
jg 0xab5c
leaq 0x6(%r13), %rax
movq %rax, (%rsp)
movzbl 0x5(%r13), %ebp
movl $0x0, 0x20(%rsp)
xorl %ecx, %ecx
movzbl (%rax), %edx
cmpl $0x2c, %edx
je 0xa84d
testl %edx, %edx
jne 0xa84f
jmp 0xa854
incl %ecx
incq %rax
jmp 0xa83f
movl %ecx, 0x20(%rsp)
movl $0x42, %edi
movq %rbx, %rsi
callq 0xac75
movl %ebp, %edi
movq %rbx, %rsi
callq 0xac75
leaq 0x20(%rsp), %rdi
movl $0x4, %esi
movq %rbx, %rdx
callq 0xaba4
cmpl $0x62, %ebp
jle 0xa952
cmpl $0x68, %ebp
jg 0xa9ba
cmpl $0x63, %ebp
je 0xaa78
cmpl $0x66, %ebp
jne 0xaa57
movq (%rsp), %rdi
xorl %r12d, %r12d
cmpq %r14, %rdi
leaq 0x28(%rsp), %rbx
movq %rsp, %r13
leaq 0x24(%rsp), %rbp
jae 0xab43
incq %rdi
movq %r13, %rsi
callq 0x20f0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x24(%rsp)
movq %rbp, %rdi
movl $0x4, %esi
movq %rbx, %rdx
callq 0xaba4
movq (%rsp), %rdi
cmpq %r14, %rdi
jb 0xa8c2
jmp 0xab43
cmpq $-0x8000, %r14          # imm = 0x8000
jl 0xa929
movw %r14w, 0x20(%rsp)
movl $0x73, %edi
movq %rbx, %rsi
callq 0xac75
leaq 0x20(%rsp), %rdi
movl $0x2, %esi
jmp 0xa945
movl %r14d, 0x20(%rsp)
movl $0x49, %edi
jmp 0xa933
movl %r14d, 0x20(%rsp)
movl $0x69, %edi
movq %rbx, %rsi
callq 0xac75
leaq 0x20(%rsp), %rdi
movl $0x4, %esi
movq %rbx, %rdx
callq 0xaba4
jmp 0xa6b4
cmpl $0x43, %ebp
je 0xaa19
cmpl $0x49, %ebp
je 0xaafb
cmpl $0x53, %ebp
jne 0xaa57
movq (%rsp), %rdi
cmpq %r14, %rdi
leaq 0x28(%rsp), %rbx
movq %rsp, %r13
leaq 0x24(%rsp), %rbp
jae 0xab40
incq %rdi
xorl %r12d, %r12d
movq %r13, %rsi
xorl %edx, %edx
callq 0x2230
movw %ax, 0x24(%rsp)
movq %rbp, %rdi
movl $0x2, %esi
movq %rbx, %rdx
callq 0xaba4
movq (%rsp), %rdi
cmpq %r14, %rdi
jb 0xa987
jmp 0xab43
cmpl $0x69, %ebp
je 0xaab6
cmpl $0x73, %ebp
jne 0xaa57
movq (%rsp), %rdi
cmpq %r14, %rdi
leaq 0x28(%rsp), %rbx
movq %rsp, %r13
leaq 0x24(%rsp), %rbp
jae 0xab40
incq %rdi
xorl %r12d, %r12d
movq %r13, %rsi
xorl %edx, %edx
callq 0x2230
movw %ax, 0x24(%rsp)
movq %rbp, %rdi
movl $0x2, %esi
movq %rbx, %rdx
callq 0xaba4
movq (%rsp), %rdi
cmpq %r14, %rdi
jb 0xa9e6
jmp 0xab43
movq (%rsp), %rdi
cmpq %r14, %rdi
leaq 0x28(%rsp), %rbx
movq %rsp, %r13
jae 0xab40
incq %rdi
xorl %r12d, %r12d
movq %r13, %rsi
xorl %edx, %edx
callq 0x2230
movzbl %al, %edi
movq %rbx, %rsi
callq 0xac75
movq (%rsp), %rdi
cmpq %r14, %rdi
jb 0xaa2e
jmp 0xab43
leaq 0x77c2(%rip), %rax      # 0x12220
cmpl $0x0, (%rax)
leaq 0x3d06(%rip), %rdi      # 0xe76e
jg 0xab5c
xorl %r12d, %r12d
movb $0x1, %al
jmp 0xab69
movq (%rsp), %rdi
cmpq %r14, %rdi
jae 0xab40
leaq 0x28(%rsp), %rbx
movq %rsp, %r13
incq %rdi
xorl %r12d, %r12d
movq %r13, %rsi
xorl %edx, %edx
callq 0x2230
movsbl %al, %edi
movq %rbx, %rsi
callq 0xac75
movq (%rsp), %rdi
cmpq %r14, %rdi
jb 0xaa8d
jmp 0xab43
movq (%rsp), %rdi
cmpq %r14, %rdi
leaq 0x28(%rsp), %rbx
movq %rsp, %r13
leaq 0x24(%rsp), %rbp
jae 0xab40
incq %rdi
xorl %r12d, %r12d
movq %r13, %rsi
xorl %edx, %edx
callq 0x2230
movl %eax, 0x24(%rsp)
movq %rbp, %rdi
movl $0x4, %esi
movq %rbx, %rdx
callq 0xaba4
movq (%rsp), %rdi
cmpq %r14, %rdi
jb 0xaacc
jmp 0xab43
movq (%rsp), %rdi
cmpq %r14, %rdi
leaq 0x28(%rsp), %rbx
movq %rsp, %r13
leaq 0x24(%rsp), %rbp
jae 0xab40
incq %rdi
xorl %r12d, %r12d
movq %r13, %rsi
xorl %edx, %edx
callq 0x2230
movl %eax, 0x24(%rsp)
movq %rbp, %rdi
movl $0x4, %esi
movq %rbx, %rdx
callq 0xaba4
movq (%rsp), %rdi
cmpq %r14, %rdi
jb 0xab11
jmp 0xab43
xorl %r12d, %r12d
movq 0x8(%rsp), %rbx
movb $0x1, %al
testb %al, %al
movq 0x10(%rsp), %rbp
jne 0xa6b9
jmp 0xa6bc
callq 0x263d
movl $0x8, %r12d
xorl %eax, %eax
movq 0x8(%rsp), %rbx
jmp 0xab4a
cmpl $0x8, %r12d
je 0xa296
jmp 0xa2b2
xorl %eax, %eax
jmp 0xa29b
callq 0x25e0
jmp 0xa354
callq 0x261e
jmp 0x9ec7
callq 0x25ff
jmp 0x9ec7