// File: rpavlik[P]edid-decode/parse-base-block.cpp
// Function: edid_state::parse_base_block(unsigned char const*)
void edid_state::parse_base_block(const unsigned char *x)
{
	time_t the_time;
	struct tm *ptm;
	int analog;
	unsigned col_x, col_y;
	bool has_preferred_timing = false;

	data_block = "EDID Structure Version & Revision";
	printf("  %s: %hhu.%hhu\n", data_block.c_str(), x[0x12], x[0x13]);
	if (x[0x12] == 1) {
		base.edid_minor = x[0x13];
		if (base.edid_minor > 4)
			warn("Unknown EDID minor version %u, assuming 1.4 conformance.\n", base.edid_minor);
		if (base.edid_minor < 3)
			warn("EDID 1.%u is deprecated, do not use.\n", base.edid_minor);
	} else {
		fail("Unknown EDID major version.\n");
	}

	data_block = "Vendor & Product Identification";
	printf("  %s:\n", data_block.c_str());
	printf("    Manufacturer: %s\n    Model: %u\n",
	       manufacturer_name(x + 0x08),
	       (unsigned short)(x[0x0a] + (x[0x0b] << 8)));
	base.has_serial_number = x[0x0c] || x[0x0d] || x[0x0e] || x[0x0f];
	if (base.has_serial_number) {
		if (hide_serial_numbers)
			printf("    Serial Number: ...\n");
		else
			printf("    Serial Number: %u\n",
			       (unsigned)(x[0x0c] + (x[0x0d] << 8) +
					  (x[0x0e] << 16) + (x[0x0f] << 24)));
	}

	time(&the_time);
	ptm = localtime(&the_time);

	unsigned char week = x[0x10];
	int year = 1990 + x[0x11];

	if (week) {
		if (base.edid_minor <= 3 && week == 0xff)
			fail("EDID 1.3 does not support week 0xff.\n");
		// The max week is 53 in EDID 1.3 and 54 in EDID 1.4.
		// No idea why there is a difference.
		if (base.edid_minor <= 3 && week == 54)
			fail("EDID 1.3 does not support week 54.\n");
		if (week != 0xff && week > 54)
			fail("Invalid week %u of manufacture.\n", week);
		if (week != 0xff)
			printf("    Made in: week %hhu of %d\n", week, year);
	}
	if (week == 0xff)
		printf("    Model year: %d\n", year);
	else if (!week)
		printf("    Made in: %d\n", year);
	if (year - 1 > ptm->tm_year + 1900)
		fail("The year %d is more than one year in the future.\n", year);

	/* display section */

	data_block = "Basic Display Parameters & Features";
	printf("  %s:\n", data_block.c_str());
	if (x[0x14] & 0x80) {
		analog = 0;
		printf("    Digital display\n");
		if (base.edid_minor >= 4) {
			if ((x[0x14] & 0x70) == 0x00)
				printf("    Color depth is undefined\n");
			else if ((x[0x14] & 0x70) == 0x70)
				fail("Color Bit Depth set to reserved value.\n");
			else
				printf("    Bits per primary color channel: %u\n",
				       ((x[0x14] & 0x70) >> 3) + 4);

			printf("    ");
			switch (x[0x14] & 0x0f) {
			case 0x00: printf("Digital interface is not defined\n"); break;
			case 0x01: printf("DVI interface\n"); break;
			case 0x02: printf("HDMI-a interface\n"); break;
			case 0x03: printf("HDMI-b interface\n"); break;
			case 0x04: printf("MDDI interface\n"); break;
			case 0x05: printf("DisplayPort interface\n"); break;
			default:
				   printf("Unknown interface: 0x%02x\n", x[0x14] & 0x0f);
				   fail("Digital Video Interface Standard set to reserved value 0x%02x.\n", x[0x14] & 0x0f);
				   break;
			}
		} else if (base.edid_minor >= 2) {
			if (x[0x14] & 0x01) {
				printf("    DFP 1.x compatible TMDS\n");
			}
			if (x[0x14] & 0x7e)
				fail("Digital Video Interface Standard set to reserved value 0x%02x.\n", x[0x14] & 0x7e);
		} else if (x[0x14] & 0x7f) {
			fail("Digital Video Interface Standard set to reserved value 0x%02x.\n", x[0x14] & 0x7f);
		}
	} else {
		unsigned voltage = (x[0x14] & 0x60) >> 5;
		unsigned sync = (x[0x14] & 0x0f);

		analog = 1;
		printf("    Analog display\n");
		printf("    Input voltage level: %s V\n",
		       voltage == 3 ? "0.7/0.7" :
		       voltage == 2 ? "1.0/0.4" :
		       voltage == 1 ? "0.714/0.286" :
		       "0.7/0.3");

		if (x[0x14] & 0x10)
			printf("    Blank-to-black setup/pedestal\n");
		else
			printf("    Blank level equals black level\n");

		if (sync)
			printf("    Sync:%s%s%s%s\n",
			       sync & 0x08 ? " Separate" : "",
			       sync & 0x04 ? " Composite" : "",
			       sync & 0x02 ? " SyncOnGreen" : "",
			       sync & 0x01 ? " Serration" : "");
	}

	if (x[0x15] && x[0x16]) {
		printf("    Maximum image size: %u cm x %u cm\n", x[0x15], x[0x16]);
		base.max_display_width_mm = x[0x15] * 10;
		base.max_display_height_mm = x[0x16] * 10;
		if (x[0x15] < 10 || x[0x16] < 10)
			warn("Dubious maximum image size (%ux%u is smaller than 10x10 cm).\n",
			     x[0x15], x[0x16]);
	}
	else if (base.edid_minor >= 4 && (x[0x15] || x[0x16])) {
		if (x[0x15])
			printf("    Aspect ratio: %.2f (landscape)\n", (x[0x15] + 99) / 100.0);
		else
			printf("    Aspect ratio: %.2f (portrait)\n", 100.0 / (x[0x16] + 99));
	} else {
		/* Either or both can be zero for 1.3 and before */
		printf("    Image size is variable\n");
	}

	if (x[0x17] == 0xff)
		printf("    Gamma is defined in an extension block\n");
	else
		printf("    Gamma: %.2f\n", ((x[0x17] + 100.0) / 100.0));

	if (x[0x18] & 0xe0) {
		printf("    DPMS levels:");
		if (x[0x18] & 0x80) printf(" Standby");
		if (x[0x18] & 0x40) printf(" Suspend");
		if (x[0x18] & 0x20) printf(" Off");
		printf("\n");
	}

	if (analog || base.edid_minor < 4) {
		printf("    ");
		switch (x[0x18] & 0x18) {
		case 0x00: printf("Monochrome or grayscale display\n"); break;
		case 0x08: printf("RGB color display\n"); break;
		case 0x10: printf("Non-RGB color display\n"); break;
		case 0x18: printf("Undefined display color type\n");
		}
	} else {
		printf("    Supported color formats: RGB 4:4:4");
		if (x[0x18] & 0x08)
			printf(", YCrCb 4:4:4");
		if (x[0x18] & 0x10)
			printf(", YCrCb 4:2:2");
		printf("\n");
	}

	if (x[0x18] & 0x04) {
		/*
		 * The sRGB chromaticities are (x, y):
		 * red:   0.640,  0.330
		 * green: 0.300,  0.600
		 * blue:  0.150,  0.060
		 * white: 0.3127, 0.3290
		 */
		static const unsigned char srgb_chromaticity[10] = {
			0xee, 0x91, 0xa3, 0x54, 0x4c, 0x99, 0x26, 0x0f, 0x50, 0x54
		};
		printf("    Default (sRGB) color space is primary color space\n");
		if (memcmp(x + 0x19, srgb_chromaticity, sizeof(srgb_chromaticity)))
			fail("sRGB is signaled, but the chromaticities do not match.\n");
	}
	if (base.edid_minor >= 4) {
		/* 1.4 always has a preferred timing and this bit means something else. */
		has_preferred_timing = true;
		base.preferred_is_also_native = x[0x18] & 0x02;
		printf("    First detailed timing %s the native pixel format and preferred refresh rate\n",
		       base.preferred_is_also_native ? "includes" : "does not include");
	} else {
		if (x[0x18] & 0x02) {
			printf("    First detailed timing is the preferred timing\n");
			has_preferred_timing = true;
			// 1.3 recommends that the preferred timing corresponds to the
			// native timing, but it is not a requirement.
			// That said, we continue with the assumption that it actually
			// is the native timing.
			base.preferred_is_also_native = true;
		} else if (base.edid_minor == 3) {
			fail("EDID 1.3 requires that the first detailed timing is the preferred timing.\n");
		}
	}

	if (x[0x18] & 0x01) {
		if (base.edid_minor >= 4) {
			base.supports_continuous_freq = true;
			printf("    Display is continuous frequency\n");
		} else {
			printf("    Supports GTF timings within operating range\n");
			base.supports_gtf = true;
		}
	}

	data_block = "Color Characteristics";
	printf("  %s:\n", data_block.c_str());
	col_x = (x[0x1b] << 2) | (x[0x19] >> 6);
	col_y = (x[0x1c] << 2) | ((x[0x19] >> 4) & 3);
	printf("    Red  : 0.%04u, 0.%04u\n",
	       (col_x * 10000) / 1024, (col_y * 10000) / 1024);
	col_x = (x[0x1d] << 2) | ((x[0x19] >> 2) & 3);
	col_y = (x[0x1e] << 2) | (x[0x19] & 3);
	printf("    Green: 0.%04u, 0.%04u\n",
	       (col_x * 10000) / 1024, (col_y * 10000) / 1024);
	col_x = (x[0x1f] << 2) | (x[0x1a] >> 6);
	col_y = (x[0x20] << 2) | ((x[0x1a] >> 4) & 3);
	printf("    Blue : 0.%04u, 0.%04u\n",
	       (col_x * 10000) / 1024, (col_y * 10000) / 1024);
	col_x = (x[0x21] << 2) | ((x[0x1a] >> 2) & 3);
	col_y = (x[0x22] << 2) | (x[0x1a] & 3);
	printf("    White: 0.%04u, 0.%04u\n",
	       (col_x * 10000) / 1024, (col_y * 10000) / 1024);

	data_block = "Established Timings I & II";
	if (x[0x23] || x[0x24] || x[0x25]) {
		printf("  %s:\n", data_block.c_str());
		for (unsigned i = 0; i < ARRAY_SIZE(established_timings12); i++) {
			if (x[0x23 + i / 8] & (1 << (7 - i % 8))) {
				unsigned char dmt_id = established_timings12[i].dmt_id;
				const struct timings *t;
				char type[16];

				if (dmt_id) {
					sprintf(type, "DMT 0x%02x", dmt_id);
					t = find_dmt_id(dmt_id);
				} else {
					t = &established_timings12[i].t;
					sprintf(type, "%-8s", established_timings12[i].type);
				}
				print_timings("    ", t, type);
			}
		}
	} else {
		printf("  %s: none\n", data_block.c_str());
	}
	base.has_640x480p60_est_timing = x[0x23] & 0x20;

	/*
	 * Need to find the Display Range Limit info before reading
	 * the standard timings.
	 */
	preparse_detailed_block(x + 0x36);
	preparse_detailed_block(x + 0x48);
	preparse_detailed_block(x + 0x5a);
	preparse_detailed_block(x + 0x6c);

	data_block = "Standard Timings";
	bool found = false;
	for (unsigned i = 0; i < 8; i++) {
		if (x[0x26 + i * 2] != 0x01 || x[0x26 + i * 2 + 1] != 0x01) {
			found = true;
			break;
		}
	}
	if (found) {
		printf("  %s:\n", data_block.c_str());
		for (unsigned i = 0; i < 8; i++)
			print_standard_timing("    ", x[0x26 + i * 2], x[0x26 + i * 2 + 1]);
	} else {
		printf("  %s: none\n", data_block.c_str());
	}

	/* 18 byte descriptors */
	if (has_preferred_timing && !x[0x36] && !x[0x37])
		fail("Missing preferred timing.\n");

	/* Look for SPWG Noteboook Panel EDID data blocks */
	if ((x[0x36] || x[0x37]) &&
	    (x[0x48] || x[0x49]) &&
	    !x[0x5a] && !x[0x5b] && x[0x5d] == 0xfe &&
	    !x[0x6c] && !x[0x6d] && x[0x6f] == 0xfe &&
	    (x[0x79] == 1 || x[0x79] == 2) && x[0x7a] <= 1)
		base.has_spwg = true;

	for (unsigned i = 0; i < (base.has_spwg ? 2 : 4); i++)
		if (x[0x36 + i * 18] || x[0x37 + i * 18])
			cta.preparsed_total_dtds++;

	data_block = "Detailed Timing Descriptors";
	printf("  %s:\n", data_block.c_str());
	detailed_block(x + 0x36);
	detailed_block(x + 0x48);
	detailed_block(x + 0x5a);
	detailed_block(x + 0x6c);
	base.has_spwg = false;
	if (!base.preferred_is_also_native) {
		cta.native_timings.clear();
		base.preferred_timing = timings_ext();
	}

	data_block = block;
	if (x[0x7e])
		printf("  Extension blocks: %u\n", x[0x7e]);
	if (x[0x7e] + 1U != num_blocks)
		fail("EDID specified %u extension block(s), but found %u extension block(s).\n",
		     x[0x7e], num_blocks - 1);

	block = block_name(0x00);
	data_block.clear();
	do_checksum("", x, EDID_PAGE_SIZE);
	if (base.edid_minor >= 3) {
		if (!base.has_name_descriptor)
			fail("Missing Display Product Name.\n");
		if ((base.edid_minor == 3 || base.supports_continuous_freq) &&
		    !base.has_display_range_descriptor)
			fail("Missing Display Range Limits Descriptor.\n");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x130(%rbp)
movb $0x0, -0x2d(%rbp)
addq $0x30, %rdi
leaq 0x21f19(%rip), %rsi     # 0x34d16
callq 0x4420
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
callq 0x4150
movq %rax, %rsi
movq -0x10(%rbp), %rax
movzbl 0x12(%rax), %edx
movq -0x10(%rbp), %rax
movzbl 0x13(%rax), %ecx
leaq 0x21f0c(%rip), %rdi     # 0x34d38
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x12(%rax), %eax
cmpl $0x1, %eax
jne 0x12eb0
movq -0x130(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl 0x13(%rcx), %ecx
movl %ecx, 0x88(%rax)
cmpl $0x4, 0x88(%rax)
jbe 0x12e7e
movq -0x130(%rbp), %rax
movl 0x88(%rax), %edx
movl $0x1, %edi
leaq 0x21ed2(%rip), %rsi     # 0x34d49
movb $0x0, %al
callq 0x47d0
movq -0x130(%rbp), %rax
cmpl $0x3, 0x88(%rax)
jae 0x12eae
movq -0x130(%rbp), %rax
movl 0x88(%rax), %edx
movl $0x1, %edi
leaq 0x21edc(%rip), %rsi     # 0x34d83
movb $0x0, %al
callq 0x47d0
jmp 0x12ec0
xorl %edi, %edi
leaq 0x21ef0(%rip), %rsi     # 0x34da9
movb $0x0, %al
callq 0x47d0
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
leaq 0x21ef4(%rip), %rsi     # 0x34dc6
callq 0x4420
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
callq 0x4150
movq %rax, %rsi
leaq 0x21200(%rip), %rdi     # 0x340f1
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x14140
movq %rax, %rsi
movq -0x10(%rbp), %rax
movzbl 0xa(%rax), %eax
movq -0x10(%rbp), %rcx
movzbl 0xb(%rcx), %ecx
shll $0x8, %ecx
addl %ecx, %eax
movzwl %ax, %edx
leaq 0x21ebf(%rip), %rdi     # 0x34de6
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rcx
movb $0x1, %al
cmpb $0x0, 0xc(%rcx)
movb %al, -0x131(%rbp)
jne 0x12f75
movq -0x10(%rbp), %rcx
movb $0x1, %al
cmpb $0x0, 0xd(%rcx)
movb %al, -0x131(%rbp)
jne 0x12f75
movq -0x10(%rbp), %rcx
movb $0x1, %al
cmpb $0x0, 0xe(%rcx)
movb %al, -0x131(%rbp)
jne 0x12f75
movq -0x10(%rbp), %rax
cmpb $0x0, 0xf(%rax)
setne %al
movb %al, -0x131(%rbp)
movq -0x130(%rbp), %rax
movb -0x131(%rbp), %cl
andb $0x1, %cl
movb %cl, 0x8e(%rax)
testb $0x1, 0x8e(%rax)
je 0x12ff0
movq -0x130(%rbp), %rax
testb $0x1, 0x52(%rax)
je 0x12fb1
leaq 0x21e62(%rip), %rdi     # 0x34e0a
movb $0x0, %al
callq 0x4050
jmp 0x12fee
movq -0x10(%rbp), %rax
movzbl 0xc(%rax), %esi
movq -0x10(%rbp), %rax
movzbl 0xd(%rax), %eax
shll $0x8, %eax
addl %eax, %esi
movq -0x10(%rbp), %rax
movzbl 0xe(%rax), %eax
shll $0x10, %eax
addl %eax, %esi
movq -0x10(%rbp), %rax
movzbl 0xf(%rax), %eax
shll $0x18, %eax
addl %eax, %esi
leaq 0x21e3b(%rip), %rdi     # 0x34e22
movb $0x0, %al
callq 0x4050
jmp 0x12ff0
leaq -0x18(%rbp), %rdi
callq 0x42e0
leaq -0x18(%rbp), %rdi
callq 0x4240
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movb 0x10(%rax), %al
movb %al, -0x2e(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x11(%rax), %eax
addl $0x7c6, %eax            # imm = 0x7C6
movl %eax, -0x34(%rbp)
cmpb $0x0, -0x2e(%rbp)
je 0x130c8
movq -0x130(%rbp), %rax
cmpl $0x3, 0x88(%rax)
ja 0x13055
movzbl -0x2e(%rbp), %eax
cmpl $0xff, %eax
jne 0x13055
xorl %edi, %edi
leaq 0x21deb(%rip), %rsi     # 0x34e39
movb $0x0, %al
callq 0x47d0
movq -0x130(%rbp), %rax
cmpl $0x3, 0x88(%rax)
ja 0x1307e
movzbl -0x2e(%rbp), %eax
cmpl $0x36, %eax
jne 0x1307e
xorl %edi, %edi
leaq 0x21de8(%rip), %rsi     # 0x34e5f
movb $0x0, %al
callq 0x47d0
movzbl -0x2e(%rbp), %eax
cmpl $0xff, %eax
je 0x130a6
movzbl -0x2e(%rbp), %eax
cmpl $0x36, %eax
jle 0x130a6
movzbl -0x2e(%rbp), %edx
xorl %edi, %edi
leaq 0x21de4(%rip), %rsi     # 0x34e83
movb $0x0, %al
callq 0x47d0
movzbl -0x2e(%rbp), %eax
cmpl $0xff, %eax
je 0x130c6
movzbl -0x2e(%rbp), %esi
movl -0x34(%rbp), %edx
leaq 0x21de5(%rip), %rdi     # 0x34ea4
movb $0x0, %al
callq 0x4050
jmp 0x130c8
movzbl -0x2e(%rbp), %eax
cmpl $0xff, %eax
jne 0x130e6
movl -0x34(%rbp), %esi
leaq 0x21de5(%rip), %rdi     # 0x34ec2
movb $0x0, %al
callq 0x4050
jmp 0x130ff
cmpb $0x0, -0x2e(%rbp)
jne 0x130fd
movl -0x34(%rbp), %esi
leaq 0x21de0(%rip), %rdi     # 0x34ed6
movb $0x0, %al
callq 0x4050
jmp 0x130ff
movl -0x34(%rbp), %eax
subl $0x1, %eax
movq -0x20(%rbp), %rcx
movl 0x14(%rcx), %ecx
addl $0x76c, %ecx            # imm = 0x76C
cmpl %ecx, %eax
jle 0x13129
movl -0x34(%rbp), %edx
xorl %edi, %edi
leaq 0x21dc5(%rip), %rsi     # 0x34ee7
movb $0x0, %al
callq 0x47d0
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
leaq 0x21dde(%rip), %rsi     # 0x34f19
callq 0x4420
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
callq 0x4150
movq %rax, %rsi
leaq 0x20f97(%rip), %rdi     # 0x340f1
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x1336c
movl $0x0, -0x24(%rbp)
leaq 0x21db8(%rip), %rdi     # 0x34f3d
movb $0x0, %al
callq 0x4050
movq -0x130(%rbp), %rax
cmpl $0x4, 0x88(%rax)
jb 0x132dd
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %eax
andl $0x70, %eax
cmpl $0x0, %eax
jne 0x131c0
leaq 0x21d9b(%rip), %rdi     # 0x34f52
movb $0x0, %al
callq 0x4050
jmp 0x13203
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %eax
andl $0x70, %eax
cmpl $0x70, %eax
jne 0x131e2
xorl %edi, %edi
leaq 0x21d97(%rip), %rsi     # 0x34f70
movb $0x0, %al
callq 0x47d0
jmp 0x13201
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %esi
andl $0x70, %esi
sarl $0x3, %esi
addl $0x4, %esi
leaq 0x21d9e(%rip), %rdi     # 0x34f98
movb $0x0, %al
callq 0x4050
jmp 0x13203
leaq 0x215d5(%rip), %rdi     # 0x347df
xorl %eax, %eax
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %eax
andl $0xf, %eax
movl %eax, %ecx
movq %rcx, -0x140(%rbp)
subl $0x5, %eax
ja 0x132a4
movq -0x140(%rbp), %rax
leaq 0x1e47c(%rip), %rcx     # 0x316b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x21d78(%rip), %rdi     # 0x34fc0
movb $0x0, %al
callq 0x4050
jmp 0x132d8
leaq 0x21d87(%rip), %rdi     # 0x34fe2
movb $0x0, %al
callq 0x4050
jmp 0x132d8
leaq 0x21d86(%rip), %rdi     # 0x34ff1
movb $0x0, %al
callq 0x4050
jmp 0x132d8
leaq 0x21d88(%rip), %rdi     # 0x35003
movb $0x0, %al
callq 0x4050
jmp 0x132d8
leaq 0x21d8a(%rip), %rdi     # 0x35015
movb $0x0, %al
callq 0x4050
jmp 0x132d8
leaq 0x21d8a(%rip), %rdi     # 0x35025
movb $0x0, %al
callq 0x4050
jmp 0x132d8
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %esi
andl $0xf, %esi
leaq 0x21d86(%rip), %rdi     # 0x3503c
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %edx
andl $0xf, %edx
xorl %edi, %edi
leaq 0x21d86(%rip), %rsi     # 0x35057
movb $0x0, %al
callq 0x47d0
jmp 0x13367
movq -0x130(%rbp), %rax
cmpl $0x2, 0x88(%rax)
jb 0x13338
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1330b
leaq 0x21d93(%rip), %rdi     # 0x35097
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %eax
andl $0x7e, %eax
cmpl $0x0, %eax
je 0x13336
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %edx
andl $0x7e, %edx
xorl %edi, %edi
leaq 0x21d28(%rip), %rsi     # 0x35057
movb $0x0, %al
callq 0x47d0
jmp 0x13365
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %eax
andl $0x7f, %eax
cmpl $0x0, %eax
je 0x13363
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %edx
andl $0x7f, %edx
xorl %edi, %edi
leaq 0x21cfb(%rip), %rsi     # 0x35057
movb $0x0, %al
callq 0x47d0
jmp 0x13365
jmp 0x13367
jmp 0x134be
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %eax
andl $0x60, %eax
sarl $0x5, %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %eax
andl $0xf, %eax
movl %eax, -0x3c(%rbp)
movl $0x1, -0x24(%rbp)
leaq 0x21d1b(%rip), %rdi     # 0x350b4
movb $0x0, %al
callq 0x4050
cmpl $0x3, -0x38(%rbp)
jne 0x133b6
leaq 0x21d3a(%rip), %rax     # 0x350e7
movq %rax, -0x148(%rbp)
jmp 0x133f9
cmpl $0x2, -0x38(%rbp)
jne 0x133cc
leaq 0x21d2c(%rip), %rax     # 0x350ef
movq %rax, -0x150(%rbp)
jmp 0x133eb
movl -0x38(%rbp), %edx
leaq 0x21d2d(%rip), %rax     # 0x35103
leaq 0x21d1a(%rip), %rcx     # 0x350f7
cmpl $0x1, %edx
cmoveq %rcx, %rax
movq %rax, -0x150(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rsi
leaq 0x21cc1(%rip), %rdi     # 0x350c8
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x14(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x1342e
leaq 0x21ce6(%rip), %rdi     # 0x3510b
movb $0x0, %al
callq 0x4050
jmp 0x1343c
leaq 0x21cf9(%rip), %rdi     # 0x3512e
movb $0x0, %al
callq 0x4050
cmpl $0x0, -0x3c(%rbp)
je 0x134bc
movl -0x3c(%rbp), %ecx
andl $0x8, %ecx
leaq 0x1ca6a(%rip), %rsi     # 0x2feb9
leaq 0x21d0f(%rip), %rax     # 0x35165
cmpl $0x0, %ecx
cmovneq %rax, %rsi
movl -0x3c(%rbp), %ecx
andl $0x4, %ecx
leaq 0x1ca4f(%rip), %rdx     # 0x2feb9
leaq 0x21cfe(%rip), %rax     # 0x3516f
cmpl $0x0, %ecx
cmovneq %rax, %rdx
movl -0x3c(%rbp), %edi
andl $0x2, %edi
leaq 0x1ca34(%rip), %rcx     # 0x2feb9
leaq 0x21cee(%rip), %rax     # 0x3517a
cmpl $0x0, %edi
cmovneq %rax, %rcx
movl -0x3c(%rbp), %edi
andl $0x1, %edi
leaq 0x1ca19(%rip), %r8      # 0x2feb9
leaq 0x21ce0(%rip), %rax     # 0x35187
cmpl $0x0, %edi
cmovneq %rax, %r8
leaq 0x21c9d(%rip), %rdi     # 0x35152
movb $0x0, %al
callq 0x4050
jmp 0x134be
movq -0x10(%rbp), %rax
cmpb $0x0, 0x15(%rax)
je 0x13563
movq -0x10(%rbp), %rax
cmpb $0x0, 0x16(%rax)
je 0x13563
movq -0x10(%rbp), %rax
movzbl 0x15(%rax), %esi
movq -0x10(%rbp), %rax
movzbl 0x16(%rax), %edx
leaq 0x21ca1(%rip), %rdi     # 0x35192
movb $0x0, %al
callq 0x4050
movq -0x130(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl 0x15(%rcx), %ecx
imull $0xa, %ecx, %ecx
movl %ecx, 0x174(%rax)
movq -0x10(%rbp), %rcx
movzbl 0x16(%rcx), %ecx
imull $0xa, %ecx, %ecx
movl %ecx, 0x178(%rax)
movq -0x10(%rbp), %rax
movzbl 0x15(%rax), %eax
cmpl $0xa, %eax
jl 0x1353b
movq -0x10(%rbp), %rax
movzbl 0x16(%rax), %eax
cmpl $0xa, %eax
jge 0x1355e
movq -0x10(%rbp), %rax
movzbl 0x15(%rax), %edx
movq -0x10(%rbp), %rax
movzbl 0x16(%rax), %ecx
movl $0x1, %edi
leaq 0x21c62(%rip), %rsi     # 0x351b9
movb $0x0, %al
callq 0x47d0
jmp 0x135f7
movq -0x130(%rbp), %rax
cmpl $0x4, 0x88(%rax)
jb 0x135e7
movq -0x10(%rbp), %rax
cmpb $0x0, 0x15(%rax)
jne 0x13587
movq -0x10(%rbp), %rax
cmpb $0x0, 0x16(%rax)
je 0x135e7
movq -0x10(%rbp), %rax
cmpb $0x0, 0x15(%rax)
je 0x135bc
movq -0x10(%rbp), %rax
movzbl 0x15(%rax), %eax
addl $0x63, %eax
cvtsi2sd %eax, %xmm0
movsd 0x1ba90(%rip), %xmm1    # 0x2f038
divsd %xmm1, %xmm0
leaq 0x21c44(%rip), %rdi     # 0x351f7
movb $0x1, %al
callq 0x4050
jmp 0x135e5
movq -0x10(%rbp), %rax
movzbl 0x16(%rax), %eax
addl $0x63, %eax
cvtsi2sd %eax, %xmm1
movsd 0x1ba65(%rip), %xmm0    # 0x2f038
divsd %xmm1, %xmm0
leaq 0x21c3d(%rip), %rdi     # 0x3521b
movb $0x1, %al
callq 0x4050
jmp 0x135f5
leaq 0x21c50(%rip), %rdi     # 0x3523e
movb $0x0, %al
callq 0x4050
jmp 0x135f7
movq -0x10(%rbp), %rax
movzbl 0x17(%rax), %eax
cmpl $0xff, %eax
jne 0x13616
leaq 0x21c4d(%rip), %rdi     # 0x3525a
movb $0x0, %al
callq 0x4050
jmp 0x13648
movq -0x10(%rbp), %rax
movzbl 0x17(%rax), %eax
cvtsi2sd %eax, %xmm0
movsd 0x1ba0e(%rip), %xmm1    # 0x2f038
addsd %xmm1, %xmm0
movsd 0x1ba02(%rip), %xmm1    # 0x2f038
divsd %xmm1, %xmm0
leaq 0x21c45(%rip), %rdi     # 0x35286
movb $0x1, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x18(%rax), %eax
andl $0xe0, %eax
cmpl $0x0, %eax
je 0x136d2
leaq 0x21c36(%rip), %rdi     # 0x35297
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x18(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x13688
leaq 0x21c27(%rip), %rdi     # 0x352a8
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x18(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x136a6
leaq 0x21c12(%rip), %rdi     # 0x352b1
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x18(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x136c4
leaq 0x21bfd(%rip), %rdi     # 0x352ba
movb $0x0, %al
callq 0x4050
leaq 0x1c23e(%rip), %rdi     # 0x2f909
movb $0x0, %al
callq 0x4050
cmpl $0x0, -0x24(%rbp)
jne 0x136e8
movq -0x130(%rbp), %rax
cmpl $0x4, 0x88(%rax)
jae 0x13766
leaq 0x210f0(%rip), %rdi     # 0x347df
xorl %eax, %eax
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x18(%rax), %eax
andl $0x18, %eax
movl %eax, %ecx
movq %rcx, -0x158(%rbp)
subl $0x18, %eax
ja 0x13764
movq -0x158(%rbp), %rax
leaq 0x1dfaf(%rip), %rcx     # 0x316cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x21b92(%rip), %rdi     # 0x352bf
movb $0x0, %al
callq 0x4050
jmp 0x13764
leaq 0x21ba7(%rip), %rdi     # 0x352e4
movb $0x0, %al
callq 0x4050
jmp 0x13764
leaq 0x21b93(%rip), %rdi     # 0x352e0
movb $0x0, %al
callq 0x4050
jmp 0x13764
leaq 0x21b9a(%rip), %rdi     # 0x352f7
movb $0x0, %al
callq 0x4050
jmp 0x137be
leaq 0x21ba8(%rip), %rdi     # 0x35315
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x18(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x13792
leaq 0x21bb1(%rip), %rdi     # 0x3533c
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x18(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x137b0
leaq 0x21ba1(%rip), %rdi     # 0x3534a
movb $0x0, %al
callq 0x4050
leaq 0x1c152(%rip), %rdi     # 0x2f909
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x18(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1380c
leaq 0x21b83(%rip), %rdi     # 0x35358
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rdi
addq $0x19, %rdi
leaq 0x20087(%rip), %rsi     # 0x33872
movl $0xa, %edx
callq 0x4190
cmpl $0x0, %eax
je 0x1380a
xorl %edi, %edi
leaq 0x21b8c(%rip), %rsi     # 0x3538f
movb $0x0, %al
callq 0x47d0
jmp 0x1380c
movq -0x130(%rbp), %rax
cmpl $0x4, 0x88(%rax)
jb 0x1386c
movq -0x130(%rbp), %rax
movb $0x1, -0x2d(%rbp)
movq -0x10(%rbp), %rcx
movzbl 0x18(%rcx), %ecx
andl $0x2, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0xc6(%rax)
movb 0xc6(%rax), %cl
leaq 0x21bd3(%rip), %rsi     # 0x35421
leaq 0x21bc3(%rip), %rax     # 0x35418
testb $0x1, %cl
cmovneq %rax, %rsi
leaq 0x21b64(%rip), %rdi     # 0x353c7
movb $0x0, %al
callq 0x4050
jmp 0x138c2
movq -0x10(%rbp), %rax
movzbl 0x18(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1389e
leaq 0x21baf(%rip), %rdi     # 0x35432
movb $0x0, %al
callq 0x4050
movq -0x130(%rbp), %rax
movb $0x1, -0x2d(%rbp)
movb $0x1, 0xc6(%rax)
jmp 0x138c0
movq -0x130(%rbp), %rax
cmpl $0x3, 0x88(%rax)
jne 0x138be
xorl %edi, %edi
leaq 0x21bae(%rip), %rsi     # 0x35465
movb $0x0, %al
callq 0x47d0
jmp 0x138c0
jmp 0x138c2
movq -0x10(%rbp), %rax
movzbl 0x18(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1391e
movq -0x130(%rbp), %rax
cmpl $0x4, 0x88(%rax)
jb 0x13900
movq -0x130(%rbp), %rax
movb $0x1, 0x90(%rax)
leaq 0x21bb9(%rip), %rdi     # 0x354b0
movb $0x0, %al
callq 0x4050
jmp 0x1391c
leaq 0x21bce(%rip), %rdi     # 0x354d5
movb $0x0, %al
callq 0x4050
movq -0x130(%rbp), %rax
movb $0x1, 0x91(%rax)
jmp 0x1391e
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
leaq 0x21bd6(%rip), %rsi     # 0x35506
callq 0x4420
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
callq 0x4150
movq %rax, %rsi
leaq 0x207a2(%rip), %rdi     # 0x340f1
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x1b(%rax), %eax
shll $0x2, %eax
movq -0x10(%rbp), %rcx
movzbl 0x19(%rcx), %ecx
sarl $0x6, %ecx
orl %ecx, %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x1c(%rax), %eax
shll $0x2, %eax
movq -0x10(%rbp), %rcx
movzbl 0x19(%rcx), %ecx
sarl $0x4, %ecx
andl $0x3, %ecx
orl %ecx, %eax
movl %eax, -0x2c(%rbp)
imull $0x2710, -0x28(%rbp), %esi # imm = 0x2710
shrl $0xa, %esi
imull $0x2710, -0x2c(%rbp), %edx # imm = 0x2710
shrl $0xa, %edx
leaq 0x21b72(%rip), %rdi     # 0x3551c
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x1d(%rax), %eax
shll $0x2, %eax
movq -0x10(%rbp), %rcx
movzbl 0x19(%rcx), %ecx
sarl $0x2, %ecx
andl $0x3, %ecx
orl %ecx, %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x1e(%rax), %eax
shll $0x2, %eax
movq -0x10(%rbp), %rcx
movzbl 0x19(%rcx), %ecx
andl $0x3, %ecx
orl %ecx, %eax
movl %eax, -0x2c(%rbp)
imull $0x2710, -0x28(%rbp), %esi # imm = 0x2710
shrl $0xa, %esi
imull $0x2710, -0x2c(%rbp), %edx # imm = 0x2710
shrl $0xa, %edx
leaq 0x21b32(%rip), %rdi     # 0x35537
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x1f(%rax), %eax
shll $0x2, %eax
movq -0x10(%rbp), %rcx
movzbl 0x1a(%rcx), %ecx
sarl $0x6, %ecx
orl %ecx, %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x20(%rax), %eax
shll $0x2, %eax
movq -0x10(%rbp), %rcx
movzbl 0x1a(%rcx), %ecx
sarl $0x4, %ecx
andl $0x3, %ecx
orl %ecx, %eax
movl %eax, -0x2c(%rbp)
imull $0x2710, -0x28(%rbp), %esi # imm = 0x2710
shrl $0xa, %esi
imull $0x2710, -0x2c(%rbp), %edx # imm = 0x2710
shrl $0xa, %edx
leaq 0x21af2(%rip), %rdi     # 0x35552
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x21(%rax), %eax
shll $0x2, %eax
movq -0x10(%rbp), %rcx
movzbl 0x1a(%rcx), %ecx
sarl $0x2, %ecx
andl $0x3, %ecx
orl %ecx, %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x22(%rax), %eax
shll $0x2, %eax
movq -0x10(%rbp), %rcx
movzbl 0x1a(%rcx), %ecx
andl $0x3, %ecx
orl %ecx, %eax
movl %eax, -0x2c(%rbp)
imull $0x2710, -0x28(%rbp), %esi # imm = 0x2710
shrl $0xa, %esi
imull $0x2710, -0x2c(%rbp), %edx # imm = 0x2710
shrl $0xa, %edx
leaq 0x21ab2(%rip), %rdi     # 0x3556d
movb $0x0, %al
callq 0x4050
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
leaq 0x21ab4(%rip), %rsi     # 0x35588
callq 0x4420
movq -0x10(%rbp), %rax
cmpb $0x0, 0x23(%rax)
jne 0x13afb
movq -0x10(%rbp), %rax
cmpb $0x0, 0x24(%rax)
jne 0x13afb
movq -0x10(%rbp), %rax
cmpb $0x0, 0x25(%rax)
je 0x13c29
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
callq 0x4150
movq %rax, %rsi
leaq 0x205dc(%rip), %rdi     # 0x340f1
movb $0x0, %al
callq 0x4050
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpq $0x11, %rax
jae 0x13c27
movq -0x10(%rbp), %rax
movl -0x40(%rbp), %ecx
shrl $0x3, %ecx
addl $0x23, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0x40(%rbp), %edx
andl $0x7, %edx
movl $0x7, %ecx
subl %edx, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x13c17
movl -0x40(%rbp), %eax
movl %eax, %ecx
leaq 0x36bd0(%rip), %rax     # 0x4a740
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movb %al, -0x41(%rbp)
cmpb $0x0, -0x41(%rbp)
je 0x13ba7
leaq -0x60(%rbp), %rdi
movzbl -0x41(%rbp), %edx
leaq 0x1bf28(%rip), %rsi     # 0x2fab9
movb $0x0, %al
callq 0x40a0
movzbl -0x41(%rbp), %edi
callq 0xe6b0
movq %rax, -0x50(%rbp)
jmp 0x13beb
movl -0x40(%rbp), %eax
movl %eax, %ecx
leaq 0x36b8d(%rip), %rax     # 0x4a740
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
addq $0x4, %rax
movq %rax, -0x50(%rbp)
leaq -0x60(%rbp), %rdi
movl -0x40(%rbp), %eax
movl %eax, %ecx
leaq 0x36b6e(%rip), %rax     # 0x4a740
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq 0x58(%rax), %rdx
leaq 0x1fce6(%rip), %rsi     # 0x338ca
movb $0x0, %al
callq 0x40a0
movq -0x130(%rbp), %rdi
movq -0x50(%rbp), %rdx
leaq -0x60(%rbp), %rcx
leaq 0x20bde(%rip), %rsi     # 0x347df
leaq 0x1c2b1(%rip), %r8      # 0x2feb9
xorl %r9d, %r9d
movl $0x1, (%rsp)
callq 0x50c0
jmp 0x13c19
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x13b23
jmp 0x13c4a
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
callq 0x4150
movq %rax, %rsi
leaq 0x21960(%rip), %rdi     # 0x355a3
movb $0x0, %al
callq 0x4050
movq -0x130(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x23(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0xc5(%rdi)
movq -0x10(%rbp), %rsi
addq $0x36, %rsi
callq 0x11ed0
movq -0x130(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x11ed0
movq -0x130(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x5a, %rsi
callq 0x11ed0
movq -0x130(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x6c, %rsi
callq 0x11ed0
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
leaq 0x218ea(%rip), %rsi     # 0x355af
callq 0x4420
movb $0x0, -0x61(%rbp)
movl $0x0, -0x68(%rbp)
cmpl $0x8, -0x68(%rbp)
jae 0x13d1f
movq -0x10(%rbp), %rax
movl -0x68(%rbp), %ecx
shll %ecx
addl $0x26, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0x13d0c
movq -0x10(%rbp), %rax
movl -0x68(%rbp), %ecx
shll %ecx
addl $0x26, %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
je 0x13d12
movb $0x1, -0x61(%rbp)
jmp 0x13d1f
jmp 0x13d14
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x13cd5
testb $0x1, -0x61(%rbp)
je 0x13da2
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
callq 0x4150
movq %rax, %rsi
leaq 0x203b2(%rip), %rdi     # 0x340f1
movb $0x0, %al
callq 0x4050
movl $0x0, -0x6c(%rbp)
cmpl $0x8, -0x6c(%rbp)
jae 0x13da0
movq -0x130(%rbp), %rdi
movq -0x10(%rbp), %rax
movl -0x6c(%rbp), %ecx
shll %ecx
addl $0x26, %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x6c(%rbp), %ecx
shll %ecx
addl $0x26, %ecx
addl $0x1, %ecx
movl %ecx, %ecx
leaq 0x20a5c(%rip), %rsi     # 0x347df
xorl %r9d, %r9d
movzbl %dl, %edx
movzbl (%rax,%rcx), %ecx
movl %r9d, %r8d
callq 0xf6f0
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x13d4d
jmp 0x13dc3
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
callq 0x4150
movq %rax, %rsi
leaq 0x217e7(%rip), %rdi     # 0x355a3
movb $0x0, %al
callq 0x4050
testb $0x1, -0x2d(%rbp)
je 0x13ded
movq -0x10(%rbp), %rax
cmpb $0x0, 0x36(%rax)
jne 0x13ded
movq -0x10(%rbp), %rax
cmpb $0x0, 0x37(%rax)
jne 0x13ded
xorl %edi, %edi
leaq 0x217da(%rip), %rsi     # 0x355c0
movb $0x0, %al
callq 0x47d0
movq -0x10(%rbp), %rax
cmpb $0x0, 0x36(%rax)
jne 0x13e05
movq -0x10(%rbp), %rax
cmpb $0x0, 0x37(%rax)
je 0x13e94
movq -0x10(%rbp), %rax
cmpb $0x0, 0x48(%rax)
jne 0x13e19
movq -0x10(%rbp), %rax
cmpb $0x0, 0x49(%rax)
je 0x13e94
movq -0x10(%rbp), %rax
cmpb $0x0, 0x5a(%rax)
jne 0x13e94
movq -0x10(%rbp), %rax
cmpb $0x0, 0x5b(%rax)
jne 0x13e94
movq -0x10(%rbp), %rax
movzbl 0x5d(%rax), %eax
cmpl $0xfe, %eax
jne 0x13e94
movq -0x10(%rbp), %rax
cmpb $0x0, 0x6c(%rax)
jne 0x13e94
movq -0x10(%rbp), %rax
cmpb $0x0, 0x6d(%rax)
jne 0x13e94
movq -0x10(%rbp), %rax
movzbl 0x6f(%rax), %eax
cmpl $0xfe, %eax
jne 0x13e94
movq -0x10(%rbp), %rax
movzbl 0x79(%rax), %eax
cmpl $0x1, %eax
je 0x13e79
movq -0x10(%rbp), %rax
movzbl 0x79(%rax), %eax
cmpl $0x2, %eax
jne 0x13e94
movq -0x10(%rbp), %rax
movzbl 0x7a(%rax), %eax
cmpl $0x1, %eax
jg 0x13e94
movq -0x130(%rbp), %rax
movb $0x1, 0xb9(%rax)
movl $0x0, -0x70(%rbp)
movq -0x130(%rbp), %rcx
movl -0x70(%rbp), %eax
movb 0xb9(%rcx), %sil
movl $0x4, %ecx
movl $0x2, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
cmpl %ecx, %eax
jae 0x13f0a
movq -0x10(%rbp), %rax
imull $0x12, -0x70(%rbp), %ecx
addl $0x36, %ecx
movl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
jne 0x13ee7
movq -0x10(%rbp), %rax
imull $0x12, -0x70(%rbp), %ecx
addl $0x37, %ecx
movl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
je 0x13efd
movq -0x130(%rbp), %rax
movl 0x180(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x180(%rax)
jmp 0x13eff
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x13e9b
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
leaq 0x216bf(%rip), %rsi     # 0x355db
callq 0x4420
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
callq 0x4150
movq %rax, %rsi
leaq 0x201b6(%rip), %rdi     # 0x340f1
movb $0x0, %al
callq 0x4050
movq -0x130(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x36, %rsi
callq 0x12020
movq -0x130(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x12020
movq -0x130(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x5a, %rsi
callq 0x12020
movq -0x130(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x6c, %rsi
callq 0x12020
movq -0x130(%rbp), %rax
movb $0x0, 0xb9(%rax)
testb $0x1, 0xc6(%rax)
jne 0x13ff9
movq -0x130(%rbp), %rdi
addq $0x180, %rdi            # imm = 0x180
addq $0x128, %rdi            # imm = 0x128
callq 0x14a90
leaq -0x108(%rbp), %rdi
callq 0xbbe0
movq -0x130(%rbp), %rdi
addq $0x88, %rdi
addq $0x40, %rdi
leaq -0x108(%rbp), %rsi
callq 0x14ab0
leaq -0x108(%rbp), %rdi
callq 0xc3d0
movq -0x130(%rbp), %rdi
movq %rdi, %rsi
addq $0x10, %rsi
addq $0x30, %rdi
callq 0x4040
movq -0x10(%rbp), %rax
cmpb $0x0, 0x7e(%rax)
je 0x14030
movq -0x10(%rbp), %rax
movzbl 0x7e(%rax), %esi
leaq 0x215ce(%rip), %rdi     # 0x355f7
movb $0x0, %al
callq 0x4050
movq -0x130(%rbp), %rcx
movq -0x10(%rbp), %rax
movzbl 0x7e(%rax), %eax
addl $0x1, %eax
cmpl 0x4(%rcx), %eax
je 0x1406c
movq -0x130(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl 0x7e(%rcx), %edx
movl 0x4(%rax), %ecx
subl $0x1, %ecx
xorl %edi, %edi
leaq 0x215aa(%rip), %rsi     # 0x3560f
movb $0x0, %al
callq 0x47d0
leaq -0x128(%rbp), %rdi
xorl %esi, %esi
callq 0x7a10
movq -0x130(%rbp), %rdi
addq $0x10, %rdi
leaq -0x128(%rbp), %rsi
callq 0x43d0
leaq -0x128(%rbp), %rdi
callq 0x41f0
movq -0x130(%rbp), %rdi
addq $0x30, %rdi
callq 0x4400
movq -0x10(%rbp), %rsi
leaq 0x1be01(%rip), %rdi     # 0x2feb9
movl $0x80, %edx
callq 0x4b50
movq -0x130(%rbp), %rax
cmpl $0x3, 0x88(%rax)
jb 0x14134
movq -0x130(%rbp), %rax
testb $0x1, 0x8c(%rax)
jne 0x140f2
xorl %edi, %edi
leaq 0x2156c(%rip), %rsi     # 0x35657
movb $0x0, %al
callq 0x47d0
movq -0x130(%rbp), %rax
cmpl $0x3, 0x88(%rax)
je 0x14112
movq -0x130(%rbp), %rax
testb $0x1, 0x90(%rax)
je 0x14132
movq -0x130(%rbp), %rax
testb $0x1, 0x8d(%rax)
jne 0x14132
xorl %edi, %edi
leaq 0x2154b(%rip), %rsi     # 0x35676
movb $0x0, %al
callq 0x47d0
jmp 0x14134
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopl (%rax)