// File: /workspace/github_c_makefile_star2_O0/ksherlock[P]nroff_man/tbl.c
// Function: tbl
void tbl(void) {


	int cols = 0;
	unsigned st = 0;
	unsigned e_flag = 0;
	unsigned e_width = 0;
	unsigned z_flag = 0;

	memset(column_width, 0, sizeof(column_width));
	memset(column_align, 0, sizeof(column_align));
	memset(column_n_left, 0, sizeof(column_n_left));
	memset(column_n_right, 0, sizeof(column_n_right));

	lines = NULL;
	lines_capacity = 0;
	lines_length = 0;


	lines = malloc(sizeof(char *) * 64);
	if (!lines) man_err(1,"malloc");
	lines_capacity = 64;

	for(;;) {
		const unsigned char *cp = read_text();
		if (type == tkEOF) {
			man_warnx("TS without TE");
			break;
		}

		if (type == tkTE) break;
		if (type == tkPP) continue;
		if (type == tkPD) continue;
		if (type != tkTEXT) {
			man_warnx1s("unsupported %s within tbl", token_names[type]);
			break;
		}

		// text!
		unsigned x = strlen(cp);
		if (!x) continue;

		if (st == 0) {
			// (optional) option string (;-terminated)
			++st;
			if (cp[x-1] == ';') continue;
		}

		if (st == 1) {

			// 1+ format strings, final one is '.' terminated.
			// currently, only one line is (partially) supported

			// format string...
			cols = -1;
			unsigned w_flag = 0;

			for (unsigned i = 0; ;++i) {
				unsigned c = cp[i];
				if (c == 0) break;
				c = tolower(c);

				if (c == ',') {
					// multiple formats on one line.
					cols = -1;
					continue;
				}

				if (c == '.') {
					++st;
					++cols;
					if (cols < 1) {
						cols = 1;
						column_align[0] = align_left;
					}
					if (cols >= MAX_COLS) cols = MAX_COLS - 1;
					break;
				}
				if (c == 'l' || c == 'r' || c == 'c' || c == 'n' || c == 'a') {
					++cols;
				}
				if (cols < 0 || cols >= MAX_COLS) continue;

				switch(c) {
				case 'l':
				case 'a': // alphabetic subcolumn
					column_align[cols] = align_left;
					break;
				case 'r':
					column_align[cols] = align_right;
					break;
				case 'n':
					column_align[cols] = align_number;
					break;
				case 'c': 
					column_align[cols] = align_center;
					break;

				case 'e':
					e_flag |= (1 << cols);
					break;
				case 'z':
					z_flag |= (1 << cols);
					break;


				case 'w':
					// followed by unit-less integer -or- (width expression)
					c = cp[++i];
					x = 0;
					if (c == '(') {
						++i;
						x = get_unit(cp + i, 0, 0);
						for(;;) {
							c = cp[++i];
							if (c == ')' || c == 0) break;
						}
					}
					if (isdigit(c)) {
						x = c - '0';
						while (isdigit(c = cp[++i])) {
							x *= 10;
							x += c - '0';
						}
					}
					column_width[cols] = x;
					if (x) w_flag |= (1 << cols);
					--i;
					break;
				}
				// silently ignore everything else....
			}

			// e/z/w interaction...
			// z_flag w/o w_flag is an error...
			if ((z_flag & w_flag) != z_flag) {
				z_flag &= w_flag;
			}
			if (w_flag & e_flag) {
				w_flag &= e_flag;
				for (unsigned i = 0, mask = 1; i < cols; ++i, mask <<= 1) {
					if (w_flag & mask) {
						x = column_width[i];
						if (i > e_width) e_width = x;
					}
				}
			}

			continue;
		}


		if (lines_length == lines_capacity) {
			lines_capacity <<= 1;
			char **tmp = realloc(lines, lines_capacity * sizeof(char *));
			if (!tmp) man_err(1, "realloc");
			lines = tmp;
		}

		// a line of data...
		// count the columns...
		unsigned nc = 1;
		unsigned l = 0;
		for (l = 0; ; ++l) {
			unsigned c = cp[l];
			if (!c) break;
			if (c == '\t') ++nc;
		}

		if (!l) {
			lines[lines_length++] = SPECIAL_BLANK;
			continue;
		}

		// todo: '-', '=' just draw a line.
		if (l == 1) {
			if (cp[0] == '_' || cp[0] == '=') {
				lines[lines_length++] = SPECIAL_DASH;
				continue;
			}
		}

		if (nc > cols) nc = cols;

		// each chunk has 1 byte length, 1 byte length w/o formatting.
		char *line = malloc(l + cols * 2 + 2);
		if (!line) man_err(1, "malloc");
		memset(line, 0, l + cols * 2 + 2);
		lines[lines_length++] = line;

		for (unsigned i = 0, j = 0, col = 0, mask = 1; col < nc; ++col, mask <<= 1) {

			unsigned st = i;
			unsigned c;

			for (;;) { c = cp[i++]; if (c == '\t' || c == 0) break; }
			unsigned end = i - 1;

			line[j++] = end - st; // total length

			unsigned x = 0;

			if (column_align[col] == align_number) {
				int left;
				x = num_width(cp + st, end - st, &left);

				if (left > 0) {
					int right = x - left;
					if (left > column_n_left[col]) column_n_left[col] = left;
					if (right > column_n_right[col]) column_n_right[col] = right;
				}
			} else {
				x = xstrnlen(cp + st, end - st);
			}

			if (!(z_flag & mask)) {
				if (x > column_width[col]) column_width[col] = x;
			}

			if (e_flag & mask) {
				if (x > e_width) e_width = x;
			}

			line[j++] = x;
			while (st < end) line[j++] = cp[st++];
		}

		// todo -- only first N lines to calc width?

	}

	// re-calc n columns:
	for (unsigned col = 0, mask = 1; col < cols; ++col, mask <<= 1) {
		if (z_flag & mask) continue;
		if (column_align[col] == align_number) {
			unsigned x = column_n_left[col] + column_n_right[col];
			unsigned w = column_width[col];
			if (x > w)
				column_width[col] = x;
			else if (x < w) {
				// adjust left so content will be centered.
				unsigned sp = (w - x) >> 1;
				column_n_left[col] += sp;
				x = w;
			}

			if ((e_flag & mask) && x > e_width)
				e_width = x;

		}
	}

	// resize e columns?
	if (e_flag) {
		for (unsigned col = 0, mask = 1; col < cols; ++col, mask <<= 1) {
			if (e_flag & mask) column_width[col] = e_width;
		}
	}


	// calculate the total width (for _)
	unsigned twidth = -3; // account for extra padding
	for (unsigned i = 0, mask = 1; i < cols; ++i, mask <<= 1) {

		if (e_flag & mask) {
			column_width[i] = e_width;
			twidth += e_width;
		} else {
			twidth += column_width[i];
		}
		twidth += 3;
	}

	// now print the buffered table...

	for (unsigned i = 0; i < lines_length; ++i) {
		unsigned char *line = lines[i];


		if (line == SPECIAL_BLANK) {
			fputc('\n', stdout);
			continue;
		}
		if (line == SPECIAL_DASH) {
			for (unsigned j = 0; j < in; ++j) fputc(' ', stdout);
			for (unsigned j = 0; j < twidth; ++j)
				fputc('_', stdout);
			fputc('\n', stdout);
			continue;
		}

		unsigned padding = 0;
		unsigned k = 0;
		for (unsigned col = 0, offset = 0; col < cols; ++col) {
			unsigned w = column_width[col];
			unsigned align = column_align[col];

			unsigned ll = line[offset++]; // width w/ formatting
			unsigned l = line[offset++]; // printable width

			unsigned sp = w > l ? w - l : 0;


			switch(align) {
			default:
			case align_left:
				break;
			case align_right:
				padding += sp;
				sp = 0;
				break;
			case align_center:
				padding += sp >> 1;
				sp = (sp+1) >> 1;
				break;
			case align_number: {
					int left;
					int x;
					num_width(line + offset, l, &left);
					if (left < 0) {
						// just center it..
						padding += sp >> 1;
						sp = (sp+1) >> 1;
					} else {
						x = column_n_left[col] - left;
						if (x > 0) padding += x;
						sp = sp - x;
					}
				}
				break;

			}

			for (unsigned i = 0; i < padding; ++i) {
				buffer[k++] = ' ';
			}

			for(unsigned i = 0; i < ll; ++i) {
				buffer[k++] = line[offset++];
			}

			padding = sp + 3; // 3 spaces of padding between columns + alignment.
		}


		buffer[k++] = '\n';
		buffer[k++] = 0;
		print(buffer, 0);

		free(line);
	}

	
	free(lines);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movl $0x0, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
leaq 0x8ccb(%rip), %rdi      # 0x12b20
xorl %esi, %esi
movl $0x20, %edx
callq 0x40d0
leaq 0x8cd8(%rip), %rdi      # 0x12b40
xorl %esi, %esi
movl $0x20, %edx
callq 0x40d0
leaq 0x8ce5(%rip), %rdi      # 0x12b60
xorl %esi, %esi
movl $0x20, %edx
callq 0x40d0
leaq 0x8cf2(%rip), %rdi      # 0x12b80
xorl %esi, %esi
movl $0x20, %edx
callq 0x40d0
movq $0x0, 0x8cfb(%rip) # 0x12ba0
movl $0x0, 0x8cf9(%rip)      # 0x12ba8
movl $0x0, 0x8cf3(%rip)      # 0x12bac
movl $0x200, %edi            # imm = 0x200
callq 0x4140
movq %rax, 0x8cd6(%rip)      # 0x12ba0
cmpq $0x0, 0x8cce(%rip)      # 0x12ba0
jne 0x9eec
callq 0x4060
movl (%rax), %esi
movl $0x1, %edi
leaq 0x25b9(%rip), %rdx      # 0xc4a0
callq 0x49a0
movl $0x40, 0x8cb2(%rip)     # 0x12ba8
callq 0x6a70
movq %rax, -0x20(%rbp)
leaq 0x440a(%rip), %rax      # 0xe310
cmpl $0x0, (%rax)
jne 0x9f1e
xorl %edi, %edi
leaq 0x2593(%rip), %rsi      # 0xc4a7
callq 0x49d0
jmp 0xa65f
leaq 0x43eb(%rip), %rax      # 0xe310
cmpl $0x29, (%rax)
jne 0x9f2f
jmp 0xa65f
leaq 0x43da(%rip), %rax      # 0xe310
cmpl $0x16, (%rax)
jne 0x9f3d
jmp 0x9ef6
leaq 0x43cc(%rip), %rax      # 0xe310
cmpl $0x15, (%rax)
jne 0x9f4b
jmp 0x9ef6
leaq 0x43be(%rip), %rax      # 0xe310
cmpl $0x1, (%rax)
je 0x9f7f
leaq 0x43b2(%rip), %rax      # 0xe310
movslq (%rax), %rcx
leaq 0x4198(%rip), %rax      # 0xe100
movq (%rax,%rcx,8), %rdx
xorl %edi, %edi
leaq 0x2540(%rip), %rsi      # 0xc4b5
callq 0x4ad0
jmp 0xa65f
movq -0x20(%rbp), %rdi
callq 0x40a0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x9f96
jmp 0x9ef6
cmpl $0x0, -0x8(%rbp)
jne 0x9fc1
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x3b, %eax
jne 0x9fbf
jmp 0x9ef6
jmp 0x9fc1
cmpl $0x1, -0x8(%rbp)
jne 0xa2de
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0x9ff9
jmp 0xa257
movl -0x30(%rbp), %edi
callq 0x4120
movl %eax, -0x30(%rbp)
cmpl $0x2c, -0x30(%rbp)
jne 0xa016
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa249
cmpl $0x2e, -0x30(%rbp)
jne 0xa057
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
cmpl $0x1, -0x4(%rbp)
jge 0xa045
movl $0x1, -0x4(%rbp)
movl $0x0, 0x8afb(%rip)      # 0x12b40
cmpl $0x8, -0x4(%rbp)
jl 0xa052
movl $0x7, -0x4(%rbp)
jmp 0xa257
cmpl $0x6c, -0x30(%rbp)
je 0xa075
cmpl $0x72, -0x30(%rbp)
je 0xa075
cmpl $0x63, -0x30(%rbp)
je 0xa075
cmpl $0x6e, -0x30(%rbp)
je 0xa075
cmpl $0x61, -0x30(%rbp)
jne 0xa07e
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0xa08a
cmpl $0x8, -0x4(%rbp)
jl 0xa08f
jmp 0xa249
movl -0x30(%rbp), %eax
addl $-0x61, %eax
movl %eax, %ecx
movq %rcx, -0x100(%rbp)
subl $0x19, %eax
ja 0xa247
movq -0x100(%rbp), %rax
leaq 0x2373(%rip), %rcx      # 0xc428
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq -0x4(%rbp), %rcx
leaq 0x8a77(%rip), %rax      # 0x12b40
movl $0x0, (%rax,%rcx,4)
jmp 0xa247
movslq -0x4(%rbp), %rcx
leaq 0x8a60(%rip), %rax      # 0x12b40
movl $0x1, (%rax,%rcx,4)
jmp 0xa247
movslq -0x4(%rbp), %rcx
leaq 0x8a49(%rip), %rax      # 0x12b40
movl $0x3, (%rax,%rcx,4)
jmp 0xa247
movslq -0x4(%rbp), %rcx
leaq 0x8a32(%rip), %rax      # 0x12b40
movl $0x2, (%rax,%rcx,4)
jmp 0xa247
movl -0x4(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
orl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0xa247
movl -0x4(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0xa247
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x2c(%rbp)
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x28, -0x30(%rbp)
jne 0xa1ae
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rdi
movl -0x2c(%rbp), %eax
addq %rax, %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x7610
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x2c(%rbp)
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
cmpl $0x29, -0x30(%rbp)
je 0xa1a8
cmpl $0x0, -0x30(%rbp)
jne 0xa1aa
jmp 0xa1ac
jmp 0xa186
jmp 0xa1ae
callq 0x41d0
movq (%rax), %rax
movslq -0x30(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xa217
movl -0x30(%rbp), %eax
subl $0x30, %eax
movl %eax, -0x24(%rbp)
callq 0x41d0
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movl -0x2c(%rbp), %edx
addl $0x1, %edx
movl %edx, -0x2c(%rbp)
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
movl %ecx, -0x30(%rbp)
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xa215
imull $0xa, -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x30(%rbp), %eax
subl $0x30, %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0xa1d1
jmp 0xa217
movl -0x24(%rbp), %edx
movslq -0x4(%rbp), %rcx
leaq 0x88fb(%rip), %rax      # 0x12b20
movl %edx, (%rax,%rcx,4)
cmpl $0x0, -0x24(%rbp)
je 0xa23e
movl -0x4(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xa249
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x9fe0
movl -0x14(%rbp), %eax
andl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0xa26b
movl -0x28(%rbp), %eax
andl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x28(%rbp), %eax
andl -0xc(%rbp), %eax
cmpl $0x0, %eax
je 0xa2d9
movl -0xc(%rbp), %eax
andl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x1, -0x38(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x4(%rbp), %eax
jae 0xa2d7
movl -0x28(%rbp), %eax
andl -0x38(%rbp), %eax
cmpl $0x0, %eax
je 0xa2c2
movl -0x34(%rbp), %eax
movl %eax, %ecx
leaq 0x8874(%rip), %rax      # 0x12b20
movl (%rax,%rcx,4), %eax
movl %eax, -0x24(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x10(%rbp), %eax
jbe 0xa2c0
movl -0x24(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0xa2c2
jmp 0xa2c4
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %eax
shll %eax
movl %eax, -0x38(%rbp)
jmp 0xa28d
jmp 0xa2d9
jmp 0x9ef6
movl 0x88c8(%rip), %eax      # 0x12bac
cmpl 0x88be(%rip), %eax      # 0x12ba8
jne 0xa340
movl 0x88b6(%rip), %eax      # 0x12ba8
shll %eax
movl %eax, 0x88ae(%rip)      # 0x12ba8
movq 0x889f(%rip), %rdi      # 0x12ba0
movl 0x88a1(%rip), %eax      # 0x12ba8
movl %eax, %esi
shlq $0x3, %rsi
callq 0x4160
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0xa335
callq 0x4060
movl (%rax), %esi
movl $0x1, %edi
leaq 0x219f(%rip), %rdx      # 0xc4cf
callq 0x49a0
movq -0x40(%rbp), %rax
movq %rax, 0x8860(%rip)      # 0x12ba0
movl $0x1, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x20(%rbp), %rax
movl -0x48(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
jne 0xa36b
jmp 0xa387
cmpl $0x9, -0x4c(%rbp)
jne 0xa37a
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xa37c
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xa355
cmpl $0x0, -0x48(%rbp)
jne 0xa3b5
movq 0x880c(%rip), %rax      # 0x12ba0
movl 0x8812(%rip), %ecx      # 0x12bac
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x8807(%rip)      # 0x12bac
movl %ecx, %ecx
movl $0x2, %edx
movq %rdx, (%rax,%rcx,8)
jmp 0x9ef6
cmpl $0x1, -0x48(%rbp)
jne 0xa3fd
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x5f, %eax
je 0xa3d3
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x3d, %eax
jne 0xa3fb
movq 0x87c6(%rip), %rax      # 0x12ba0
movl 0x87cc(%rip), %ecx      # 0x12bac
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x87c1(%rip)      # 0x12bac
movl %ecx, %ecx
movl $0x1, %edx
movq %rdx, (%rax,%rcx,8)
jmp 0x9ef6
jmp 0xa3fd
movl -0x44(%rbp), %eax
cmpl -0x4(%rbp), %eax
jbe 0xa40b
movl -0x4(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x48(%rbp), %eax
movl -0x4(%rbp), %ecx
shll %ecx
addl %ecx, %eax
addl $0x2, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x4140
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0xa444
callq 0x4060
movl (%rax), %esi
movl $0x1, %edi
leaq 0x2061(%rip), %rdx      # 0xc4a0
callq 0x49a0
movq -0x58(%rbp), %rdi
movl -0x48(%rbp), %eax
movl -0x4(%rbp), %ecx
shll %ecx
addl %ecx, %eax
addl $0x2, %eax
movl %eax, %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x40d0
movq -0x58(%rbp), %rdx
movq 0x8735(%rip), %rax      # 0x12ba0
movl 0x873b(%rip), %ecx      # 0x12bac
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x8730(%rip)      # 0x12bac
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
movl $0x1, -0x68(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x44(%rbp), %eax
jae 0xa65a
movl -0x5c(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq -0x20(%rbp), %rax
movl -0x5c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x5c(%rbp)
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x70(%rbp)
cmpl $0x9, -0x70(%rbp)
je 0xa4d4
cmpl $0x0, -0x70(%rbp)
jne 0xa4d6
jmp 0xa4d8
jmp 0xa4b0
movl -0x5c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
subl -0x6c(%rbp), %eax
movb %al, %dl
movq -0x58(%rbp), %rax
movl -0x60(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x60(%rbp)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl $0x0, -0x78(%rbp)
movl -0x64(%rbp), %eax
movl %eax, %ecx
leaq 0x8630(%rip), %rax      # 0x12b40
cmpl $0x3, (%rax,%rcx,4)
jne 0xa591
movq -0x20(%rbp), %rdi
movl -0x6c(%rbp), %eax
addq %rax, %rdi
movl -0x74(%rbp), %esi
subl -0x6c(%rbp), %esi
leaq -0x7c(%rbp), %rdx
callq 0x9cf0
movl %eax, -0x78(%rbp)
cmpl $0x0, -0x7c(%rbp)
jle 0xa58f
movl -0x78(%rbp), %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x7c(%rbp), %eax
movl -0x64(%rbp), %ecx
movl %ecx, %edx
leaq 0x8610(%rip), %rcx      # 0x12b60
cmpl (%rcx,%rdx,4), %eax
jle 0xa567
movl -0x7c(%rbp), %edx
movl -0x64(%rbp), %eax
movl %eax, %ecx
leaq 0x85fc(%rip), %rax      # 0x12b60
movl %edx, (%rax,%rcx,4)
movl -0x80(%rbp), %eax
movl -0x64(%rbp), %ecx
movl %ecx, %edx
leaq 0x860a(%rip), %rcx      # 0x12b80
cmpl (%rcx,%rdx,4), %eax
jle 0xa58d
movl -0x80(%rbp), %edx
movl -0x64(%rbp), %eax
movl %eax, %ecx
leaq 0x85f6(%rip), %rax      # 0x12b80
movl %edx, (%rax,%rcx,4)
jmp 0xa58f
jmp 0xa5a9
movq -0x20(%rbp), %rdi
movl -0x6c(%rbp), %eax
addq %rax, %rdi
movl -0x74(%rbp), %esi
subl -0x6c(%rbp), %esi
callq 0x91a0
movl %eax, -0x78(%rbp)
movl -0x14(%rbp), %eax
andl -0x68(%rbp), %eax
cmpl $0x0, %eax
jne 0xa5dc
movl -0x78(%rbp), %eax
movl -0x64(%rbp), %ecx
movl %ecx, %edx
leaq 0x855d(%rip), %rcx      # 0x12b20
cmpl (%rcx,%rdx,4), %eax
jbe 0xa5da
movl -0x78(%rbp), %edx
movl -0x64(%rbp), %eax
movl %eax, %ecx
leaq 0x8549(%rip), %rax      # 0x12b20
movl %edx, (%rax,%rcx,4)
jmp 0xa5dc
movl -0xc(%rbp), %eax
andl -0x68(%rbp), %eax
cmpl $0x0, %eax
je 0xa5f7
movl -0x78(%rbp), %eax
cmpl -0x10(%rbp), %eax
jbe 0xa5f5
movl -0x78(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0xa5f7
movl -0x78(%rbp), %eax
movb %al, %dl
movq -0x58(%rbp), %rax
movl -0x60(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x60(%rbp)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x6c(%rbp), %eax
cmpl -0x74(%rbp), %eax
jae 0xa642
movq -0x20(%rbp), %rax
movl -0x6c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x6c(%rbp)
movl %ecx, %ecx
movb (%rax,%rcx), %dl
movq -0x58(%rbp), %rax
movl -0x60(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x60(%rbp)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
jmp 0xa610
jmp 0xa644
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movl -0x68(%rbp), %eax
shll %eax
movl %eax, -0x68(%rbp)
jmp 0xa49e
jmp 0x9ef6
movl $0x0, -0x84(%rbp)
movl $0x1, -0x88(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x4(%rbp), %eax
jae 0xa7b2
movl -0x14(%rbp), %eax
andl -0x88(%rbp), %eax
cmpl $0x0, %eax
je 0xa695
jmp 0xa790
movl -0x84(%rbp), %eax
movl %eax, %ecx
leaq 0x849c(%rip), %rax      # 0x12b40
cmpl $0x3, (%rax,%rcx,4)
jne 0xa78e
movl -0x84(%rbp), %eax
movl %eax, %ecx
leaq 0x84a3(%rip), %rax      # 0x12b60
movl (%rax,%rcx,4), %eax
movl -0x84(%rbp), %ecx
movl %ecx, %edx
leaq 0x84b1(%rip), %rcx      # 0x12b80
addl (%rcx,%rdx,4), %eax
movl %eax, -0x8c(%rbp)
movl -0x84(%rbp), %eax
movl %eax, %ecx
leaq 0x8439(%rip), %rax      # 0x12b20
movl (%rax,%rcx,4), %eax
movl %eax, -0x90(%rbp)
movl -0x8c(%rbp), %eax
cmpl -0x90(%rbp), %eax
jbe 0xa718
movl -0x8c(%rbp), %edx
movl -0x84(%rbp), %eax
movl %eax, %ecx
leaq 0x840d(%rip), %rax      # 0x12b20
movl %edx, (%rax,%rcx,4)
jmp 0xa76a
movl -0x8c(%rbp), %eax
cmpl -0x90(%rbp), %eax
jae 0xa768
movl -0x90(%rbp), %eax
subl -0x8c(%rbp), %eax
shrl %eax
movl %eax, -0x94(%rbp)
movl -0x94(%rbp), %edx
movl -0x84(%rbp), %eax
movl %eax, %ecx
leaq 0x8411(%rip), %rax      # 0x12b60
addl (%rax,%rcx,4), %edx
leaq 0x8407(%rip), %rax      # 0x12b60
movl %edx, (%rax,%rcx,4)
movl -0x90(%rbp), %eax
movl %eax, -0x8c(%rbp)
jmp 0xa76a
movl -0xc(%rbp), %eax
andl -0x88(%rbp), %eax
cmpl $0x0, %eax
je 0xa78c
movl -0x8c(%rbp), %eax
cmpl -0x10(%rbp), %eax
jbe 0xa78c
movl -0x8c(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0xa78e
jmp 0xa790
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
movl -0x88(%rbp), %eax
shll %eax
movl %eax, -0x88(%rbp)
jmp 0xa673
cmpl $0x0, -0xc(%rbp)
je 0xa81d
movl $0x0, -0x98(%rbp)
movl $0x1, -0x9c(%rbp)
movl -0x98(%rbp), %eax
cmpl -0x4(%rbp), %eax
jae 0xa81b
movl -0xc(%rbp), %eax
andl -0x9c(%rbp), %eax
cmpl $0x0, %eax
je 0xa7fa
movl -0x10(%rbp), %edx
movl -0x98(%rbp), %eax
movl %eax, %ecx
leaq 0x8329(%rip), %rax      # 0x12b20
movl %edx, (%rax,%rcx,4)
jmp 0xa7fc
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
movl -0x9c(%rbp), %eax
shll %eax
movl %eax, -0x9c(%rbp)
jmp 0xa7cc
jmp 0xa81d
movl $0xfffffffd, -0xa0(%rbp) # imm = 0xFFFFFFFD
movl $0x0, -0xa4(%rbp)
movl $0x1, -0xa8(%rbp)
movl -0xa4(%rbp), %eax
cmpl -0x4(%rbp), %eax
jae 0xa8cd
movl -0xc(%rbp), %eax
andl -0xa8(%rbp), %eax
cmpl $0x0, %eax
je 0xa87e
movl -0x10(%rbp), %edx
movl -0xa4(%rbp), %eax
movl %eax, %ecx
leaq 0x82b6(%rip), %rax      # 0x12b20
movl %edx, (%rax,%rcx,4)
movl -0x10(%rbp), %eax
addl -0xa0(%rbp), %eax
movl %eax, -0xa0(%rbp)
jmp 0xa89c
movl -0xa4(%rbp), %eax
movl %eax, %ecx
leaq 0x8293(%rip), %rax      # 0x12b20
movl (%rax,%rcx,4), %eax
addl -0xa0(%rbp), %eax
movl %eax, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
addl $0x3, %eax
movl %eax, -0xa0(%rbp)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movl -0xa8(%rbp), %eax
shll %eax
movl %eax, -0xa8(%rbp)
jmp 0xa83b
movl $0x0, -0xac(%rbp)
movl -0xac(%rbp), %eax
cmpl 0x82c9(%rip), %eax      # 0x12bac
jae 0xad11
movq 0x82b0(%rip), %rax      # 0x12ba0
movl -0xac(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0xb8(%rbp)
movl $0x2, %eax
cmpq %rax, -0xb8(%rbp)
jne 0xa928
movq 0x36aa(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x40e0
jmp 0xacfd
movl $0x1, %eax
cmpq %rax, -0xb8(%rbp)
jne 0xa9d0
movl $0x0, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
leaq 0x597b(%rip), %rcx      # 0x102cc
cmpl (%rcx), %eax
jae 0xa97a
movq 0x3664(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
movl $0x20, %edi
callq 0x40e0
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
jmp 0xa944
movl $0x0, -0xc0(%rbp)
movl -0xc0(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jae 0xa9b7
movq 0x3627(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
movl $0x5f, %edi
callq 0x40e0
movl -0xc0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc0(%rbp)
jmp 0xa984
movq 0x3602(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x40e0
jmp 0xacfd
movl $0x0, -0xc4(%rbp)
movl $0x0, -0xc8(%rbp)
movl $0x0, -0xcc(%rbp)
movl $0x0, -0xd0(%rbp)
movl -0xcc(%rbp), %eax
cmpl -0x4(%rbp), %eax
jae 0xaca3
movl -0xcc(%rbp), %eax
movl %eax, %ecx
leaq 0x810a(%rip), %rax      # 0x12b20
movl (%rax,%rcx,4), %eax
movl %eax, -0xd4(%rbp)
movl -0xcc(%rbp), %eax
movl %eax, %ecx
leaq 0x8112(%rip), %rax      # 0x12b40
movl (%rax,%rcx,4), %eax
movl %eax, -0xd8(%rbp)
movq -0xb8(%rbp), %rax
movl -0xd0(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xd0(%rbp)
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0xdc(%rbp)
movq -0xb8(%rbp), %rax
movl -0xd0(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xd0(%rbp)
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0xe0(%rbp)
movl -0xd4(%rbp), %eax
cmpl -0xe0(%rbp), %eax
jbe 0xaaa1
movl -0xd4(%rbp), %eax
subl -0xe0(%rbp), %eax
movl %eax, -0x104(%rbp)
jmp 0xaaab
xorl %eax, %eax
movl %eax, -0x104(%rbp)
jmp 0xaaab
movl -0x104(%rbp), %eax
movl %eax, -0xe4(%rbp)
movl -0xd8(%rbp), %eax
movq %rax, -0x110(%rbp)
subq $0x3, %rax
ja 0xaae1
movq -0x110(%rbp), %rax
leaq 0x19b8(%rip), %rcx      # 0xc490
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0xaae3
jmp 0xabd2
movl -0xe4(%rbp), %eax
addl -0xc4(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl $0x0, -0xe4(%rbp)
jmp 0xabd2
movl -0xe4(%rbp), %eax
shrl %eax
addl -0xc4(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl -0xe4(%rbp), %eax
addl $0x1, %eax
shrl %eax
movl %eax, -0xe4(%rbp)
jmp 0xabd2
movq -0xb8(%rbp), %rdi
movl -0xd0(%rbp), %eax
addq %rax, %rdi
movl -0xe0(%rbp), %esi
leaq -0xe8(%rbp), %rdx
callq 0x9cf0
cmpl $0x0, -0xe8(%rbp)
jge 0xab85
movl -0xe4(%rbp), %eax
shrl %eax
addl -0xc4(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl -0xe4(%rbp), %eax
addl $0x1, %eax
shrl %eax
movl %eax, -0xe4(%rbp)
jmp 0xabd0
movl -0xcc(%rbp), %eax
movl %eax, %ecx
leaq 0x7fcc(%rip), %rax      # 0x12b60
movl (%rax,%rcx,4), %eax
subl -0xe8(%rbp), %eax
movl %eax, -0xec(%rbp)
cmpl $0x0, -0xec(%rbp)
jle 0xabbe
movl -0xec(%rbp), %eax
addl -0xc4(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl -0xe4(%rbp), %eax
subl -0xec(%rbp), %eax
movl %eax, -0xe4(%rbp)
jmp 0xabd2
movl $0x0, -0xf0(%rbp)
movl -0xf0(%rbp), %eax
cmpl -0xc4(%rbp), %eax
jae 0xac1b
movl -0xc8(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc8(%rbp)
movl %eax, %eax
movl %eax, %ecx
leaq 0x7faa(%rip), %rax      # 0x12bb0
movb $0x20, (%rax,%rcx)
movl -0xf0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf0(%rbp)
jmp 0xabdc
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
cmpl -0xdc(%rbp), %eax
jae 0xac80
movq -0xb8(%rbp), %rax
movl -0xd0(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xd0(%rbp)
movl %ecx, %ecx
movb (%rax,%rcx), %dl
movl -0xc8(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc8(%rbp)
movl %eax, %eax
movl %eax, %ecx
leaq 0x7f44(%rip), %rax      # 0x12bb0
movb %dl, (%rax,%rcx)
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0xac25
movl -0xe4(%rbp), %eax
addl $0x3, %eax
movl %eax, -0xc4(%rbp)
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
jmp 0xa9f8
movl -0xc8(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc8(%rbp)
movl %eax, %eax
movl %eax, %ecx
leaq 0x7ef1(%rip), %rax      # 0x12bb0
movb $0xa, (%rax,%rcx)
movl -0xc8(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc8(%rbp)
movl %eax, %eax
movl %eax, %ecx
leaq 0x7ed1(%rip), %rax      # 0x12bb0
movb $0x0, (%rax,%rcx)
leaq 0x7ec6(%rip), %rdi      # 0x12bb0
xorl %esi, %esi
callq 0x8de0
movq -0xb8(%rbp), %rdi
callq 0x4040
movl -0xac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xac(%rbp)
jmp 0xa8d7
movq 0x7e88(%rip), %rdi      # 0x12ba0
callq 0x4040
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq