// File: /workspace/github_c_makefile_star2_O0/inflex[P]ripMIME/uuencode.c
// Function: UUENCODE_decode_uu
int UUENCODE_decode_uu( FFGET_FILE *f, char *unpackdir, char *input_filename, char *out_filename, int out_filename_size, int decode_whole_file, int keep )
{
	int filename_found = 0;
	char buf[ UUENCODE_STRLEN_MAX ];
	char *bp = buf, *fn, *fp;
	int n, i, expected;
	char fullpath[ UUENCODE_STRLEN_MAX ]="";
	struct PLD_strtok tx;
	unsigned char *writebuffer = NULL;
	unsigned char *wbpos;
	int wbcount = 0;
	int loop = 0;
	int buflen = 0;
	int filecount = 0;
	FFGET_FILE ffinf;	// Local static FFGET struct used if *f is  NULL
	FFGET_FILE *finf;	// Points to either *f or &ffinf
	FILE *outf;
	int outfo =0; 			// set if outfile was opened.
	FILE *inf = NULL;
	int output_filename_supplied = 0;
	int start_found = 0;

	if ((out_filename != NULL))
	{
		if ((out_filename[0] != '\0'))
		{
			output_filename_supplied = 1;
		}
	}

	bp = buf;

	if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: Starting.(input=%s,output=%s)\n", FL, input_filename,out_filename );


	// If no FFGET_FILE param is passed to us directly, then we must create out own.

	if (!f)
	{
		if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: NULL FFGET source stream given to us, create our own.\n",FL);

		// Setup the full source-data file path.
		snprintf(fullpath, sizeof(fullpath),"%s", input_filename );

		if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: Full INPUT file path set as '%s'\n", FL, fullpath);

		inf = fopen(fullpath,"r");
		if (!inf)
		{
			LOGGER_log("%s:%d:UUENCODE_decode_uu:ERROR: Cannot open file '%s' for reading (%s)", FL, fullpath, strerror(errno));
			uuencode_error = UUENCODE_STATUS_CANNOT_OPEN_FILE;
			return -1;
		}

		FFGET_setstream(&ffinf, inf);
		FFGET_set_watch_SDL( glb.doubleCR_mode );
		finf = &ffinf;

		if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: Creation done. [FFGET-FILE=%p, FILE=%p]\n", FL, finf, inf);
	} else {
		if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: File handle already exists to read from, using",FL);	
		finf = f;
	}

	writebuffer = malloc( UUENCODE_WRITE_BUFFER_SIZE *sizeof(unsigned char));
	if (!writebuffer)
	{
		LOGGER_log("%s:%d:UUENCODE_decode_uu:ERROR: cannot allocate 100K of memory for the write buffer",FL);
		uuencode_error = UUENCODE_STATUS_CANNOT_ALLOCATE_MEMORY;
		return -1;
	}
	else {
		wbpos = writebuffer;
		wbcount = 0;
	}


	if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: Beginning.(%s)\n",FL,fullpath);


	while (!FFGET_feof(finf))
	{
		filename_found = 0;


		// First lets locate the BEGIN line of this UUDECODE file

		//		if (output_filename_supplied == 0)

		if (1) /** 20041105-23H00:PLD: Stepan Kasal - UUbegin patch **/
		{

			while (FFGET_fgets(buf, sizeof(buf), finf))
			{

				if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: BUFFER: \n%s\n", FL, buf);

				// Check for the presence of 'BEGIN', but make sure it's not followed by a 
				//		colon ( which indicates a VCARD instead of UUENCODE

				if ((strncasecmp(buf,"begin",5)==0)&&(buf[5] !=':')&&(isspace((int)buf[5])))
				{
					if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: Located BEGIN\n",FL);
					// Okay, so the line contains begin at the start, now, lets get the decode details
					fp = fn = NULL;

					bp = PLD_strtok(&tx, buf, " \n\r\t"); // Get the begin

					if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: BEGIN = '%s'\n", FL, bp);
					if (bp) fp = PLD_strtok(&tx, NULL, " \n\r\t"); // Get the file-permissions

					if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: Permissions/Name = '%s'\n", FL, fp);
					if (fp) fn = PLD_strtok(&tx, NULL, "\n\r"); // Get the file-name

					if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: Name = '%s'\n", FL, fn);

					if (!fn)
					{
						bp = fp;
					}
					else bp = fn;

					if ((!bp)&&(!f))
					{
						LOGGER_log("%s:%d:UUENCODE_decode_uu:WARNING: unable to obtain filename from UUencoded text file header", FL);
						if (writebuffer) free(writebuffer);
						fclose(inf);
						uuencode_error = UUENCODE_STATUS_CANNOT_FIND_FILENAME;
						return -1;
					}

					if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: Full path = (%s)\n",FL,bp);

					filename_found = 1;
					break;
				} // If line starts with BEGIN

			} // While more lines in the INPUT file.

		}

		/** 20041105-23H02:PLD: Stepan Kasal Patch **/
		// Filename from header has precedence:
		if (output_filename_supplied != 0)
		{
			filename_found = 1;
			bp = out_filename;
			if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: Output filename set to '%s'",FL, bp);
		}




		// If we have a filename, and we have our bp as NON-null, then we shall commence
		//	to decode the UUencoded data from the stream.

		if ((filename_found != 0)&&(bp))
		{
			if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: Located filename (%s), now decoding.\n", FL, bp);

			// Clean up the file name
			FNFILTER_filter( bp, out_filename_size );

			// If our filename wasn't supplied via the params, then copy it over here
			if (output_filename_supplied == 0) snprintf( out_filename, out_filename_size, "%s", bp );


			// Create the new output full path

			snprintf(fullpath, sizeof(fullpath), "%s/%s", unpackdir, bp );
			if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: Filename = (%s)\n", FL, fullpath);

			outf = fopen(fullpath, "wb");
			if (!outf)
			{
				LOGGER_log("%s:%d:UUENCODE_decode_uu:ERROR: Cannot open file '%s' (%s)", FL, fullpath,strerror(errno));
				if (writebuffer) free(writebuffer);
				uuencode_error = UUENCODE_STATUS_CANNOT_OPEN_FILE;
				return -1;
			}
			else outfo = 1;

			// Allocate the write buffer.  By using the write buffer we gain an additional 10% in performance
			// due to the lack of function call (fwrite) overheads

			// Okay, now we have the UUDECODE data to decode...

			wbcount = 0;
			wbpos = writebuffer;

			while (outf)
			{

				// for each input line
				FFGET_fgets(buf, sizeof(buf), finf);
				if (UUENCODE_DPEDANTIC) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: Read line:\n%s",FL,buf);
				if (FFGET_feof(finf) != 0)
				{
					if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:WARNING: Short file (%s)\n",FL, fullpath);
					if (writebuffer != NULL) free(writebuffer);
					uuencode_error = UUENCODE_STATUS_SHORT_FILE;
					return -1;
				}

				// If we've reached the end of the UUencoding

				if (strncasecmp(buf,"end",3)==0)
				{
					if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: End of UUencoding detected\n",FL);
					break;
				}

				if ( !strpbrk(buf,"\r\n") )
				{
					LOGGER_log("%s:%d:UUENCODE_decode_uu:WARNING: Excessive length line\n",FL);
				}

				// The first char of the line indicates how many bytes are to be expected

				n = uudec[(int)*buf];


				// If the line is a -blank- then break out.

				if ((start_found == 0)&&((*buf == '\n')||(*buf == '\r'))) continue;
				else start_found =1 ;

				if ((start_found != 0)&&((n <= 0) || (*buf == '\n'))) break;

				// Calculate expected # of chars and pad if necessary

				expected = ((n+2)/3)<<2;
				buflen = strlen(buf) -1;
				for (i = buflen; i <= expected; i++) buf[i] = ' ';
				bp = &buf[1];

				// Decode input buffer to output file.

				while (n > 0)
				{
					// In order to reduce function call overheads, we've bought the UUDecoding
					// bit shifting routines into the UUDecode main decoding routines. This should
					// save us about 250,000 function calls per Mb.
					// UUENCODE_outdec(bp, outf, n);

					char c[3];
					int m = n;

					c[0] = uudec[(int)*bp] << 2 | uudec[(int)*(bp+1)] >> 4;
					c[1] = uudec[(int)*(bp+1)] << 4 | uudec[(int)*(bp+2)] >> 2;
					c[2] = uudec[(int)*(bp+2)] << 6 | uudec[(int)*(bp+3)];

					if (m > 3) m = 3;

					if ( wbcount >= UUENCODE_WRITE_BUFFER_LIMIT )
					{
						size_t bc;
						bc = fwrite(writebuffer, 1, wbcount, outf);
						if (bc != wbcount) {
							LOGGER_log("%s:%d:ERROR: Attempted to write %ld bytes, only wrote %ld\n", FL, wbcount, bc);
						}
						wbpos = writebuffer;
						wbcount = 0;
					}

					// Transfer the decoded data to the write buffer.
					// The reason why we use a loop, rather than just a set of if
					// statements is just for code-viewing simplicity.  It's a lot
					// easier to read than some nested chain of if's

					for (loop = 0; loop < m; loop++)
					{
						*wbpos = c[loop];
						wbpos++;
						wbcount++;
					}

					bp += 4;
					n -= 3;

				} // while (n > 0)

			} // While (1)

			if ((outfo)&&(wbcount > 0))
			{
				size_t bc;
				bc = fwrite(writebuffer, 1, wbcount, outf);
				if (bc != wbcount) {
					LOGGER_log("%s:%d:ERROR: Attempted to write %ld bytes, only wrote %ld\n", FL, wbcount, bc);
				}

			}


			if (outfo) fclose(outf);
			// Call our reporting function, else, if no function is defined, use the default
			//		standard call

			if ((UUENCODE_VERBOSE) && (output_filename_supplied == 0))
			{
				if (glb.filename_decoded_report == NULL)
				{
					LOGGER_log("Decoded: %s\n", fullpath);
				} else {
					glb.filename_decoded_report( fullpath, (glb.verbosity_contenttype>0?"uuencoded":NULL) );
				}
			}

			filecount++;

		} // If valid filename was found for UUdecode

		else
		{
			out_filename[0] = '\0';
			if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: No FILENAME was found in data...\n",FL);
		}

		if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: Segment completed\n",FL);

		// If this file was a result of the x-uuencode content encoding, then we need to exit out
		// as we're reading in the -stream-, and we dont want to carry on reading because we'll
		// end up just absorbing email data which we weren't supposed to.

		if ((f)&&( !decode_whole_file )) break;


	} // While !feof(inf)



	if (writebuffer) free(writebuffer);

	if (UUENCODE_DNORMAL) LOGGER_log("%s:%d:UUENCODE_decode_uu:DEBUG: Completed\n",FL);

	if (inf) fclose(inf);


	return filecount;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2960, %rsp           # imm = 0x2960
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl %r9d, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
leaq -0x440(%rbp), %rax
movq %rax, -0x448(%rbp)
leaq -0x870(%rbp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x2150
movq $0x0, -0x888(%rbp)
movl $0x0, -0x894(%rbp)
movl $0x0, -0x898(%rbp)
movl $0x0, -0x89c(%rbp)
movl $0x0, -0x8a0(%rbp)
movl $0x0, -0x2924(%rbp)
movq $0x0, -0x2930(%rbp)
movl $0x0, -0x2934(%rbp)
movl $0x0, -0x2938(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x13599
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x13597
movl $0x1, -0x2934(%rbp)
jmp 0x13599
leaq -0x440(%rbp), %rax
movq %rax, -0x448(%rbp)
cmpl $0x1, 0x227c2(%rip)     # 0x35d70
jl 0x135d2
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
leaq 0xbe1d(%rip), %rdi      # 0x1f3dc
leaq 0xbd20(%rip), %rsi      # 0x1f2e6
movl $0x189, %edx            # imm = 0x189
movb $0x0, %al
callq 0x117c0
cmpq $0x0, -0x10(%rbp)
jne 0x1371f
cmpl $0x1, 0x2278c(%rip)     # 0x35d70
jl 0x13600
leaq 0xbe2e(%rip), %rdi      # 0x1f41b
leaq 0xbcf2(%rip), %rsi      # 0x1f2e6
movl $0x190, %edx            # imm = 0x190
movb $0x0, %al
callq 0x117c0
leaq -0x870(%rbp), %rdi
movq -0x20(%rbp), %rcx
movl $0x400, %esi            # imm = 0x400
leaq 0xb993(%rip), %rdx      # 0x1efaa
movb $0x0, %al
callq 0x2130
cmpl $0x1, 0x2274b(%rip)     # 0x35d70
jl 0x13648
leaq -0x870(%rbp), %rcx
leaq 0xbe3d(%rip), %rdi      # 0x1f472
leaq 0xbcaa(%rip), %rsi      # 0x1f2e6
movl $0x195, %edx            # imm = 0x195
movb $0x0, %al
callq 0x117c0
leaq -0x870(%rbp), %rdi
leaq 0xa03e(%rip), %rsi      # 0x1d694
callq 0x2330
movq %rax, -0x2930(%rbp)
cmpq $0x0, -0x2930(%rbp)
jne 0x136c0
leaq -0x870(%rbp), %rax
movq %rax, -0x2958(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x23a0
movq -0x2958(%rbp), %rcx
movq %rax, %r8
leaq 0xbe1d(%rip), %rdi      # 0x1f4b4
leaq 0xbc48(%rip), %rsi      # 0x1f2e6
movl $0x19a, %edx            # imm = 0x19A
movb $0x0, %al
callq 0x117c0
movl $0x65, 0x226dc(%rip)    # 0x35d90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1420c
movq -0x2930(%rbp), %rsi
leaq -0x2910(%rbp), %rdi
callq 0x9760
movl 0x226a7(%rip), %edi     # 0x35d80
callq 0x9490
leaq -0x2910(%rbp), %rax
movq %rax, -0x2918(%rbp)
cmpl $0x1, 0x2267d(%rip)     # 0x35d70
jl 0x1371d
movq -0x2918(%rbp), %rcx
movq -0x2930(%rbp), %r8
leaq 0xbdf1(%rip), %rdi      # 0x1f4fb
leaq 0xbbd5(%rip), %rsi      # 0x1f2e6
movl $0x1a3, %edx            # imm = 0x1A3
movb $0x0, %al
callq 0x117c0
jmp 0x1374d
cmpl $0x1, 0x2264a(%rip)     # 0x35d70
jl 0x13742
leaq 0xbe15(%rip), %rdi      # 0x1f544
leaq 0xbbb0(%rip), %rsi      # 0x1f2e6
movl $0x1a5, %edx            # imm = 0x1A5
movb $0x0, %al
callq 0x117c0
movq -0x10(%rbp), %rax
movq %rax, -0x2918(%rbp)
movl $0x1000, %edi           # imm = 0x1000
callq 0x2290
movq %rax, -0x888(%rbp)
cmpq $0x0, -0x888(%rbp)
jne 0x13798
leaq 0xbe24(%rip), %rdi      # 0x1f593
leaq 0xbb70(%rip), %rsi      # 0x1f2e6
movl $0x1ac, %edx            # imm = 0x1AC
movb $0x0, %al
callq 0x117c0
movl $0x66, 0x22604(%rip)    # 0x35d90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1420c
movq -0x888(%rbp), %rax
movq %rax, -0x890(%rbp)
movl $0x0, -0x894(%rbp)
cmpl $0x1, 0x225b9(%rip)     # 0x35d70
jl 0x137da
leaq -0x870(%rbp), %rcx
leaq 0xbe20(%rip), %rdi      # 0x1f5e7
leaq 0xbb18(%rip), %rsi      # 0x1f2e6
movl $0x1b6, %edx            # imm = 0x1B6
movb $0x0, %al
callq 0x117c0
jmp 0x137dc
movq -0x2918(%rbp), %rdi
callq 0x98c0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x137f9
jmp 0x141b4
movl $0x0, -0x34(%rbp)
leaq -0x440(%rbp), %rdi
movq -0x2918(%rbp), %rdx
movl $0x400, %esi            # imm = 0x400
callq 0x9ab0
cmpq $0x0, %rax
je 0x13a8c
cmpl $0x1, 0x22547(%rip)     # 0x35d70
jl 0x1384c
leaq -0x440(%rbp), %rcx
leaq 0xbdde(%rip), %rdi      # 0x1f617
leaq 0xbaa6(%rip), %rsi      # 0x1f2e6
movl $0x1c8, %edx            # imm = 0x1C8
movb $0x0, %al
callq 0x117c0
leaq -0x440(%rbp), %rdi
leaq 0xba4b(%rip), %rsi      # 0x1f2a5
movl $0x5, %edx
callq 0x22a0
cmpl $0x0, %eax
jne 0x13a87
movsbl -0x43b(%rbp), %eax
cmpl $0x3a, %eax
je 0x13a87
callq 0x23c0
movq (%rax), %rax
movsbl -0x43b(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x13a87
cmpl $0x1, 0x224c8(%rip)     # 0x35d70
jl 0x138c4
leaq 0xbd93(%rip), %rdi      # 0x1f644
leaq 0xba2e(%rip), %rsi      # 0x1f2e6
movl $0x1cf, %edx            # imm = 0x1CF
movb $0x0, %al
callq 0x117c0
movq $0x0, -0x450(%rbp)
movq $0x0, -0x458(%rbp)
leaq -0x440(%rbp), %rsi
leaq -0x880(%rbp), %rdi
leaq 0x9b67(%rip), %rdx      # 0x1d456
callq 0x10a10
movq %rax, -0x448(%rbp)
cmpl $0x1, 0x2246e(%rip)     # 0x35d70
jl 0x13925
movq -0x448(%rbp), %rcx
leaq 0xbd61(%rip), %rdi      # 0x1f673
leaq 0xb9cd(%rip), %rsi      # 0x1f2e6
movl $0x1d5, %edx            # imm = 0x1D5
movb $0x0, %al
callq 0x117c0
cmpq $0x0, -0x448(%rbp)
je 0x1394d
leaq -0x880(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x9b15(%rip), %rdx      # 0x1d456
callq 0x10a10
movq %rax, -0x458(%rbp)
cmpl $0x1, 0x2241c(%rip)     # 0x35d70
jl 0x13977
movq -0x458(%rbp), %rcx
leaq 0xbd3d(%rip), %rdi      # 0x1f6a1
leaq 0xb97b(%rip), %rsi      # 0x1f2e6
movl $0x1d8, %edx            # imm = 0x1D8
movb $0x0, %al
callq 0x117c0
cmpq $0x0, -0x458(%rbp)
je 0x1399f
leaq -0x880(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xb334(%rip), %rdx      # 0x1ecc7
callq 0x10a10
movq %rax, -0x450(%rbp)
cmpl $0x1, 0x223ca(%rip)     # 0x35d70
jl 0x139c9
movq -0x450(%rbp), %rcx
leaq 0xbd24(%rip), %rdi      # 0x1f6da
leaq 0xb929(%rip), %rsi      # 0x1f2e6
movl $0x1db, %edx            # imm = 0x1DB
movb $0x0, %al
callq 0x117c0
cmpq $0x0, -0x450(%rbp)
jne 0x139e3
movq -0x458(%rbp), %rax
movq %rax, -0x448(%rbp)
jmp 0x139f1
movq -0x450(%rbp), %rax
movq %rax, -0x448(%rbp)
cmpq $0x0, -0x448(%rbp)
jne 0x13a54
cmpq $0x0, -0x10(%rbp)
jne 0x13a54
leaq 0xbcfe(%rip), %rdi      # 0x1f707
leaq 0xb8d6(%rip), %rsi      # 0x1f2e6
movl $0x1e5, %edx            # imm = 0x1E5
movb $0x0, %al
callq 0x117c0
cmpq $0x0, -0x888(%rbp)
je 0x13a32
movq -0x888(%rbp), %rdi
callq 0x2030
movq -0x2930(%rbp), %rdi
callq 0x20e0
movl $0x67, 0x22348(%rip)    # 0x35d90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1420c
cmpl $0x1, 0x22315(%rip)     # 0x35d70
jl 0x13a7e
movq -0x448(%rbp), %rcx
leaq 0xbcf8(%rip), %rdi      # 0x1f763
leaq 0xb874(%rip), %rsi      # 0x1f2e6
movl $0x1ec, %edx            # imm = 0x1EC
movb $0x0, %al
callq 0x117c0
movl $0x1, -0x34(%rbp)
jmp 0x13a8c
jmp 0x13800
cmpl $0x0, -0x2934(%rbp)
je 0x13ad3
movl $0x1, -0x34(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x448(%rbp)
cmpl $0x1, 0x222c2(%rip)     # 0x35d70
jl 0x13ad1
movq -0x448(%rbp), %rcx
leaq 0xbcd7(%rip), %rdi      # 0x1f795
leaq 0xb821(%rip), %rsi      # 0x1f2e6
movl $0x1fc, %edx            # imm = 0x1FC
movb $0x0, %al
callq 0x117c0
jmp 0x13ad3
cmpl $0x0, -0x34(%rbp)
je 0x14151
cmpq $0x0, -0x448(%rbp)
je 0x14151
cmpl $0x1, 0x2227e(%rip)     # 0x35d70
jl 0x13b15
movq -0x448(%rbp), %rcx
leaq 0xbccf(%rip), %rdi      # 0x1f7d1
leaq 0xb7dd(%rip), %rsi      # 0x1f2e6
movl $0x207, %edx            # imm = 0x207
movb $0x0, %al
callq 0x117c0
movq -0x448(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x144e0
cmpl $0x0, -0x2934(%rbp)
jne 0x13b4a
movq -0x28(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
movq -0x448(%rbp), %rcx
leaq 0xb467(%rip), %rdx      # 0x1efaa
movb $0x0, %al
callq 0x2130
leaq -0x870(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x448(%rbp), %r8
movl $0x400, %esi            # imm = 0x400
leaq 0x5994(%rip), %rdx      # 0x194fc
movb $0x0, %al
callq 0x2130
cmpl $0x1, 0x221fa(%rip)     # 0x35d70
jl 0x13b99
leaq -0x870(%rbp), %rcx
leaq 0xbc91(%rip), %rdi      # 0x1f817
leaq 0xb759(%rip), %rsi      # 0x1f2e6
movl $0x213, %edx            # imm = 0x213
movb $0x0, %al
callq 0x117c0
leaq -0x870(%rbp), %rdi
leaq 0xbca1(%rip), %rsi      # 0x1f848
callq 0x2330
movq %rax, -0x2920(%rbp)
cmpq $0x0, -0x2920(%rbp)
jne 0x13c27
leaq -0x870(%rbp), %rax
movq %rax, -0x2960(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x23a0
movq -0x2960(%rbp), %rcx
movq %rax, %r8
leaq 0xbc63(%rip), %rdi      # 0x1f84b
leaq 0xb6f7(%rip), %rsi      # 0x1f2e6
movl $0x218, %edx            # imm = 0x218
movb $0x0, %al
callq 0x117c0
cmpq $0x0, -0x888(%rbp)
je 0x13c11
movq -0x888(%rbp), %rdi
callq 0x2030
movl $0x65, 0x22175(%rip)    # 0x35d90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1420c
movl $0x1, -0x2924(%rbp)
movl $0x0, -0x894(%rbp)
movq -0x888(%rbp), %rax
movq %rax, -0x890(%rbp)
cmpq $0x0, -0x2920(%rbp)
je 0x1405a
leaq -0x440(%rbp), %rdi
movq -0x2918(%rbp), %rdx
movl $0x400, %esi            # imm = 0x400
callq 0x9ab0
cmpl $0xa, 0x220fa(%rip)     # 0x35d70
jl 0x13c99
leaq -0x440(%rbp), %rcx
leaq 0xbc00(%rip), %rdi      # 0x1f886
leaq 0xb659(%rip), %rsi      # 0x1f2e6
movl $0x22c, %edx            # imm = 0x22C
movb $0x0, %al
callq 0x117c0
movq -0x2918(%rbp), %rdi
callq 0x98c0
cmpl $0x0, %eax
je 0x13d00
cmpl $0x1, 0x220bf(%rip)     # 0x35d70
jl 0x13cd4
leaq -0x870(%rbp), %rcx
leaq 0xbbf3(%rip), %rdi      # 0x1f8b4
leaq 0xb61e(%rip), %rsi      # 0x1f2e6
movl $0x22f, %edx            # imm = 0x22F
movb $0x0, %al
callq 0x117c0
cmpq $0x0, -0x888(%rbp)
je 0x13cea
movq -0x888(%rbp), %rdi
callq 0x2030
movl $0x64, 0x2209c(%rip)    # 0x35d90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1420c
leaq -0x440(%rbp), %rdi
leaq 0xbbd9(%rip), %rsi      # 0x1f8e7
movl $0x3, %edx
callq 0x22a0
cmpl $0x0, %eax
jne 0x13d45
cmpl $0x1, 0x2204c(%rip)     # 0x35d70
jl 0x13d40
leaq 0xbbbe(%rip), %rdi      # 0x1f8eb
leaq 0xb5b2(%rip), %rsi      # 0x1f2e6
movl $0x239, %edx            # imm = 0x239
movb $0x0, %al
callq 0x117c0
jmp 0x1405a
leaq -0x440(%rbp), %rdi
leaq 0x84e1(%rip), %rsi      # 0x1c234
callq 0x22e0
cmpq $0x0, %rax
jne 0x13d78
leaq 0xbbc2(%rip), %rdi      # 0x1f927
leaq 0xb57a(%rip), %rsi      # 0x1f2e6
movl $0x23f, %edx            # imm = 0x23F
movb $0x0, %al
callq 0x117c0
movsbl -0x440(%rbp), %eax
movslq %eax, %rcx
leaq 0x13427(%rip), %rax     # 0x271b0
movzbl (%rax,%rcx), %eax
movl %eax, -0x45c(%rbp)
cmpl $0x0, -0x2938(%rbp)
jne 0x13db9
movsbl -0x440(%rbp), %eax
cmpl $0xa, %eax
je 0x13db4
movsbl -0x440(%rbp), %eax
cmpl $0xd, %eax
jne 0x13db9
jmp 0x13c49
movl $0x1, -0x2938(%rbp)
cmpl $0x0, -0x2938(%rbp)
je 0x13de6
cmpl $0x0, -0x45c(%rbp)
jle 0x13de1
movsbl -0x440(%rbp), %eax
cmpl $0xa, %eax
jne 0x13de6
jmp 0x1405a
movl -0x45c(%rbp), %eax
addl $0x2, %eax
movl $0x3, %ecx
cltd
idivl %ecx
shll $0x2, %eax
movl %eax, -0x464(%rbp)
leaq -0x440(%rbp), %rdi
callq 0x2100
subq $0x1, %rax
movl %eax, -0x89c(%rbp)
movl -0x89c(%rbp), %eax
movl %eax, -0x460(%rbp)
movl -0x460(%rbp), %eax
cmpl -0x464(%rbp), %eax
jg 0x13e50
movslq -0x460(%rbp), %rax
movb $0x20, -0x440(%rbp,%rax)
movl -0x460(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x460(%rbp)
jmp 0x13e22
leaq -0x440(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x448(%rbp)
cmpl $0x0, -0x45c(%rbp)
jle 0x14055
movl -0x45c(%rbp), %eax
movl %eax, -0x2940(%rbp)
movq -0x448(%rbp), %rax
movsbl (%rax), %eax
movslq %eax, %rcx
leaq 0x13321(%rip), %rax     # 0x271b0
movzbl (%rax,%rcx), %eax
shll $0x2, %eax
movq -0x448(%rbp), %rcx
movsbl 0x1(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x13305(%rip), %rcx     # 0x271b0
movzbl (%rcx,%rdx), %ecx
sarl $0x4, %ecx
orl %ecx, %eax
movb %al, -0x293b(%rbp)
movq -0x448(%rbp), %rax
movsbl 0x1(%rax), %eax
movslq %eax, %rcx
leaq 0x132e1(%rip), %rax     # 0x271b0
movzbl (%rax,%rcx), %eax
shll $0x4, %eax
movq -0x448(%rbp), %rcx
movsbl 0x2(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x132c5(%rip), %rcx     # 0x271b0
movzbl (%rcx,%rdx), %ecx
sarl $0x2, %ecx
orl %ecx, %eax
movb %al, -0x293a(%rbp)
movq -0x448(%rbp), %rax
movsbl 0x2(%rax), %eax
movslq %eax, %rcx
leaq 0x132a1(%rip), %rax     # 0x271b0
movzbl (%rax,%rcx), %eax
shll $0x6, %eax
movq -0x448(%rbp), %rcx
movsbl 0x3(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x13285(%rip), %rcx     # 0x271b0
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movb %al, -0x2939(%rbp)
cmpl $0x3, -0x2940(%rbp)
jle 0x13f4a
movl $0x3, -0x2940(%rbp)
cmpl $0xfa0, -0x894(%rbp)    # imm = 0xFA0
jl 0x13fce
movq -0x888(%rbp), %rdi
movslq -0x894(%rbp), %rdx
movq -0x2920(%rbp), %rcx
movl $0x1, %esi
callq 0x2380
movq %rax, -0x2948(%rbp)
movq -0x2948(%rbp), %rax
movslq -0x894(%rbp), %rcx
cmpq %rcx, %rax
je 0x13fb6
movl -0x894(%rbp), %ecx
movq -0x2948(%rbp), %r8
leaq 0xb9bd(%rip), %rdi      # 0x1f960
leaq 0xb33c(%rip), %rsi      # 0x1f2e6
movl $0x26c, %edx            # imm = 0x26C
movb $0x0, %al
callq 0x117c0
movq -0x888(%rbp), %rax
movq %rax, -0x890(%rbp)
movl $0x0, -0x894(%rbp)
movl $0x0, -0x898(%rbp)
movl -0x898(%rbp), %eax
cmpl -0x2940(%rbp), %eax
jge 0x1402f
movslq -0x898(%rbp), %rax
movb -0x293b(%rbp,%rax), %cl
movq -0x890(%rbp), %rax
movb %cl, (%rax)
movq -0x890(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x890(%rbp)
movl -0x894(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x894(%rbp)
movl -0x898(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x898(%rbp)
jmp 0x13fd8
movq -0x448(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x448(%rbp)
movl -0x45c(%rbp), %eax
subl $0x3, %eax
movl %eax, -0x45c(%rbp)
jmp 0x13e62
jmp 0x13c49
cmpl $0x0, -0x2924(%rbp)
je 0x140ce
cmpl $0x0, -0x894(%rbp)
jle 0x140ce
movq -0x888(%rbp), %rdi
movslq -0x894(%rbp), %rdx
movq -0x2920(%rbp), %rcx
movl $0x1, %esi
callq 0x2380
movq %rax, -0x2950(%rbp)
movq -0x2950(%rbp), %rax
movslq -0x894(%rbp), %rcx
cmpq %rcx, %rax
je 0x140cc
movl -0x894(%rbp), %ecx
movq -0x2950(%rbp), %r8
leaq 0xb8a7(%rip), %rdi      # 0x1f960
leaq 0xb226(%rip), %rsi      # 0x1f2e6
movl $0x28a, %edx            # imm = 0x28A
movb $0x0, %al
callq 0x117c0
jmp 0x140ce
cmpl $0x0, -0x2924(%rbp)
je 0x140e3
movq -0x2920(%rbp), %rdi
callq 0x20e0
cmpl $0x0, 0x21c8a(%rip)     # 0x35d74
jle 0x14140
cmpl $0x0, -0x2934(%rbp)
jne 0x14140
cmpq $0x0, 0x21c8b(%rip)     # 0x35d88
jne 0x14116
leaq -0x870(%rbp), %rsi
leaq 0xb88e(%rip), %rdi      # 0x1f99b
movb $0x0, %al
callq 0x117c0
jmp 0x1413e
movq 0x21c6b(%rip), %rax     # 0x35d88
leaq -0x870(%rbp), %rdi
movl 0x21c4e(%rip), %edx     # 0x35d78
xorl %ecx, %ecx
movl %ecx, %esi
leaq 0xb873(%rip), %rcx      # 0x1f9a8
cmpl $0x0, %edx
cmovgq %rcx, %rsi
callq *%rax
jmp 0x14140
movl -0x8a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8a0(%rbp)
jmp 0x1417d
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
cmpl $0x1, 0x21c11(%rip)     # 0x35d70
jl 0x1417b
leaq 0xb84a(%rip), %rdi      # 0x1f9b2
leaq 0xb177(%rip), %rsi      # 0x1f2e6
movl $0x2a5, %edx            # imm = 0x2A5
movb $0x0, %al
callq 0x117c0
jmp 0x1417d
cmpl $0x1, 0x21bec(%rip)     # 0x35d70
jl 0x141a0
leaq 0xb867(%rip), %rdi      # 0x1f9f4
leaq 0xb152(%rip), %rsi      # 0x1f2e6
movl $0x2a8, %edx            # imm = 0x2A8
movb $0x0, %al
callq 0x117c0
cmpq $0x0, -0x10(%rbp)
je 0x141af
cmpl $0x0, -0x30(%rbp)
jne 0x141af
jmp 0x141b4
jmp 0x137dc
cmpq $0x0, -0x888(%rbp)
je 0x141ca
movq -0x888(%rbp), %rdi
callq 0x2030
cmpl $0x1, 0x21b9f(%rip)     # 0x35d70
jl 0x141ed
leaq 0xb84d(%rip), %rdi      # 0x1fa27
leaq 0xb105(%rip), %rsi      # 0x1f2e6
movl $0x2b7, %edx            # imm = 0x2B7
movb $0x0, %al
callq 0x117c0
cmpq $0x0, -0x2930(%rbp)
je 0x14203
movq -0x2930(%rbp), %rdi
callq 0x20e0
movl -0x8a0(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x2960, %rsp           # imm = 0x2960
popq %rbp
retq
nopl (%rax,%rax)