// File: /workspace/github_c_makefile_star2_O2/lh3[P]bgt/vcf.c
// Function: vcf_parse1
int vcf_parse1(kstring_t *s, const bcf_hdr_t *h, bcf1_t *v)
{
	int i = 0;
	char *p, *q, *r, *t;
	fmt_aux_t *fmt = 0;
	kstring_t *str, *mem = (kstring_t*)&h->mem;
	khint_t k;
	ks_tokaux_t aux;

	mem->l = v->shared.l = v->indiv.l = 0;
	str = &v->shared;
	v->n_fmt = 0;
	v->unpacked = 0;
	v->unpack_ptr = NULL;
	memset(&aux, 0, sizeof(ks_tokaux_t));
	for (p = kstrtok(s->s, "\t", &aux), i = 0; p; p = kstrtok(0, 0, &aux), ++i) {
		q = (char*)aux.p;
		*q = 0;
		if (i == 0) { // CHROM
			vdict_t *d = (vdict_t*)h->dict[BCF_DT_CTG];
			k = kh_get(vdict, d, p);
			if (k == kh_end(d)) {
				if (hts_verbose >= 2)
					fprintf(stderr, "[W::%s] can't find '%s' in the sequence dictionary\n", __func__, p);
				return 0;
			} else v->rid = kh_val(d, k).id;
		} else if (i == 1) { // POS
			v->pos = atoi(p) - 1;
		} else if (i == 2) { // ID
			if (strcmp(p, ".")) bcf_enc_vchar(str, q - p, p);
			else bcf_enc_size(str, 0, BCF_BT_CHAR);
		} else if (i == 3) { // REF
			bcf_enc_vchar(str, q - p, p);
			v->n_allele = 1, v->rlen = q - p;
		} else if (i == 4) { // ALT
			if (strcmp(p, ".")) {
				for (r = t = p;; ++r) {
					if (*r == ',' || *r == 0) {
						bcf_enc_vchar(str, r - t, t);
						t = r + 1;
						++v->n_allele;
					}
					if (r == q) break;
				}
			}
		} else if (i == 5) { // QUAL
			if (strcmp(p, ".")) v->qual = atof(p);
			else memcpy(&v->qual, &bcf_float_missing, 4);
		} else if (i == 6) { // FILTER
			if (strcmp(p, ".")) {
				int32_t *a;
				int n_flt = 1, i;
				ks_tokaux_t aux1;
				vdict_t *d = (vdict_t*)h->dict[BCF_DT_ID];
				// count the number of filters
				if (*(q-1) == ';') *(q-1) = 0;
				for (r = p; *r; ++r)
					if (*r == ';') ++n_flt;
				a = (int32_t*)alloca(n_flt * 4);
				// add filters
				for (t = kstrtok(p, ";", &aux1), i = 0; t; t = kstrtok(0, 0, &aux1)) {
					*(char*)aux1.p = 0;
					k = kh_get(vdict, d, t);
					if (k == kh_end(d)) { // not defined
						if (hts_verbose >= 2) fprintf(stderr, "[W::%s] undefined FILTER '%s'\n", __func__, t);
					} else a[i++] = kh_val(d, k).id;
				}
				n_flt = i;
				bcf_enc_vint(str, n_flt, a, -1);
			} else bcf_enc_vint(str, 0, 0, -1);
		} else if (i == 7) { // INFO
			char *key;
			vdict_t *d = (vdict_t*)h->dict[BCF_DT_ID];
			v->n_info = 0;
			if (strcmp(p, ".")) {
				if (*(q-1) == ';') *(q-1) = 0;
				for (r = key = p;; ++r) {
					int c;
					char *val, *end;
					if (*r != ';' && *r != '=' && *r != 0) continue;
					val = end = 0;
					c = *r; *r = 0;
					if (c == '=') {
						val = r + 1;
						for (end = val; *end != ';' && *end != 0; ++end);
						c = *end; *end = 0;
					} else end = r;
					k = kh_get(vdict, d, key);
					if (k == kh_end(d) || kh_val(d, k).info[BCF_HL_INFO] == 15) { // not defined in the header
						if (hts_verbose >= 2) fprintf(stderr, "[W::%s] undefined INFO '%s'\n", __func__, key);
					} else { // defined in the header
						uint32_t y = kh_val(d, k).info[BCF_HL_INFO];
						++v->n_info;
						bcf_enc_int1(str, kh_val(d, k).id);
						if (val == 0) {
							bcf_enc_size(str, 0, BCF_BT_NULL);
						} else if ((y>>4&0xf) == BCF_HT_FLAG || (y>>4&0xf) == BCF_HT_STR) { // if Flag has a value, treat it as a string
							bcf_enc_vchar(str, end - val, val);
						} else { // int/float value/array
							int i, n_val;
							char *t;
							for (t = val, n_val = 1; *t; ++t) // count the number of values
								if (*t == ',') ++n_val;
							if ((y>>4&0xf) == BCF_HT_INT) {
								int32_t *z;
								z = (int32_t*)alloca(n_val<<2);
								for (i = 0, t = val; i < n_val; ++i, ++t)
									z[i] = strtol(t, &t, 10);
								bcf_enc_vint(str, n_val, z, -1);
								if (strcmp(key, "END") == 0) v->rlen = z[0] - v->pos;
							} else if ((y>>4&0xf) == BCF_HT_REAL) {
								float *z;
								z = (float*)alloca(n_val<<2);
								for (i = 0, t = val; i < n_val; ++i, ++t)
									z[i] = strtod(t, &t);
								bcf_enc_vfloat(str, n_val, z);
							}
						}
					}
					if (c == 0) break;
					r = end;
					key = r + 1;
				}
			}
		} else if (i == 8) { // FORMAT
			int j, l, m, g;
			ks_tokaux_t aux1;
			vdict_t *d = (vdict_t*)h->dict[BCF_DT_ID];
			char *end = s->s + s->l;
			// count the number of format fields
			for (r = p, v->n_fmt = 1; *r; ++r)
				if (*r == ':') ++v->n_fmt;
			fmt = (fmt_aux_t*)alloca(v->n_fmt * sizeof(fmt_aux_t));
			// get format information from the dictionary
			for (j = 0, t = kstrtok(p, ":", &aux1); t; t = kstrtok(0, 0, &aux1), ++j) {
				*(char*)aux1.p = 0;
				k = kh_get(vdict, d, t);
				if (k == kh_end(d) || kh_val(d, k).info[BCF_HL_FMT] == 15) {
					if (hts_verbose >= 2)
						fprintf(stderr, "[W::%s] FORMAT '%s' is not defined in the header\n", __func__, t);
					v->n_fmt = 0;
					break;
				} else {
					fmt[j].max_l = fmt[j].max_m = fmt[j].max_g = 0;
					fmt[j].key = kh_val(d, k).id;
					fmt[j].is_gt = !strcmp(t, "GT");
					fmt[j].y = h->id[0][fmt[j].key].val->info[BCF_HL_FMT];
				}
			}
			// compute max
			for (r = q + 1, j = 0, m = l = g = 1, v->n_sample = 0;; ++r, ++l) {
				if (*r == '\t') *r = 0;
				if (*r == ':' || *r == '\0') { // end of a sample
					if (fmt[j].max_m < m) fmt[j].max_m = m;
					if (fmt[j].max_l < l - 1) fmt[j].max_l = l - 1;
					if (fmt[j].is_gt && fmt[j].max_g < g) fmt[j].max_g = g;
					l = 0, m = g = 1;
					if (*r) ++j;
					else j = 0, ++v->n_sample;
				} else if (*r == ',') ++m;
				else if (*r == '|' || *r == '/') ++g;
				if (r == end) break;
			}
			// allocate memory for arrays
			for (j = 0; j < v->n_fmt; ++j) {
				fmt_aux_t *f = &fmt[j];
				if ((f->y>>4&0xf) == BCF_HT_STR) {
					f->size = f->is_gt? f->max_g << 2 : f->max_l;
				} else if ((f->y>>4&0xf) == BCF_HT_REAL || (f->y>>4&0xf) == BCF_HT_INT) {
					f->size = f->max_m << 2;
				} else abort(); // I do not know how to do with Flag in the genotype fields
				align_mem(mem);
				f->offset = mem->l;
				ks_resize(mem, mem->l + v->n_sample * f->size);
				mem->l += v->n_sample * f->size;
			}
			for (j = 0; j < v->n_fmt; ++j)
				fmt[j].buf = (uint8_t*)mem->s + fmt[j].offset;
			// fill the sample fields; at beginning of the loop, t points to the first char of an individual field (i.e. a field after FORMAT)
			for (t = q + 1, j = m = 0;; ++t) { // j-th fmt, m-th sample
				fmt_aux_t *z = &fmt[j];
				if ((z->y>>4&0xf) == BCF_HT_STR) {
					if (z->is_gt) { // genotypes
						int32_t is_phased = 0, *x = (int32_t*)(z->buf + z->size * m);
						for (l = 0;; ++t) {
							if (*t == '.') ++t, x[l++] = is_phased;
							else x[l++] = (strtol(t, &t, 10) + 1) << 1 | is_phased;
							is_phased = (*t == '|');
							if (*t == ':' || *t == 0) break;
						}
						for (; l < z->size>>2; ++l) x[l] = bcf_int32_end;
					} else {
						char *x = (char*)z->buf + z->size * m;
						for (r = t, l = 0; *t != ':' && *t; ++t) x[l++] = *t;
						for (; l < z->size; ++l) x[l] = 0;
					}
				} else if ((z->y>>4&0xf) == BCF_HT_INT) {
					int32_t *x = (int32_t*)(z->buf + z->size * m);
					for (l = 0;; ++t) {
						if (*t == '.') x[l++] = bcf_int32_missing, ++t; // ++t to skip "."
						else x[l++] = strtol(t, &t, 10);
						if (*t == ':' || *t == 0) break;
					}
					for (; l < z->size>>2; ++l) x[l] = bcf_int32_end;
				} else if ((z->y>>4&0xf) == BCF_HT_REAL) {
					float *x = (float*)(z->buf + z->size * m);
					for (l = 0;; ++t) {
						if (*t == '.' && !isdigit(t[1])) *(int32_t*)&x[l++] = bcf_float_missing, ++t; // ++t to skip "."
						else x[l++] = strtod(t, &t);
						if (*t == ':' || *t == 0) break;
					}
					for (; l < z->size>>2; ++l) *(int32_t*)(x+l) = bcf_float_end;
				} else abort(); // unknown type
				if (*t == 0) { // now we are at the end of the individual field
					// Write end-of-vector values to the rest of FORMAT in the field. This happens if the entire field is missing.
					for (++j; j < v->n_fmt; ++j) {
						z = &fmt[j];
						if ((z->y>>4&0xf) == BCF_HT_STR) {
							if (z->is_gt) {
								int32_t *x = (int32_t*)(z->buf + z->size * m);
								for (l = 0; l != z->size>>2; ++l) x[l] = bcf_int32_end;
							} else {
								char *x = (char*)z->buf + z->size * m;
								for (l = 0; l != z->size; ++l) x[l] = 0;
							}
						} else if ((z->y>>4&0xf) == BCF_HT_INT) {
							int32_t *x = (int32_t*)(z->buf + z->size * m);
							for (l = 0; l != z->size>>2; ++l) x[l] = bcf_int32_end;
						} else if ((z->y>>4&0xf) == BCF_HT_REAL) {
							float *x = (float*)(z->buf + z->size * m);
							for (l = 0; l != z->size>>2; ++l) *(int32_t*)(x+l) = bcf_float_end;
						}
					}
					if (t == end) break;
					++m, j = 0;
				} else if (*t == ':') ++j;
			}
			break;
		}
	}
	// write individual genotype information
	str = &v->indiv;
	if (v->n_sample > 0) {
		for (i = 0; i < v->n_fmt; ++i) {
			fmt_aux_t *z = &fmt[i];
			bcf_enc_int1(str, z->key);
			if ((z->y>>4&0xf) == BCF_HT_STR && !z->is_gt) {
				bcf_enc_size(str, z->size, BCF_BT_CHAR);
				kputsn((char*)z->buf, z->size * v->n_sample, str);
			} else if ((z->y>>4&0xf) == BCF_HT_INT || z->is_gt) {
				bcf_enc_vint(str, (z->size>>2) * v->n_sample, (int32_t*)z->buf, z->size>>2);
			} else {
				bcf_enc_size(str, z->size>>2, BCF_BT_FLOAT);
				kputsn((char*)z->buf, z->size * v->n_sample, str);
			}
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdx, %rbx
andq $0x0, 0x30(%rdx)
andq $0x0, 0x18(%rdx)
andq $0x0, 0x50(%rsi)
movb $0x0, 0x14(%rdx)
andl $0x0, 0x88(%rdx)
movq %rsi, -0x60(%rbp)
leaq 0x50(%rsi), %rax
movq %rax, -0x78(%rbp)
andq $0x0, 0x90(%rdx)
leaq 0x30(%rdx), %rax
movq %rax, -0x70(%rbp)
leaq 0x18(%rdx), %rax
movq %rax, -0x48(%rbp)
xorps %xmm0, %xmm0
leaq -0xf0(%rbp), %rdx
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, (%rdx)
movq %rdi, -0xb0(%rbp)
movq 0x10(%rdi), %rdi
leaq 0xe7ae(%rip), %rsi      # 0x19caa
callq 0xc303
movq %rax, %r15
movabsq $0x2800000000000001, %r12 # imm = 0x2800000000000001
movl $0x0, -0x50(%rbp)
movq %rbx, -0x30(%rbp)
testq %r15, %r15
je 0xbaa6
movq -0xc8(%rbp), %r13
movb $0x0, (%r13)
cmpl $0x8, -0x50(%rbp)
ja 0xba5a
movl -0x50(%rbp), %eax
leaq 0xdc3e(%rip), %rcx      # 0x19180
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x60(%rbp), %rax
movq 0x38(%rax), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc3b9
cmpl (%rbx), %eax
je 0xbcf0
movq 0x20(%rbx), %rcx
movl %eax, %eax
shlq $0x4, %rax
movl 0xc(%rcx,%rax), %eax
movq -0x30(%rbp), %rcx
movl %eax, (%rcx)
jmp 0xba5a
cmpb $0x2e, (%r15)
jne 0xb590
cmpb $0x0, 0x1(%r15)
je 0xba5a
leaq 0x1(%r15), %r14
movl %r15d, %ebx
movzbl -0x1(%r14), %eax
cmpl $0x2c, %eax
je 0xb5a5
testl %eax, %eax
jne 0xb5e1
movl %ebx, %esi
subl %r15d, %esi
movq -0x48(%rbp), %rdi
movq %r15, %rdx
callq 0xb092
movq -0x30(%rbp), %rsi
movq 0x10(%rsi), %rax
leal 0x10000(%rax), %ecx
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
movabsq $-0xffff0001, %rdx      # imm = 0xFFFFFFFF0000FFFF
andq %rdx, %rax
orq %rcx, %rax
movq %rax, 0x10(%rsi)
movq %r14, %r15
leaq 0x1(%r14), %rax
decq %r14
incl %ebx
cmpq %r13, %r14
movq %rax, %r14
jne 0xb597
movq %r15, -0x38(%rbp)
jmp 0xba5a
cmpb $0x2e, (%r15)
jne 0xb60c
cmpb $0x0, 0x1(%r15)
je 0xba75
subl %r15d, %r13d
movq -0x48(%rbp), %rdi
movl %r13d, %esi
movq %r15, %rdx
callq 0xb092
jmp 0xba5a
subl %r15d, %r13d
movq -0x48(%rbp), %rdi
movl %r13d, %esi
movq %r15, %rdx
callq 0xb092
movq -0x30(%rbp), %rdx
movq 0x10(%rdx), %rax
movabsq $-0xffff0001, %rcx      # imm = 0xFFFFFFFF0000FFFF
andq %rcx, %rax
orq $0x10000, %rax          # imm = 0x10000
movq %rax, 0x10(%rdx)
movl %r13d, 0x8(%rdx)
jmp 0xba5a
movq -0x60(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x30(%rbp), %rax
andq $-0x10000, 0x10(%rax)   # imm = 0xFFFF0000
cmpb $0x2e, (%r15)
jne 0xb682
cmpb $0x0, 0x1(%r15)
je 0xba5a
cmpb $0x3b, -0x1(%r13)
jne 0xb68e
movb $0x0, -0x1(%r13)
movq %r15, %r13
movq %rdx, -0x68(%rbp)
movzbl (%r13), %ebx
cmpq $0x3d, %rbx
ja 0xb7aa
btq %rbx, %r12
jae 0xb7aa
movb $0x0, (%r13)
cmpb $0x3d, %bl
jne 0xb6d4
movq %r13, %r14
incq %r14
movq %r14, %r13
movzbl (%r13), %ebx
testl %ebx, %ebx
je 0xb6d9
cmpl $0x3b, %ebx
je 0xb6d9
incq %r13
jmp 0xb6c1
xorl %r14d, %r14d
jmp 0xb6de
movb $0x0, (%r13)
movq -0x68(%rbp), %rdi
movq %r15, -0x58(%rbp)
movq %r15, %rsi
callq 0xc3b9
movq -0x68(%rbp), %rdx
cmpl (%rdx), %eax
je 0xb70b
movq 0x20(%rdx), %rcx
movl %eax, %eax
shlq $0x4, %rax
movl 0x4(%rcx,%rax), %r15d
cmpl $0xf, %r15d
jne 0xb740
leaq 0x15b3e(%rip), %rax     # 0x21250
cmpl $0x2, (%rax)
jl 0xb79e
movq 0x158d6(%rip), %rax     # 0x20ff8
movq (%rax), %rdi
leaq 0xdc98(%rip), %rsi      # 0x193c4
leaq 0xdc65(%rip), %rdx      # 0x19398
movq -0x58(%rbp), %rcx
xorl %eax, %eax
callq 0x2250
jmp 0xb79e
movq -0x30(%rbp), %rcx
incw 0x10(%rcx)
movq 0x20(%rdx), %rcx
movl 0xc(%rcx,%rax), %esi
movq -0x48(%rbp), %r12
movq %r12, %rdi
callq 0xafbb
testq %r14, %r14
je 0xb788
shrl $0x4, %r15d
andl $0xf, %r15d
cmpl $0x3, %r15d
je 0xb774
testl %r15d, %r15d
jne 0xb7b2
movl %r13d, %esi
subl %r14d, %esi
movq -0x48(%rbp), %rdi
movq %r14, %rdx
callq 0xb092
jmp 0xb794
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xaf23
movabsq $0x2800000000000001, %r12 # imm = 0x2800000000000001
testb %bl, %bl
je 0xba5a
leaq 0x1(%r13), %r15
incq %r13
jmp 0xb695
movq %r14, %rax
pushq $0x1
popq %rcx
movl %ecx, %r12d
movq %rax, -0xa8(%rbp)
movzbl (%rax), %ecx
cmpl $0x2c, %ecx
je 0xb7d0
testl %ecx, %ecx
jne 0xb7d3
jmp 0xb7d8
incl %r12d
incq %rax
jmp 0xb7bb
cmpl $0x2, %r15d
je 0xb88d
cmpl $0x1, %r15d
jne 0xb794
leal (,%r12,4), %eax
cltq
movq %rsp, %rcx
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, %rsp
testl %r12d, %r12d
movl $0x0, %eax
cmovgl %r12d, %eax
movq %rax, -0x40(%rbp)
xorl %r15d, %r15d
movq %r14, -0xa8(%rbp)
cmpq %r15, -0x40(%rbp)
je 0xb84e
movq %r14, %rdi
leaq -0xa8(%rbp), %rsi
movq %rcx, %r14
pushq $0xa
popq %rdx
callq 0x2270
movq %r14, %rcx
movl %eax, (%r14,%r15,4)
incq %r15
movq -0xa8(%rbp), %r14
incq %r14
jmp 0xb816
movq -0x48(%rbp), %rdi
movl %r12d, %esi
movq %rcx, %r14
movq %rcx, %rdx
pushq $-0x1
popq %rcx
callq 0xad8f
movq -0x58(%rbp), %rdi
leaq 0xdb73(%rip), %rsi      # 0x193e1
callq 0x2230
testl %eax, %eax
jne 0xb794
movl (%r14), %eax
movq -0x30(%rbp), %rcx
subl 0x4(%rcx), %eax
movl %eax, 0x8(%rcx)
jmp 0xb794
leal (,%r12,4), %eax
cltq
movq %rsp, %rcx
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, -0x58(%rbp)
movq %rcx, %rsp
testl %r12d, %r12d
movl $0x0, %eax
cmovgl %r12d, %eax
movq %rax, -0x40(%rbp)
xorl %r15d, %r15d
movq %r14, -0xa8(%rbp)
cmpq %r15, -0x40(%rbp)
je 0xb8f8
movq %r14, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movq -0x58(%rbp), %rax
movss %xmm0, (%rax,%r15,4)
incq %r15
movq -0xa8(%rbp), %r14
incq %r14
jmp 0xb8bf
movq -0x48(%rbp), %rdi
movl %r12d, %esi
movq -0x58(%rbp), %rdx
callq 0xb06a
jmp 0xb794
movq %r15, %rdi
callq 0x23f0
decl %eax
movq -0x30(%rbp), %rcx
movl %eax, 0x4(%rcx)
jmp 0xba5a
cmpb $0x2e, (%r15)
jne 0xb934
cmpb $0x0, 0x1(%r15)
je 0xba85
movq %r15, %rdi
callq 0x2120
cvtsd2ss %xmm0, %xmm0
movq -0x30(%rbp), %rax
movss %xmm0, 0xc(%rax)
jmp 0xba5a
cmpb $0x2e, (%r15)
jne 0xb95f
cmpb $0x0, 0x1(%r15)
je 0xba94
movq -0x60(%rbp), %rax
movq 0x30(%rax), %r14
cmpb $0x3b, -0x1(%r13)
jne 0xb973
movb $0x0, -0x1(%r13)
pushq $0x1
popq %rax
movq %r15, %rcx
movzbl (%rcx), %edx
cmpl $0x3b, %edx
je 0xb987
testl %edx, %edx
jne 0xb989
jmp 0xb98e
incl %eax
incq %rcx
jmp 0xb979
shll $0x2, %eax
cltq
movq %rsp, %r12
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movq %r15, %rdi
leaq 0xd9f5(%rip), %rsi      # 0x193a3
leaq -0xa8(%rbp), %rdx
callq 0xc303
movq %rax, %rbx
xorl %r15d, %r15d
testq %rbx, %rbx
je 0xba39
movq -0x80(%rbp), %rax
movb $0x0, (%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc3b9
cmpl (%r14), %eax
jne 0xba0c
leaq 0x1586d(%rip), %rax     # 0x21250
cmpl $0x2, (%rax)
jl 0xba24
movq 0x15609(%rip), %rax     # 0x20ff8
movq (%rax), %rdi
leaq 0xd9ac(%rip), %rsi      # 0x193a5
leaq 0xd998(%rip), %rdx      # 0x19398
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2250
jmp 0xba24
movq 0x20(%r14), %rcx
movl %eax, %eax
shlq $0x4, %rax
movl 0xc(%rcx,%rax), %eax
movslq %r15d, %rcx
incl %r15d
movl %eax, (%r12,%rcx,4)
xorl %edi, %edi
xorl %esi, %esi
leaq -0xa8(%rbp), %rdx
callq 0xc303
movq %rax, %rbx
jmp 0xb9c0
andq $0x0, -0x38(%rbp)
movq -0x48(%rbp), %rdi
movl %r15d, %esi
movq %r12, %rdx
pushq $-0x1
popq %rcx
callq 0xad8f
movabsq $0x2800000000000001, %r12 # imm = 0x2800000000000001
xorl %edi, %edi
xorl %esi, %esi
leaq -0xf0(%rbp), %rdx
callq 0xc303
movq %rax, %r15
incl -0x50(%rbp)
jmp 0xb519
movq -0x48(%rbp), %rdi
xorl %esi, %esi
pushq $0x7
popq %rdx
callq 0xaf23
jmp 0xba5a
movl 0x158f5(%rip), %eax     # 0x21380
movq -0x30(%rbp), %rcx
movl %eax, 0xc(%rcx)
jmp 0xba5a
movq -0x48(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
pushq $-0x1
popq %rcx
callq 0xad8f
jmp 0xba5a
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
xorl %ebx, %ebx
movabsq $0xffffffffff, %rcx     # imm = 0xFFFFFFFFFF
incq %rcx
cmpq %rcx, %rax
jae 0xbad3
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x18, %rbx
xorl %r12d, %r12d
pushq $0x5
popq %r15
shrq $0x20, %rax
movzbl %al, %eax
cmpq %rax, %r12
jae 0xbac2
movl -0x18(%rbx), %esi
movq -0x70(%rbp), %rdi
callq 0xafbb
movl -0x4(%rbx), %eax
movl %eax, %ecx
andb $-0x10, %cl
cmpb $0x10, %cl
je 0xbb5c
andl $0xf0, %eax
cmpl $0x30, %eax
jne 0xbb23
movl -0x8(%rbx), %eax
testb $0x1, %al
jne 0xbb26
movl -0x10(%rbx), %esi
movq -0x70(%rbp), %r13
movq %r13, %rdi
pushq $0x7
popq %rdx
jmp 0xbb3a
movl -0x8(%rbx), %eax
testb $0x1, %al
jne 0xbb5c
movl -0x10(%rbx), %esi
sarl $0x2, %esi
movq -0x70(%rbp), %r13
movq %r13, %rdi
movl %r15d, %edx
callq 0xaf23
movq (%rbx), %rdi
movq -0x30(%rbp), %r14
movq 0x10(%r14), %rsi
shrq $0x28, %rsi
imull -0x10(%rbx), %esi
movq %r13, %rdx
callq 0xac22
jmp 0xbb7d
movl -0x10(%rbx), %ecx
sarl $0x2, %ecx
movq -0x30(%rbp), %r14
movq 0x10(%r14), %rsi
shrq $0x28, %rsi
imull %ecx, %esi
movq (%rbx), %rdx
movq -0x70(%rbp), %rdi
callq 0xad8f
incq %r12
movq 0x10(%r14), %rax
addq $0x20, %rbx
jmp 0xbade
movabsq $0x100000000, %rdx      # imm = 0x100000000
movq -0x60(%rbp), %rax
movq 0x30(%rax), %r14
movq -0xb0(%rbp), %rax
movq (%rax), %rcx
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
movq 0x10(%rdi), %rax
movabsq $-0xff00000001, %rsi    # imm = 0xFFFFFF00FFFFFFFF
andq %rsi, %rax
btsq $0x20, %rax
movq %rax, 0x10(%rdi)
movabsq $0xff00000000, %rsi     # imm = 0xFF00000000
movq %r15, %rdi
movabsq $-0xff00000001, %r9     # imm = 0xFFFFFF00FFFFFFFF
movzbl (%rdi), %r8d
cmpl $0x3a, %r8d
je 0xbbf7
testl %r8d, %r8d
jne 0xbc0c
jmp 0xbc11
leaq (%rax,%rdx), %r8
andq %rsi, %r8
andq %r9, %rax
orq %r8, %rax
movq -0x30(%rbp), %r8
movq %rax, 0x10(%r8)
incq %rdi
jmp 0xbbe6
addq %rcx, -0x40(%rbp)
shrq $0x1b, %rax
movq %rsp, %rbx
andl $0x1fe0, %eax           # imm = 0x1FE0
subq %rax, %rbx
movq %rbx, -0x50(%rbp)
movq %rbx, %rsp
leaq 0xc923(%rip), %rsi      # 0x18555
leaq -0xa8(%rbp), %rdx
movq %r15, %rdi
callq 0xc303
movq %rax, %r15
leaq 0x14(%rbx), %r12
leaq -0xa8(%rbp), %rbx
testq %r15, %r15
je 0xbd53
movq -0x80(%rbp), %rax
movb $0x0, (%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0xc3b9
cmpl (%r14), %eax
je 0xbd27
movq 0x20(%r14), %rcx
movl %eax, %eax
shlq $0x4, %rax
cmpl $0xf, 0x8(%rcx,%rax)
je 0xbd27
andl $0x0, -0x10(%r12)
andl $0x1, -0x4(%r12)
movq 0x20(%r14), %rcx
movslq 0xc(%rcx,%rax), %rax
movl %eax, -0x14(%r12)
xorl %ecx, %ecx
cmpb $0x47, (%r15)
jne 0xbcbb
cmpb $0x54, 0x1(%r15)
jne 0xbcbb
xorl %ecx, %ecx
cmpb $0x0, 0x2(%r15)
sete %cl
movl %ecx, -0x4(%r12)
movq -0x60(%rbp), %rcx
movq 0x18(%rcx), %rcx
shlq $0x4, %rax
movq 0x8(%rcx,%rax), %rax
movl 0x8(%rax), %eax
movl %eax, (%r12)
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
callq 0xc303
movq %rax, %r15
addq $0x20, %r12
jmp 0xbc4f
leaq 0x15559(%rip), %rax     # 0x21250
cmpl $0x2, (%rax)
jl 0xbac2
movq 0x152f1(%rip), %rax     # 0x20ff8
movq (%rax), %rdi
leaq 0xd653(%rip), %rsi      # 0x19364
leaq 0xd680(%rip), %rdx      # 0x19398
movq %r15, %rcx
xorl %eax, %eax
callq 0x2250
jmp 0xbac2
movq %r15, -0x38(%rbp)
leaq 0x1551e(%rip), %rax     # 0x21250
cmpl $0x2, (%rax)
movq -0x40(%rbp), %r14
jge 0xc2d7
movq -0x30(%rbp), %rbx
movabsq $-0xff00000001, %rcx    # imm = 0xFFFFFF00FFFFFFFF
andq 0x10(%rbx), %rcx
jmp 0xbd5f
movq -0x30(%rbp), %rbx
movq 0x10(%rbx), %rcx
movq -0x40(%rbp), %r14
incq %r13
movabsq $0xffffffffff, %rax     # imm = 0xFFFFFFFFFF
andq %rax, %rcx
movq %rcx, 0x10(%rbx)
pushq $0x1
popq %rax
xorl %esi, %esi
movabsq $-0x10000000000, %rcx   # imm = 0xFFFFFF0000000000
movl %eax, %r8d
movl %eax, %r9d
movl %eax, %edi
movq %r13, %rdx
movzbl (%rdx), %r10d
testl %r10d, %r10d
je 0xbdc7
cmpl $0x7c, %r10d
je 0xbe3d
cmpl $0x2c, %r10d
je 0xbe71
cmpl $0x2f, %r10d
je 0xbe3d
cmpl $0x3a, %r10d
je 0xbdc7
cmpl $0x9, %r10d
jne 0xbe74
movb $0x0, (%rdx)
movslq %esi, %r11
shlq $0x5, %r11
movq -0x50(%rbp), %r14
leaq (%r14,%r11), %r10
cmpl %r9d, 0x4(%r14,%r11)
jge 0xbde1
movl %r9d, 0x4(%r10)
movl 0x10(%r10), %r9d
movl %r9d, %r11d
shrl $0x10, %r11d
decl %r8d
cmpl %r8d, %r11d
jge 0xbe03
shll $0x10, %r8d
movzwl %r9w, %r9d
orl %r8d, %r9d
movl %r9d, 0x10(%r10)
movq -0x40(%rbp), %r14
testb $0x1, %r9b
je 0xbe34
movl %r9d, %r8d
shrl %r8d
andl $0x7fff, %r8d           # imm = 0x7FFF
cmpl %edi, %r8d
jge 0xbe34
andl $0x7fff, %edi           # imm = 0x7FFF
andl $0xffff0001, %r9d       # imm = 0xFFFF0001
leal (%r9,%rdi,2), %edi
movl %edi, 0x10(%r10)
cmpb $0x0, (%rdx)
je 0xbe41
incl %esi
jmp 0xbe67
incl %edi
jmp 0xbe74
movq 0x10(%rbx), %rsi
movq %rsi, %rdi
andq %rcx, %rdi
movabsq $0xffffffffff, %r8      # imm = 0xFFFFFFFFFF
orq %r8, %rdi
andq %r8, %rsi
addq %rdi, %rsi
incq %rsi
movq %rsi, 0x10(%rbx)
xorl %esi, %esi
xorl %r8d, %r8d
movl %eax, %r9d
movl %eax, %edi
jmp 0xbe74
incl %r9d
cmpq %r14, %rdx
je 0xbe84
incq %rdx
incl %r8d
jmp 0xbd8d
movq -0x50(%rbp), %rax
leaq 0x14(%rax), %r15
movq %rbx, %r14
xorl %r12d, %r12d
movq -0x78(%rbp), %r8
movq 0x10(%r14), %rax
movq %rax, %rcx
shrq $0x20, %rcx
movzbl %cl, %edx
cmpq %rdx, %r12
jae 0xbf65
movl (%r15), %ecx
shrl $0x4, %ecx
andl $0xf, %ecx
leal -0x1(%rcx), %edx
cmpl $0x2, %edx
jae 0xbec7
movl -0x10(%r15), %ebx
shll $0x2, %ebx
jmp 0xbee8
cmpl $0x3, %ecx
jne 0xc2fe
movl -0x4(%r15), %ecx
leal (%rcx,%rcx), %edx
andl $0x1fffc, %edx          # imm = 0x1FFFC
movl %ecx, %ebx
shrl $0x10, %ebx
testb $0x1, %cl
cmovnel %edx, %ebx
movl %ebx, -0xc(%r15)
movq (%r8), %rcx
testb $0x7, %cl
je 0xbf28
andq $0x0, -0xb8(%rbp)
leal 0x7(%rcx), %esi
andl $-0x8, %esi
subl %ecx, %esi
leaq -0xb8(%rbp), %rdi
movq %r8, %rdx
callq 0xac22
movq -0x78(%rbp), %r8
movq (%r8), %rcx
movq -0x30(%rbp), %r14
movq 0x10(%r14), %rax
movl -0xc(%r15), %ebx
jmp 0xbf2c
movq -0x30(%rbp), %r14
movl %ecx, -0x8(%r15)
shrq $0x28, %rax
imull %ebx, %eax
movslq %eax, %rsi
addq %rcx, %rsi
movq %r8, %rdi
callq 0xc489
movq -0x78(%rbp), %r8
movq 0x10(%r14), %rax
shrq $0x28, %rax
imull %ebx, %eax
cltq
addq %rax, (%r8)
incq %r12
addq $0x20, %r15
jmp 0xbe96
movzbl %cl, %eax
shll $0x5, %eax
xorl %ecx, %ecx
movq -0x50(%rbp), %rbx
movq -0x40(%rbp), %r14
movq -0x60(%rbp), %rsi
cmpq %rcx, %rax
je 0xbf92
movslq 0xc(%rbx,%rcx), %rdx
addq 0x60(%rsi), %rdx
movq %rdx, 0x18(%rbx,%rcx)
addq $0x20, %rcx
jmp 0xbf79
xorl %eax, %eax
xorl %r8d, %r8d
movq %r13, -0x38(%rbp)
movq %rax, -0x58(%rbp)
movslq %eax, %r15
movq %r15, %rax
shlq $0x5, %rax
leaq (%rbx,%rax), %rdx
movl 0x14(%rbx,%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x1, %eax
movq %rdx, -0x68(%rbp)
movl %r8d, -0x48(%rbp)
je 0xc0a2
cmpl $0x2, %eax
je 0xc010
cmpl $0x3, %eax
jne 0xc2fe
movl 0x8(%rdx), %eax
imull %r8d, %eax
movslq %eax, %r12
addq 0x18(%rdx), %r12
testb $0x1, 0x10(%rdx)
jne 0xc23d
xorl %eax, %eax
movzbl (%r13,%rax), %ecx
testl %ecx, %ecx
je 0xc29a
cmpl $0x3a, %ecx
je 0xc29a
movb %cl, (%r12,%rax)
incq %rax
jmp 0xbff0
movl 0x8(%rdx), %eax
imull %r8d, %eax
movslq %eax, %r12
addq 0x18(%rdx), %r12
pushq $0x1
popq %rbx
cmpb $0x2e, (%r13)
jne 0xc050
callq 0x2470
movq (%rax), %rax
movsbq 0x1(%r13), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0xc050
incq %r13
movl 0x1533b(%rip), %eax     # 0x21380
movl %eax, -0x4(%r12,%rbx,4)
movq %r13, -0x38(%rbp)
jmp 0xc06b
movq %r13, %rdi
leaq -0x38(%rbp), %rsi
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x4(%r12,%rbx,4)
movq -0x38(%rbp), %r13
movzbl (%r13), %eax
cmpl $0x3a, %eax
movq -0x68(%rbp), %rcx
je 0xc096
testl %eax, %eax
je 0xc096
incq %r13
movq %r13, -0x38(%rbp)
incq %rbx
jmp 0xc021
movl 0x152f5(%rip), %eax     # 0x21384
movl %eax, (%r12,%rbx,4)
incq %rbx
movl 0x8(%rcx), %eax
sarl $0x2, %eax
cmpl %ebx, %eax
jg 0xc089
jmp 0xc115
movl 0x8(%rdx), %eax
imull %r8d, %eax
movslq %eax, %rbx
addq 0x18(%rdx), %rbx
pushq $0x1
popq %r12
cmpb $0x2e, (%r13)
jne 0xc0c9
incq %r13
movq %r13, -0x38(%rbp)
movl $0x80000000, %eax       # imm = 0x80000000
jmp 0xc0e0
movq %r13, %rdi
leaq -0x38(%rbp), %rsi
pushq $0xa
popq %rdx
callq 0x2270
movq -0x68(%rbp), %rdx
movq -0x38(%rbp), %r13
movl %eax, -0x4(%rbx,%r12,4)
movzbl (%r13), %eax
cmpl $0x3a, %eax
je 0xc10a
testl %eax, %eax
je 0xc10a
incq %r13
movq %r13, -0x38(%rbp)
incq %r12
jmp 0xc0b4
movl $0x80000001, (%rbx,%r12,4) # imm = 0x80000001
incq %r12
movl 0x8(%rdx), %eax
sarl $0x2, %eax
cmpl %r12d, %eax
jg 0xc0ff
movq -0x50(%rbp), %rbx
movzbl (%r13), %eax
cmpl $0x3a, %eax
movq -0x30(%rbp), %rdi
movl -0x48(%rbp), %r8d
je 0xc229
testl %eax, %eax
jne 0xc231
incq %r15
movq 0x10(%rdi), %rax
movq %rax, %rcx
shrq $0x20, %rcx
movzbl %cl, %ecx
cmpq %rcx, %r15
jge 0xc219
movq %r15, %rcx
shlq $0x5, %rcx
leaq (%rbx,%rcx), %rax
movl 0x14(%rbx,%rcx), %ecx
shrl $0x4, %ecx
andl $0xf, %ecx
cmpl $0x1, %ecx
je 0xc1cf
cmpl $0x2, %ecx
je 0xc1a0
cmpl $0x3, %ecx
jne 0xc137
movl 0x8(%rax), %edx
movl %edx, %ecx
imull %r8d, %ecx
movslq %ecx, %rcx
addq 0x18(%rax), %rcx
testb $0x1, 0x10(%rax)
jne 0xc1fc
xorl %esi, %esi
movl %edx, %edx
cmpq %rdx, %rsi
je 0xc137
movb $0x0, (%rcx,%rsi)
incq %rsi
movl 0x8(%rax), %edx
jmp 0xc18d
movl 0x8(%rax), %edx
movl %edx, %ecx
imull %r8d, %ecx
movslq %ecx, %rcx
addq 0x18(%rax), %rcx
xorl %esi, %esi
sarl $0x2, %edx
cmpq %rdx, %rsi
je 0xc137
movl 0x151c0(%rip), %edx     # 0x21384
movl %edx, (%rcx,%rsi,4)
incq %rsi
movl 0x8(%rax), %edx
jmp 0xc1b2
movl 0x8(%rax), %edx
movl %edx, %ecx
imull %r8d, %ecx
movslq %ecx, %rcx
addq 0x18(%rax), %rcx
xorl %esi, %esi
sarl $0x2, %edx
cmpq %rdx, %rsi
je 0xc137
movl $0x80000001, (%rcx,%rsi,4) # imm = 0x80000001
incq %rsi
movl 0x8(%rax), %edx
jmp 0xc1e1
xorl %esi, %esi
sarl $0x2, %edx
cmpq %rdx, %rsi
je 0xc137
movl $0x80000001, (%rcx,%rsi,4) # imm = 0x80000001
incq %rsi
movl 0x8(%rax), %edx
jmp 0xc1fe
cmpq %r14, %r13
je 0xbab0
incl %r8d
xorl %eax, %eax
jmp 0xc235
movq -0x58(%rbp), %rax
incl %eax
jmp 0xc235
movq -0x58(%rbp), %rax
incq %r13
jmp 0xbf97
xorl %r14d, %r14d
pushq $0x1
popq %rbx
cmpb $0x2e, (%r13)
jne 0xc253
incq %r13
movq %r13, -0x38(%rbp)
jmp 0xc272
movq %r13, %rdi
leaq -0x38(%rbp), %rsi
pushq $0xa
popq %rdx
callq 0x2270
movq -0x68(%rbp), %rdx
leal (%r14,%rax,2), %r14d
addl $0x2, %r14d
movq -0x38(%rbp), %r13
movl %r14d, -0x4(%r12,%rbx,4)
movzbl (%r13), %eax
cmpl $0x3a, %eax
je 0xc2b8
testl %eax, %eax
je 0xc2b8
xorl %r14d, %r14d
cmpb $0x7c, %al
sete %r14b
incq %r13
movq %r13, -0x38(%rbp)
incq %rbx
jmp 0xc243
addq %rax, %r13
movq %r13, -0x38(%rbp)
movslq 0x8(%rdx), %rcx
cmpq %rcx, %rax
jge 0xc119
movb $0x0, (%r12,%rax)
incq %rax
jmp 0xc2a1
movq -0x40(%rbp), %r14
movl 0x8(%rdx), %eax
sarl $0x2, %eax
cmpl %ebx, %eax
jle 0xc115
movl $0x80000001, (%r12,%rbx,4) # imm = 0x80000001
incq %rbx
jmp 0xc2bc
movq 0x14d1a(%rip), %rax     # 0x20ff8
movq (%rax), %rdi
leaq 0xd0fd(%rip), %rsi      # 0x193e5
leaq 0xd0a9(%rip), %rdx      # 0x19398
movq %r15, %rcx
xorl %eax, %eax
callq 0x2250
jmp 0xbd3f
callq 0x2070