// File: /workspace/github_cpp_makefile_star2_O1/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 0x1627c
movq %rbx, %rdi
movl $0x9, %esi
movl $0x76, %edx
xorl %ecx, %ecx
callq 0x165ab
testb %al, %al
je 0x1a7a9
movb $0x1, 0x921(%r14)
movzbl 0x2(%rbx), %r14d
testl %r14d, %r14d
je 0x1a5d7
movzbl 0x3(%rbx), %esi
leaq 0x14dc7(%rip), %rdi     # 0x2f390
leaq 0x20000(%rip), %rdx     # 0x3a5d0
xorl %ecx, %ecx
callq 0x186b9
cmpb $0x2, %r14b
jb 0x1a5f6
movzbl 0x4(%rbx), %esi
leaq 0x14dcb(%rip), %rdi     # 0x2f3b3
leaq 0x1ffe1(%rip), %rdx     # 0x3a5d0
xorl %ecx, %ecx
callq 0x186b9
cmpb $0x3, %r14b
jb 0x1a615
movzbl 0x5(%rbx), %esi
leaq 0x14dd7(%rip), %rdi     # 0x2f3de
leaq 0x20002(%rip), %rdx     # 0x3a610
xorl %ecx, %ecx
callq 0x186b9
cmpb $0x4, %r14b
jb 0x1a634
movzbl 0x6(%rbx), %esi
leaq 0x1569a(%rip), %rdi     # 0x2fcc0
leaq 0x1ffe3(%rip), %rdx     # 0x3a610
xorl %ecx, %ecx
callq 0x186b9
cmpb $0x5, %r14b
jb 0x1a65e
movb 0x7(%rbx), %al
testb %al, %al
je 0x1a65e
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
mulsd 0x13fd0(%rip), %xmm0    # 0x2e620
leaq 0x15694(%rip), %rdi     # 0x2fceb
movb $0x1, %al
callq 0x3030
cmpb $0x6, %r14b
jb 0x1a680
movzbl 0x8(%rbx), %esi
leaq 0x156c9(%rip), %rdi     # 0x2fd38
leaq 0x1ffda(%rip), %rdx     # 0x3a650
movl $0x1, %ecx
callq 0x186b9
cmpb $0x7, %r14b
jb 0x1a69f
movzbl 0x9(%rbx), %esi
leaq 0x156d9(%rip), %rdi     # 0x2fd6a
leaq 0x1fff8(%rip), %rdx     # 0x3a690
xorl %ecx, %ecx
callq 0x186b9
cmpb $0x8, %r14b
jb 0x1a6be
movzbl 0xa(%rbx), %esi
leaq 0x156f4(%rip), %rdi     # 0x2fda4
leaq 0x2cb99(%rip), %rdx     # 0x47250
xorl %ecx, %ecx
callq 0x186b9
movl $0x9, %r15d
cmpb $0x9, %r14b
jb 0x1a7f3
cmpb $0x0, 0xb(%rbx)
je 0x1a7f3
leaq 0x156ff(%rip), %rdi     # 0x2fdde
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x3030
movb 0xb(%rbx), %al
testb %al, %al
je 0x1a7e5
addl $-0x9, %r14d
leaq 0x157dc(%rip), %rbp     # 0x2fedb
xorl %r15d, %r15d
cmpq $0x7, %r15
je 0x1a7b8
cmpq %r15, %r14
je 0x1a7d1
movzbl 0xc(%rbx,%r15), %eax
movq %rbp, %r12
testb %al, %al
js 0x1a735
movl %eax, %ecx
shrl $0x4, %ecx
leaq 0x14236(%rip), %rdx     # 0x2e964
movslq (%rdx,%rcx,4), %r12
addq %rdx, %r12
andl $0xf, %eax
movq %rbp, %r13
cmpl $0xa, %eax
ja 0x1a74e
leaq 0x1423d(%rip), %rcx     # 0x2e984
movslq (%rcx,%rax,4), %r13
addq %rcx, %r13
testq %r15, %r15
je 0x1a761
leaq 0x63b4(%rip), %rdi      # 0x20b0e
xorl %eax, %eax
callq 0x3030
movq %r12, %rdi
movq %r13, %rsi
callq 0x3320
testl %eax, %eax
je 0x1a786
leaq 0x15771(%rip), %rdi     # 0x2fee8
movq %r12, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x3030
jmp 0x1a797
leaq 0x65d5(%rip), %rdi      # 0x20d62
movq %r12, %rsi
xorl %eax, %eax
callq 0x3030
incq %r15
movzbl 0xb(%rbx), %eax
cmpq %rax, %r15
jb 0x1a702
jmp 0x1a7e5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl %al, %esi
leaq 0x15658(%rip), %rdi     # 0x2fe1a
xorl %eax, %eax
callq 0x3030
movl $0x7, %r15d
jmp 0x1a7e5
movzbl %al, %esi
leaq 0x1569d(%rip), %rdi     # 0x2fe78
movl %r14d, %edx
xorl %eax, %eax
callq 0x3030
movl $0xa, %edi
callq 0x3310
addl $0x9, %r15d
movq %rbx, %rdi
movl %r15d, %esi
movl %r15d, %edx
movl %r15d, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x165ab