// File: /workspace/github_cpp_makefile_star2_O2/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::parse_displayid_interface_features(unsigned char const*)
void edid_state::parse_displayid_interface_features(const unsigned char *x)
{
	check_displayid_datablock_revision(x[1]);

	if (!check_displayid_datablock_length(x, 9))
		return;

	dispid.has_display_interface_features = true;
	unsigned len = x[2];
	if (len > 0) print_flags("    Supported bpc for RGB encoding", x[3], bpc444);
	if (len > 1) print_flags("    Supported bpc for YCbCr 4:4:4 encoding", x[4], bpc444);
	if (len > 2) print_flags("    Supported bpc for YCbCr 4:2:2 encoding", x[5], bpc4xx);
	if (len > 3) print_flags("    Supported bpc for YCbCr 4:2:0 encoding", x[6], bpc4xx);
	if (len > 4 && x[7])
		printf("    Minimum pixel rate at which YCbCr 4:2:0 encoding is supported: %.3f MHz\n",
		       74.25 * x[7]);
	if (len > 5) print_flags("    Supported audio capability and features (kHz)",
				 x[8], audiorates, true);
	if (len > 6) print_flags("    Supported color space and EOTF standard combination 1",
				 x[9], colorspace_eotf_combinations);
	if (len > 7) print_flags("    Supported color space and EOTF standard combination 2",x[10], colorspace_eotf_reserved);

	unsigned i = 0;

	if (len > 8 && x[11]) {
		printf("    Supported color space and EOTF additional combinations:");
		for (i = 0; i < x[11]; i++) {
			if (i > 6) {
				printf("\n    Number of additional color space and EOTF combinations (%d) is greater than allowed (7).", x[11]);
				break;
			} else if (i + 10 > len) {
				printf("\n    Number of additional color space and EOTF combinations (%d) is too many to fit in block (%d).", x[11], len - 9);
				break;
			}

			const char *colorspace = "Out of range";
			const char *eotf = "Out of range";
			unsigned colorspace_index = (x[12 + i] >> 4) & 0xf;
			unsigned eotf_index = x[12 + i] & 0xf;

			if (colorspace_index < sizeof(colorspaces) / sizeof(colorspaces[0]))
				colorspace = colorspaces[colorspace_index];
			if (eotf_index < sizeof(eotfs) / sizeof(eotfs[0]))
				eotf = eotfs[eotf_index];

			if (i > 0)
				printf(", ");
			if (!strcmp(colorspace, eotf))
				printf("%s", colorspace);
			else
				printf("%s/%s", colorspace, eotf);
		}
		printf("\n");
	}
	check_displayid_datablock_length(x, 9 + i, 9 + i, 9 + i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzbl 0x1(%rsi), %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x123f0
pushq $0x9
popq %rbp
pushq $0x76
popq %rdx
movq %rbx, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0x126fe
testb %al, %al
je 0x15a0f
movb $0x1, 0x921(%r14)
movzbl 0x2(%rbx), %r12d
testl %r12d, %r12d
je 0x15a58
movzbl 0x3(%rbx), %esi
leaq 0x13bb3(%rip), %rdi     # 0x293d0
leaq 0x1edcc(%rip), %rdx     # 0x345f0
xorl %ecx, %ecx
callq 0x1424a
cmpl $0x1, %r12d
je 0x15a58
movzbl 0x4(%rbx), %esi
leaq 0x13bb3(%rip), %rdi     # 0x293f3
leaq 0x1eda9(%rip), %rdx     # 0x345f0
xorl %ecx, %ecx
callq 0x1424a
cmpb $0x3, %r12b
jb 0x15a58
movzbl 0x5(%rbx), %esi
leaq 0x13bbb(%rip), %rdi     # 0x2941e
leaq 0x1edc6(%rip), %rdx     # 0x34630
xorl %ecx, %ecx
callq 0x1424a
cmpl $0x3, %r12d
je 0x15a58
movzbl 0x6(%rbx), %esi
leaq 0x1447a(%rip), %rdi     # 0x29d00
leaq 0x1eda3(%rip), %rdx     # 0x34630
xorl %ecx, %ecx
callq 0x1424a
cmpb $0x5, %r12b
jb 0x15a58
movb 0x7(%rbx), %al
testb %al, %al
je 0x158c2
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
mulsd 0x12d9c(%rip), %xmm0    # 0x28650
leaq 0x14470(%rip), %rdi     # 0x29d2b
movb $0x1, %al
callq 0x3030
cmpl $0x5, %r12d
je 0x15a58
movzbl 0x8(%rbx), %esi
leaq 0x144a1(%rip), %rdi     # 0x29d78
leaq 0x1ed92(%rip), %rdx     # 0x34670
pushq $0x1
popq %rcx
callq 0x1424a
cmpb $0x7, %r12b
jb 0x15a58
movzbl 0x9(%rbx), %esi
leaq 0x144af(%rip), %rdi     # 0x29daa
leaq 0x1edae(%rip), %rdx     # 0x346b0
xorl %ecx, %ecx
callq 0x1424a
cmpl $0x7, %r12d
je 0x15a58
movzbl 0xa(%rbx), %esi
leaq 0x144c6(%rip), %rdi     # 0x29de4
leaq 0x2b94b(%rip), %rdx     # 0x41270
xorl %ecx, %ecx
callq 0x1424a
cmpb $0x9, %r12b
jb 0x15a58
cmpb $0x0, 0xb(%rbx)
je 0x15a58
leaq 0x144d7(%rip), %rdi     # 0x29e1e
xorl %eax, %eax
callq 0x3030
leal -0x9(%r12), %eax
movq %rax, (%rsp)
leaq 0x145bd(%rip), %r15     # 0x29f1b
xorl %r13d, %r13d
movzbl 0xb(%rbx), %esi
cmpq %rsi, %r13
jae 0x15a1e
cmpq $0x7, %r13
je 0x15a27
cmpq %r13, (%rsp)
je 0x15a3b
movzbl 0xc(%rbx,%r13), %eax
movq %r15, %rbp
testb %al, %al
js 0x159a2
movl %eax, %ecx
shrl $0x4, %ecx
leaq 0x12ff9(%rip), %rdx     # 0x28994
movslq (%rdx,%rcx,4), %rbp
addq %rdx, %rbp
andl $0xf, %eax
movq %r15, %r14
cmpl $0xa, %eax
ja 0x159bb
leaq 0x13000(%rip), %rcx     # 0x289b4
movslq (%rcx,%rax,4), %r15
addq %rcx, %r15
testq %r13, %r13
je 0x159ce
leaq 0x5157(%rip), %rdi      # 0x1ab1e
xorl %eax, %eax
callq 0x3030
movq %rbp, %rdi
movq %r15, %rsi
callq 0x3350
testl %eax, %eax
je 0x159f3
leaq 0x14544(%rip), %rdi     # 0x29f28
movq %rbp, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3030
jmp 0x15a04
leaq 0x5378(%rip), %rdi      # 0x1ad72
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3030
movq %r14, %r15
incq %r13
jmp 0x15961
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addl $0x9, %r13d
movl %r13d, %r12d
jmp 0x15a4d
leaq 0x1442c(%rip), %rdi     # 0x29e5a
xorl %eax, %eax
callq 0x3030
pushq $0x10
popq %r12
jmp 0x15a4d
leaq 0x14476(%rip), %rdi     # 0x29eb8
movq (%rsp), %rdx
xorl %eax, %eax
callq 0x3030
pushq $0xa
popq %rdi
callq 0x3340
movl %r12d, %ebp
movq %rbx, %rdi
movl %ebp, %esi
movl %ebp, %edx
movl %ebp, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x126fe