// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
addq $0x30, %rdi
movq 0x38(%r14), %rdx
leaq 0x18f56(%rip), %rcx     # 0x2597e
movl $0x21, %r8d
movq %rdi, 0x10(%rsp)
xorl %esi, %esi
callq 0x3390
movq 0x30(%r14), %rsi
movzbl 0x12(%rbx), %edx
movzbl 0x13(%rbx), %ecx
leaq 0x18f53(%rip), %rdi     # 0x259a0
xorl %eax, %eax
callq 0x3030
cmpb $0x1, 0x12(%rbx)
jne 0xca9e
movzbl 0x13(%rbx), %edx
movl %edx, 0x88(%r14)
cmpl $0x5, %edx
jb 0xca7d
leaq 0x18f40(%rip), %rsi     # 0x259b1
movl $0x1, %edi
xorl %eax, %eax
callq 0x37ec
movl 0x88(%r14), %edx
cmpl $0x2, %edx
ja 0xcaae
leaq 0x18f5b(%rip), %rsi     # 0x259eb
movl $0x1, %edi
xorl %eax, %eax
callq 0x37ec
jmp 0xcaae
leaq 0x18f6c(%rip), %rsi     # 0x25a11
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
movq 0x38(%r14), %rdx
leaq 0x18f75(%rip), %rcx     # 0x25a2e
movl $0x1f, %r8d
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x3390
movq 0x30(%r14), %rsi
leaq 0x182e5(%rip), %rdi     # 0x24dbb
xorl %eax, %eax
callq 0x3030
movzbl 0x8(%rbx), %eax
movl %eax, %edi
shrl $0x2, %edi
andl $0x1f, %edi
orl $0x40, %edi
movb %dil, 0x3a74d(%rip)     # 0x47240
andl $0x3, %eax
movq %rbx, 0x8(%rsp)
movzbl 0x9(%rbx), %ebp
movl %ebp, %ecx
shrl $0x5, %ecx
leal (%rcx,%rax,8), %ebx
addl $0x40, %ebx
movb %bl, 0x3a731(%rip)      # 0x47241
andl $0x1f, %ebp
orl $0x40, %ebp
movb %bpl, 0x3a725(%rip)     # 0x47242
movb $0x0, 0x3a71f(%rip)     # 0x47243
callq 0x3190
testl %eax, %eax
je 0xcb43
movl %ebx, %edi
callq 0x3190
testl %eax, %eax
je 0xcb43
movl %ebp, %edi
callq 0x3190
testl %eax, %eax
jne 0xcb53
leaq 0x197f9(%rip), %rsi     # 0x26343
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
movq 0x8(%rsp), %r13
movzwl 0xa(%r13), %edx
leaq 0x18eea(%rip), %rdi     # 0x25a4e
leaq 0x3a6d5(%rip), %rsi     # 0x47240
xorl %eax, %eax
callq 0x3030
movb $0x1, %al
cmpb $0x0, 0xc(%r13)
jne 0xcb91
cmpb $0x0, 0xd(%r13)
jne 0xcb91
cmpb $0x0, 0xe(%r13)
jne 0xcb91
cmpb $0x0, 0xf(%r13)
setne %al
movb %al, 0x8e(%r14)
testb %al, %al
je 0xcbc3
cmpb $0x1, 0x52(%r14)
jne 0xcbb1
leaq 0x199a2(%rip), %rdi     # 0x2654c
callq 0x3380
jmp 0xcbc3
movl 0xc(%r13), %esi
leaq 0x18eb6(%rip), %rdi     # 0x25a72
xorl %eax, %eax
callq 0x3030
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
callq 0x3210
movq %rbx, %rdi
callq 0x3180
movq %rax, %r15
movzbl 0x10(%r13), %r12d
movzbl 0x11(%r13), %ebx
leal 0x7c6(%rbx), %ebp
testl %r12d, %r12d
je 0xcc6b
cmpl $0xff, %r12d
jne 0xcc13
cmpl $0x3, 0x88(%r14)
ja 0xcc13
leaq 0x18e7f(%rip), %rsi     # 0x25a89
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
cmpl $0x36, %r12d
jne 0xcc33
cmpl $0x3, 0x88(%r14)
ja 0xcc33
leaq 0x18e85(%rip), %rsi     # 0x25aaf
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
leal -0x37(%r12), %eax
cmpb $-0x39, %al
ja 0xcc4f
leaq 0x18e90(%rip), %rsi     # 0x25ad3
xorl %edi, %edi
movl %r12d, %edx
xorl %eax, %eax
callq 0x37ec
cmpl $0xff, %r12d
je 0xcc8d
leaq 0x18e95(%rip), %rdi     # 0x25af4
movl %r12d, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3030
leaq 0x18ea0(%rip), %rax     # 0x25b12
leaq 0x18ead(%rip), %rdi     # 0x25b26
cmpl $0xff, %r12d
cmoveq %rax, %rdi
je 0xcc94
testl %r12d, %r12d
je 0xcc94
jmp 0xcc9d
leaq 0x18e7e(%rip), %rdi     # 0x25b12
movl %ebp, %esi
xorl %eax, %eax
callq 0x3030
addl $0x59, %ebx
cmpl 0x14(%r15), %ebx
jle 0xccb8
leaq 0x18e8a(%rip), %rsi     # 0x25b37
xorl %edi, %edi
movl %ebp, %edx
xorl %eax, %eax
callq 0x37ec
movq 0x38(%r14), %rdx
leaq 0x18ea6(%rip), %rcx     # 0x25b69
movl $0x23, %r8d
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x3390
movq 0x30(%r14), %rsi
leaq 0x180db(%rip), %rdi     # 0x24dbb
xorl %eax, %eax
callq 0x3030
movq 0x8(%rsp), %r15
movsbl 0x14(%r15), %ebx
testl %ebx, %ebx
js 0xcd19
movl %ebx, %ebp
shrl $0x5, %ebp
leaq 0x19862(%rip), %rdi     # 0x26563
callq 0x3380
cmpl $0x2, %ebp
je 0xcd5f
cmpl $0x3, %ebp
jne 0xcd68
leaq 0x18f40(%rip), %rsi     # 0x25c57
jmp 0xcd7d
leaq 0x1989b(%rip), %rdi     # 0x265bb
callq 0x3380
movl 0x88(%r14), %eax
cmpl $0x4, %eax
jb 0xce07
movzbl 0x14(%r15), %esi
andl $0x70, %esi
cmpl $0x70, %esi
je 0xce43
testl %esi, %esi
jne 0xce55
leaq 0x19896(%rip), %rdi     # 0x265eb
callq 0x3380
jmp 0xce69
leaq 0x18ef9(%rip), %rsi     # 0x25c5f
jmp 0xcd7d
cmpl $0x1, %ebp
leaq 0x18ef5(%rip), %rax     # 0x25c67
leaq 0x18efa(%rip), %rsi     # 0x25c73
cmoveq %rax, %rsi
leaq 0x18eb4(%rip), %rdi     # 0x25c38
xorl %eax, %eax
callq 0x3030
movq 0x8(%rsp), %r15
testb $0x10, 0x14(%r15)
leaq 0x197da(%rip), %rax     # 0x26576
leaq 0x197f6(%rip), %rdi     # 0x26599
cmoveq %rax, %rdi
callq 0x3380
testb $0xf, %bl
je 0xcef6
testb $0x8, %bl
leaq 0x13eba(%rip), %rax     # 0x20c79
leaq 0x24757(%rip), %rsi     # 0x3151d
cmoveq %rax, %rsi
testb $0x4, %bl
leaq 0x18eba(%rip), %rdx     # 0x25c8e
cmoveq %rax, %rdx
testb $0x2, %bl
leaq 0x18eb7(%rip), %rcx     # 0x25c99
cmoveq %rax, %rcx
testb $0x1, %bl
leaq 0x18eb6(%rip), %r8      # 0x25ca6
cmoveq %rax, %r8
leaq 0x18e80(%rip), %rdi     # 0x25c7b
xorl %eax, %eax
callq 0x3030
jmp 0xcef6
movzbl 0x14(%r15), %edx
cmpl $0x2, %eax
jb 0xce35
testb $0x1, %dl
je 0xce22
leaq 0x197b2(%rip), %rdi     # 0x265cf
callq 0x3380
movzbl 0x14(%r15), %edx
andl $0x7e, %edx
jne 0xcee6
jmp 0xcef6
andl $0x7f, %edx
jne 0xcee6
jmp 0xcef6
leaq 0x18d43(%rip), %rsi     # 0x25b8d
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
jmp 0xce69
shrl $0x3, %esi
addl $0x4, %esi
leaq 0x18d53(%rip), %rdi     # 0x25bb5
xorl %eax, %eax
callq 0x3030
leaq 0x185d7(%rip), %rdi     # 0x25447
xorl %eax, %eax
callq 0x3030
movzbl 0x14(%r15), %esi
andl $0xf, %esi
cmpb $0x5, %sil
ja 0xced0
leaq 0x156a4(%rip), %rax     # 0x22530
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x197c1(%rip), %rdi     # 0x2665d
jmp 0xcec9
leaq 0x19779(%rip), %rdi     # 0x2661e
jmp 0xcec9
leaq 0x19790(%rip), %rdi     # 0x2663e
jmp 0xcec9
leaq 0x19776(%rip), %rdi     # 0x2662d
jmp 0xcec9
leaq 0x1978f(%rip), %rdi     # 0x2664f
jmp 0xcec9
leaq 0x1973f(%rip), %rdi     # 0x26608
callq 0x3380
jmp 0xcef6
leaq 0x18d06(%rip), %rdi     # 0x25bdd
xorl %eax, %eax
callq 0x3030
movzbl 0x14(%r15), %edx
andl $0xf, %edx
leaq 0x18d0b(%rip), %rsi     # 0x25bf8
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
movzbl 0x15(%r15), %esi
testl %esi, %esi
je 0xcf63
movzbl 0x16(%r15), %edx
testl %edx, %edx
je 0xcf63
leaq 0x18da2(%rip), %rdi     # 0x25cb1
xorl %eax, %eax
callq 0x3030
movzbl 0x15(%r15), %eax
addl %eax, %eax
leal (%rax,%rax,4), %eax
movl %eax, 0x174(%r14)
movzbl 0x16(%r15), %eax
addl %eax, %eax
leal (%rax,%rax,4), %eax
movl %eax, 0x178(%r14)
movzbl 0x15(%r15), %edx
cmpl $0xa, %edx
jb 0xcf49
cmpb $0x9, 0x16(%r15)
ja 0xcfc8
movzbl 0x16(%r15), %ecx
leaq 0x18d83(%rip), %rsi     # 0x25cd8
movl $0x1, %edi
xorl %eax, %eax
callq 0x37ec
jmp 0xcfc8
cmpl $0x4, 0x88(%r14)
jb 0xcfbc
testl %esi, %esi
je 0xcf90
addl $0x63, %esi
cvtsi2sd %esi, %xmm0
divsd 0x13098(%rip), %xmm0    # 0x20018
leaq 0x18d8f(%rip), %rdi     # 0x25d16
movb $0x1, %al
callq 0x3030
jmp 0xcfc8
cmpb $0x0, 0x16(%r15)
je 0xcfbc
testl %esi, %esi
jne 0xcf71
movzbl 0x16(%r15), %eax
addl $0x63, %eax
cvtsi2sd %eax, %xmm1
movsd 0x13069(%rip), %xmm0    # 0x20018
divsd %xmm1, %xmm0
leaq 0x18d80(%rip), %rdi     # 0x25d3a
jmp 0xcf87
leaq 0x196bb(%rip), %rdi     # 0x2667e
callq 0x3380
movb 0x17(%r15), %al
cmpb $-0x1, %al
je 0xcffa
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x13036(%rip), %xmm1    # 0x20018
addsd %xmm1, %xmm0
divsd %xmm1, %xmm0
leaq 0x18d6c(%rip), %rdi     # 0x25d5d
movb $0x1, %al
callq 0x3030
jmp 0xd006
leaq 0x19698(%rip), %rdi     # 0x26699
callq 0x3380
cmpb $0x20, 0x18(%r15)
jb 0xd064
leaq 0x18d5a(%rip), %rdi     # 0x25d6e
xorl %eax, %eax
callq 0x3030
cmpb $0x0, 0x18(%r15)
jns 0xd030
leaq 0x18d56(%rip), %rdi     # 0x25d7f
xorl %eax, %eax
callq 0x3030
testb $0x40, 0x18(%r15)
je 0xd045
leaq 0x18d4a(%rip), %rdi     # 0x25d88
xorl %eax, %eax
callq 0x3030
testb $0x20, 0x18(%r15)
je 0xd05a
leaq 0x18d3e(%rip), %rdi     # 0x25d91
xorl %eax, %eax
callq 0x3030
movl $0xa, %edi
callq 0x3310
testb %bl, %bl
jns 0xd0b6
cmpl $0x3, 0x88(%r14)
jbe 0xd0b6
leaq 0x18d1d(%rip), %rdi     # 0x25d96
xorl %eax, %eax
callq 0x3030
testb $0x8, 0x18(%r15)
je 0xd095
leaq 0x18d2f(%rip), %rdi     # 0x25dbd
xorl %eax, %eax
callq 0x3030
testb $0x10, 0x18(%r15)
je 0xd0aa
leaq 0x18d28(%rip), %rdi     # 0x25dcb
xorl %eax, %eax
callq 0x3030
movl $0xa, %edi
callq 0x3310
jmp 0xd106
leaq 0x1838a(%rip), %rdi     # 0x25447
xorl %eax, %eax
callq 0x3030
movzbl 0x18(%r15), %eax
shrl $0x3, %eax
andl $0x3, %eax
leaq 0x15472(%rip), %rcx     # 0x22548
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x19611(%rip), %rdi     # 0x266f7
jmp 0xd101
leaq 0x195f2(%rip), %rdi     # 0x266e1
jmp 0xd101
leaq 0x195cc(%rip), %rdi     # 0x266c4
jmp 0xd101
leaq 0x195e4(%rip), %rdi     # 0x266e5
callq 0x3380
testb $0x4, 0x18(%r15)
je 0xd148
leaq 0x19603(%rip), %rdi     # 0x26717
callq 0x3380
movabsq $0xf26994c54a391ee, %rax # imm = 0xF26994C54A391EE
xorq 0x19(%r15), %rax
movzwl 0x21(%r15), %ecx
xorq $0x5450, %rcx           # imm = 0x5450
orq %rax, %rcx
je 0xd148
leaq 0x18c9a(%rip), %rsi     # 0x25dd9
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
movl 0x88(%r14), %eax
movb 0x18(%r15), %cl
andb $0x2, %cl
cmpl $0x4, %eax
jb 0xd18a
movl %ecx, %eax
shrb %al
testb %cl, %cl
movb %al, 0xc6(%r14)
leaq 0x18cfc(%rip), %rax     # 0x25e6b
leaq 0x18cec(%rip), %rsi     # 0x25e62
cmoveq %rax, %rsi
leaq 0x18c90(%rip), %rdi     # 0x25e11
xorl %eax, %eax
callq 0x3030
jmp 0xd1c5
testb %cl, %cl
jne 0xd1b1
cmpl $0x3, %eax
jne 0xd8bd
leaq 0x18cde(%rip), %rsi     # 0x25e7c
movl $0x0, 0x1c(%rsp)
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
jmp 0xd1cb
leaq 0x19595(%rip), %rdi     # 0x2674d
callq 0x3380
movb $0x1, 0xc6(%r14)
movb $0x1, %al
movl %eax, 0x1c(%rsp)
testb $0x1, 0x18(%r15)
je 0xd206
cmpl $0x4, 0x88(%r14)
jb 0xd1f2
movb $0x1, 0x90(%r14)
leaq 0x195c4(%rip), %rdi     # 0x267af
callq 0x3380
jmp 0xd206
leaq 0x19586(%rip), %rdi     # 0x2677f
callq 0x3380
movb $0x1, 0x91(%r14)
movq 0x38(%r14), %rdx
leaq 0x18cb6(%rip), %rcx     # 0x25ec7
movl $0x15, %r8d
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3390
movq 0x30(%r14), %rsi
leaq 0x17b8a(%rip), %rdi     # 0x24dbb
xorl %eax, %eax
callq 0x3030
movzbl 0x1b(%r15), %eax
movzbl 0x19(%r15), %ecx
movl %ecx, %edx
shrl $0x6, %edx
leal (%rdx,%rax,4), %eax
movzbl 0x1c(%r15), %edx
shrl $0x4, %ecx
andl $0x3, %ecx
leal (%rcx,%rdx,4), %ecx
imull $0x2710, %eax, %esi     # imm = 0x2710
shrl $0xa, %esi
imull $0x2710, %ecx, %edx     # imm = 0x2710
shrl $0xa, %edx
leaq 0x18c6c(%rip), %rdi     # 0x25edd
xorl %eax, %eax
callq 0x3030
movzbl 0x1d(%r15), %eax
movzbl 0x19(%r15), %ecx
movl %ecx, %edx
shrl $0x2, %edx
andl $0x3, %edx
leal (%rdx,%rax,4), %eax
movzbl 0x1e(%r15), %edx
andl $0x3, %ecx
leal (%rcx,%rdx,4), %ecx
imull $0x2710, %eax, %esi     # imm = 0x2710
shrl $0xa, %esi
imull $0x2710, %ecx, %edx     # imm = 0x2710
shrl $0xa, %edx
leaq 0x18c47(%rip), %rdi     # 0x25ef8
xorl %eax, %eax
callq 0x3030
movzbl 0x1f(%r15), %eax
movzbl 0x1a(%r15), %ecx
movl %ecx, %edx
shrl $0x6, %edx
leal (%rdx,%rax,4), %eax
movzbl 0x20(%r15), %edx
shrl $0x4, %ecx
andl $0x3, %ecx
leal (%rcx,%rdx,4), %ecx
imull $0x2710, %eax, %esi     # imm = 0x2710
shrl $0xa, %esi
imull $0x2710, %ecx, %edx     # imm = 0x2710
shrl $0xa, %edx
leaq 0x18c22(%rip), %rdi     # 0x25f13
xorl %eax, %eax
callq 0x3030
movzbl 0x21(%r15), %eax
movzbl 0x1a(%r15), %ecx
movl %ecx, %edx
shrl $0x2, %edx
andl $0x3, %edx
leal (%rdx,%rax,4), %eax
movzbl 0x22(%r15), %edx
andl $0x3, %ecx
leal (%rcx,%rdx,4), %ecx
imull $0x2710, %eax, %esi     # imm = 0x2710
shrl $0xa, %esi
imull $0x2710, %ecx, %edx     # imm = 0x2710
shrl $0xa, %edx
leaq 0x18bfd(%rip), %rdi     # 0x25f2e
xorl %eax, %eax
callq 0x3030
movq %r14, 0x20(%rsp)
movq 0x38(%r14), %rdx
leaq 0x18c01(%rip), %rcx     # 0x25f49
movl $0x1a, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3390
cmpb $0x0, 0x23(%r15)
jne 0xd371
cmpb $0x0, 0x24(%r15)
jne 0xd371
cmpb $0x0, 0x25(%r15)
je 0xd8ca
movq 0x10(%rsp), %rax
movq (%rax), %rsi
leaq 0x17a3b(%rip), %rdi     # 0x24dbb
xorl %eax, %eax
callq 0x3030
leaq 0x2c282(%rip), %r14     # 0x39610
leaq 0x40(%rsp), %r12
leaq 0x151c6(%rip), %r13     # 0x22560
xorl %ebp, %ebp
movl %ebp, %eax
shrl $0x3, %eax
movq 0x8(%rsp), %rcx
movzbl 0x23(%rcx,%rax), %eax
movl %ebp, %ecx
notb %cl
movzbl %cl, %ecx
andl $0x7, %ecx
btl %ecx, %eax
jae 0xd450
leaq (,%rbp,2), %r15
addq %rbp, %r15
shlq $0x5, %r15
movzbl (%r15,%r14), %ebx
testl %ebx, %ebx
je 0xd402
movq %r12, %rdi
leaq 0x134ef(%rip), %rsi     # 0x208cf
movl %ebx, %edx
xorl %eax, %eax
callq 0x3070
xorl %eax, %eax
cmpl %ebx, (%rax,%r13)
je 0xd420
addq $0x60, %rax
cmpq $0x2100, %rax           # imm = 0x2100
jne 0xd3eb
xorl %r15d, %r15d
jmp 0xd428
addq %r14, %r15
movq 0x58(%r15), %rdx
addq $0x4, %r15
movq %r12, %rdi
leaq 0x172b9(%rip), %rsi     # 0x246d0
xorl %eax, %eax
callq 0x3070
jmp 0xd428
leaq (%rax,%r13), %r15
addq $0xc, %r15
movl $0x1, (%rsp)
movq 0x20(%rsp), %rdi
leaq 0x1800c(%rip), %rsi     # 0x25447
movq %r15, %rdx
movq %r12, %rcx
leaq 0x13831(%rip), %r8      # 0x20c79
xorl %r9d, %r9d
callq 0x3ebe
incq %rbp
cmpq $0x11, %rbp
jne 0xd39c
movq 0x8(%rsp), %r14
movb 0x23(%r14), %al
shrb $0x5, %al
andb $0x1, %al
movq 0x20(%rsp), %rbp
movb %al, 0xc5(%rbp)
leaq 0x36(%r14), %rsi
movq %rbp, %rdi
movq %rsi, 0x28(%rsp)
callq 0xbf60
leaq 0x48(%r14), %r12
movq %rbp, %rdi
movq %r12, %rsi
callq 0xbf60
leaq 0x5a(%r14), %rsi
movq %rbp, %rdi
movq %rsi, 0x30(%rsp)
callq 0xbf60
leaq 0x6c(%r14), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0xbf60
movq 0x38(%rbp), %rdx
leaq 0x18aaf(%rip), %rcx     # 0x25f70
movl $0x10, %r8d
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x3390
movl $0x27, %eax
cmpb $0x1, -0x1(%r14,%rax)
jne 0xd509
cmpb $0x1, (%r14,%rax)
jne 0xd509
addq $0x2, %rax
cmpq $0x37, %rax
jne 0xd4d8
movq 0x10(%rsp), %rax
movq (%rax), %rsi
leaq 0x18a64(%rip), %rdi     # 0x25f64
xorl %eax, %eax
callq 0x3030
jmp 0xd552
movq 0x10(%rsp), %rax
movq (%rax), %rsi
leaq 0x178a3(%rip), %rdi     # 0x24dbb
movq %r14, %r15
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x3030
leaq 0x17f1b(%rip), %rbx     # 0x25447
movzbl 0x26(%r15,%r14,2), %edx
movzbl 0x27(%r15,%r14,2), %ecx
movq %rbp, %rdi
movq %rbx, %rsi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xa252
incq %r14
cmpq $0x8, %r14
jne 0xd52c
cmpb $0x0, 0x1c(%rsp)
je 0xd57e
movq 0x28(%rsp), %rax
cmpb $0x0, (%rax)
jne 0xd57e
movq 0x8(%rsp), %rax
cmpb $0x0, 0x37(%rax)
jne 0xd57e
leaq 0x18a0c(%rip), %rsi     # 0x25f81
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
movq 0x28(%rsp), %rax
cmpb $0x0, (%rax)
movq 0x20(%rsp), %rbp
movq 0x30(%rsp), %rbx
jne 0xd59d
movq 0x8(%rsp), %rax
cmpb $0x0, 0x37(%rax)
je 0xd607
cmpb $0x0, (%r12)
jne 0xd5af
movq 0x8(%rsp), %rax
cmpb $0x0, 0x49(%rax)
je 0xd607
cmpb $0x0, (%rbx)
jne 0xd607
movq 0x8(%rsp), %rax
cmpb $0x0, 0x5b(%rax)
jne 0xd607
movq 0x8(%rsp), %rax
cmpb $-0x2, 0x5d(%rax)
jne 0xd607
cmpb $0x0, (%r13)
jne 0xd607
movq 0x8(%rsp), %rax
cmpb $0x0, 0x6d(%rax)
jne 0xd607
movq 0x8(%rsp), %rax
cmpb $-0x2, 0x6f(%rax)
jne 0xd607
movq 0x8(%rsp), %rax
movb 0x79(%rax), %al
decb %al
cmpb $0x1, %al
ja 0xd607
movq 0x8(%rsp), %rax
cmpb $0x1, 0x7a(%rax)
ja 0xd607
movb $0x1, 0xb9(%rbp)
movzbl 0xb9(%rbp), %ecx
movl 0x180(%rbp), %eax
xorl $0x1, %ecx
leaq 0x2(,%rcx,2), %rcx
movq 0x8(%rsp), %rdx
addq $0x37, %rdx
cmpb $0x0, -0x1(%rdx)
jne 0xd633
cmpb $0x0, (%rdx)
je 0xd63b
incl %eax
movl %eax, 0x180(%rbp)
addq $0x12, %rdx
decq %rcx
jne 0xd628
movq 0x38(%rbp), %rdx
leaq 0x1894d(%rip), %rcx     # 0x25f9c
xorl %r14d, %r14d
movl $0x1b, %r8d
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x3390
movq 0x30(%rbp), %rsi
leaq 0x1774c(%rip), %rdi     # 0x24dbb
xorl %eax, %eax
callq 0x3030
movq %rbp, %rdi
movq 0x28(%rsp), %rsi
callq 0xc056
movq %rbp, %rdi
movq %r12, %rsi
callq 0xc056
movq %rbp, %rdi
movq %rbx, %rsi
callq 0xc056
movq %rbp, %rdi
movq %r13, %rsi
callq 0xc056
movb $0x0, 0xb9(%rbp)
cmpb $0x0, 0xc6(%rbp)
jne 0xd7b4
leaq 0x2a8(%rbp), %rdi
movq 0x2a8(%rbp), %rsi
callq 0xe144
leaq 0x98(%rsp), %rsi
leaq 0xa8(%rsp), %r15
movq %r15, -0x10(%r15)
movq %r14, -0x8(%r15)
movb %r14b, (%r15)
leaq 0xb8(%rsp), %rbx
leaq 0xc8(%rsp), %r12
movq %r12, -0x10(%r12)
movq %r14, -0x8(%r12)
movb %r14b, (%r12)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x78(%rbx)
movapd %xmm0, -0x78(%r12)
movapd %xmm0, -0x68(%r12)
movapd %xmm0, -0x58(%r12)
movapd %xmm0, -0x48(%r12)
movl %r14d, -0x38(%r12)
movl %r14d, 0x118(%rbp)
movupd %xmm0, 0x108(%rbp)
movupd %xmm0, 0xf8(%rbp)
movupd %xmm0, 0xe8(%rbp)
movupd %xmm0, 0xd8(%rbp)
movupd %xmm0, 0xc8(%rbp)
leaq 0x120(%rbp), %rdi
callq 0x32d0
leaq 0x140(%rbp), %rdi
movq %rbx, %rsi
callq 0x32d0
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0xd792
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x98(%rsp), %rdi
cmpq %r15, %rdi
je 0xd7af
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x20(%rsp), %rbp
leaq 0x10(%rbp), %r15
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x3140
movq 0x8(%rsp), %rax
movzbl 0x7e(%rax), %esi
testl %esi, %esi
je 0xd7e0
leaq 0x187df(%rip), %rdi     # 0x25fb8
xorl %eax, %eax
callq 0x3030
movq 0x8(%rsp), %rax
movzbl 0x7e(%rax), %edx
leal 0x1(%rdx), %eax
movl 0x4(%rbp), %ecx
cmpl %ecx, %eax
je 0xd805
decl %ecx
leaq 0x187d4(%rip), %rsi     # 0x25fd0
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5d27
movq %r15, %rdi
movq %rbx, %rsi
callq 0x32d0
movq (%rbx), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0xd839
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3260
movq $0x0, 0x38(%rbp)
movq 0x30(%rbp), %rax
movb $0x0, (%rax)
leaq 0x1342a(%rip), %rdi     # 0x20c79
movl $0x80, %edx
movq 0x8(%rsp), %rsi
callq 0x3b9c
cmpl $0x3, 0x88(%rbp)
jb 0xd8ab
cmpb $0x0, 0x8c(%rbp)
jne 0xd880
leaq 0x187a1(%rip), %rsi     # 0x26018
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
cmpl $0x3, 0x88(%rbp)
je 0xd892
cmpb $0x1, 0x90(%rbp)
jne 0xd8ab
cmpb $0x0, 0x8d(%rbp)
jne 0xd8ab
leaq 0x18795(%rip), %rsi     # 0x26037
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x0, 0x1c(%rsp)
jmp 0xd1cb
movq 0x10(%rsp), %rax
movq (%rax), %rsi
leaq 0x1868b(%rip), %rdi     # 0x25f64
xorl %eax, %eax
callq 0x3030
jmp 0xd45d
nop