// File: /workspace/github_cpp_makefile_star2_O3/rpavlik[P]edid-decode/parse-cta-block.cpp
// Function: edid_state::cta_vfpdb(unsigned char const*, unsigned int)
void edid_state::cta_vfpdb(const unsigned char *x, unsigned length)
{
	unsigned i;

	if (length == 0) {
		fail("Empty Data Block with length %u.\n", length);
		return;
	}
	cta.preferred_timings.clear();
	for (i = 0; i < length; i++)  {
		unsigned char svr = x[i];
		char suffix[16];

		if ((svr > 0 && svr < 128) || (svr > 192 && svr < 254)) {
			const struct timings *t;
			unsigned char vic = svr;

			sprintf(suffix, "VIC %3u", vic);

			t = find_vic_id(vic);
			if (t) {
				print_timings("    ", t, suffix);
				cta.preferred_timings.push_back(timings_ext(*t, suffix, ""));
			} else {
				printf("    %s: Unknown\n", suffix);
				fail("Unknown VIC %u.\n", vic);
			}

		} else if (svr >= 129 && svr <= 144) {
			sprintf(suffix, "DTD %3u", svr - 128);
			if (svr >= cta.preparsed_total_dtds + 129) {
				printf("    %s: Invalid\n", suffix);
				fail("Invalid DTD %u.\n", svr - 128);
			} else {
				printf("    %s\n", suffix);
				cta.preferred_timings.push_back(timings_ext(svr, suffix));
			}
		} else if (svr >= 145 && svr <= 160) {
			sprintf(suffix, "VTDB %3u", svr - 144);
			if (svr >= cta.preparsed_total_vtdbs + 145) {
				printf("    %s: Invalid\n", suffix);
				fail("Invalid VTDB %u.\n", svr - 144);
			} else {
				printf("    %s\n", suffix);
				cta.preferred_timings.push_back(timings_ext(svr, suffix));
			}
		} else if (svr == 254) {
			sprintf(suffix, "T8VTDB");
			if (!cta.preparsed_has_t8vtdb) {
				printf("    %s: Invalid\n", suffix);
				fail("Invalid T8VTDB.\n");
			} else {
				printf("    %s\n", suffix);
				cta.preferred_timings.push_back(timings_ext(svr, suffix));
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, 0x88(%rsp)
testl %edx, %edx
je 0xf05c
movl %edx, %ebp
leaq 0x1c0(%rdi), %rax
movq %rdi, 0x58(%rsp)
movq 0x1c0(%rdi), %rsi
movq %rax, 0x50(%rsp)
movq %rax, %rdi
callq 0xdf82
leaq 0x90(%rsp), %r12
leaq 0x88(%r12), %rax
movq %rax, 0x48(%rsp)
movl %ebp, %eax
movq %rax, 0x80(%rsp)
leaq 0x30(%rsp), %rbp
leaq 0x10(%rsp), %rbx
xorl %r14d, %r14d
movq %r12, %r15
movq 0x88(%rsp), %rax
movzbl (%rax,%r14), %r13d
testb %r13b, %r13b
setle %al
leal 0x3f(%r13), %r12d
cmpb $0x3d, %r12b
setae %cl
testb %cl, %al
jne 0xed86
movq %rbp, %rdi
leaq 0x11c9e(%rip), %rsi     # 0x20904
movl %r13d, %edx
xorl %eax, %eax
callq 0x3070
leaq 0x17e25(%rip), %rax     # 0x26a9c
testb %r13b, %r13b
jg 0xec8d
leaq 0x168c9(%rip), %rax     # 0x2554c
cmpb $0x1a, %r12b
ja 0xefc9
movl %r13d, %ecx
imulq $0x54, %rcx, %r13
addq %rax, %r13
movl $0x1, (%rsp)
movq 0x58(%rsp), %rdi
leaq 0x167ed(%rip), %rsi     # 0x25497
movq %r13, %rdx
movq %rbp, %rcx
leaq 0x11fd2(%rip), %r12     # 0x20c89
movq %r12, %r8
xorl %r9d, %r9d
callq 0x3e8c
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbp, %rdi
callq 0x3110
leaq (%rsp,%rax), %rdx
addq $0x30, %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x8d58
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x60(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movq %r12, %rdx
callq 0x8d58
movq %r15, %r12
movq %r15, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
callq 0xdb20
movq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x15ede
movq 0x108(%rsp), %rdi
cmpq 0x48(%rsp), %rdi
je 0xed44
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0xed69
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xefa6
movq 0x70(%rsp), %rsi
jmp 0xef9e
leal 0x7f(%r13), %eax
cmpb $0xf, %al
ja 0xee1e
leal -0x80(%r13), %r12d
movq %rbp, %rdi
leaq 0x1b3e2(%rip), %rsi     # 0x2a182
movl %r12d, %edx
xorl %eax, %eax
callq 0x3070
movq 0x58(%rsp), %rax
movl 0x180(%rax), %eax
movl $0x81, %ecx
addl %ecx, %eax
cmpl %r13d, %eax
jbe 0xeeb9
leaq 0x1b95b(%rip), %rdi     # 0x2a727
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3030
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbp, %rdi
callq 0x3110
leaq (%rsp,%rax), %rdx
addq $0x30, %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x8d58
movq %r15, %r12
movq %r15, %rdi
movl %r13d, %esi
movq %rbx, %rdx
callq 0x15b38
movq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x15ede
jmp 0xef62
leal 0x6f(%r13), %eax
cmpb $0xf, %al
ja 0xeed8
leal -0x90(%r13), %r12d
movq %rbp, %rdi
leaq 0x1b371(%rip), %rsi     # 0x2a1ac
movl %r12d, %edx
xorl %eax, %eax
callq 0x3070
movq 0x58(%rsp), %rax
movl 0x1a0(%rax), %eax
movl $0x91, %ecx
addl %ecx, %eax
cmpl %r13d, %eax
jbe 0xefe8
leaq 0x1b8c0(%rip), %rdi     # 0x2a727
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3030
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbp, %rdi
callq 0x3110
leaq (%rsp,%rax), %rdx
addq $0x30, %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x8d58
movq %r15, %r12
movq %r15, %rdi
movl %r13d, %esi
movq %rbx, %rdx
callq 0x15b38
movq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x15ede
jmp 0xef62
leaq 0x1b2ca(%rip), %rdi     # 0x2a18a
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3030
xorl %edi, %edi
leaq 0x1b2c8(%rip), %rsi     # 0x2a19b
jmp 0xf002
cmpl $0xfe, %r13d
movq %r15, %r12
jne 0xf00f
movl $0x424454, 0x33(%rsp)   # imm = 0x424454
movl $0x54563854, 0x30(%rsp) # imm = 0x54563854
movq 0x58(%rsp), %rax
cmpb $0x0, 0x1d8(%rax)
je 0xf022
leaq 0x1b816(%rip), %rdi     # 0x2a727
leaq 0x30(%rsp), %r15
movq %r15, %rsi
xorl %eax, %eax
callq 0x3030
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r15, %rdi
callq 0x3110
leaq (%rsp,%rax), %rdx
addq $0x30, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8d58
movq %r12, %rdi
movl $0xfe, %esi
movq %rbx, %rdx
callq 0x15b38
movq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x15ede
movq 0x108(%rsp), %rdi
cmpq 0x48(%rsp), %rdi
je 0xef81
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0xefa6
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xefc2
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3260
leaq 0x30(%rsp), %rbp
jmp 0xf00f
leaq 0x1b1a1(%rip), %rdi     # 0x2a171
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3030
xorl %edi, %edi
leaq 0x1b075(%rip), %rsi     # 0x2a058
movl %r13d, %edx
jmp 0xf005
leaq 0x1b19b(%rip), %rdi     # 0x2a18a
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3030
xorl %edi, %edi
leaq 0x1b1b3(%rip), %rsi     # 0x2a1b5
movl %r12d, %edx
xorl %eax, %eax
callq 0x37cc
movq %r15, %r12
incq %r14
cmpq %r14, 0x80(%rsp)
jne 0xec33
jmp 0xf04a
leaq 0x1b161(%rip), %rdi     # 0x2a18a
leaq 0x30(%rsp), %rbp
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3030
xorl %edi, %edi
leaq 0x1b18d(%rip), %rsi     # 0x2a1ce
xorl %eax, %eax
callq 0x37cc
jmp 0xf00f
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1b0ec(%rip), %rsi     # 0x2a14f
xorl %edi, %edi
xorl %edx, %edx
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x37cc
jmp 0xf08b
jmp 0xf0a6
jmp 0xf0ab
jmp 0xf08b
jmp 0xf0a6
jmp 0xf0ab
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0xdbdc
jmp 0xf0dc
jmp 0xf0a6
jmp 0xf0ab
movq %rax, %rbx
jmp 0xf0c0
movq %rax, %rbx
jmp 0xf0dc
movq %rax, %rbx
jmp 0xf0f8
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0xdbdc
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xf0dc
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xf0f8
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x3400