// File: /workspace/github_cpp_makefile_star2_O3/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 0x1611c
movl $0x9, %ebp
movq %rbx, %rdi
movl $0x9, %esi
movl $0x76, %edx
xorl %ecx, %ecx
callq 0x1644b
testb %al, %al
je 0x1a697
movb $0x1, 0x921(%r14)
movzbl 0x2(%rbx), %r12d
testl %r12d, %r12d
je 0x1a6e9
movzbl 0x3(%rbx), %esi
leaq 0x14f3c(%rip), %rdi     # 0x2f3d0
leaq 0x20135(%rip), %rdx     # 0x3a5d0
xorl %ecx, %ecx
callq 0x18567
cmpl $0x1, %r12d
je 0x1a6e9
movzbl 0x4(%rbx), %esi
leaq 0x14f3c(%rip), %rdi     # 0x2f3f3
leaq 0x20112(%rip), %rdx     # 0x3a5d0
xorl %ecx, %ecx
callq 0x18567
cmpb $0x3, %r12b
jb 0x1a6e9
movzbl 0x5(%rbx), %esi
leaq 0x14f44(%rip), %rdi     # 0x2f41e
leaq 0x2012f(%rip), %rdx     # 0x3a610
xorl %ecx, %ecx
callq 0x18567
cmpl $0x3, %r12d
je 0x1a6e9
movzbl 0x6(%rbx), %esi
leaq 0x15803(%rip), %rdi     # 0x2fd00
leaq 0x2010c(%rip), %rdx     # 0x3a610
xorl %ecx, %ecx
callq 0x18567
cmpb $0x5, %r12b
jb 0x1a6e9
movb 0x7(%rbx), %al
testb %al, %al
je 0x1a539
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
mulsd 0x1411d(%rip), %xmm0    # 0x2e648
leaq 0x157f9(%rip), %rdi     # 0x2fd2b
movb $0x1, %al
callq 0x3030
cmpl $0x5, %r12d
je 0x1a6e9
movzbl 0x8(%rbx), %esi
leaq 0x1582a(%rip), %rdi     # 0x2fd78
leaq 0x200fb(%rip), %rdx     # 0x3a650
movl $0x1, %ecx
callq 0x18567
cmpb $0x7, %r12b
jb 0x1a6e9
movzbl 0x9(%rbx), %esi
leaq 0x15836(%rip), %rdi     # 0x2fdaa
leaq 0x20115(%rip), %rdx     # 0x3a690
xorl %ecx, %ecx
callq 0x18567
cmpl $0x7, %r12d
je 0x1a6e9
movzbl 0xa(%rbx), %esi
leaq 0x1584d(%rip), %rdi     # 0x2fde4
leaq 0x2ccb2(%rip), %rdx     # 0x47250
xorl %ecx, %ecx
callq 0x18567
cmpb $0x9, %r12b
jb 0x1a6e9
cmpb $0x0, 0xb(%rbx)
je 0x1a6e9
leaq 0x1585e(%rip), %rdi     # 0x2fe1e
xorl %eax, %eax
callq 0x3030
movb 0xb(%rbx), %al
testb %al, %al
je 0x1a6a6
leal -0x9(%r12), %ecx
movq %rcx, (%rsp)
leaq 0x15939(%rip), %r15     # 0x2ff1b
xorl %r13d, %r13d
cmpq $0x7, %r13
je 0x1a6ae
cmpq %r13, (%rsp)
je 0x1a6c7
movzbl 0xc(%rbx,%r13), %eax
movq %r15, %rbp
testb %al, %al
js 0x1a619
movl %eax, %ecx
shrl $0x4, %ecx
leaq 0x1437a(%rip), %rdx     # 0x2e98c
movslq (%rdx,%rcx,4), %rbp
addq %rdx, %rbp
andl $0xf, %eax
movq %r15, %r14
cmpl $0xa, %eax
ja 0x1a632
leaq 0x14381(%rip), %rcx     # 0x2e9ac
movslq (%rcx,%rax,4), %r15
addq %rcx, %r15
testq %r13, %r13
je 0x1a645
leaq 0x64e0(%rip), %rdi      # 0x20b1e
xorl %eax, %eax
callq 0x3030
movq %rbp, %rdi
movq %r15, %rsi
callq 0x3320
testl %eax, %eax
je 0x1a66a
leaq 0x158cd(%rip), %rdi     # 0x2ff28
movq %rbp, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3030
jmp 0x1a67b
leaq 0x6701(%rip), %rdi      # 0x20d72
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3030
movq %r14, %r15
incq %r13
movzbl 0xb(%rbx), %eax
cmpq %rax, %r13
jb 0x1a5e5
addl $0x9, %r13d
movl %r13d, %r12d
jmp 0x1a6dc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x9, %r12d
jmp 0x1a6dc
movzbl %al, %esi
leaq 0x157a2(%rip), %rdi     # 0x2fe5a
xorl %eax, %eax
callq 0x3030
movl $0x10, %r12d
jmp 0x1a6dc
movzbl %al, %esi
leaq 0x157e7(%rip), %rdi     # 0x2feb8
movq (%rsp), %rdx
xorl %eax, %eax
callq 0x3030
movl $0xa, %edi
callq 0x3310
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 0x1644b
nop