// File: /workspace/github_cpp_makefile_star2_O3/rpavlik[P]edid-decode/parse-base-block.cpp
// Function: edid_state::detailed_timings(char const*, unsigned char const*, bool)
void edid_state::detailed_timings(const char *prefix, const unsigned char *x,
				  bool base_or_cta)
{
	struct timings t = {};
	unsigned hbl, vbl;
	std::string s_sync, s_flags;

	// Only count DTDs in base block 0 or CTA-861 extension blocks
	if (base_or_cta)
		base.dtd_cnt++;
	data_block = "Detailed Timing Descriptor #" + std::to_string(base.dtd_cnt);
	t.pixclk_khz = (x[0] + (x[1] << 8)) * 10;
	if (t.pixclk_khz < 10000) {
		printf("%sDetailed mode: ", prefix);
		hex_block("", x, 18, true, 18);
		if (!t.pixclk_khz)
			fail("First two bytes are 0, invalid data.\n");
		else
			fail("Pixelclock < 10 MHz, assuming invalid data 0x%02x 0x%02x.\n",
			     x[0], x[1]);
		return;
	}

	/*
	 * If the borders are non-zero, then it is unclear how to interpret
	 * the DTD blanking parameters.
	 *
	 * According to EDID 1.3 (3.12) the Hor/Vert Blanking includes the
	 * borders, and so does the Hor/Vert Sync Offset.
	 *
	 * According to EDID 1.4 (3.12) the Hor/Vert Blanking excludes the
	 * borders, and they are also excluded from the Hor/Vert Front Porch.
	 *
	 * But looking at what is really done in EDIDs is that the Hor/Vert
	 * Blanking follows EDID 1.3, but the Hor/Vert Front Porch does not
	 * include the border.
	 *
	 * So hbl/vbl includes the borders, so those need to be subtracted,
	 * but hfp/vfp is used as-is.
	 *
	 * In practice you really shouldn't use non-zero borders in DTDs
	 * since clearly nobody knows how to interpret the timing.
	 */
	t.hact = (x[2] + ((x[4] & 0xf0) << 4));
	t.hborder = x[15];
	hbl = (x[3] + ((x[4] & 0x0f) << 8)) - t.hborder * 2;
	t.hfp = (x[8] + ((x[11] & 0xc0) << 2));
	t.hsync = (x[9] + ((x[11] & 0x30) << 4));
	t.hbp = hbl - t.hsync - t.hfp;
	t.vact = (x[5] + ((x[7] & 0xf0) << 4));
	t.vborder = x[16];
	vbl = (x[6] + ((x[7] & 0x0f) << 8)) - t.vborder * 2;
	t.vfp = ((x[10] >> 4) + ((x[11] & 0x0c) << 2));
	t.vsync = ((x[10] & 0x0f) + ((x[11] & 0x03) << 4));
	t.vbp = vbl - t.vsync - t.vfp;

	unsigned char flags = x[17];

	if (base.has_spwg && base.detailed_block_cnt == 2)
		flags = *(x - 1);

	switch ((flags & 0x18) >> 3) {
	case 0x00:
		s_flags = "analog composite";
		/* fall-through */
	case 0x01:
		if (s_flags.empty())
			s_flags = "bipolar analog composite";
		switch ((flags & 0x06) >> 1) {
		case 0x00:
			add_str(s_flags, "sync-on-green");
			break;
		case 0x01:
			break;
		case 0x02:
			add_str(s_flags, "serrate, sync-on-green");
			break;
		case 0x03:
			add_str(s_flags, "serrate");
			break;
		}
		break;
	case 0x02:
		if (flags & (1 << 1))
			t.pos_pol_hsync = true;
		t.no_pol_vsync = true;
		s_flags = "digital composite";
		if (flags & (1 << 2))
		    add_str(s_flags, "serrate");
		break;
	case 0x03:
		if (flags & (1 << 1))
			t.pos_pol_hsync = true;
		if (flags & (1 << 2))
			t.pos_pol_vsync = true;
		s_sync = t.pos_pol_hsync ? "+hsync " : "-hsync ";
		s_sync += t.pos_pol_vsync ? "+vsync " : "-vsync ";
		if (base.has_spwg && (flags & 0x01))
			s_flags = "DE timing only";
		break;
	}
	if (flags & 0x80) {
		t.interlaced = true;
		t.vact *= 2;
		/*
		 * Check if this DTD matches VIC code 39 with special
		 * interlaced timings.
		 */
		if (t.hact == 1920 && t.vact == 1080 && t.pixclk_khz == 72000 &&
		    t.hfp == 32 && t.hsync == 168 && t.hbp == 184 && !t.hborder &&
		    t.vfp == 23 && t.vsync == 5 && t.vbp == 57 && !t.vborder &&
		    !base.has_spwg && cta.preparsed_has_vic[0][39] && (flags & 0x1e) == 0x1a)
			t.even_vtotal = true;
	}
	switch (flags & 0x61) {
	case 0x20:
		add_str(s_flags, "field sequential L/R");
		break;
	case 0x40:
		add_str(s_flags, "field sequential R/L");
		break;
	case 0x21:
		add_str(s_flags, "interleaved right even");
		break;
	case 0x41:
		add_str(s_flags, "interleaved left even");
		break;
	case 0x60:
		add_str(s_flags, "four way interleaved");
		break;
	case 0x61:
		add_str(s_flags, "side by side interleaved");
		break;
	default:
		break;
	}

	t.hsize_mm = x[12] + ((x[14] & 0xf0) << 4);
	t.vsize_mm = x[13] + ((x[14] & 0x0f) << 8);

	calc_ratio(&t);

	std::string s_type = base_or_cta ? dtd_type() : "DTD";
	bool ok = print_timings(prefix, &t, s_type.c_str(), s_flags.c_str(), true);
	timings_ext te(t, s_type, s_flags);

	if (block_nr == 0 && base.dtd_cnt == 1) {
		te.type = "DTD   1";
		base.preferred_timing = te;
		if (has_cta) {
			cta.preferred_timings.push_back(te);
			cta.native_timings.push_back(te);
		}
	}
	if (base_or_cta)
		cta.vec_dtds.push_back(te);

	if (t.hborder || t.vborder)
		warn("The use of non-zero borders in a DTD is not recommended.\n");
	if ((base.max_display_width_mm && !t.hsize_mm) ||
	    (base.max_display_height_mm && !t.vsize_mm)) {
		fail("Mismatch of image size vs display size: image size is not set, but display size is.\n");
	}
	if (base.has_spwg && base.detailed_block_cnt == 2)
		printf("%sSPWG Module Revision: %hhu\n", prefix, x[17]);
	if (!ok) {
		std::string s = prefix;

		s += "               ";
		hex_block(s.c_str(), x, 18, true, 18);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pxor %xmm0, %xmm0
movdqa %xmm0, 0x90(%rsp)
movdqa %xmm0, 0x80(%rsp)
movdqa %xmm0, 0x70(%rsp)
movdqa %xmm0, 0x60(%rsp)
movdqa %xmm0, 0x50(%rsp)
movl $0x0, 0xa0(%rsp)
leaq 0x158(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x20(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movl 0xc0(%rdi), %r12d
testl %ebp, %ebp
je 0xb1c3
incl %r12d
movl %r12d, 0xc0(%r15)
movl $0x1, %eax
cmpl $0xa, %r12d
jb 0xb213
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %r12d, %edx
cmpl $0x63, %edx
jbe 0xb20c
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0xb211
cmpl $0x2710, %edx           # imm = 0x2710
jb 0xb213
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0xb1db
addl $-0x3, %eax
jmp 0xb213
addl $-0x2, %eax
jmp 0xb213
decl %eax
movl %eax, %esi
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x30(%rsp), %rdi
xorl %edx, %edx
callq 0x32a0
leaq 0x30(%rsp), %r13
movq (%r13), %rdi
movl 0x8(%r13), %esi
movl %r12d, %edx
callq 0x8a6d
leaq 0x1a003(%rip), %rcx     # 0x25249
movl $0x1c, %r8d
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3290
leaq 0xc0(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb288
movq %rdx, 0xb0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc0(%rsp)
jmp 0xb292
movdqu (%rcx), %xmm0
movdqu %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0xb0(%rsp), %r12
movq %rdx, 0x8(%r12)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x30(%r15), %rdi
movq %r12, %rsi
callq 0x32d0
movq (%r12), %rdi
cmpq %r13, %rdi
je 0xb2d7
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xb2f3
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3260
movzwl (%rbx), %eax
leal (%rax,%rax), %ecx
leal (%rcx,%rcx,4), %ecx
movl %ecx, 0x60(%rsp)
cmpl $0x3e7, %eax            # imm = 0x3E7
ja 0xb35e
leaq 0x19f58(%rip), %rdi     # 0x25266
movq %r14, %rsi
xorl %eax, %eax
callq 0x3030
leaq 0x1596a(%rip), %rdi     # 0x20c89
movq %rbx, %rsi
movl $0x12, %edx
movl $0x1, %ecx
movl $0x12, %r8d
callq 0x5bd2
cmpl $0x0, 0x60(%rsp)
je 0xb4fb
movzbl (%rbx), %edx
movzbl 0x1(%rbx), %ecx
leaq 0x19f4e(%rip), %rsi     # 0x2529e
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
jmp 0xbc02
movzbl 0x2(%rbx), %eax
movzbl 0x4(%rbx), %ecx
movl %ecx, %edx
andl $-0x10, %edx
shll $0x4, %edx
orl %eax, %edx
movl %edx, 0x50(%rsp)
movzbl 0xf(%rbx), %edx
movl %edx, 0x8c(%rsp)
movzbl 0x3(%rbx), %eax
andl $0xf, %ecx
shll $0x8, %ecx
orl %eax, %ecx
movzbl 0x8(%rbx), %esi
movzbl 0xb(%rbx), %eax
movl %eax, %edi
andl $-0x40, %edi
leal (%rsi,%rdi,4), %esi
movl %esi, 0x6c(%rsp)
movzbl 0x9(%rbx), %edi
movl %eax, %r8d
andl $0x30, %r8d
shll $0x4, %r8d
orl %edi, %r8d
movl %r8d, 0x70(%rsp)
leal (%r8,%rdx,2), %edx
addl %esi, %edx
subl %edx, %ecx
movl %ecx, 0x74(%rsp)
movzbl 0x5(%rbx), %edx
movzbl 0x7(%rbx), %ecx
movl %ecx, %esi
andl $-0x10, %esi
shll $0x4, %esi
orl %edx, %esi
movl %esi, 0x54(%rsp)
movzbl 0x10(%rbx), %edx
movl %edx, 0x90(%rsp)
movzbl 0x6(%rbx), %esi
andl $0xf, %ecx
shll $0x8, %ecx
orl %esi, %ecx
movb 0xa(%rbx), %sil
movl %esi, %edi
shrb $0x4, %dil
leal (,%rax,4), %r8d
andb $0x30, %r8b
orb %dil, %r8b
movzbl %r8b, %edi
movl %edi, 0x7c(%rsp)
andb $0xf, %sil
shlb $0x4, %al
andb $0x30, %al
orb %sil, %al
movzbl %al, %eax
movl %eax, 0x80(%rsp)
leal (%rax,%rdx,2), %eax
addl %edi, %eax
subl %eax, %ecx
movl %ecx, 0x84(%rsp)
cmpl $0x2, 0xbc(%r15)
sete %al
andb 0xb9(%r15), %al
movzbl %al, %eax
negq %rax
orq $0x11, %rax
movzbl (%rbx,%rax), %r12d
movl %r12d, %eax
shrl $0x3, %eax
andl $0x3, %eax
leaq 0x17097(%rip), %rcx     # 0x224fc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x19e63(%rip), %rcx     # 0x252e1
movl $0x10, %r8d
xorl %esi, %esi
callq 0x3390
cmpq $0x0, 0x18(%rsp)
jne 0xb4ae
leaq 0x19e3f(%rip), %rcx     # 0x252d9
leaq 0x10(%rsp), %rdi
movl $0x18, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3390
movl %r12d, %eax
shrl %eax
andl $0x3, %eax
leaq 0x1704f(%rip), %rcx     # 0x2250c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xb0(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x19e23(%rip), %rsi     # 0x252fb
leaq 0x19e29(%rip), %rdx     # 0x25308
callq 0x8d58
leaq 0x10(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x9aba
jmp 0xb688
leaq 0x19d76(%rip), %rsi     # 0x25278
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
jmp 0xbc02
testb $0x2, %r12b
je 0xb51b
movb $0x1, 0x78(%rsp)
movb $0x1, 0x95(%rsp)
leaq 0x10(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x19dde(%rip), %rcx     # 0x25311
movl $0x11, %r8d
xorl %esi, %esi
callq 0x3390
testb $0x4, %r12b
je 0xb6a5
leaq 0xb0(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x19dad(%rip), %rsi     # 0x25309
leaq 0x19dad(%rip), %rdx     # 0x25310
callq 0x8d58
leaq 0x10(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x9aba
jmp 0xb688
testb $0x2, %r12b
je 0xb58a
movb $0x1, 0x78(%rsp)
testb $0x4, %r12b
je 0xb598
movb $0x1, 0x88(%rsp)
leaq 0x19d84(%rip), %rax     # 0x25323
leaq 0x19d85(%rip), %rcx     # 0x2532b
cmpb $0x0, 0x78(%rsp)
cmovneq %rax, %rcx
leaq 0x148(%rsp), %rdi
movq 0x8(%rdi), %rdx
movl $0x7, %r8d
xorl %esi, %esi
callq 0x3390
leaq 0x19d64(%rip), %rax     # 0x25333
leaq 0x19d65(%rip), %rsi     # 0x2533b
cmpb $0x0, 0x88(%rsp)
cmovneq %rax, %rsi
leaq 0x148(%rsp), %rdi
callq 0x3420
testb $0x1, %r12b
je 0xb6a5
cmpb $0x0, 0xb9(%r15)
je 0xb6a5
leaq 0x10(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x19d2c(%rip), %rcx     # 0x25343
movl $0xe, %r8d
xorl %esi, %esi
callq 0x3390
jmp 0xb6a5
leaq 0xb0(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x19cba(%rip), %rsi     # 0x252f2
leaq 0x19cc9(%rip), %rdx     # 0x25308
callq 0x8d58
leaq 0x10(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x9aba
jmp 0xb688
leaq 0xb0(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x19c9f(%rip), %rsi     # 0x25309
leaq 0x19c9f(%rip), %rdx     # 0x25310
callq 0x8d58
leaq 0x10(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x9aba
movq 0xb0(%rsp), %rdi
cmpq %r13, %rdi
je 0xb6a5
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3260
testb %r12b, %r12b
js 0xb75e
andl $0x61, %r12d
cmpl $0x40, %r12d
jg 0xb70b
cmpl $0x20, %r12d
je 0xb838
cmpl $0x21, %r12d
je 0xb89f
cmpl $0x40, %r12d
jne 0xb91e
leaq 0xb0(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x19c7f(%rip), %rsi     # 0x25367
leaq 0x19c8c(%rip), %rdx     # 0x2537b
callq 0x8d58
leaq 0x10(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x9aba
jmp 0xb901
cmpl $0x41, %r12d
je 0xb86d
cmpl $0x60, %r12d
je 0xb8d1
cmpl $0x61, %r12d
jne 0xb91e
leaq 0xb0(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x19c83(%rip), %rsi     # 0x253be
leaq 0x19c94(%rip), %rdx     # 0x253d6
callq 0x8d58
leaq 0x10(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x9aba
jmp 0xb901
movb $0x1, 0x68(%rsp)
movl 0x50(%rsp), %ecx
movl 0x54(%rsp), %eax
addl %eax, %eax
movl %eax, 0x54(%rsp)
cmpl $0x780, %ecx            # imm = 0x780
jne 0xb6ae
cmpl $0x438, %eax            # imm = 0x438
jne 0xb6ae
cmpl $0x11940, 0x60(%rsp)    # imm = 0x11940
jne 0xb6ae
cmpl $0x20, 0x6c(%rsp)
jne 0xb6ae
cmpl $0xa8, 0x70(%rsp)
jne 0xb6ae
cmpl $0xb8, 0x74(%rsp)
jne 0xb6ae
cmpl $0x0, 0x8c(%rsp)
jne 0xb6ae
cmpl $0x17, 0x7c(%rsp)
jne 0xb6ae
cmpl $0x5, 0x80(%rsp)
jne 0xb6ae
cmpl $0x39, 0x84(%rsp)
jne 0xb6ae
cmpl $0x0, 0x90(%rsp)
jne 0xb6ae
cmpb $0x0, 0xb9(%r15)
jne 0xb6ae
movl %r12d, %eax
andl $0x1e, %eax
cmpl $0x1a, %eax
jne 0xb6ae
cmpb $0x0, 0x707(%r15)
je 0xb6ae
movb $0x1, 0x94(%rsp)
jmp 0xb6ae
leaq 0xb0(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x19b08(%rip), %rsi     # 0x25352
leaq 0x19b15(%rip), %rdx     # 0x25366
callq 0x8d58
leaq 0x10(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x9aba
jmp 0xb901
leaq 0xb0(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x19b14(%rip), %rsi     # 0x25393
leaq 0x19b22(%rip), %rdx     # 0x253a8
callq 0x8d58
leaq 0x10(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x9aba
jmp 0xb901
leaq 0xb0(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x19acb(%rip), %rsi     # 0x2537c
leaq 0x19ada(%rip), %rdx     # 0x25392
callq 0x8d58
leaq 0x10(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x9aba
jmp 0xb901
leaq 0xb0(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x19ac6(%rip), %rsi     # 0x253a9
leaq 0x19ad3(%rip), %rdx     # 0x253bd
callq 0x8d58
leaq 0x10(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x9aba
movq 0xb0(%rsp), %rdi
cmpq %r13, %rdi
je 0xb91e
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3260
movzwl 0xc(%rbx), %eax
movd %eax, %xmm0
pxor %xmm1, %xmm1
movzbl 0xe(%rbx), %eax
movd %eax, %xmm2
punpcklbw %xmm2, %xmm2    # xmm2 = xmm2[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pand 0x18da2(%rip), %xmm2    # 0x246e0
punpcklbw %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
punpcklbw %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3],xmm2[4],xmm1[4],xmm2[5],xmm1[5],xmm2[6],xmm1[6],xmm2[7],xmm1[7]
pmullw 0x18da2(%rip), %xmm2    # 0x246f0
por %xmm0, %xmm2
punpcklwd %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3]
leaq 0x50(%rsp), %rdi
movq %xmm2, 0x48(%rdi)
callq 0x3c00
testb %bpl, %bpl
je 0xb980
movl 0xc0(%r15), %edx
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x3c50
jmp 0xb9a0
leaq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
movq %rax, (%rdi)
leaq 0x14929(%rip), %rsi     # 0x202bd
leaq 0x14925(%rip), %rdx     # 0x202c0
callq 0x8d58
movq 0x30(%rsp), %rcx
movq 0x10(%rsp), %r8
movl $0x1, (%rsp)
leaq 0x50(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
movl $0x1, %r9d
callq 0x3e8c
movl %eax, %r12d
leaq 0xb0(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0xdb20
cmpl $0x0, 0x8(%r15)
jne 0xba98
cmpl $0x1, 0xc0(%r15)
jne 0xba98
leaq 0x108(%rsp), %r13
movq 0x8(%r13), %rdx
leaq 0x199c5(%rip), %rcx     # 0x253d7
movl $0x7, %r8d
movq %r13, %rdi
xorl %esi, %esi
callq 0x3390
leaq 0xc8(%r15), %rdi
leaq 0xb0(%rsp), %rax
movl $0xa, %ecx
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x50(%rax), %eax
movl %eax, 0x118(%r15)
leaq 0x120(%r15), %rdi
movq %r13, %rsi
callq 0x3140
leaq 0x140(%r15), %rdi
leaq 0x128(%rsp), %rsi
callq 0x3140
cmpb $0x1, 0x50(%r15)
jne 0xba98
leaq 0x1c0(%r15), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xdbb0
leaq 0x2a8(%r15), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xdbb0
testb %bpl, %bpl
je 0xbab1
leaq 0x188(%r15), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xdbb0
movl 0x90(%rsp), %eax
orl 0x8c(%rsp), %eax
je 0xbad4
leaq 0x19917(%rip), %rsi     # 0x253df
movl $0x1, %edi
xorl %eax, %eax
callq 0x37cc
cmpl $0x0, 0x174(%r15)
je 0xbae8
cmpl $0x0, 0x98(%rsp)
je 0xbafc
cmpl $0x0, 0x178(%r15)
je 0xbb0c
cmpl $0x0, 0x9c(%rsp)
jne 0xbb0c
leaq 0x19916(%rip), %rsi     # 0x25419
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
cmpb $0x1, 0xb9(%r15)
jne 0xbb35
cmpl $0x2, 0xbc(%r15)
jne 0xbb35
movzbl 0x11(%rbx), %edx
leaq 0x19943(%rip), %rdi     # 0x2546e
movq %r14, %rsi
xorl %eax, %eax
callq 0x3030
testb %r12b, %r12b
jne 0xbba4
leaq 0x168(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %r14, %rsi
callq 0x8818
leaq 0x19936(%rip), %rsi     # 0x2548c
leaq 0x168(%rsp), %rdi
callq 0x3420
movq 0x168(%rsp), %rdi
movq %rbx, %rsi
movl $0x12, %edx
movl $0x1, %ecx
movl $0x12, %r8d
callq 0x5bd2
leaq 0x178(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbba4
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x3260
leaq 0x138(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbbc5
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x3260
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbbe6
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xbc02
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xbc1e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0xbc43
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x3260
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xbc6f
jmp 0xbc6f
jmp 0xbc6f
jmp 0xbc6f
jmp 0xbcd2
jmp 0xbcd2
jmp 0xbcd2
jmp 0xbcd2
jmp 0xbc6f
jmp 0xbc6f
jmp 0xbc6f
jmp 0xbc6f
jmp 0xbc6f
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %r13, %rdi
je 0xbd03
movq 0xc0(%rsp), %rsi
jmp 0xbcfb
jmp 0xbcd2
jmp 0xbcd2
jmp 0xbcd2
jmp 0xbcd2
jmp 0xbcd2
jmp 0xbcd2
jmp 0xbcd7
jmp 0xbcd2
jmp 0xbcd2
movq %rax, %rbx
leaq 0x178(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbcda
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0xbcda
jmp 0xbccb
jmp 0xbccb
jmp 0xbcd2
movq %rax, %rbx
jmp 0xbce7
jmp 0xbcd2
movq %rax, %rbx
jmp 0xbd03
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xdbdc
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xbd03
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xbd1f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0xbd44
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x3400