// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc1d8, %rsp           # imm = 0xC1D8
movq %rsi, 0x20(%rsp)
movl %edi, 0x54(%rsp)
cmpl $0x2, %edi
jl 0x1966
movl $0x7, %r12d
movl $0x1, %ebx
movq $0x0, 0x48(%rsp)
movl $0x8000, %eax           # imm = 0x8000
movq %rax, 0x38(%rsp)
movl $0x5fff, %eax           # imm = 0x5FFF
movq %rax, 0x28(%rsp)
movq $0x0, 0x58(%rsp)
movl $0x0, 0x44(%rsp)
movl $0x0, 0x34(%rsp)
xorl %eax, %eax
xorl %r15d, %r15d
xorl %ebp, %ebp
movl $0x8000, %r14d          # imm = 0x8000
movl %eax, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movslq %ebx, %r12
movq 0x20(%rsp), %rax
movq (%rax,%r12,8), %r13
movb (%r13), %r14b
cmpb $0x2d, %r14b
jne 0x14b9
cmpb $0x68, 0x1(%r13)
jne 0x1470
cmpb $0x0, 0x2(%r13)
je 0x1979
movq %r13, %rdi
leaq 0x1b95(%rip), %rsi      # 0x300f
callq 0x1070
testl %eax, %eax
je 0x1979
cmpb $0x76, 0x1(%r13)
jne 0x161d
cmpb $0x0, 0x2(%r13)
je 0x198e
movq %r13, %rdi
leaq 0x1b6f(%rip), %rsi      # 0x3016
callq 0x1070
testl %eax, %eax
jne 0x163e
jmp 0x198e
movq %r13, %rdi
leaq 0x1b4c(%rip), %rsi      # 0x300f
callq 0x1070
testl %eax, %eax
je 0x1979
movq %r13, %rdi
leaq 0x1b3c(%rip), %rsi      # 0x3016
callq 0x1070
testl %eax, %eax
je 0x198e
movq %r13, %rdi
leaq 0x1c10(%rip), %rsi      # 0x3101
callq 0x1070
testl %eax, %eax
je 0x15c1
movq %r13, %rdi
leaq 0x1c46(%rip), %rsi      # 0x314e
callq 0x1070
testl %eax, %eax
je 0x170d
movq %r13, %rdi
leaq 0x1c7c(%rip), %rsi      # 0x319b
callq 0x1070
testl %eax, %eax
je 0x1770
movq %r13, %rdi
leaq 0x1cb2(%rip), %rsi      # 0x31e8
callq 0x1070
testl %eax, %eax
je 0x17e4
movq %r13, %rdi
leaq 0x1ca0(%rip), %rsi      # 0x31ed
callq 0x1070
testl %eax, %eax
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %r12
je 0x17d5
movq %r13, %rdi
leaq 0x1c83(%rip), %rsi      # 0x31f1
callq 0x1070
testl %eax, %eax
je 0x17d5
movq %r13, %rdi
leaq 0x1c7b(%rip), %rsi      # 0x3200
callq 0x1070
testl %eax, %eax
je 0x1a20
movq %r13, %rdi
leaq 0x1c63(%rip), %rsi      # 0x31ff
callq 0x1070
testl %eax, %eax
je 0x1a20
cmpl $0x0, 0x34(%rsp)
movl %ebx, 0x34(%rsp)
movl 0x8(%rsp), %eax
je 0x1916
jmp 0x2215
leal 0x1(%r12), %ebx
movq 0x20(%rsp), %rax
movq 0x8(%rax,%r12,8), %rax
movb (%rax), %cl
testb %cl, %cl
je 0x17ce
incq %rax
xorl %ebp, %ebp
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %r12
leal -0x30(%rcx), %edx
cmpb $0x9, %dl
ja 0x19ae
leal (%rbp,%rbp,4), %edx
movzbl %cl, %ecx
leal (%rcx,%rdx,2), %ebp
addl $-0x30, %ebp
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x15e9
cmpl $0x8, %ebp
movl 0x8(%rsp), %eax
jl 0x1916
jmp 0x21f7
movq %r13, %rdi
leaq 0x19ef(%rip), %rsi      # 0x3016
callq 0x1070
testl %eax, %eax
je 0x198e
cmpb $0x2d, %r14b
jne 0x14e7
cmpb $0x6f, 0x1(%r13)
jne 0x1650
cmpb $0x0, 0x2(%r13)
je 0x17f3
cmpb $0x61, 0x1(%r13)
jne 0x1662
cmpb $0x0, 0x2(%r13)
je 0x180e
cmpb $0x62, 0x1(%r13)
jne 0x1674
cmpb $0x0, 0x2(%r13)
je 0x186c
cmpb $0x63, 0x1(%r13)
jne 0x1686
cmpb $0x0, 0x2(%r13)
je 0x1886
cmpb $0x72, 0x1(%r13)
jne 0x14e7
cmpb $0x0, 0x2(%r13)
jne 0x14e7
leal 0x1(%r12), %ebx
movq 0x20(%rsp), %rax
movq 0x8(%rax,%r12,8), %rax
movb (%rax), %cl
testb %cl, %cl
je 0x18ff
incq %rax
movq $0x0, 0x38(%rsp)
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %r12
leal -0x30(%rcx), %edx
cmpb $0x9, %dl
ja 0x21ed
movq 0x38(%rsp), %rdx
leal (%rdx,%rdx,4), %edx
movzbl %cl, %ecx
leal (%rcx,%rdx,2), %ecx
addl $-0x30, %ecx
movq %rcx, 0x38(%rsp)
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x16cb
cmpl $0x10000, 0x38(%rsp)    # imm = 0x10000
movl 0x8(%rsp), %eax
jl 0x1916
jmp 0x2233
leal 0x1(%r12), %ebx
movq 0x20(%rsp), %rax
movq 0x8(%rax,%r12,8), %rax
movb (%rax), %cl
testb %cl, %cl
je 0x1806
incq %rax
xorl %r15d, %r15d
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %r12
leal -0x30(%rcx), %edx
cmpb $0x9, %dl
ja 0x1a0c
leal (%r15,%r15,4), %edx
movzbl %cl, %ecx
leal (%rcx,%rdx,2), %r15d
addl $-0x30, %r15d
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x1736
cmpl $0x10000, %r15d         # imm = 0x10000
movl 0x8(%rsp), %eax
jl 0x1916
jmp 0x2201
leal 0x1(%r12), %ebx
movq 0x20(%rsp), %rax
movq 0x8(%rax,%r12,8), %rax
movb (%rax), %cl
testb %cl, %cl
je 0x1879
incq %rax
xorl %r12d, %r12d
movq 0x18(%rsp), %r14
leal -0x30(%rcx), %edx
cmpb $0x9, %dl
ja 0x1a16
leal (%r12,%r12,4), %edx
movzbl %cl, %ecx
leal (%rcx,%rdx,2), %r12d
addl $-0x30, %r12d
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x1794
cmpl $0x10000, %r12d         # imm = 0x10000
movl 0x8(%rsp), %eax
jl 0x1916
jmp 0x220b
xorl %ebp, %ebp
jmp 0x1908
movl $0x1, %eax
movq %rax, 0x48(%rsp)
jmp 0x1912
movl $0x1, %eax
movq %rax, 0x58(%rsp)
jmp 0x1908
incl %ebx
movl %ebx, %eax
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %r12
jmp 0x1916
xorl %r15d, %r15d
jmp 0x1908
leal 0x1(%r12), %ebx
movq 0x20(%rsp), %rax
movq 0x8(%rax,%r12,8), %rax
movb (%rax), %cl
testb %cl, %cl
je 0x18ef
incq %rax
xorl %r14d, %r14d
movq 0x10(%rsp), %r12
leal -0x30(%rcx), %edx
cmpb $0x9, %dl
ja 0x1b6b
leal (%r14,%r14,4), %edx
movzbl %cl, %ecx
leal (%rcx,%rdx,2), %r14d
addl $-0x30, %r14d
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x1832
cmpl $0x10000, %r14d         # imm = 0x10000
movl 0x8(%rsp), %eax
jl 0x1916
jmp 0x221f
movl $0x1, 0x44(%rsp)
jmp 0x1908
xorl %r12d, %r12d
movq 0x18(%rsp), %r14
jmp 0x1912
leal 0x1(%r12), %ebx
movq 0x20(%rsp), %rax
movq 0x8(%rax,%r12,8), %rax
movb (%rax), %cl
testb %cl, %cl
je 0x18f4
incq %rax
movq $0x0, 0x28(%rsp)
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %r12
leal -0x30(%rcx), %edx
cmpb $0x9, %dl
ja 0x21e3
movq 0x28(%rsp), %rdx
leal (%rdx,%rdx,4), %edx
movzbl %cl, %ecx
leal (%rcx,%rdx,2), %ecx
addl $-0x30, %ecx
movq %rcx, 0x28(%rsp)
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x18b1
cmpl $0x10000, 0x28(%rsp)    # imm = 0x10000
movl 0x8(%rsp), %eax
jl 0x1916
jmp 0x2229
xorl %r14d, %r14d
jmp 0x190d
movq $0x0, 0x28(%rsp)
jmp 0x1908
movq $0x0, 0x38(%rsp)
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %r12
movl 0x8(%rsp), %eax
incl %ebx
cmpl 0x54(%rsp), %ebx
jl 0x143a
movl 0x34(%rsp), %ecx
testl %ecx, %ecx
je 0x1966
movslq %ecx, %rbx
testl %eax, %eax
je 0x19b5
cltq
movq 0x20(%rsp), %r13
movq (%r13,%rax,8), %rsi
leaq 0x60(%rsp), %rdi
movl $0xfe, %edx
callq 0x1040
leaq 0x60(%rsp), %rax
movb $0x0, 0xfe(%rax)
movq (%r13,%rbx,8), %rbx
jmp 0x1a48
leaq 0x1b93(%rip), %rdi      # 0x3500
callq 0x1090
movl $0x1, %eax
jmp 0x199c
leaq 0x18ad(%rip), %rdi      # 0x322d
callq 0x1090
leaq 0x18d0(%rip), %rdi      # 0x325c
jmp 0x1995
leaq 0x1898(%rip), %rdi      # 0x322d
callq 0x1090
xorl %eax, %eax
addq $0xc1d8, %rsp           # imm = 0xC1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x116c
jmp 0x1972
movq 0x20(%rsp), %rax
movq (%rax,%rbx,8), %rbx
leaq 0x60(%rsp), %r13
movl $0xfa, %edx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1040
movb $0x0, 0xf9(%r13)
movq %r13, %rdi
callq 0x1030
leal -0x1(%rax), %ecx
testl %ecx, %ecx
jle 0x1a31
addl $-0x2, %eax
cmpl $0x3, %eax
movl $0x3, %edx
cmovbl %eax, %edx
incl %edx
movl %ecx, %ecx
cmpb $0x2e, 0x60(%rsp,%rcx)
je 0x1a2c
decl %ecx
decq %rdx
jne 0x19fa
jmp 0x1a31
callq 0x1134
jmp 0x1972
callq 0x10fc
jmp 0x1972
leaq 0x1b75(%rip), %rdi      # 0x359c
jmp 0x196d
movb $0x0, 0x60(%rsp,%rcx)
leaq 0x60(%rsp), %rdi
callq 0x1030
movl $0x7061742e, 0x60(%rsp,%rax) # imm = 0x7061742E
movb $0x0, 0x64(%rsp,%rax)
leaq 0x17d7(%rip), %rsi      # 0x3226
movq %rbx, %rdi
callq 0x1060
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x1b4c
leaq 0x17bd(%rip), %rsi      # 0x3229
leaq 0x60(%rsp), %r13
movq %r13, %rdi
callq 0x1060
testq %rax, %rax
je 0x1b58
cmpl $0x0, 0x44(%rsp)
movq %r14, 0x18(%rsp)
movq %rax, 0x8(%rsp)
je 0x1b64
movb 0x60(%rsp), %dl
xorl %ecx, %ecx
movq 0x58(%rsp), %r11
movl %r11d, %edi
cmpb $0x2e, %dl
leaq 0x1b6(%rsp), %r10
je 0x1ad8
leaq (%rsp,%rdi), %rsi
addq $0x1ce, %rsi            # imm = 0x1CE
xorl %ecx, %ecx
cmpq $0x9, %rcx
ja 0x1ad8
testb %dl, %dl
je 0x1ad8
movb %dl, (%rsi,%rcx)
movb 0x61(%rsp,%rcx), %dl
incq %rcx
cmpb $0x2e, %dl
jne 0x1abf
addb $0x30, %bpl
addb $0x30, %r15b
addb $0x30, %r12b
movq 0x48(%rsp), %rsi
leal (%rsi,%rsi,8), %edx
leal (%rsi,%rdx,2), %esi
addl %r11d, %esi
leal (%rcx,%rsi), %edx
addl $0x56, %edx
movb %dl, 0x16e(%rsp)
addl %ecx, %esi
addl $0x155, %esi            # imm = 0x155
testl %edx, %edx
cmovnsl %edx, %esi
shrl $0x8, %esi
movb %sil, 0x16f(%rsp)
movl $0x13, 0x160(%rsp)
testl %r11d, %r11d
movq %rdi, 0x10(%rsp)
je 0x1b75
movabsq $0x20202020206e7572, %rcx # imm = 0x20202020206E7572
movq %rcx, 0x164(%rsp)
movw $0x2020, 0x16c(%rsp)    # imm = 0x2020
movb $0x43, %cl
jmp 0x1bca
leaq 0x19e2(%rip), %rdi      # 0x3535
jmp 0x196d
leaq 0x19ee(%rip), %rdi      # 0x354d
jmp 0x196d
xorl %ecx, %ecx
jmp 0x2020
callq 0x1214
jmp 0x1972
movl $0x1, %esi
xorl %edx, %edx
xorl %ecx, %ecx
testl %esi, %esi
je 0x1b90
movzbl 0x60(%rsp,%rdx), %esi
testl %esi, %esi
je 0x1b90
cmpl $0x2e, %esi
jne 0x1b9f
movb $0x20, 0x164(%rsp,%rdx)
xorb $0x20, %cl
xorl %esi, %esi
jmp 0x1baf
movb %sil, 0x164(%rsp,%rdx)
xorb %sil, %cl
movl $0x1, %esi
incq %rdx
cmpq $0xa, %rdx
jne 0x1b7e
movb 0x16e(%rsp), %dl
movb 0x16f(%rsp), %sil
xorb $0xa, %cl
movw $0xa, 0x170(%rsp)
movb %dl, 0x172(%rsp)
movb %sil, 0x173(%rsp)
movb %cl, 0x174(%rsp)
movsbl %sil, %ecx
shll $0x8, %ecx
movsbl %dl, %edx
leal (%rdx,%rcx), %esi
addl $0x2, %esi
addl %edx, %ecx
addl $0x101, %ecx            # imm = 0x101
addl $0x2, %edx
movb %dl, 0x175(%rsp)
testl %esi, %esi
cmovnsl %esi, %ecx
movb %ch, 0x176(%rsp)
movb $-0x1, 0x177(%rsp)
movaps 0x1989(%rip), %xmm0     # 0x35b0
movups %xmm0, 0x178(%rsp)
movaps 0x198a(%rip), %xmm0     # 0x35c0
movups %xmm0, 0x188(%rsp)
movb $0x22, %cl
movb %cl, 0x198(%rsp)
movb %bpl, 0x199(%rsp)
movb %cl, 0x19e(%rsp)
movl $0xb0da3a22, 0x19a(%rsp) # imm = 0xB0DA3A22
movb %r15b, 0x19f(%rsp)
xorb %r15b, %bpl
movb %cl, 0x1a4(%rsp)
movl $0xb0d93a22, 0x1a0(%rsp) # imm = 0xB0D93A22
movb %r12b, 0x1a5(%rsp)
xorb %r12b, %bpl
xorb $0x61, %bpl
movzbl %bpl, %edx
movb %cl, 0x1ae(%rsp)
movabsq $-0x4f02fff5e1fff2de, %rcx # imm = 0xB0FD000A1E000D22
movq %rcx, 0x1a6(%rsp)
xorl %esi, %esi
leaq 0x18fd(%rip), %rcx      # 0x35b0
movzbl 0x2b(%rsi,%rcx), %edi
xorl %edi, %edx
incq %rsi
cmpl $0x9, %esi
jne 0x1cb3
movq 0x28(%rsp), %rbx
movslq %ebx, %rsi
imulq $0x68db8bad, %rsi, %rsi # imm = 0x68DB8BAD
movq %rsi, %rdi
shrq $0x3f, %rdi
sarq $0x2c, %rsi
addl %edi, %esi
leal 0x30(%rsi), %r8d
movb %r8b, 0x1af(%rsp)
imull $0x2710, %esi, %esi     # imm = 0x2710
subl %esi, %ebx
movswl %bx, %esi
imull $0xffff8313, %esi, %esi # imm = 0xFFFF8313
shrl $0x10, %esi
addl %ebx, %esi
movl $0xffff, %edi           # imm = 0xFFFF
movswl %si, %r9d
andl %edi, %esi
shrl $0xf, %esi
sarl $0x9, %r9d
addl %esi, %r9d
leal 0x30(%r9), %esi
movb %sil, 0x1b0(%rsp)
xorb %r8b, %sil
imull $0x3e8, %r9d, %r8d      # imm = 0x3E8
subl %r8d, %ebx
movswl %bx, %r8d
imull $0x147b, %r8d, %r8d     # imm = 0x147B
movl %r8d, %r9d
shrl $0x1f, %r9d
sarl $0x13, %r8d
addl %r9d, %r8d
leal 0x30(%r8), %r9d
movb %r9b, 0x1b1(%rsp)
xorb %r9b, %sil
imull $0x64, %r8d, %r8d
subl %r8d, %ebx
movsbl %bl, %r8d
imull $0x67, %r8d, %r8d
andl %r8d, %edi
shrl $0xf, %edi
movswl %r8w, %r8d
shrl $0xa, %r8d
addb %dil, %r8b
leal 0x30(%r8), %edi
movb %dil, 0x1b2(%rsp)
xorb %dil, %sil
movzbl %r8b, %edi
addl %edi, %edi
leal (%rdi,%rdi,4), %edi
subb %dil, %bl
addb $0x30, %bl
movb %bl, 0x1b3(%rsp)
xorb %sil, %bl
movzbl %bl, %esi
xorl %esi, %edx
movw $0xd22, 0x1b4(%rsp)     # imm = 0xD22
xorl $0x2f, %edx
cmpl $0x0, 0x48(%rsp)
je 0x1df1
movups 0x1828(%rip), %xmm0     # 0x35e6
movups %xmm0, 0x1b6(%rsp)
movl $0xd226f22, 0x1c5(%rsp) # imm = 0xD226F22
xorl %esi, %esi
movzbl 0x36(%rsi,%rcx), %edi
xorl %edi, %edx
incq %rsi
cmpl $0x13, %esi
jne 0x1dd3
movl $0x69, %edi
leaq 0x1c9(%rsp), %r10
jmp 0x1df6
movl $0x56, %edi
movb $-0x11, 0x4(%r10)
movl $0x53200, (%r10)        # imm = 0x53200
movl %edi, %esi
movb 0x162(%rsp,%rsi), %r9b
xorb 0x163(%rsp,%rsi), %r9b
leaq 0x5(%rsi), %r8
movzbl %r9b, %esi
xorl %edx, %esi
testl %r11d, %r11d
je 0x1e37
addl $0x6, %edi
movb $0x2a, 0x160(%rsp,%r8)
xorl $-0xe, %esi
movq %rdi, %r8
jmp 0x1e3d
xorl $-0x28, %esi
movl %r8d, %edi
movb $0x22, 0x160(%rsp,%r8)
xorl $0x22, %esi
movl %edi, %r8d
addl $0xb, %edi
leaq 0x160(%rsp), %r9
xorl %edx, %edx
movzbl (%r13), %r10d
testl %r10d, %r10d
je 0x1e8d
cmpl $0x2e, %r10d
je 0x1e8d
movb %r10b, 0x1(%r9,%r8)
xorl %r10d, %esi
decq %rdx
incq %r13
incq %r9
cmpq $-0xa, %rdx
jne 0x1e59
movl $0xa, %r8d
movl $0xa, %edx
jmp 0x1e9c
subl %edx, %r8d
incl %r8d
negq %rdx
movl %r8d, %edi
movq %rdx, %r8
leal (%r11,%rdx), %r9d
addl $0x5, %r9d
movslq %edi, %rdi
leaq (%rsp,%rdi), %r10
addq $0x160, %r10            # imm = 0x160
subq 0x10(%rsp), %r10
subq %r8, %r10
leal (%r11,%rdx), %eax
addl $0x104, %eax            # imm = 0x104
testl %r9d, %r9d
cmovnsl %r9d, %eax
movb %r9b, -0x4(%r10)
sarl $0x8, %eax
movb %al, -0x3(%r10)
xorl %r9d, %eax
movsbl %al, %eax
xorl %esi, %eax
movl %edi, %edx
movabsq $-0x6fff4c3fff250de, %rsi # imm = 0xF9000B3C000DAF22
movq %rsi, 0x160(%rsp,%rdx)
movl $0x22b0c0f9, 0x167(%rsp,%rdx) # imm = 0x22B0C0F9
addl $0xa, %edi
xorl %esi, %esi
movzbl 0x4e(%rsi,%rcx), %r8d
xorl %r8d, %eax
incq %rsi
cmpl $0xb, %esi
jne 0x1f01
leal 0xb(%rdx), %esi
movq 0x38(%rsp), %r11
movslq %r11d, %rcx
imulq $0x68db8bad, %rcx, %r8  # imm = 0x68DB8BAD
movq %r8, %rcx
shrq $0x3f, %rcx
sarq $0x2c, %r8
addl %ecx, %r8d
leal 0x30(%r8), %ecx
movslq %esi, %rsi
movb %cl, 0x160(%rsp,%rsi)
imull $0x2710, %r8d, %esi     # imm = 0x2710
subl %esi, %r11d
movswl %r11w, %esi
imull $0xffff8313, %esi, %esi # imm = 0xFFFF8313
shrl $0x10, %esi
addl %r11d, %esi
movl $0xffff, %r8d           # imm = 0xFFFF
movswl %si, %r9d
andl %r8d, %esi
shrl $0xf, %esi
sarl $0x9, %r9d
addl %esi, %r9d
leal 0x30(%r9), %esi
movslq %edi, %rdi
movb %sil, 0x162(%rsp,%rdi)
imull $0x3e8, %r9d, %r9d      # imm = 0x3E8
subl %r9d, %r11d
movswl %r11w, %r9d
imull $0x147b, %r9d, %r10d    # imm = 0x147B
movl %r10d, %r9d
shrl $0x1f, %r9d
sarl $0x13, %r10d
addl %r9d, %r10d
leal 0x30(%r10), %r9d
movb %r9b, 0x163(%rsp,%rdi)
imull $0x64, %r10d, %r10d
subl %r10d, %r11d
movsbl %r11b, %r10d
imull $0x67, %r10d, %r10d
andl %r10d, %r8d
shrl $0xf, %r8d
movswl %r10w, %r10d
shrl $0xa, %r10d
addb %r8b, %r10b
leal 0x30(%r10), %r8d
movb %r8b, 0x164(%rsp,%rdi)
movzbl %r10b, %r10d
addl %r10d, %r10d
leal (%r10,%r10,4), %r10d
subb %r10b, %r11b
addb $0x30, %r11b
movb %r11b, 0x165(%rsp,%rdi)
movw $0xd22, 0x170(%rsp,%rdx) # imm = 0xD22
leal 0x12(%rdx), %edi
xorb %cl, %al
xorb %sil, %al
xorb %r9b, %al
xorb %r8b, %al
xorb %r11b, %al
xorb $0x2f, %al
leal 0x13(%rdx), %ecx
movslq %edi, %rdx
movb %al, 0x160(%rsp,%rdx)
movslq %ecx, %rax
movl $0x3000013, 0x160(%rsp,%rax) # imm = 0x3000013
movl %eax, %edx
leaq (%rsp,%rdx), %rbp
addq $0x160, %rbp            # imm = 0x160
movl $0x3, %ebx
movl $0x1, %eax
xorl %r12d, %r12d
testl %eax, %eax
je 0x205b
movzbl 0x60(%rsp,%r12), %ecx
testl %ecx, %ecx
je 0x205b
cmpl $0x2e, %ecx
jne 0x206a
movb $0x20, 0x4(%rbp,%r12)
xorl %eax, %eax
movl $0x20, %ecx
jmp 0x2074
movb %cl, 0x4(%rbp,%r12)
movl $0x1, %eax
xorl %ecx, %ebx
incq %r12
cmpq $0xa, %r12
jne 0x2048
movq %rdx, 0x10(%rsp)
leaq (%r12,%rbp), %r15
addq $0xe, %r15
movl $0x1, %esi
movl $0xc000, %edx           # imm = 0xC000
movq %r15, %rdi
movq 0x20(%rsp), %r14
movq %r14, %rcx
callq 0x1080
movq %rax, 0x28(%rsp)
movl %eax, %r13d
movq %r14, %rdi
callq 0x10a0
testl %eax, %eax
jne 0x20c6
leaq 0x14a5(%rip), %rdi      # 0x3566
callq 0x1090
movl $0xff, %eax
leal (%rax,%r13), %ecx
testl %r13d, %r13d
cmovnsl %r13d, %ecx
sarl $0x8, %ecx
movq 0x18(%rsp), %r9
addl %r9d, %eax
testl %r9d, %r9d
cmovnsl %r9d, %eax
sarl $0x8, %eax
movl %r9d, %edi
xorl %r13d, %edi
xorl %ebx, %edi
xorl %eax, %edi
xorl %ecx, %edi
addb $-0x80, %dil
leal 0x2(%r13), %r8d
leal 0x101(%r13), %edx
testl %r8d, %r8d
cmovnsl %r8d, %edx
movq 0x10(%rsp), %r10
leaq (%r10,%r12), %rsi
movq 0x28(%rsp), %r11
movb %r11b, 0x4(%rbp,%r12)
movb %cl, 0x165(%rsp,%rsi)
movb %r9b, 0x166(%rsp,%rsi)
movb %al, 0x167(%rsp,%rsi)
movw $0x8000, 0x168(%rsp,%rsi) # imm = 0x8000
movb %dil, 0x16a(%rsp,%rsi)
movb %r8b, 0x16b(%rsp,%rsi)
movb %dh, 0x16c(%rsp,%rsi)
movb $-0x1, 0x16d(%rsp,%rsi)
testl %r13d, %r13d
jle 0x2181
movq %r11, %rcx
movb $-0x1, %al
movq 0x8(%rsp), %rbx
xorb (%r15), %al
incq %r15
decl %r13d
jne 0x216e
addl %r10d, %ecx
addl $0x18, %ecx
jmp 0x2190
leaq (%r10,%r12), %rcx
addq $0xe, %rcx
movb $-0x1, %al
movq 0x8(%rsp), %rbx
movslq %ecx, %rdx
incl %ecx
movb %al, 0x160(%rsp,%rdx)
movslq %ecx, %rdx
leaq 0x160(%rsp), %rdi
movl $0x1, %esi
movq %rbx, %rcx
callq 0x10c0
movq %rbx, %rdi
callq 0x10b0
testl %eax, %eax
je 0x21cc
leaq 0x13c1(%rip), %rdi      # 0x3588
jmp 0x196d
movq 0x20(%rsp), %rdi
callq 0x1050
movq %rbx, %rdi
callq 0x1050
jmp 0x199a
callq 0x11dc
jmp 0x1972
callq 0x11a4
jmp 0x1972
callq 0x1188
jmp 0x1972
callq 0x1150
jmp 0x1972
callq 0x1118
jmp 0x1972
callq 0x10e0
jmp 0x1972
callq 0x1230
jmp 0x1972
callq 0x11f8
jmp 0x1972
callq 0x11c0
jmp 0x1972