// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/bin2tap/bin2tap.c
// Function: main
int main (int argc, char *argv[]) {

	int	inputlen;		/* inputlen - input file lenght*/

	FILE	*foutput, *finput;	/* foutput - output file descriptor */
					/* finput - input file description */
	int	foutname_i = 0;		/* foutname_i - index to name in argv field */
	char	foutname[255];		/* foutname - output file name */
	int	finname_i = 0;		/* finname_i - index to name in argv field */

	int	checksum;		/* checksum - TAP checksum */
	int	i, in_name, no;		/* general purpose variables */

	int	address = ADDRESS;	/* address - start address of binary file */
	int	basic = 0;		/* basic - indicator of BASIC loader */
	int	clear = CLEAR;		/* clear - CLEAR value for BASIC loader */
	int	run = RUN;		/* run - address where to start binary file */
	int	cb = 0, cp = 0, ci = 7;	/* cb, cp, ci - colors for border, paper and ink*/
	int	d80 = 0;		/* d80 - indicate D80 loader */
	int	hp = 0;			/* hp - add poke for header dissable */
	char	run_name[] = "run       "; /* run_name - alternative name of basic loader */

	char	loader_template[] = "\0\x0A\x16\0\xEAloader by bin2tap1.2\x0D\
\0\x14\x12\0\xE7\xB0\"\":\xDA\xB0\"\":\xD9\xB0\"\"\x0D\
\0\x1E\x0A\0\xFD\xB0\"\"\x0D\
\0\x28\x0F\0\xF4\xB0\"23739\",\xAF\"o\"\x0D\
\0\x32\x05\0\xEF\"\xAF\x0D\
\0\x3C\x0B\0\xF9\xC0\xB0\"\"\x0D";	/* loader - fiel for BASIC loader */

	char tap[49152+115], *loader;
	int tap_index = 0;

	loader = loader_template;
	for (i = 1; i<argc; i++) {
		if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
			usage();
			return 0;
		}
		if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) {
			version();
			return 0;
		}
		if (!strcmp(argv[i], "-o")) {
			foutname_i = ++i;
			continue;
		}
		if (!strcmp(argv[i], "-a")) {
			if (str2int(argv[++i], &address)) {
				fprintf(stderr, "After -a must follow decadic address !\n");
				return 1;
			}
			if (address > 65535) {
				fprintf(stderr, "Maximum number after -a is 65535!\n");
				return 1;
			}
			continue;
		}
		if (!strcmp(argv[i], "-b")) {
			basic = 1;
			continue;
		}
		if (!strcmp(argv[i], "-c")) {
			if (str2int(argv[++i], &clear)) {
				fprintf(stderr, "After -c must follow decadic address !\n");
				return 1;
			}
			if (clear > 65535) {
				fprintf(stderr, "Maximum number after -c is 65535!\n");
				return 1;
			}
			continue;
		}
		if (!strcmp(argv[i], "-r")) {
			if (str2int(argv[++i], &run)) {
				fprintf(stderr, "After -r must follow decadic address !\n");
				return 1;
			}
			if (run > 65535) {
				fprintf(stderr, "Maximum number after -r is 65535!\n");
				return 1;
			}
			continue;
		}
		if (!strcmp(argv[i], "-cb")) {
			if (str2int(argv[++i], &cb)) {
				fprintf(stderr, "After -cb must follow decadic address !\n");
				return 1;
			}
			if (cb > 7) {
				fprintf(stderr, "Maximum number after -cb is 7!\n");
				return 1;
			}
			continue;
		}
		if (!strcmp(argv[i], "-cp")) {
			if (str2int(argv[++i], &cp)) {
				fprintf(stderr, "After -cp must follow decadic address !\n");
				return 1;
			}
			if (cp > 65535) {
				fprintf(stderr, "Maximum number after -cp is 7!\n");
				return 1;
			}
			continue;
		}
		if (!strcmp(argv[i], "-ci")) {
			if (str2int(argv[++i], &ci)) {
				fprintf(stderr, "After -ci must follow decadic address !\n");
				return 1;
			}
			if (ci > 65535) {
				fprintf(stderr, "Maximum number after -ci is 7!\n");
				return 1;
			}
			continue;
		}
		if (!strcmp(argv[i], "-d80")) {
			d80 = 1;
			continue;
		}
		if (!strcmp(argv[i], "-hp") || !strcmp(argv[i], "--header-poke")) {
			hp = 1;
			continue;
		}
		if (!strcmp(argv[i], "-soaz") || !strcmp(argv[i], "--soaz")) {
			printf("Yebo!\n");
			return 1;
		}
		if (!finname_i)
			finname_i = i;
		else {
			fprintf(stderr, "Input only one bin. file!\n");
			return 1;
		}
	}

	if (!finname_i) {
		printf("Enter input filename!\nTry `bin2tap --help` for help.\n");
		return 1;
	}

	if (!foutname_i) {
		strncpy(foutname, argv[finname_i], 255-5);
		foutname[254-5] = '\0';
		i = strlen(foutname);
		no = 0;
		i--;
		while ((no < 4) && (i-no > 0)) {
			if (foutname[i-no] == '.') {
				foutname[i-no] = '\0';
				break;
			}
			++no;
		}
		strcat (foutname, ".tap");
	}
	else {
		strncpy(foutname, argv[foutname_i], 254);
		foutname[254] = '\0';
	}

	finput = fopen(argv[finname_i], "rb");
	if (!finput) {
		printf("Input file open failed!\n");
		return 1;
	}

	foutput = fopen(foutname, "wb+");
	if (!foutput) {
		printf("Output file open failed!\n");
		return 1;
	}

	if (basic) {
		tap_index = 110+d80;
		i = 0;
		while ((*(foutname+i) != '.' && *(foutname+i) != '\0') && i<10) {
			*(tap+tap_index+i) = *(foutname+i);
			i++;
		}
		*(tap+14) = (86+d80+i+19*hp) % 256;
		*(tap+15) = (86+d80+i+19*hp) / 256; 

		tap_index = 0;

		*(tap+tap_index++) = 19;		/* tap lenght */
		*(tap+tap_index++) = 0;
		checksum = *(tap+tap_index++) = 0;	/* 00 - header, FF - data*/
		checksum ^= *(tap+tap_index++) = 0;
		if (d80) {
			for (i = 0; i < 10; i++)
				checksum ^= *(tap+tap_index++) = *(run_name+i);
		}
		else {
			in_name = 1;
			for (i = 0; i < 10; ++i) {			/* filename  */
				if (in_name && (foutname[i] == '.' || foutname[i] == '\0'))
					in_name = 0;
				if (in_name)
					checksum ^= *(tap+tap_index++) = foutname[i];
				else
					checksum ^= *(tap+tap_index++) = ' ';
			}
		}
		checksum ^= *(tap+tap_index++);		/* lenght of data block */
		checksum ^= *(tap+tap_index++);
		checksum ^= *(tap+tap_index++) = 10;	/* param1 - autostart of BASIC */
		checksum ^= *(tap+tap_index++) = 0;
		checksum ^= *(tap+tap_index++) = *(tap+14);	/* param2 - start of variables */
		checksum ^= *(tap+tap_index++) = *(tap+15);
		*(tap+tap_index++) = checksum;

		i = *(tap+15)*256 + *(tap+14) + 2;
		*(tap+tap_index++) = i % 256;
		*(tap+tap_index++) = i / 256;
		checksum = *(tap+tap_index++) = 255;

		l_copy (tap, loader, &tap_index, &checksum, 33);
		loader += 33;
		checksum ^= *(tap+tap_index++) = '0' + cb;
		l_copy (tap, loader, &tap_index, &checksum, 5);
		loader += 5;
		checksum ^= *(tap+tap_index++) = '0' + cp;
		l_copy (tap, loader, &tap_index, &checksum, 5);
		loader += 5;
		checksum ^= *(tap+tap_index++) = '0' + ci;
		l_copy (tap, loader, &tap_index, &checksum, 9);
		loader += 9;
		checksum ^= *(tap+tap_index++) = '0' + clear/10000;
		clear -= 10000 * (clear/10000);
		checksum ^= *(tap+tap_index++) = '0' + clear/1000;
		clear -= 1000 * (clear/1000);
		checksum ^= *(tap+tap_index++) = '0' + clear/100;
		clear -= 100 * (clear/100);
		checksum ^= *(tap+tap_index++) = '0' + clear/10;
		clear -= 10 * (clear/10);
		checksum ^= *(tap+tap_index++) = '0' + clear;
		l_copy (tap, loader, &tap_index, &checksum, 2);
		loader += 2;
		if (hp)
			l_copy (tap, loader, &tap_index, &checksum, 19);
		loader += 19;
		l_copy (tap, loader, &tap_index, &checksum, 5);
		loader += 5;
		checksum ^= *(tap+tap_index-2);
		checksum ^= *(tap+tap_index-3);
		if (d80)
			checksum ^= *(tap+tap_index++) = '*';
		checksum ^= *(tap+tap_index++) = '\"';
		i = 0;
		while (((no = foutname[i]) != '.' && no != '\0') && i<10) {
			checksum ^= *(tap+tap_index++) = no;
			i++;
		}
		checksum ^= *(tap+tap_index-d80-i-4) = (i+d80+5) % 256;	/* dlzka riadku */
		checksum ^= *(tap+tap_index-d80-i-3) = (i+d80+5) / 256;
		l_copy (tap, loader, &tap_index, &checksum, 11);
		loader += 11;
		checksum ^= *(tap+tap_index++) = '0' + run/10000;
		run -= 10000 * (run/10000);
		checksum ^= *(tap+tap_index++) = '0' + run/1000;
		run -= 1000 * (run/1000);
		checksum ^= *(tap+tap_index++) = '0' + run/100;
		run -= 100 * (run/100);
		checksum ^= *(tap+tap_index++) = '0' + run/10;
		run -= 10 * (run/10);
		checksum ^= *(tap+tap_index++) = '0' + run;
		l_copy (tap, loader, &tap_index, &checksum, 2);
		loader += 2;
		*(tap+tap_index++) = checksum;
	}
	*(tap+tap_index++) = 19;	/* bytes header len */
	*(tap+tap_index++) = 0;
	*(tap+tap_index++) = 0;		/* header */
	checksum = *(tap+tap_index++) = 3;		/* bytes file */
	in_name = 1;
	for (i = 0; i < 10; ++i) {	/* filename  */
		if (in_name && (foutname[i] == '.' || foutname[i] == '\0'))
			in_name = 0;
		if (in_name)
			checksum ^= *(tap+tap_index++) = foutname[i];
		else
			checksum ^= *(tap+tap_index++) = ' ';
	}
	inputlen = fread (tap+tap_index+10, 1, 49152, finput);
	if (!feof(finput))
		printf("Warning: File exceed 49151 limit!\n");
	checksum ^= *(tap+tap_index++) = inputlen % 256;
	checksum ^= *(tap+tap_index++) = inputlen / 256;
	checksum ^= *(tap+tap_index++) = address % 256;
	checksum ^= *(tap+tap_index++) = address / 256;
	checksum ^= *(tap+tap_index++) = 0;
	checksum ^= *(tap+tap_index++) = 32768 / 256;
	*(tap+tap_index++) = checksum;

	*(tap+tap_index++) = (inputlen + 2) % 256;
	*(tap+tap_index++) = (inputlen + 2) / 256;
	checksum = *(tap+tap_index++) = 255;
	for (i = 0; i < inputlen; i++)
		checksum ^= *(tap+tap_index++);
	*(tap+tap_index++) = checksum;

	inputlen = fwrite(tap, 1, tap_index, foutput);
	if (ferror(foutput)) {
		printf("Error in save file!\n");
		return 1;
	}
	fclose(finput);
	fclose(foutput);
	return 0;
}

// Assembly:
subq $0xc268, %rsp           # imm = 0xC268
movl $0x0, 0xc264(%rsp)
movl %edi, 0xc260(%rsp)
movq %rsi, 0xc258(%rsp)
movl $0x0, 0xc23c(%rsp)
movl $0x0, 0xc12c(%rsp)
movl $0x8000, 0xc118(%rsp) # imm = 0x8000
movl $0x0, 0xc114(%rsp)
movl $0x5fff, 0xc110(%rsp) # imm = 0x5FFF
movl $0x8000, 0xc10c(%rsp) # imm = 0x8000
movl $0x0, 0xc108(%rsp)
movl $0x0, 0xc104(%rsp)
movl $0x7, 0xc100(%rsp)
movl $0x0, 0xc0fc(%rsp)
movl $0x0, 0xc0f8(%rsp)
movq 0x1ed8(%rip), %rax      # 0x32d9
movq %rax, 0xc0ed(%rsp)
movw 0x1ed1(%rip), %ax       # 0x32e1
movw %ax, 0xc0f5(%rsp)
movb 0x1ec5(%rip), %al       # 0x32e3
movb %al, 0xc0f7(%rsp)
leaq 0xc090(%rsp), %rdi
leaq 0x218c(%rip), %rsi      # 0x35c0
movl $0x5c, %edx
callq 0x1060
movl $0x0, 0x4(%rsp)
leaq 0xc090(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x1, 0xc124(%rsp)
movl 0xc124(%rsp), %eax
cmpl 0xc260(%rsp), %eax
jge 0x1b63
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1e57(%rip), %rsi      # 0x32e4
callq 0x1090
cmpl $0x0, %eax
je 0x14bc
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1e35(%rip), %rsi      # 0x32e7
callq 0x1090
cmpl $0x0, %eax
jne 0x14d1
callq 0x12c0
movl $0x0, 0xc264(%rsp)
jmp 0x2d02
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1e02(%rip), %rsi      # 0x32ee
callq 0x1090
cmpl $0x0, %eax
je 0x151b
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1de0(%rip), %rsi      # 0x32f1
callq 0x1090
cmpl $0x0, %eax
jne 0x1530
callq 0x12a0
movl $0x0, 0xc264(%rsp)
jmp 0x2d02
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1db0(%rip), %rsi      # 0x32fb
callq 0x1090
cmpl $0x0, %eax
jne 0x1572
movl 0xc124(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc124(%rsp)
movl %eax, 0xc23c(%rsp)
jmp 0x1b4d
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1d71(%rip), %rsi      # 0x32fe
callq 0x1090
cmpl $0x0, %eax
jne 0x162f
movq 0xc258(%rsp), %rax
movl 0xc124(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0xc124(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc118(%rsp), %rsi
callq 0x1200
cmpl $0x0, %eax
je 0x15f5
movq 0x3a0c(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1d23(%rip), %rsi      # 0x3301
movb $0x0, %al
callq 0x10a0
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
cmpl $0xffff, 0xc118(%rsp) # imm = 0xFFFF
jle 0x162a
movq 0x39d7(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1d16(%rip), %rsi      # 0x3329
movb $0x0, %al
callq 0x10a0
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
jmp 0x1b4d
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1d02(%rip), %rsi      # 0x334c
callq 0x1090
cmpl $0x0, %eax
jne 0x1664
movl $0x1, 0xc114(%rsp)
jmp 0x1b4d
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1cd0(%rip), %rsi      # 0x334f
callq 0x1090
cmpl $0x0, %eax
jne 0x1721
movq 0xc258(%rsp), %rax
movl 0xc124(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0xc124(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc110(%rsp), %rsi
callq 0x1200
cmpl $0x0, %eax
je 0x16e7
movq 0x391a(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1c82(%rip), %rsi      # 0x3352
movb $0x0, %al
callq 0x10a0
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
cmpl $0xffff, 0xc110(%rsp) # imm = 0xFFFF
jle 0x171c
movq 0x38e5(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1c75(%rip), %rsi      # 0x337a
movb $0x0, %al
callq 0x10a0
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
jmp 0x1b4d
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1c61(%rip), %rsi      # 0x339d
callq 0x1090
cmpl $0x0, %eax
jne 0x17de
movq 0xc258(%rsp), %rax
movl 0xc124(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0xc124(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc10c(%rsp), %rsi
callq 0x1200
cmpl $0x0, %eax
je 0x17a4
movq 0x385d(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1c13(%rip), %rsi      # 0x33a0
movb $0x0, %al
callq 0x10a0
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
cmpl $0xffff, 0xc10c(%rsp) # imm = 0xFFFF
jle 0x17d9
movq 0x3828(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1c06(%rip), %rsi      # 0x33c8
movb $0x0, %al
callq 0x10a0
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
jmp 0x1b4d
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1bf2(%rip), %rsi      # 0x33eb
callq 0x1090
cmpl $0x0, %eax
jne 0x1898
movq 0xc258(%rsp), %rax
movl 0xc124(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0xc124(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc108(%rsp), %rsi
callq 0x1200
cmpl $0x0, %eax
je 0x1861
movq 0x37a0(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1ba5(%rip), %rsi      # 0x33ef
movb $0x0, %al
callq 0x10a0
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
cmpl $0x7, 0xc108(%rsp)
jle 0x1893
movq 0x376e(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1b9c(%rip), %rsi      # 0x3418
movb $0x0, %al
callq 0x10a0
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
jmp 0x1b4d
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1b85(%rip), %rsi      # 0x3438
callq 0x1090
cmpl $0x0, %eax
jne 0x1955
movq 0xc258(%rsp), %rax
movl 0xc124(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0xc124(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc104(%rsp), %rsi
callq 0x1200
cmpl $0x0, %eax
je 0x191b
movq 0x36e6(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1b38(%rip), %rsi      # 0x343c
movb $0x0, %al
callq 0x10a0
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
cmpl $0xffff, 0xc104(%rsp) # imm = 0xFFFF
jle 0x1950
movq 0x36b1(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1b2c(%rip), %rsi      # 0x3465
movb $0x0, %al
callq 0x10a0
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
jmp 0x1b4d
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1b15(%rip), %rsi      # 0x3485
callq 0x1090
cmpl $0x0, %eax
jne 0x1a12
movq 0xc258(%rsp), %rax
movl 0xc124(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0xc124(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc100(%rsp), %rsi
callq 0x1200
cmpl $0x0, %eax
je 0x19d8
movq 0x3629(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1ac8(%rip), %rsi      # 0x3489
movb $0x0, %al
callq 0x10a0
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
cmpl $0xffff, 0xc100(%rsp) # imm = 0xFFFF
jle 0x1a0d
movq 0x35f4(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x1abc(%rip), %rsi      # 0x34b2
movb $0x0, %al
callq 0x10a0
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
jmp 0x1b4d
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1aa5(%rip), %rsi      # 0x34d2
callq 0x1090
cmpl $0x0, %eax
jne 0x1a47
movl $0x1, 0xc0fc(%rsp)
jmp 0x1b4d
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1a75(%rip), %rsi      # 0x34d7
callq 0x1090
cmpl $0x0, %eax
je 0x1a91
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1a54(%rip), %rsi      # 0x34db
callq 0x1090
cmpl $0x0, %eax
jne 0x1aa1
movl $0x1, 0xc0f8(%rsp)
jmp 0x1b4d
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1a2e(%rip), %rsi      # 0x34ea
callq 0x1090
cmpl $0x0, %eax
je 0x1aeb
movq 0xc258(%rsp), %rax
movslq 0xc124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1a08(%rip), %rsi      # 0x34e9
callq 0x1090
cmpl $0x0, %eax
jne 0x1b09
leaq 0x19fe(%rip), %rdi      # 0x34f0
movb $0x0, %al
callq 0x1030
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
cmpl $0x0, 0xc12c(%rsp)
jne 0x1b23
movl 0xc124(%rsp), %eax
movl %eax, 0xc12c(%rsp)
jmp 0x1b4b
movq 0x34b6(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leaq 0x19c3(%rip), %rsi      # 0x34f7
movb $0x0, %al
callq 0x10a0
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
jmp 0x1b4d
movl 0xc124(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc124(%rsp)
jmp 0x145e
cmpl $0x0, 0xc12c(%rsp)
jne 0x1b8b
leaq 0x199e(%rip), %rdi      # 0x3512
movb $0x0, %al
callq 0x1030
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
cmpl $0x0, 0xc23c(%rsp)
jne 0x1c89
leaq 0xc130(%rsp), %rdi
movq 0xc258(%rsp), %rax
movslq 0xc12c(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movl $0xfa, %edx
callq 0x1050
movb $0x0, 0xc229(%rsp)
leaq 0xc130(%rsp), %rdi
callq 0x1040
movl %eax, 0xc124(%rsp)
movl $0x0, 0xc11c(%rsp)
movl 0xc124(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xc124(%rsp)
xorl %eax, %eax
cmpl $0x4, 0xc11c(%rsp)
movb %al, 0x3(%rsp)
jge 0x1c1f
movl 0xc124(%rsp), %eax
subl 0xc11c(%rsp), %eax
cmpl $0x0, %eax
setg %al
movb %al, 0x3(%rsp)
movb 0x3(%rsp), %al
testb $0x1, %al
jne 0x1c29
jmp 0x1c73
movl 0xc124(%rsp), %eax
subl 0xc11c(%rsp), %eax
cltq
movsbl 0xc130(%rsp,%rax), %eax
cmpl $0x2e, %eax
jne 0x1c60
movl 0xc124(%rsp), %eax
subl 0xc11c(%rsp), %eax
cltq
movb $0x0, 0xc130(%rsp,%rax)
jmp 0x1c73
movl 0xc11c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc11c(%rsp)
jmp 0x1bf7
leaq 0xc130(%rsp), %rdi
leaq 0x18c6(%rip), %rsi      # 0x3548
callq 0x10d0
jmp 0x1cb7
leaq 0xc130(%rsp), %rdi
movq 0xc258(%rsp), %rax
movslq 0xc23c(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movl $0xfe, %edx
callq 0x1050
movb $0x0, 0xc22e(%rsp)
movq 0xc258(%rsp), %rax
movslq 0xc12c(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x187b(%rip), %rsi      # 0x354d
callq 0x1080
movq %rax, 0xc240(%rsp)
cmpq $0x0, 0xc240(%rsp)
jne 0x1d08
leaq 0x185f(%rip), %rdi      # 0x3550
movb $0x0, %al
callq 0x1030
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
leaq 0xc130(%rsp), %rdi
leaq 0x1852(%rip), %rsi      # 0x3569
callq 0x1080
movq %rax, 0xc248(%rsp)
cmpq $0x0, 0xc248(%rsp)
jne 0x1d4d
leaq 0x1837(%rip), %rdi      # 0x356d
movb $0x0, %al
callq 0x1030
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
cmpl $0x0, 0xc114(%rsp)
je 0x28f0
movl 0xc0fc(%rsp), %eax
addl $0x6e, %eax
movl %eax, 0x4(%rsp)
movl $0x0, 0xc124(%rsp)
movslq 0xc124(%rsp), %rax
movsbl 0xc130(%rsp,%rax), %ecx
xorl %eax, %eax
cmpl $0x2e, %ecx
movb %al, 0x2(%rsp)
je 0x1db9
movslq 0xc124(%rsp), %rax
movsbl 0xc130(%rsp,%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x2(%rsp)
je 0x1db9
cmpl $0xa, 0xc124(%rsp)
setl %al
movb %al, 0x2(%rsp)
movb 0x2(%rsp), %al
testb $0x1, %al
jne 0x1dc3
jmp 0x1e00
movslq 0xc124(%rsp), %rax
movb 0xc130(%rsp,%rax), %dl
leaq 0x10(%rsp), %rax
movslq 0x4(%rsp), %rcx
addq %rcx, %rax
movslq 0xc124(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0xc124(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc124(%rsp)
jmp 0x1d74
movl 0xc0fc(%rsp), %eax
addl $0x56, %eax
addl 0xc124(%rsp), %eax
imull $0x13, 0xc0f8(%rsp), %ecx
addl %ecx, %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movb %dl, %al
movb %al, 0x1e(%rsp)
movl 0xc0fc(%rsp), %eax
addl $0x56, %eax
addl 0xc124(%rsp), %eax
imull $0x13, 0xc0f8(%rsp), %ecx
addl %ecx, %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movb %al, 0x1f(%rsp)
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0x13, 0x10(%rsp,%rax)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0x0, 0x10(%rsp,%rax)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0x0, 0x10(%rsp,%rax)
movl $0x0, 0xc128(%rsp)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0x0, 0x10(%rsp,%rax)
movl 0xc128(%rsp), %eax
xorl $0x0, %eax
movl %eax, 0xc128(%rsp)
cmpl $0x0, 0xc0fc(%rsp)
je 0x1f2f
movl $0x0, 0xc124(%rsp)
cmpl $0xa, 0xc124(%rsp)
jge 0x1f2a
movslq 0xc124(%rsp), %rax
movb 0xc0ed(%rsp,%rax), %al
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc124(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc124(%rsp)
jmp 0x1ed9
jmp 0x2011
movl $0x1, 0xc120(%rsp)
movl $0x0, 0xc124(%rsp)
cmpl $0xa, 0xc124(%rsp)
jge 0x200f
cmpl $0x0, 0xc120(%rsp)
je 0x1f92
movslq 0xc124(%rsp), %rax
movsbl 0xc130(%rsp,%rax), %eax
cmpl $0x2e, %eax
je 0x1f87
movslq 0xc124(%rsp), %rax
movsbl 0xc130(%rsp,%rax), %eax
cmpl $0x0, %eax
jne 0x1f92
movl $0x0, 0xc120(%rsp)
cmpl $0x0, 0xc120(%rsp)
je 0x1fd2
movslq 0xc124(%rsp), %rax
movb 0xc130(%rsp,%rax), %al
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
jmp 0x1ff7
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0x20, 0x10(%rsp,%rax)
movl 0xc128(%rsp), %eax
xorl $0x20, %eax
movl %eax, 0xc128(%rsp)
jmp 0x1ff9
movl 0xc124(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc124(%rsp)
jmp 0x1f45
jmp 0x2011
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movsbl 0x10(%rsp,%rax), %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movsbl 0x10(%rsp,%rax), %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0xa, 0x10(%rsp,%rax)
movl 0xc128(%rsp), %eax
xorl $0xa, %eax
movl %eax, 0xc128(%rsp)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0x0, 0x10(%rsp,%rax)
movl 0xc128(%rsp), %eax
xorl $0x0, %eax
movl %eax, 0xc128(%rsp)
movb 0x1e(%rsp), %al
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movb 0x1f(%rsp), %al
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc128(%rsp), %eax
movb %al, %cl
movl 0x4(%rsp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
cltq
movb %cl, 0x10(%rsp,%rax)
movsbl 0x1f(%rsp), %eax
shll $0x8, %eax
movsbl 0x1e(%rsp), %ecx
addl %ecx, %eax
addl $0x2, %eax
movl %eax, 0xc124(%rsp)
movl 0xc124(%rsp), %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movb %dl, %cl
movl 0x4(%rsp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
cltq
movb %cl, 0x10(%rsp,%rax)
movl 0xc124(%rsp), %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movb %al, %cl
movl 0x4(%rsp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
cltq
movb %cl, 0x10(%rsp,%rax)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $-0x1, 0x10(%rsp,%rax)
movl $0xffffffff, 0xc128(%rsp) # imm = 0xFFFFFFFF
leaq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
leaq 0xc128(%rsp), %rcx
movl $0x21, %r8d
callq 0x12e0
movq 0x8(%rsp), %rax
addq $0x21, %rax
movq %rax, 0x8(%rsp)
movl 0xc108(%rsp), %eax
addl $0x30, %eax
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
leaq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
leaq 0xc128(%rsp), %rcx
movl $0x5, %r8d
callq 0x12e0
movq 0x8(%rsp), %rax
addq $0x5, %rax
movq %rax, 0x8(%rsp)
movl 0xc104(%rsp), %eax
addl $0x30, %eax
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
leaq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
leaq 0xc128(%rsp), %rcx
movl $0x5, %r8d
callq 0x12e0
movq 0x8(%rsp), %rax
addq $0x5, %rax
movq %rax, 0x8(%rsp)
movl 0xc100(%rsp), %eax
addl $0x30, %eax
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
leaq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
leaq 0xc128(%rsp), %rcx
movl $0x9, %r8d
callq 0x12e0
movq 0x8(%rsp), %rax
addq $0x9, %rax
movq %rax, 0x8(%rsp)
movl 0xc110(%rsp), %eax
movl $0x2710, %ecx           # imm = 0x2710
cltd
idivl %ecx
addl $0x30, %eax
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc110(%rsp), %eax
movl $0x2710, %ecx           # imm = 0x2710
cltd
idivl %ecx
imull $0x2710, %eax, %ecx     # imm = 0x2710
movl 0xc110(%rsp), %eax
subl %ecx, %eax
movl %eax, 0xc110(%rsp)
movl 0xc110(%rsp), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
addl $0x30, %eax
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc110(%rsp), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
imull $0x3e8, %eax, %ecx      # imm = 0x3E8
movl 0xc110(%rsp), %eax
subl %ecx, %eax
movl %eax, 0xc110(%rsp)
movl 0xc110(%rsp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
addl $0x30, %eax
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc110(%rsp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
imull $0x64, %eax, %ecx
movl 0xc110(%rsp), %eax
subl %ecx, %eax
movl %eax, 0xc110(%rsp)
movl 0xc110(%rsp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
addl $0x30, %eax
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc110(%rsp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
imull $0xa, %eax, %ecx
movl 0xc110(%rsp), %eax
subl %ecx, %eax
movl %eax, 0xc110(%rsp)
movl 0xc110(%rsp), %eax
addl $0x30, %eax
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
leaq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
leaq 0xc128(%rsp), %rcx
movl $0x2, %r8d
callq 0x12e0
movq 0x8(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x8(%rsp)
cmpl $0x0, 0xc0f8(%rsp)
je 0x24cf
leaq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
leaq 0xc128(%rsp), %rcx
movl $0x13, %r8d
callq 0x12e0
movq 0x8(%rsp), %rax
addq $0x13, %rax
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
leaq 0xc128(%rsp), %rcx
movl $0x5, %r8d
callq 0x12e0
movq 0x8(%rsp), %rax
addq $0x5, %rax
movq %rax, 0x8(%rsp)
movslq 0x4(%rsp), %rax
movsbl 0xe(%rsp,%rax), %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movslq 0x4(%rsp), %rax
movsbl 0xd(%rsp,%rax), %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
cmpl $0x0, 0xc0fc(%rsp)
je 0x256c
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0x2a, 0x10(%rsp,%rax)
movl 0xc128(%rsp), %eax
xorl $0x2a, %eax
movl %eax, 0xc128(%rsp)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0x22, 0x10(%rsp,%rax)
movl 0xc128(%rsp), %eax
xorl $0x22, %eax
movl %eax, 0xc128(%rsp)
movl $0x0, 0xc124(%rsp)
movslq 0xc124(%rsp), %rax
movsbl 0xc130(%rsp,%rax), %ecx
movl %ecx, 0xc11c(%rsp)
xorl %eax, %eax
cmpl $0x2e, %ecx
movb %al, 0x1(%rsp)
je 0x25dd
xorl %eax, %eax
cmpl $0x0, 0xc11c(%rsp)
movb %al, 0x1(%rsp)
je 0x25dd
cmpl $0xa, 0xc124(%rsp)
setl %al
movb %al, 0x1(%rsp)
movb 0x1(%rsp), %al
testb $0x1, %al
jne 0x25e7
jmp 0x2629
movl 0xc11c(%rsp), %eax
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc124(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc124(%rsp)
jmp 0x259c
movl 0xc124(%rsp), %eax
addl 0xc0fc(%rsp), %eax
addl $0x5, %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movb %dl, %al
leaq 0x10(%rsp), %rcx
movslq 0x4(%rsp), %rdx
addq %rdx, %rcx
movslq 0xc0fc(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
addq %rdx, %rcx
movslq 0xc124(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
movb %al, -0x4(%rcx,%rdx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc124(%rsp), %eax
addl 0xc0fc(%rsp), %eax
addl $0x5, %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
leaq 0x10(%rsp), %rcx
movslq 0x4(%rsp), %rdx
addq %rdx, %rcx
movslq 0xc0fc(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
addq %rdx, %rcx
movslq 0xc124(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
movb %al, -0x3(%rcx,%rdx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
leaq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
leaq 0xc128(%rsp), %rcx
movl $0xb, %r8d
callq 0x12e0
movq 0x8(%rsp), %rax
addq $0xb, %rax
movq %rax, 0x8(%rsp)
movl 0xc10c(%rsp), %eax
movl $0x2710, %ecx           # imm = 0x2710
cltd
idivl %ecx
addl $0x30, %eax
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc10c(%rsp), %eax
movl $0x2710, %ecx           # imm = 0x2710
cltd
idivl %ecx
imull $0x2710, %eax, %ecx     # imm = 0x2710
movl 0xc10c(%rsp), %eax
subl %ecx, %eax
movl %eax, 0xc10c(%rsp)
movl 0xc10c(%rsp), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
addl $0x30, %eax
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc10c(%rsp), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
imull $0x3e8, %eax, %ecx      # imm = 0x3E8
movl 0xc10c(%rsp), %eax
subl %ecx, %eax
movl %eax, 0xc10c(%rsp)
movl 0xc10c(%rsp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
addl $0x30, %eax
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc10c(%rsp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
imull $0x64, %eax, %ecx
movl 0xc10c(%rsp), %eax
subl %ecx, %eax
movl %eax, 0xc10c(%rsp)
movl 0xc10c(%rsp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
addl $0x30, %eax
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc10c(%rsp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
imull $0xa, %eax, %ecx
movl 0xc10c(%rsp), %eax
subl %ecx, %eax
movl %eax, 0xc10c(%rsp)
movl 0xc10c(%rsp), %eax
addl $0x30, %eax
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
leaq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
leaq 0xc128(%rsp), %rcx
movl $0x2, %r8d
callq 0x12e0
movq 0x8(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x8(%rsp)
movl 0xc128(%rsp), %eax
movb %al, %cl
movl 0x4(%rsp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
cltq
movb %cl, 0x10(%rsp,%rax)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0x13, 0x10(%rsp,%rax)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0x0, 0x10(%rsp,%rax)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0x0, 0x10(%rsp,%rax)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0x3, 0x10(%rsp,%rax)
movl $0x3, 0xc128(%rsp)
movl $0x1, 0xc120(%rsp)
movl $0x0, 0xc124(%rsp)
cmpl $0xa, 0xc124(%rsp)
jge 0x2a2b
cmpl $0x0, 0xc120(%rsp)
je 0x29ae
movslq 0xc124(%rsp), %rax
movsbl 0xc130(%rsp,%rax), %eax
cmpl $0x2e, %eax
je 0x29a3
movslq 0xc124(%rsp), %rax
movsbl 0xc130(%rsp,%rax), %eax
cmpl $0x0, %eax
jne 0x29ae
movl $0x0, 0xc120(%rsp)
cmpl $0x0, 0xc120(%rsp)
je 0x29ee
movslq 0xc124(%rsp), %rax
movb 0xc130(%rsp,%rax), %al
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
jmp 0x2a13
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0x20, 0x10(%rsp,%rax)
movl 0xc128(%rsp), %eax
xorl $0x20, %eax
movl %eax, 0xc128(%rsp)
jmp 0x2a15
movl 0xc124(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc124(%rsp)
jmp 0x2961
leaq 0x10(%rsp), %rdi
movslq 0x4(%rsp), %rax
addq %rax, %rdi
addq $0xa, %rdi
movq 0xc240(%rsp), %rcx
movl $0x1, %esi
movl $0xc000, %edx           # imm = 0xC000
callq 0x10b0
movl %eax, 0xc254(%rsp)
movq 0xc240(%rsp), %rdi
callq 0x10c0
cmpl $0x0, %eax
jne 0x2a7a
leaq 0xb14(%rip), %rdi       # 0x3587
movb $0x0, %al
callq 0x1030
movl 0xc254(%rsp), %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movb %dl, %al
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc254(%rsp), %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc118(%rsp), %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movb %dl, %al
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc118(%rsp), %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movl 0x4(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
movslq %ecx, %rcx
movb %al, 0x10(%rsp,%rcx)
movsbl %al, %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $0x0, 0x10(%rsp,%rax)
movl 0xc128(%rsp), %eax
xorl $0x0, %eax
movl %eax, 0xc128(%rsp)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $-0x80, 0x10(%rsp,%rax)
movl 0xc128(%rsp), %eax
xorl $-0x80, %eax
movl %eax, 0xc128(%rsp)
movl 0xc128(%rsp), %eax
movb %al, %cl
movl 0x4(%rsp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
cltq
movb %cl, 0x10(%rsp,%rax)
movl 0xc254(%rsp), %eax
addl $0x2, %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movb %dl, %cl
movl 0x4(%rsp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
cltq
movb %cl, 0x10(%rsp,%rax)
movl 0xc254(%rsp), %eax
addl $0x2, %eax
movl $0x100, %ecx            # imm = 0x100
cltd
idivl %ecx
movb %al, %cl
movl 0x4(%rsp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
cltq
movb %cl, 0x10(%rsp,%rax)
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movb $-0x1, 0x10(%rsp,%rax)
movl $0xffffffff, 0xc128(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0xc124(%rsp)
movl 0xc124(%rsp), %eax
cmpl 0xc254(%rsp), %eax
jge 0x2c71
movl 0x4(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
cltq
movsbl 0x10(%rsp,%rax), %eax
xorl 0xc128(%rsp), %eax
movl %eax, 0xc128(%rsp)
movl 0xc124(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc124(%rsp)
jmp 0x2c2c
movl 0xc128(%rsp), %eax
movb %al, %cl
movl 0x4(%rsp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x4(%rsp)
cltq
movb %cl, 0x10(%rsp,%rax)
leaq 0x10(%rsp), %rdi
movslq 0x4(%rsp), %rdx
movq 0xc248(%rsp), %rcx
movl $0x1, %esi
callq 0x10f0
movl %eax, 0xc254(%rsp)
movq 0xc248(%rsp), %rdi
callq 0x10e0
cmpl $0x0, %eax
je 0x2cdd
leaq 0x8e1(%rip), %rdi       # 0x35aa
movb $0x0, %al
callq 0x1030
movl $0x1, 0xc264(%rsp)
jmp 0x2d02
movq 0xc240(%rsp), %rdi
callq 0x1070
movq 0xc248(%rsp), %rdi
callq 0x1070
movl $0x0, 0xc264(%rsp)
movl 0xc264(%rsp), %eax
addq $0xc268, %rsp           # imm = 0xC268
retq