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

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

	dispid.has_display_interface_features = true;
	printf("    Interface Type: ");
	switch (x[3] >> 4) {
	case 0x00:
		switch (x[3] & 0xf) {
		case 0x00: printf("Analog 15HD/VGA\n"); break;
		case 0x01: printf("Analog VESA NAVI-V (15HD)\n"); break;
		case 0x02: printf("Analog VESA NAVI-D\n"); break;
		default: printf("Reserved\n"); break;
		}
		break;
	case 0x01: printf("LVDS\n"); break;
	case 0x02: printf("TMDS\n"); break;
	case 0x03: printf("RSDS\n"); break;
	case 0x04: printf("DVI-D\n"); break;
	case 0x05: printf("DVI-I, analog\n"); break;
	case 0x06: printf("DVI-I, digital\n"); break;
	case 0x07: printf("HDMI-A\n"); break;
	case 0x08: printf("HDMI-B\n"); break;
	case 0x09: printf("MDDI\n"); break;
	case 0x0a: printf("DisplayPort\n"); break;
	case 0x0b: printf("Proprietary Digital Interface\n"); break;
	default: printf("Reserved\n"); break;
	}
	if (x[3] >> 4)
		printf("    Number of Links: %u\n", x[3] & 0xf);
	printf("    Interface Standard Version: %u.%u\n",
	       x[4] >> 4, x[4] & 0xf);
	print_flags("    Supported bpc for RGB encoding", x[5], bpc444);
	print_flags("    Supported bpc for YCbCr 4:4:4 encoding", x[6], bpc444);
	print_flags("    Supported bpc for YCbCr 4:2:2 encoding", x[7], bpc4xx);
	printf("    Supported Content Protection: ");
	switch (x[8] & 0xf) {
	case 0x00: printf("None\n"); break;
	case 0x01: printf("HDCP "); break;
	case 0x02: printf("DTCP "); break;
	case 0x03: printf("DPCP "); break;
	default: printf("Reserved "); break;
	}
	if (x[8] & 0xf)
		printf("%u.%u\n", x[9] >> 4, x[9] & 0xf);
	unsigned char v = x[0x0a] & 0xf;
	printf("    Spread Spectrum: ");
	switch (x[0x0a] >> 6) {
	case 0x00: printf("None\n"); break;
	case 0x01: printf("Down Spread %.1f%%\n", v / 10.0); break;
	case 0x02: printf("Center Spread %.1f%%\n", v / 10.0); break;
	case 0x03: printf("Reserved\n"); break;
	}
	switch (x[3] >> 4) {
	case 0x01:
		printf("    LVDS Color Mapping: %s mode\n",
		       (x[0x0b] & 0x10) ? "6 bit compatible" : "normal");
		if (x[0x0b] & 0x08) printf("    LVDS supports 2.8V\n");
		if (x[0x0b] & 0x04) printf("    LVDS supports 12V\n");
		if (x[0x0b] & 0x02) printf("    LVDS supports 5V\n");
		if (x[0x0b] & 0x01) printf("    LVDS supports 3.3V\n");
		printf("    LVDS %s Mode\n", (x[0x0c] & 0x04) ? "Fixed" : "DE");
		if (x[0x0c] & 0x04)
			printf("    LVDS %s Signal Level\n", (x[0x0c] & 0x02) ? "Low" : "High");
		else
			printf("    LVDS DE Polarity Active %s\n", (x[0x0c] & 0x02) ? "Low" : "High");
		printf("    LVDS Shift Clock Data Strobe at %s Edge\n", (x[0x0c] & 0x01) ? "Rising" : "Falling");
		break;
	case 0x0b:
		printf("    PDI %s Mode\n", (x[0x0b] & 0x04) ? "Fixed" : "DE");
		if (x[0x0b] & 0x04)
			printf("    PDI %s Signal Level\n", (x[0x0b] & 0x02) ? "Low" : "High");
		else
			printf("    PDI DE Polarity Active %s\n", (x[0x0b] & 0x02) ? "Low" : "High");
		printf("    PDI Shift Clock Data Strobe at %s Edge\n", (x[0x0b] & 0x01) ? "Rising" : "Falling");
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movq -0x10(%rbp), %rax
xorl %ecx, %ecx
movzbl 0x1(%rax), %esi
movl %ecx, %edx
callq 0x21b00
movq -0x10(%rbp), %rdi
movl $0xa, %edx
xorl %ecx, %ecx
movl %edx, %esi
callq 0x21f90
testb $0x1, %al
jne 0x24954
jmp 0x24f3d
movq -0x20(%rbp), %rax
movb $0x1, 0x921(%rax)
leaq 0x171c3(%rip), %rdi     # 0x3bb29
xorl %eax, %eax
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %eax
shrl $0x4, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0xb, %eax
ja 0x24abd
movq -0x28(%rbp), %rax
leaq 0x1938a(%rip), %rcx     # 0x3dd1c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %eax
andl $0xf, %eax
movl %eax, -0x2c(%rbp)
je 0x249c1
jmp 0x249ad
movl -0x2c(%rbp), %eax
subl $0x1, %eax
je 0x249d1
jmp 0x249b7
movl -0x2c(%rbp), %eax
subl $0x2, %eax
je 0x249e1
jmp 0x249f1
leaq 0x1a6ae(%rip), %rdi     # 0x3f076
movb $0x0, %al
callq 0x4050
jmp 0x249ff
leaq 0x1a6af(%rip), %rdi     # 0x3f087
movb $0x0, %al
callq 0x4050
jmp 0x249ff
leaq 0x1a6ba(%rip), %rdi     # 0x3f0a2
movb $0x0, %al
callq 0x4050
jmp 0x249ff
leaq 0x1ac2c(%rip), %rdi     # 0x3f624
movb $0x0, %al
callq 0x4050
jmp 0x24acb
leaq 0x1a6ab(%rip), %rdi     # 0x3f0b6
movb $0x0, %al
callq 0x4050
jmp 0x24acb
leaq 0x10690(%rip), %rdi     # 0x350ae
movb $0x0, %al
callq 0x4050
jmp 0x24acb
leaq 0x1a68b(%rip), %rdi     # 0x3f0bc
movb $0x0, %al
callq 0x4050
jmp 0x24acb
leaq 0x1a67e(%rip), %rdi     # 0x3f0c2
movb $0x0, %al
callq 0x4050
jmp 0x24acb
leaq 0x1a675(%rip), %rdi     # 0x3f0c9
movb $0x0, %al
callq 0x4050
jmp 0x24acb
leaq 0x1a674(%rip), %rdi     # 0x3f0d8
movb $0x0, %al
callq 0x4050
jmp 0x24acb
leaq 0x1a674(%rip), %rdi     # 0x3f0e8
movb $0x0, %al
callq 0x4050
jmp 0x24acb
leaq 0x1a66c(%rip), %rdi     # 0x3f0f0
movb $0x0, %al
callq 0x4050
jmp 0x24acb
leaq 0x1a664(%rip), %rdi     # 0x3f0f8
movb $0x0, %al
callq 0x4050
jmp 0x24acb
leaq 0x1a65a(%rip), %rdi     # 0x3f0fe
movb $0x0, %al
callq 0x4050
jmp 0x24acb
leaq 0x1a657(%rip), %rdi     # 0x3f10b
movb $0x0, %al
callq 0x4050
jmp 0x24acb
leaq 0x1ab60(%rip), %rdi     # 0x3f624
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %eax
sarl $0x4, %eax
cmpl $0x0, %eax
je 0x24af4
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %esi
andl $0xf, %esi
leaq 0x1a63d(%rip), %rdi     # 0x3f12a
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x4(%rax), %edx
movl %edx, %esi
shrl $0x4, %esi
andl $0xf, %edx
leaq 0x17124(%rip), %rdi     # 0x3bc2f
xorl %eax, %eax
movl %eax, -0x40(%rbp)
movb %al, -0x39(%rbp)
callq 0x4050
movl -0x40(%rbp), %ecx
movq -0x10(%rbp), %rax
movzbl 0x5(%rax), %esi
leaq 0x1a619(%rip), %rdi     # 0x3f143
leaq 0x26e6f(%rip), %rdx     # 0x4b9a0
movq %rdx, -0x48(%rbp)
callq 0x24f50
movq -0x48(%rbp), %rdx
movl -0x40(%rbp), %ecx
movq -0x10(%rbp), %rax
movzbl 0x6(%rax), %esi
leaq 0x1a616(%rip), %rdi     # 0x3f166
callq 0x24f50
movl -0x40(%rbp), %ecx
movq -0x10(%rbp), %rax
movzbl 0x7(%rax), %esi
leaq 0x1a62a(%rip), %rdi     # 0x3f191
leaq 0x26e72(%rip), %rdx     # 0x4b9e0
callq 0x24f50
movb -0x39(%rbp), %al
leaq 0x1a63f(%rip), %rdi     # 0x3f1bc
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x8(%rax), %eax
andl $0xf, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x3, %eax
ja 0x24bec
movq -0x38(%rbp), %rax
leaq 0x191a9(%rip), %rcx     # 0x3dd4c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1d937(%rip), %rdi     # 0x424ea
movb $0x0, %al
callq 0x4050
jmp 0x24bfa
leaq 0x1a61c(%rip), %rdi     # 0x3f1df
movb $0x0, %al
callq 0x4050
jmp 0x24bfa
leaq 0x1a612(%rip), %rdi     # 0x3f1e5
movb $0x0, %al
callq 0x4050
jmp 0x24bfa
leaq 0x1a608(%rip), %rdi     # 0x3f1eb
movb $0x0, %al
callq 0x4050
jmp 0x24bfa
leaq 0x1a5fe(%rip), %rdi     # 0x3f1f1
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x8(%rax), %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0x24c2e
movq -0x10(%rbp), %rax
movzbl 0x9(%rax), %esi
sarl $0x4, %esi
movq -0x10(%rbp), %rax
movzbl 0x9(%rax), %edx
andl $0xf, %edx
leaq 0x1c7f7(%rip), %rdi     # 0x4141e
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movb 0xa(%rax), %al
andb $0xf, %al
movb %al, -0x11(%rbp)
leaq 0x1a5ba(%rip), %rdi     # 0x3f1fb
xorl %eax, %eax
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0xa(%rax), %eax
shrl $0x6, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x3, %eax
ja 0x24cd8
movq -0x50(%rbp), %rax
leaq 0x190f3(%rip), %rcx     # 0x3dd5c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1d871(%rip), %rdi     # 0x424ea
movb $0x0, %al
callq 0x4050
jmp 0x24cd8
movzbl -0x11(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd 0x18ec6(%rip), %xmm1    # 0x3db58
divsd %xmm1, %xmm0
leaq 0x1a574(%rip), %rdi     # 0x3f211
movb $0x1, %al
callq 0x4050
jmp 0x24cd8
movzbl -0x11(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd 0x18ea2(%rip), %xmm1    # 0x3db58
divsd %xmm1, %xmm0
leaq 0x1a564(%rip), %rdi     # 0x3f225
movb $0x1, %al
callq 0x4050
jmp 0x24cd8
leaq 0x1a953(%rip), %rdi     # 0x3f624
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %eax
shrl $0x4, %eax
movl %eax, -0x54(%rbp)
subl $0x1, %eax
je 0x24cfe
jmp 0x24ced
movl -0x54(%rbp), %eax
subl $0xb, %eax
je 0x24e73
jmp 0x24f3d
movq -0x10(%rbp), %rax
movzbl 0xb(%rax), %ecx
andl $0x10, %ecx
leaq 0xf608(%rip), %rsi      # 0x34318
leaq 0x1a545(%rip), %rax     # 0x3f25c
cmpl $0x0, %ecx
cmovneq %rax, %rsi
leaq 0x1a516(%rip), %rdi     # 0x3f23b
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0xb(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x24d4a
leaq 0x1a52a(%rip), %rdi     # 0x3f26d
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0xb(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x24d68
leaq 0x1a524(%rip), %rdi     # 0x3f285
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0xb(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x24d86
leaq 0x1a51d(%rip), %rdi     # 0x3f29c
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0xb(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x24da4
leaq 0x1a515(%rip), %rdi     # 0x3f2b2
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0xc(%rax), %ecx
andl $0x4, %ecx
leaq 0x1a52c(%rip), %rsi     # 0x3f2e2
leaq 0x1a51f(%rip), %rax     # 0x3f2dc
cmpl $0x0, %ecx
cmovneq %rax, %rsi
leaq 0x1a4ff(%rip), %rdi     # 0x3f2ca
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0xc(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x24e12
movq -0x10(%rbp), %rax
movzbl 0xc(%rax), %ecx
andl $0x2, %ecx
leaq 0x1a50f(%rip), %rsi     # 0x3f303
leaq 0x1a504(%rip), %rax     # 0x3f2ff
cmpl $0x0, %ecx
cmovneq %rax, %rsi
leaq 0x1a4dc(%rip), %rdi     # 0x3f2e5
movb $0x0, %al
callq 0x4050
jmp 0x24e40
movq -0x10(%rbp), %rax
movzbl 0xc(%rax), %ecx
andl $0x2, %ecx
leaq 0x1a4df(%rip), %rsi     # 0x3f303
leaq 0x1a4d4(%rip), %rax     # 0x3f2ff
cmpl $0x0, %ecx
cmovneq %rax, %rsi
leaq 0x1a4cf(%rip), %rdi     # 0x3f308
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0xc(%rax), %ecx
andl $0x1, %ecx
leaq 0x1a50a(%rip), %rsi     # 0x3f35c
leaq 0x1a4fc(%rip), %rax     # 0x3f355
cmpl $0x0, %ecx
cmovneq %rax, %rsi
leaq 0x1a4c1(%rip), %rdi     # 0x3f328
movb $0x0, %al
callq 0x4050
jmp 0x24f3d
movq -0x10(%rbp), %rax
movzbl 0xb(%rax), %ecx
andl $0x4, %ecx
leaq 0x1a45d(%rip), %rsi     # 0x3f2e2
leaq 0x1a450(%rip), %rax     # 0x3f2dc
cmpl $0x0, %ecx
cmovneq %rax, %rsi
leaq 0x1a4ca(%rip), %rdi     # 0x3f364
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0xb(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x24ee1
movq -0x10(%rbp), %rax
movzbl 0xb(%rax), %ecx
andl $0x2, %ecx
leaq 0x1a440(%rip), %rsi     # 0x3f303
leaq 0x1a435(%rip), %rax     # 0x3f2ff
cmpl $0x0, %ecx
cmovneq %rax, %rsi
leaq 0x1a49d(%rip), %rdi     # 0x3f375
movb $0x0, %al
callq 0x4050
jmp 0x24f0f
movq -0x10(%rbp), %rax
movzbl 0xb(%rax), %ecx
andl $0x2, %ecx
leaq 0x1a410(%rip), %rsi     # 0x3f303
leaq 0x1a405(%rip), %rax     # 0x3f2ff
cmpl $0x0, %ecx
cmovneq %rax, %rsi
leaq 0x1a486(%rip), %rdi     # 0x3f38e
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0xb(%rax), %ecx
andl $0x1, %ecx
leaq 0x1a43b(%rip), %rsi     # 0x3f35c
leaq 0x1a42d(%rip), %rax     # 0x3f355
cmpl $0x0, %ecx
cmovneq %rax, %rsi
leaq 0x1a477(%rip), %rdi     # 0x3f3ad
movb $0x0, %al
callq 0x4050
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)