// File: /workspace/github_cpp_makefile_star2_O3/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_import.c
// Function: sam_read1
int sam_read1(tamFile fp, bam_header_t *header, bam1_t *b)
{
	int ret, doff, doff0, dret, z = 0;
	bam1_core_t *c = &b->core;
	kstring_t *str = fp->str;
	kstream_t *ks = fp->ks;

	if (fp->is_first) {
		fp->is_first = 0;
		ret = str->l;
	} else {
		do { // special consideration for empty lines
			ret = ks_getuntil(fp->ks, KS_SEP_TAB, str, &dret);
			if (ret >= 0) z += str->l + 1;
		} while (ret == 0);
	}
	if (ret < 0) return -1;
	++fp->n_lines;
	doff = 0;

	{ // name
		c->l_qname = strlen(str->s) + 1;
		memcpy(alloc_data(b, doff + c->l_qname) + doff, str->s, c->l_qname);
		doff += c->l_qname;
	}
	{ // flag
		long flag;
		char *s;
		ret = ks_getuntil(ks, KS_SEP_TAB, str, &dret); z += str->l + 1;
		flag = strtol((char*)str->s, &s, 0);
		if (*s) { // not the end of the string
			flag = 0;
			for (s = str->s; *s; ++s)
				flag |= bam_char2flag_table[(int)*s];
		}
		c->flag = flag;
	}
	{ // tid, pos, qual
		ret = ks_getuntil(ks, KS_SEP_TAB, str, &dret); z += str->l + 1; c->tid = bam_get_tid(header, str->s);
		if (c->tid < 0 && strcmp(str->s, "*")) {
			if (header->n_targets == 0) {
				fprintf(stderr, "[sam_read1] missing header? Abort!\n");
				exit(1);
			} else fprintf(stderr, "[sam_read1] reference '%s' is recognized as '*'.\n", str->s);
		}
		ret = ks_getuntil(ks, KS_SEP_TAB, str, &dret); z += str->l + 1; c->pos = isdigit(str->s[0])? atoi(str->s) - 1 : -1;
		ret = ks_getuntil(ks, KS_SEP_TAB, str, &dret); z += str->l + 1; c->qual = isdigit(str->s[0])? atoi(str->s) : 0;
		if (ret < 0) return -2;
	}
	{ // cigar
		char *s, *t;
		int i, op;
		long x;
		c->n_cigar = 0;
		if (ks_getuntil(ks, KS_SEP_TAB, str, &dret) < 0) return -3;
		z += str->l + 1;
		if (str->s[0] != '*') {
			for (s = str->s; *s; ++s) {
				if (isalpha(*s)) ++c->n_cigar;
				else if (!isdigit(*s)) parse_error(fp->n_lines, "invalid CIGAR character");
			}
			b->data = alloc_data(b, doff + c->n_cigar * 4);
			for (i = 0, s = str->s; i != c->n_cigar; ++i) {
				x = strtol(s, &t, 10);
				op = toupper(*t);
				if (op == 'M' || op == '=' || op == 'X') op = BAM_CMATCH;
				else if (op == 'I') op = BAM_CINS;
				else if (op == 'D') op = BAM_CDEL;
				else if (op == 'N') op = BAM_CREF_SKIP;
				else if (op == 'S') op = BAM_CSOFT_CLIP;
				else if (op == 'H') op = BAM_CHARD_CLIP;
				else if (op == 'P') op = BAM_CPAD;
				else parse_error(fp->n_lines, "invalid CIGAR operation");
				s = t + 1;
				bam1_cigar(b)[i] = x << BAM_CIGAR_SHIFT | op;
			}
			if (*s) parse_error(fp->n_lines, "unmatched CIGAR operation");
			c->bin = bam_reg2bin(c->pos, bam_calend(c, bam1_cigar(b)));
			doff += c->n_cigar * 4;
		} else {
			if (!(c->flag&BAM_FUNMAP)) {
				fprintf(stderr, "Parse warning at line %lld: mapped sequence without CIGAR\n", (long long)fp->n_lines);
				c->flag |= BAM_FUNMAP;
			}
			c->bin = bam_reg2bin(c->pos, c->pos + 1);
		}
	}
	{ // mtid, mpos, isize
		ret = ks_getuntil(ks, KS_SEP_TAB, str, &dret); z += str->l + 1;
		c->mtid = strcmp(str->s, "=")? bam_get_tid(header, str->s) : c->tid;
		ret = ks_getuntil(ks, KS_SEP_TAB, str, &dret); z += str->l + 1;
		c->mpos = isdigit(str->s[0])? atoi(str->s) - 1 : -1;
		ret = ks_getuntil(ks, KS_SEP_TAB, str, &dret); z += str->l + 1;
		c->isize = (str->s[0] == '-' || isdigit(str->s[0]))? atoi(str->s) : 0;
		if (ret < 0) return -4;
	}
	{ // seq and qual
		int i;
		uint8_t *p = 0;
		if (ks_getuntil(ks, KS_SEP_TAB, str, &dret) < 0) return -5; // seq
		z += str->l + 1;
		if (strcmp(str->s, "*")) {
			c->l_qseq = strlen(str->s);
			if (c->n_cigar && c->l_qseq != (int32_t)bam_cigar2qlen(c, bam1_cigar(b)))
				parse_error(fp->n_lines, "CIGAR and sequence length are inconsistent");
			p = (uint8_t*)alloc_data(b, doff + c->l_qseq + (c->l_qseq+1)/2) + doff;
			memset(p, 0, (c->l_qseq+1)/2);
			for (i = 0; i < c->l_qseq; ++i)
				p[i/2] |= bam_nt16_table[(int)str->s[i]] << 4*(1-i%2);
		} else c->l_qseq = 0;
		if (ks_getuntil(ks, KS_SEP_TAB, str, &dret) < 0) return -6; // qual
		z += str->l + 1;
		if (strcmp(str->s, "*") && c->l_qseq != strlen(str->s))
			parse_error(fp->n_lines, "sequence and quality are inconsistent");
		p += (c->l_qseq+1)/2;
		if (strcmp(str->s, "*") == 0) for (i = 0; i < c->l_qseq; ++i) p[i] = 0xff;
		else for (i = 0; i < c->l_qseq; ++i) p[i] = str->s[i] - 33;
		doff += c->l_qseq + (c->l_qseq+1)/2;
	}
	doff0 = doff;
	if (dret != '\n' && dret != '\r') { // aux
		while (ks_getuntil(ks, KS_SEP_TAB, str, &dret) >= 0) {
			uint8_t *s, type, key[2];
			z += str->l + 1;
			if (str->l < 6 || str->s[2] != ':' || str->s[4] != ':')
				parse_error(fp->n_lines, "missing colon in auxiliary data");
			key[0] = str->s[0]; key[1] = str->s[1];
			type = str->s[3];
			s = alloc_data(b, doff + 3) + doff;
			s[0] = key[0]; s[1] = key[1]; s += 2; doff += 2;
			if (type == 'A' || type == 'a' || type == 'c' || type == 'C') { // c and C for backward compatibility
				s = alloc_data(b, doff + 2) + doff;
				*s++ = 'A'; *s = str->s[5];
				doff += 2;
			} else if (type == 'I' || type == 'i') {
				long long x;
				s = alloc_data(b, doff + 5) + doff;
				x = (long long)atoll(str->s + 5);
				if (x < 0) {
					if (x >= -127) {
						*s++ = 'c'; *(int8_t*)s = (int8_t)x;
						s += 1; doff += 2;
					} else if (x >= -32767) {
						*s++ = 's'; *(int16_t*)s = (int16_t)x;
						s += 2; doff += 3;
					} else {
						*s++ = 'i'; *(int32_t*)s = (int32_t)x;
						s += 4; doff += 5;
						if (x < -2147483648ll)
							fprintf(stderr, "Parse warning at line %lld: integer %lld is out of range.",
									(long long)fp->n_lines, x);
					}
				} else {
					if (x <= 255) {
						*s++ = 'C'; *s++ = (uint8_t)x;
						doff += 2;
					} else if (x <= 65535) {
						*s++ = 'S'; *(uint16_t*)s = (uint16_t)x;
						s += 2; doff += 3;
					} else {
						*s++ = 'I'; *(uint32_t*)s = (uint32_t)x;
						s += 4; doff += 5;
						if (x > 4294967295ll)
							fprintf(stderr, "Parse warning at line %lld: integer %lld is out of range.",
									(long long)fp->n_lines, x);
					}
				}
			} else if (type == 'f') {
				s = alloc_data(b, doff + 5) + doff;
				*s++ = 'f';
				*(float*)s = (float)atof(str->s + 5);
				s += 4; doff += 5;
			} else if (type == 'd') {
				s = alloc_data(b, doff + 9) + doff;
				*s++ = 'd';
				*(float*)s = (float)atof(str->s + 9);
				s += 8; doff += 9;
			} else if (type == 'Z' || type == 'H') {
				int size = 1 + (str->l - 5) + 1;
				if (type == 'H') { // check whether the hex string is valid
					int i;
					if ((str->l - 5) % 2 == 1) parse_error(fp->n_lines, "length of the hex string not even");
					for (i = 0; i < str->l - 5; ++i) {
						int c = toupper(str->s[5 + i]);
						if (!((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')))
							parse_error(fp->n_lines, "invalid hex character");
					}
				}
				s = alloc_data(b, doff + size) + doff;
				*s++ = type;
				memcpy(s, str->s + 5, str->l - 5);
				s[str->l - 5] = 0;
				doff += size;
			} else parse_error(fp->n_lines, "unrecognized type");
			if (dret == '\n' || dret == '\r') break;
		}
	}
	b->l_aux = doff - doff0;
	b->data_len = doff;
	return z;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r15
movq %rsi, 0x8(%rsp)
movq %rdi, %rbx
movq 0x8(%rdi), %r13
movq 0x10(%rdi), %r12
cmpl $0x0, 0x20(%rdi)
je 0x13d68
movq %r13, %r14
movl $0x0, 0x20(%rbx)
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0xa, %ebp
testb $-0x80, 0x3(%r12)
je 0x13d9b
jmp 0x14630
xorl %ebp, %ebp
leaq 0x4(%rsp), %r14
movq 0x8(%rbx), %rdi
movl $0x1, %esi
movq %r12, %rdx
movq %r14, %rcx
callq 0x136ff
testl %eax, %eax
js 0x13e9a
movl (%r12), %eax
leal 0x1(%rbp,%rax), %ebp
je 0x13d6f
movq %r13, %r14
addl $0xa, %ebp
incq 0x18(%rbx)
movq 0x10(%r12), %rdi
callq 0x32d0
shlq $0x18, %rax
addq $0x1000000, %rax        # imm = 0x1000000
movl %eax, %ecx
movabsq $-0xff000001, %rdx      # imm = 0xFFFFFFFF00FFFFFF
andq 0x8(%r15), %rdx
orq %rcx, %rdx
movq %rdx, 0x8(%r15)
shrl $0x18, %eax
cmpl %eax, 0x28(%r15)
jge 0x13e16
decl %eax
movl %eax, %ecx
sarl %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x8, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x10, %ecx
orl %eax, %ecx
incl %ecx
movl %ecx, 0x28(%r15)
movq 0x30(%r15), %rdi
movslq %ecx, %rsi
callq 0x3610
movq %rax, %rdi
movq %rax, 0x30(%r15)
movq 0x8(%r15), %rdx
jmp 0x13e1a
movq 0x30(%r15), %rdi
movq %r14, %r13
movq 0x10(%r12), %rsi
shrl $0x18, %edx
callq 0x3680
movzbl 0xb(%r15), %eax
movq %rax, 0x28(%rsp)
leaq 0x4(%rsp), %rcx
movq %r14, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x136ff
movl (%r12), %eax
movl %eax, 0x34(%rsp)
movq 0x10(%r12), %rdi
leaq 0x50(%rsp), %r14
movq %r14, %rsi
xorl %edx, %edx
callq 0x3400
movq (%r14), %rcx
cmpb $0x0, (%rcx)
je 0x13ea7
movq 0x10(%r12), %rcx
movb (%rcx), %dl
testb %dl, %dl
je 0x13ea5
incq %rcx
xorl %eax, %eax
leaq 0x1ae5c(%rip), %rsi     # 0x2ece0
movsbq %dl, %rdx
movzwl (%rsi,%rdx,2), %edx
orq %rdx, %rax
movb (%rcx), %dl
incq %rcx
testb %dl, %dl
jne 0x13e84
jmp 0x13ea7
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jmp 0x14630
xorl %eax, %eax
movw %ax, 0xc(%r15)
leaq 0x4(%rsp), %rcx
movq %r13, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x136ff
movl (%r12), %eax
movl %eax, 0x30(%rsp)
movq 0x10(%r12), %rsi
movq 0x8(%rsp), %rdi
callq 0x11e22
movl %eax, (%r15)
testl %eax, %eax
jns 0x13ef7
movq 0x10(%r12), %rdx
cmpb $0x2a, (%rdx)
jne 0x14236
cmpb $0x0, 0x1(%rdx)
jne 0x14236
leaq 0x4(%rsp), %rcx
movq %r13, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x136ff
movl (%r12), %eax
movl %eax, 0x4c(%rsp)
callq 0x3310
movq %rax, 0x18(%rsp)
movq (%rax), %rcx
movq 0x10(%r12), %rdi
movsbq (%rdi), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x8, 0x1(%rcx,%rdx,2)
je 0x13f3d
callq 0x3410
decl %eax
movl %eax, 0x4(%r15)
leaq 0x4(%rsp), %rcx
movq %r13, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x136ff
movl %eax, %r14d
movl (%r12), %eax
movl %eax, 0x48(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x10(%r12), %rdi
movsbq (%rdi), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x13f7d
xorl %eax, %eax
jmp 0x13f88
callq 0x3410
movzbl %al, %eax
shll $0x10, %eax
movq $-0xff0001, %rcx        # imm = 0xFF00FFFF
andq 0x8(%r15), %rcx
orq %rax, %rcx
movq %rcx, 0x8(%r15)
testl %r14d, %r14d
js 0x14043
movq %rbx, 0x20(%rsp)
movabsq $0x1000000000000, %rax  # imm = 0x1000000000000
leaq -0x1(%rax), %rbx
andq %rbx, %rcx
movq %rcx, 0x8(%r15)
leaq 0x4(%rsp), %rcx
movq %r13, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x136ff
testl %eax, %eax
js 0x1404e
addq $0x18, 0x20(%rsp)
movl (%r12), %eax
movl %eax, 0x44(%rsp)
movq 0x10(%r12), %rax
movzbl (%rax), %edx
testl %edx, %edx
movq %r15, 0x10(%rsp)
movq 0x18(%rsp), %r14
movabsq $0x1000000000000, %rdi  # imm = 0x1000000000000
movq %r13, 0x38(%rsp)
je 0x140a2
cmpl $0x2a, %edx
jne 0x14059
movq 0x8(%r15), %rbx
btq $0x22, %rbx
jae 0x14a1d
movl 0x4(%r15), %eax
shrl $0xe, %eax
addl $0x1249, %eax           # imm = 0x1249
movzwl %ax, %eax
andq $-0x10000, %rbx         # imm = 0xFFFF0000
orq %rax, %rbx
movq %rbx, 0x8(%r15)
jmp 0x1429d
movl $0xfffffffe, %r13d      # imm = 0xFFFFFFFE
jmp 0x14630
movl $0xfffffffd, %r13d      # imm = 0xFFFFFFFD
jmp 0x14630
incq %rax
movabsq $-0x1000000000000, %rcx # imm = 0xFFFF000000000000
movq (%r14), %rsi
movsbq %dl, %rdx
movzwl (%rsi,%rdx,2), %edx
btl $0xa, %edx
jb 0x14082
btl $0xb, %edx
jb 0x14099
jmp 0x14a50
movq 0x8(%r15), %rdx
movq %rdx, %rsi
andq %rcx, %rsi
addq %rdi, %rsi
andq %rbx, %rdx
orq %rsi, %rdx
movq %rdx, 0x8(%r15)
movb (%rax), %dl
incq %rax
testb %dl, %dl
jne 0x14066
movq 0x8(%r15), %rax
movq %rax, %rcx
shrq $0x2e, %rcx
andl $-0x4, %ecx
addl 0x28(%rsp), %ecx
cmpl %ecx, 0x28(%r15)
jge 0x14103
decl %ecx
movl %ecx, %eax
sarl %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x10, %eax
orl %ecx, %eax
incl %eax
movl %eax, 0x28(%r15)
movq 0x30(%r15), %rdi
movslq %eax, %rsi
callq 0x3610
movabsq $0x1000000000000, %rdi  # imm = 0x1000000000000
movq %rax, %rsi
movq 0x8(%r15), %rax
jmp 0x14107
movq 0x30(%r15), %rsi
movq %rsi, 0x30(%r15)
movq 0x10(%r12), %r13
cmpq %rdi, %rax
jb 0x141c9
xorl %r14d, %r14d
callq 0x3280
movq %rax, %r15
leaq 0x11415(%rip), %rbx     # 0x25540
movq %r13, %rdi
leaq 0x50(%rsp), %rsi
movl $0xa, %edx
callq 0x3400
movq (%r15), %rcx
movq 0x50(%rsp), %r13
movsbq (%r13), %rdx
movl (%rcx,%rdx,4), %edx
xorl %ecx, %ecx
leal -0x48(%rdx), %esi
cmpl $0x10, %esi
ja 0x14167
movslq (%rbx,%rsi,4), %rdx
addq %rbx, %rdx
jmpq *%rdx
movl $0x5, %ecx
jmp 0x14196
cmpl $0x3d, %edx
je 0x14196
cmpl $0x44, %edx
jne 0x14a69
movl $0x2, %ecx
jmp 0x14196
movl $0x1, %ecx
jmp 0x14196
movl $0x4, %ecx
jmp 0x14196
movl $0x6, %ecx
jmp 0x14196
movl $0x3, %ecx
incq %r13
shll $0x4, %eax
orl %eax, %ecx
movq 0x10(%rsp), %rdx
movq 0x30(%rdx), %rsi
movzbl 0xb(%rdx), %eax
addq %rsi, %rax
movl %ecx, (%rax,%r14,4)
incq %r14
movq 0x8(%rdx), %rax
movq %rax, %rcx
shrq $0x30, %rcx
cmpq %rcx, %r14
jne 0x1412b
cmpb $0x0, (%r13)
jne 0x14a73
movq 0x10(%rsp), %r15
movl 0x4(%r15), %ebx
shrl $0x18, %eax
addq %rax, %rsi
movq %r15, %rdi
callq 0x12268
decl %eax
movl %ebx, %ecx
shrl $0xe, %ecx
movl %eax, %edx
shrl $0xe, %edx
cmpl %edx, %ecx
movq 0x38(%rsp), %r13
movq 0x18(%rsp), %r14
jne 0x1420d
addl $0x1249, %ecx           # imm = 0x1249
jmp 0x14284
movl %ebx, %ecx
shrl $0x11, %ecx
movl %eax, %edx
shrl $0x11, %edx
cmpl %edx, %ecx
jne 0x14223
addl $0x249, %ecx            # imm = 0x249
jmp 0x14284
movl %ebx, %ecx
shrl $0x14, %ecx
movl %eax, %edx
shrl $0x14, %edx
cmpl %edx, %ecx
jne 0x14261
addl $0x49, %ecx
jmp 0x14284
movq 0x8(%rsp), %rax
cmpl $0x0, (%rax)
movq 0x19da3(%rip), %rax     # 0x2dfe8
movq (%rax), %rdi
je 0x14a64
leaq 0x11422(%rip), %rsi     # 0x25677
xorl %eax, %eax
callq 0x3630
jmp 0x13ef7
movl %ebx, %ecx
shrl $0x17, %ecx
movl %eax, %edx
shrl $0x17, %edx
cmpl %edx, %ecx
jne 0x14274
addl $0x9, %ecx
jmp 0x14284
shrl $0x1a, %ebx
shrl $0x1a, %eax
leal 0x1(%rbx), %edx
xorl %ecx, %ecx
cmpl %eax, %ebx
cmovel %edx, %ecx
movq 0x8(%r15), %rax
movw %cx, 0x8(%r15)
shrq $0x2e, %rax
andl $-0x4, %eax
addl 0x28(%rsp), %eax
movq %rax, 0x28(%rsp)
leaq 0x4(%rsp), %rcx
movq %r13, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x136ff
movl (%r12), %ebx
movq 0x10(%r12), %rsi
cmpb $0x3d, (%rsi)
jne 0x142ca
cmpb $0x0, 0x1(%rsi)
je 0x14465
movq 0x8(%rsp), %rdi
callq 0x11e22
movl %eax, 0x14(%r15)
leaq 0x4(%rsp), %rcx
movq %r13, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x136ff
movl (%r12), %r13d
movq (%r14), %rcx
movq 0x10(%r12), %rdi
movsbq (%rdi), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x8, 0x1(%rcx,%rdx,2)
je 0x14310
callq 0x3410
decl %eax
movl %eax, 0x18(%r15)
leaq 0x4(%rsp), %rcx
movq 0x38(%rsp), %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x136ff
movl %eax, %r14d
movl (%r12), %eax
movl %eax, 0x8(%rsp)
movq 0x10(%r12), %rdi
movsbq (%rdi), %rcx
cmpq $0x2d, %rcx
je 0x14356
movq 0x18(%rsp), %rax
movq (%rax), %rdx
xorl %eax, %eax
testb $0x8, 0x1(%rdx,%rcx,2)
je 0x1435b
callq 0x3410
movl %eax, 0x1c(%r15)
testl %r14d, %r14d
js 0x1444f
leaq 0x4(%rsp), %rcx
movq 0x38(%rsp), %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x136ff
testl %eax, %eax
js 0x1445a
movl (%r12), %r14d
movq 0x10(%r12), %rdi
cmpb $0x2a, (%rdi)
jne 0x1439f
cmpb $0x0, 0x1(%rdi)
je 0x144de
movl %r14d, 0x18(%rsp)
callq 0x32d0
movq %rax, %r14
movl %r14d, 0x10(%r15)
movq 0x8(%r15), %rsi
movabsq $0x1000000000000, %rax  # imm = 0x1000000000000
cmpq %rax, %rsi
jb 0x143df
shrl $0x18, %esi
addq 0x30(%r15), %rsi
movq %r15, %rdi
callq 0x122aa
cmpl %r14d, %eax
jne 0x14a9b
movl 0x10(%r15), %r14d
movl %ebx, 0x40(%rsp)
movq 0x28(%rsp), %rax
addl %r14d, %eax
movl %r14d, %ecx
incl %ecx
shrl $0x1f, %ecx
addl %r14d, %ecx
incl %ecx
sarl %ecx
addl %ecx, %eax
cmpl %eax, 0x28(%r15)
jge 0x1446d
decl %eax
movl %eax, %ecx
sarl %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x8, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x10, %ecx
orl %eax, %ecx
incl %ecx
movl %ecx, 0x28(%r15)
movq 0x30(%r15), %rdi
movslq %ecx, %rsi
callq 0x3610
movq %rax, 0x30(%r15)
movl 0x10(%r15), %ecx
movl %ecx, %edx
incl %edx
shrl $0x1f, %edx
addl %edx, %ecx
incl %ecx
sarl %ecx
jmp 0x14471
movl $0xfffffffc, %r13d      # imm = 0xFFFFFFFC
jmp 0x14630
movl $0xfffffffb, %r13d      # imm = 0xFFFFFFFB
jmp 0x14630
movl (%r15), %eax
jmp 0x142d4
movq 0x30(%r15), %rax
movq %r15, %rbx
movl 0x18(%rsp), %r14d
movl 0x28(%rsp), %r15d
addq %rax, %r15
movslq %ecx, %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x3060
cmpl $0x0, 0x10(%rbx)
jle 0x144d8
xorl %eax, %eax
leaq 0x1a743(%rip), %rdx     # 0x2ebe0
xorl %esi, %esi
movq 0x10(%rsp), %r8
movl 0x40(%rsp), %ebx
movq 0x10(%r12), %rcx
movsbq (%rcx,%rsi), %rcx
movb (%rcx,%rdx), %dil
movl %eax, %ecx
notb %cl
andb $0x4, %cl
shlb %cl, %dil
movl %esi, %ecx
shrl %ecx
orb %dil, (%r15,%rcx)
incq %rsi
movslq 0x10(%r8), %rcx
addb $0x4, %al
cmpq %rcx, %rsi
jl 0x144a8
jmp 0x144e9
movl 0x40(%rsp), %ebx
jmp 0x144e9
movl $0x0, 0x10(%r15)
xorl %r15d, %r15d
leaq 0x4(%rsp), %rcx
movq 0x38(%rsp), %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x136ff
testl %eax, %eax
js 0x14574
addl 0x34(%rsp), %ebp
addl 0x30(%rsp), %ebp
addl 0x4c(%rsp), %ebp
addl 0x48(%rsp), %ebp
addl 0x44(%rsp), %ebp
addl %ebx, %ebp
addl 0x8(%rsp), %r13d
addl %r14d, %r13d
addl %ebp, %r13d
addl (%r12), %r13d
movq 0x10(%r12), %rdi
movb (%rdi), %bl
cmpb $0x2a, %bl
movq %rdi, 0x8(%rsp)
jne 0x14540
cmpb $0x0, 0x1(%rdi)
je 0x1457f
movq 0x10(%rsp), %r14
movslq 0x10(%r14), %rbp
callq 0x32d0
cmpq %rbp, %rax
jne 0x14a87
leaq 0x10(%r14), %rax
leal 0x1(%rbp), %ecx
shrl $0x1f, %ecx
addl %ebp, %ecx
incl %ecx
sarl %ecx
movslq %ecx, %rcx
addq %rcx, %r15
cmpb $0x2a, %bl
je 0x1459d
jmp 0x145a8
movl $0xfffffffa, %r13d      # imm = 0xFFFFFFFA
jmp 0x14630
movq 0x10(%rsp), %rcx
leaq 0x10(%rcx), %rax
movl 0x10(%rcx), %ebp
leal 0x1(%rbp), %ecx
shrl $0x1f, %ecx
addl %ebp, %ecx
incl %ecx
sarl %ecx
movslq %ecx, %rcx
addq %rcx, %r15
movq 0x8(%rsp), %rcx
cmpb $0x0, 0x1(%rcx)
je 0x145ca
testl %ebp, %ebp
jle 0x145e0
xorl %ecx, %ecx
movq 0x10(%r12), %rdx
movb (%rdx,%rcx), %dl
addb $-0x21, %dl
movb %dl, (%r15,%rcx)
incq %rcx
movslq (%rax), %rbp
cmpq %rbp, %rcx
jl 0x145ae
jmp 0x145e0
testl %ebp, %ebp
jle 0x145e0
xorl %ecx, %ecx
movb $-0x1, (%r15,%rcx)
incq %rcx
movslq (%rax), %rbp
cmpq %rbp, %rcx
jl 0x145d0
leal 0x1(%rbp), %eax
shrl $0x1f, %eax
addl %ebp, %eax
incl %eax
sarl %eax
movq 0x28(%rsp), %rcx
addl %ebp, %ecx
addl %eax, %ecx
movq %rcx, 0x28(%rsp)
movl 0x4(%rsp), %eax
cmpl $0xa, %eax
je 0x14616
cmpl $0xd, %eax
movq 0x10(%rsp), %r14
jne 0x14642
movq 0x28(%rsp), %rax
movl %eax, %ebp
jmp 0x14622
movq 0x28(%rsp), %rax
movl %eax, %ebp
movq 0x10(%rsp), %r14
movl %ebp, %eax
subl 0x28(%rsp), %eax
movl %eax, 0x20(%r14)
movl %ebp, 0x24(%r14)
movl %r13d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%rsp), %rax
movl %eax, %ebp
movq 0x38(%rsp), %rdi
movl $0x1, %esi
movq %r12, %rdx
leaq 0x4(%rsp), %rcx
callq 0x136ff
testl %eax, %eax
js 0x14622
movq (%r12), %rax
movq %rax, 0x8(%rsp)
cmpq $0x6, %rax
jb 0x14a5a
movq 0x10(%r12), %rax
cmpb $0x3a, 0x2(%rax)
jne 0x14a5a
cmpb $0x3a, 0x4(%rax)
jne 0x14a5a
movq %r13, %r14
movb (%rax), %dil
movb 0x1(%rax), %r15b
movb 0x3(%rax), %sil
leal 0x3(%rbp), %ebx
movq %rbp, %r13
movq 0x10(%rsp), %rbp
cmpl %ebx, 0x28(%rbp)
jge 0x14703
leal 0x2(%r13), %ecx
movl %ecx, %eax
sarl %eax
movl %ecx, 0x18(%rsp)
orl %ecx, %eax
movl %eax, %ecx
sarl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x10, %eax
orl %ecx, %eax
incl %eax
movl %eax, 0x28(%rbp)
movb %dil, 0x34(%rsp)
movq 0x30(%rbp), %rdi
movb %sil, 0x30(%rsp)
movslq %eax, %rsi
callq 0x3610
movb 0x34(%rsp), %dil
movb 0x30(%rsp), %sil
movq %rax, 0x30(%rbp)
jmp 0x1470f
movq 0x30(%rbp), %rax
leal 0x2(%r13), %ecx
movl %ecx, 0x18(%rsp)
movq %r13, %rbp
movzbl %sil, %ecx
movslq %ebp, %rdx
movb %dil, (%rax,%rdx)
movb %r15b, 0x1(%rax,%rdx)
leal -0x41(%rcx), %eax
cmpl $0x22, %eax
movq %r14, %r13
ja 0x147cc
movabsq $0x500000005, %rdx      # imm = 0x500000005
btq %rax, %rdx
jae 0x147cc
addl $0x4, %ebp
movq 0x10(%rsp), %r14
cmpl %ebp, 0x28(%r14)
jge 0x1478d
movl %ebx, %eax
sarl %eax
orl %ebx, %eax
movl %eax, %ecx
sarl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x10, %eax
orl %ecx, %eax
incl %eax
movl %eax, 0x28(%r14)
movq 0x30(%r14), %rdi
movslq %eax, %rsi
callq 0x3610
movq %rax, 0x30(%r14)
jmp 0x14791
movq 0x30(%r14), %rax
movq 0x8(%rsp), %rsi
movslq 0x18(%rsp), %rcx
movb $0x41, (%rax,%rcx)
movq 0x10(%r12), %rdx
movb 0x5(%rdx), %dl
movb %dl, 0x1(%rax,%rcx)
addl %esi, %r13d
incl %r13d
movl 0x4(%rsp), %eax
cmpl $0xd, %eax
je 0x14622
cmpl $0xa, %eax
jne 0x14649
jmp 0x14622
movl %esi, %eax
andb $-0x21, %al
cmpb $0x49, %al
jne 0x14829
leal 0x7(%rbp), %r15d
movq 0x10(%rsp), %rbx
cmpl %r15d, 0x28(%rbx)
jge 0x148e6
leal 0x6(%rbp), %eax
movl %eax, %ecx
sarl %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x8, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x10, %ecx
orl %eax, %ecx
incl %ecx
movl %ecx, 0x28(%rbx)
movq 0x30(%rbx), %rdi
movslq %ecx, %rsi
callq 0x3610
movq %rax, %r14
movq %rax, 0x30(%rbx)
jmp 0x148ea
cmpl $0x63, %ecx
jg 0x14913
cmpl $0x48, %ecx
movq 0x10(%rsp), %r14
je 0x14845
cmpl $0x5a, %ecx
jne 0x14aaf
movq (%r12), %rbx
movl %esi, %r15d
cmpb $0x48, %sil
jne 0x148a0
testb $0x1, %bl
je 0x14ac3
cmpq $0x5, %rbx
je 0x148a0
callq 0x3280
movq (%rax), %rax
movq 0x10(%r12), %rcx
movl $0x5, %edx
movsbq (%rcx,%rdx), %rsi
movl (%rax,%rsi,4), %esi
leal -0x30(%rsi), %edi
cmpl $0xa, %edi
setb %dil
addl $-0x41, %esi
cmpl $0x6, %esi
setb %sil
orb %dil, %sil
je 0x14a7d
incq %rdx
cmpq %rdx, %rbx
jne 0x14873
addl %ebx, %ebp
decl %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x14ad7
movslq 0x18(%rsp), %rcx
leaq (%rax,%rcx), %rbx
leaq (%rax,%rcx), %rdi
incq %rdi
movb %r15b, -0x1(%rdi)
movq (%r12), %rdx
movq 0x10(%r12), %rsi
addq $0x5, %rsi
addq $-0x5, %rdx
callq 0x3680
movq (%r12), %rax
movb $0x0, -0x4(%rax,%rbx)
jmp 0x149d5
movq 0x30(%rbx), %r14
movl 0x18(%rsp), %eax
movslq %eax, %rbx
movq 0x10(%r12), %rdi
addq $0x5, %rdi
callq 0x3540
testq %rax, %rax
js 0x1494a
cmpq $0xff, %rax
ja 0x1495f
movb $0x43, (%r14,%rbx)
jmp 0x14955
cmpl $0x64, %ecx
movq 0x10(%rsp), %r14
je 0x1496e
cmpl $0x66, %ecx
jne 0x14aaf
addl $0x7, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x14ad7
movq %rax, %r15
movslq 0x18(%rsp), %rbx
movb $0x66, (%rax,%rbx)
movq 0x10(%r12), %rdi
addq $0x5, %rdi
jmp 0x14990
cmpq $-0x7f, %rax
jb 0x149a2
movb $0x63, (%r14,%rbx)
movb %al, 0x1(%r14,%rbx)
addl $0x4, %ebp
jmp 0x149d0
cmpq $0xffff, %rax           # imm = 0xFFFF
ja 0x149ba
movb $0x53, (%r14,%rbx)
jmp 0x149af
addl $0xb, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x14ad7
movq %rax, %r15
movslq 0x18(%rsp), %rbx
movb $0x64, (%rax,%rbx)
movq 0x10(%r12), %rdi
addq $0x9, %rdi
callq 0x3230
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1(%r15,%rbx)
jmp 0x149d5
cmpq $-0x7fff, %rax          # imm = 0x8001
jb 0x149df
movb $0x73, (%r14,%rbx)
movw %ax, 0x1(%r14,%rbx)
addl $0x5, %ebp
jmp 0x149d0
movb $0x49, (%r14,%rbx)
movl %eax, 0x1(%r14,%rbx)
movq %rax, %rcx
shrq $0x20, %rcx
jne 0x149f8
movl %r15d, %ebp
movq 0x10(%rsp), %r14
movq 0x8(%rsp), %rsi
jmp 0x147ab
movb $0x69, (%r14,%rbx)
movl %eax, 0x1(%r14,%rbx)
movabsq $-0x80000001, %rcx      # imm = 0xFFFFFFFF7FFFFFFF
cmpq %rcx, %rax
ja 0x149cd
movq 0x195e9(%rip), %rcx     # 0x2dfe8
movq (%rcx), %rdi
movq 0x20(%rsp), %rcx
movq (%rcx), %rdx
leaq 0x10d8e(%rip), %rsi     # 0x2579f
movq %rax, %rcx
xorl %eax, %eax
callq 0x3630
jmp 0x149cd
movabsq $0x400000000, %rbx      # imm = 0x400000000
movq 0x195ba(%rip), %rax     # 0x2dfe8
movq (%rax), %rdi
movq 0x20(%rsp), %rax
movq (%rax), %rdx
leaq 0x10cb3(%rip), %rsi     # 0x256f3
xorl %eax, %eax
callq 0x3630
orq 0x8(%r15), %rbx
jmp 0x14021
movq 0x20(%rsp), %rdi
callq 0x4610
movq 0x20(%rsp), %rdi
callq 0x45e8
callq 0x4552
movq 0x20(%rsp), %rdi
callq 0x4570
movq 0x20(%rsp), %rdi
callq 0x4598
movq 0x20(%rsp), %rdi
callq 0x45c0
movq 0x20(%rsp), %rax
movq (%rax), %rdi
leaq 0x10cc3(%rip), %rsi     # 0x25759
callq 0x14b21
movq 0x20(%rsp), %rax
movq (%rax), %rdi
leaq 0x10c84(%rip), %rsi     # 0x2572e
callq 0x14b21
movq 0x20(%rsp), %rax
movq (%rax), %rdi
leaq 0x10d53(%rip), %rsi     # 0x25811
callq 0x14b21
movq 0x20(%rsp), %rax
movq (%rax), %rdi
leaq 0x10d07(%rip), %rsi     # 0x257d9
callq 0x14b21