// File: /workspace/github_cpp_makefile_star2_O1/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 $0x118, %rsp            # imm = 0x118
movq %rsi, 0x78(%rsp)
testl %edx, %edx
je 0xf202
movl %edx, %ebp
leaq 0x1c0(%rdi), %rax
movq %rdi, 0x50(%rsp)
movq 0x1c0(%rdi), %rsi
movq %rax, 0x48(%rsp)
movq %rax, %rdi
callq 0xe144
leaq 0x80(%rsp), %r13
leaq 0x88(%r13), %rax
movq %rax, 0x40(%rsp)
movl %ebp, %r15d
leaq 0x8(%rsp), %rbx
xorl %r14d, %r14d
movq %r15, 0x28(%rsp)
movq %r13, %rbp
movq 0x78(%rsp), %rax
movzbl (%rax,%r14), %r13d
testb %r13b, %r13b
setle %al
leal 0x3f(%r13), %r12d
cmpb $0x3d, %r12b
setae %cl
testb %cl, %al
jne 0xedf5
leaq 0x30(%rsp), %r15
movq %r15, %rdi
leaq 0x11b2d(%rip), %rsi     # 0x208f4
movl %r13d, %edx
xorl %eax, %eax
callq 0x3070
testb %r13b, %r13b
jle 0xef79
movl %r13d, %eax
imulq $0x54, %rax, %rax
leaq 0x17ce8(%rip), %rcx     # 0x26ad0
leaq (%rax,%rcx), %r12
addq $-0x54, %r12
jmp 0xf055
leal 0x7f(%r13), %eax
cmpb $0xf, %al
ja 0xee94
leal -0x80(%r13), %r12d
leaq 0x30(%rsp), %r15
movq %r15, %rdi
leaq 0x1b346(%rip), %rsi     # 0x2a15a
movl %r12d, %edx
xorl %eax, %eax
callq 0x3070
movq 0x50(%rsp), %rax
movl 0x180(%rax), %eax
movl $0x81, %ecx
addl %ecx, %eax
cmpl %r13d, %eax
jbe 0xef9e
leaq 0x1b8bf(%rip), %rdi     # 0x2a6ff
movq %r15, %rsi
xorl %eax, %eax
callq 0x3030
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
callq 0x3110
leaq (%rsp,%rax), %rdx
addq $0x30, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8f6e
movq %rbp, %rdi
movl %r13d, %esi
movq %rbx, %rdx
callq 0x15c9c
movq 0x28(%rsp), %r15
movq 0x48(%rsp), %rdi
movq %rbp, %rsi
callq 0x16042
jmp 0xef31
leal 0x6f(%r13), %eax
cmpb $0xf, %al
ja 0xefbd
leal -0x90(%r13), %r12d
leaq 0x30(%rsp), %r15
movq %r15, %rdi
leaq 0x1b2ce(%rip), %rsi     # 0x2a184
movl %r12d, %edx
xorl %eax, %eax
callq 0x3070
movq 0x50(%rsp), %rax
movl 0x1a0(%rax), %eax
movl $0x91, %ecx
addl %ecx, %eax
cmpl %r13d, %eax
jbe 0xf191
leaq 0x1b81d(%rip), %rdi     # 0x2a6ff
movq %r15, %rsi
xorl %eax, %eax
callq 0x3030
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
callq 0x3110
leaq (%rsp,%rax), %rdx
addq $0x30, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8f6e
movq %rbp, %rdi
movl %r13d, %esi
movq %rbx, %rdx
callq 0x15c9c
movq 0x28(%rsp), %r15
movq 0x48(%rsp), %rdi
movq %rbp, %rsi
callq 0x16042
movq %rbp, %r13
movq 0xf8(%rsp), %rdi
cmpq 0x40(%rsp), %rdi
je 0xef53
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0xf154
movq 0xe8(%rsp), %rsi
jmp 0xf14c
cmpb $0x1a, %r12b
ja 0xf052
imulq $0x54, %r13, %rax
leaq 0x1a4f2(%rip), %rcx     # 0x29480
leaq (%rax,%rcx), %r12
addq $-0x3f54, %r12          # imm = 0xC0AC
jmp 0xf055
leaq 0x1b1bd(%rip), %rdi     # 0x2a162
movq %r15, %rsi
xorl %eax, %eax
callq 0x3030
xorl %edi, %edi
leaq 0x1b1bb(%rip), %rsi     # 0x2a173
jmp 0xf1ab
cmpl $0xfe, %r13d
movq %rbp, %r13
jne 0xf1bd
movl $0x424454, 0x33(%rsp)   # imm = 0x424454
movl $0x54563854, 0x30(%rsp) # imm = 0x54563854
movq 0x50(%rsp), %rax
cmpb $0x0, 0x1d8(%rax)
je 0xf1cb
movq %r15, %r12
leaq 0x1b706(%rip), %rdi     # 0x2a6ff
leaq 0x30(%rsp), %r15
movq %r15, %rsi
xorl %eax, %eax
callq 0x3030
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
callq 0x3110
leaq (%rsp,%rax), %rdx
addq $0x30, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8f6e
movq %r13, %rdi
movl $0xfe, %esi
movq %rbx, %rdx
callq 0x15c9c
movq 0x48(%rsp), %rdi
movq %r13, %rsi
callq 0x16042
movq %r12, %r15
jmp 0xef34
xorl %r12d, %r12d
leaq 0x11c1d(%rip), %r8      # 0x20c79
testq %r12, %r12
je 0xf172
movl $0x1, (%rsp)
movq 0x50(%rsp), %rdi
leaq 0x163cf(%rip), %rsi     # 0x25447
movq %r12, %rdx
movq %r15, %rcx
xorl %r9d, %r9d
movq %r15, %r13
movq %r8, %r15
callq 0x3ebe
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r13, %rdi
callq 0x3110
leaq (%rsp,%rax), %rdx
addq $0x30, %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x8f6e
movq %rbp, %r13
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x58(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x8f6e
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
callq 0xdce2
movq 0x28(%rsp), %r15
movq 0x48(%rsp), %rdi
movq %r13, %rsi
callq 0x16042
movq 0xf8(%rsp), %rdi
cmpq 0x40(%rsp), %rdi
je 0xf113
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0xf138
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0xf154
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xf1bd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0xf1bd
leaq 0x1afd0(%rip), %rdi     # 0x2a149
movq %r15, %rsi
xorl %eax, %eax
callq 0x3030
xorl %edi, %edi
leaq 0x1aea4(%rip), %rsi     # 0x2a030
movl %r13d, %edx
jmp 0xf1ae
leaq 0x1afca(%rip), %rdi     # 0x2a162
movq %r15, %rsi
xorl %eax, %eax
callq 0x3030
xorl %edi, %edi
leaq 0x1afe2(%rip), %rsi     # 0x2a18d
movl %r12d, %edx
xorl %eax, %eax
callq 0x37ec
movq %rbp, %r13
movq 0x28(%rsp), %r15
incq %r14
cmpq %r14, %r15
jne 0xed96
jmp 0xf1f0
leaq 0x1af90(%rip), %rdi     # 0x2a162
leaq 0x30(%rsp), %rsi
xorl %eax, %eax
callq 0x3030
xorl %edi, %edi
leaq 0x1afbf(%rip), %rsi     # 0x2a1a6
xorl %eax, %eax
callq 0x37ec
jmp 0xf1bd
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1af1e(%rip), %rsi     # 0x2a127
xorl %edi, %edi
xorl %edx, %edx
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x37ec
jmp 0xf231
jmp 0xf247
jmp 0xf24c
jmp 0xf231
jmp 0xf247
jmp 0xf24c
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0xdd9e
jmp 0xf282
jmp 0xf247
jmp 0xf24c
movq %rax, %rbx
jmp 0xf282
movq %rax, %rbx
jmp 0xf29e
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0xdd9e
jmp 0xf266
movq %rax, %rbx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0xf282
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xf29e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x3400