// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-di-ext-block.cpp
// Function: edid_state::parse_display_device(unsigned char const*)
void edid_state::parse_display_device(const unsigned char *x)
{
	data_block = "Display Device";
	printf("  %s:\n", data_block.c_str());

	printf("    Sub-Pixel Layout: ");
	unsigned char v = x[0x0e];
	switch (v) {
	case 0x00: printf("Not defined\n"); break;
	case 0x01: printf("RGB\n"); break;
	case 0x02: printf("BGR\n"); break;
	case 0x03: printf("Quad Pixel - G at bottom left & top right\n"); break;
	case 0x04: printf("Quad Pixel - G at bottom right & top left\n"); break;
	default:
		   printf("Unknown (0x%02x)\n", v);
		   fail("Unknown Sub-Pixel Layout 0x%02x.\n", v);
		   break;
	}
	printf("    Sub-Pixel Configuration: ");
	v = x[0x0f];
	switch (v) {
	case 0x00: printf("Not defined\n"); break;
	case 0x01: printf("Delta (Tri-ad)\n"); break;
	case 0x02: printf("Stripe\n"); break;
	case 0x03: printf("Stripe Offset\n"); break;
	case 0x04: printf("Quad Pixel\n"); break;
	default:
		   printf("Unknown (0x%02x)\n", v);
		   fail("Unknown Sub-Pixel Configuration 0x%02x.\n", v);
		   break;
	}
	printf("    Sub-Pixel Shape: ");
	v = x[0x10];
	switch (v) {
	case 0x00: printf("Not defined\n"); break;
	case 0x01: printf("Round\n"); break;
	case 0x02: printf("Square\n"); break;
	case 0x03: printf("Rectangular\n"); break;
	case 0x04: printf("Oval\n"); break;
	case 0x05: printf("Elliptical\n"); break;
	default:
		   printf("Unknown (0x%02x)\n", v);
		   fail("Unknown Sub-Pixel Shape 0x%02x.\n", v);
		   break;
	}
	if (x[0x11])
		printf("    Horizontal Dot/Pixel Pitch: %.2f mm\n",
		       x[0x11] / 100.0);
	if (x[0x12])
		printf("    Vertical Dot/Pixel Pitch: %.2f mm\n",
		       x[0x12] / 100.0);
	v = x[0x13];
	printf("    Display Device %s a Fixed Pixel Format\n",
	       (v & 0x80) ? "has" : "does not have");
	printf("    View Direction: ");
	switch ((v & 0x60) >> 5) {
	case 0x00: printf("Not specified\n"); break;
	case 0x01: printf("Direct\n"); break;
	case 0x02: printf("Reflected\n"); break;
	case 0x03: printf("Direct & Reflected\n"); break;
	}
	printf("    Display Device uses %stransparent background\n",
	       (v & 0x10) ? "" : "non-");
	printf("    Physical Implementation: ");
	switch ((v & 0x0c) >> 2) {
	case 0x00: printf("Not specified\n"); break;
	case 0x01: printf("Large Image device for group viewing\n"); break;
	case 0x02: printf("Desktop or personal display\n"); break;
	case 0x03: printf("Eyepiece type personal display\n"); break;
	}
	printf("    Monitor/display does %ssupport DDC/CI\n",
	       (v & 0x02) ? "" : "not ");
	if (v & 0x01)
		fail("Bit 0 of byte 0x13 should be 0.\n");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x30, %rdi
movq 0x38(%r14), %rdx
leaq 0x13ebd(%rip), %rcx     # 0x31ee4
movl $0xe, %r8d
xorl %esi, %esi
callq 0x3390
movq 0x30(%r14), %rsi
leaq 0x6d7c(%rip), %rdi      # 0x24dbb
xorl %eax, %eax
callq 0x3030
leaq 0x13ea6(%rip), %rdi     # 0x31ef3
xorl %eax, %eax
callq 0x3030
movzbl 0xe(%rbx), %r14d
cmpq $0x4, %r14
ja 0x1e136
leaq 0x13972(%rip), %rax     # 0x319dc
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0xfcf6(%rip), %rdi      # 0x2dd70
jmp 0x1e09e
leaq 0x14da1(%rip), %rdi     # 0x32e24
jmp 0x1e09e
leaq 0x151f3(%rip), %rdi     # 0x3327f
jmp 0x1e09e
leaq 0x14db9(%rip), %rdi     # 0x32e4e
jmp 0x1e09e
leaq 0x12c2f(%rip), %rdi     # 0x30ccd
callq 0x3380
leaq 0x13e82(%rip), %rdi     # 0x31f2c
xorl %eax, %eax
callq 0x3030
movzbl 0xf(%rbx), %r14d
cmpq $0x4, %r14
ja 0x1e15f
leaq 0x13929(%rip), %rax     # 0x319f0
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0xfc99(%rip), %rdi      # 0x2dd70
jmp 0x1e0fb
leaq 0x14d98(%rip), %rdi     # 0x32e78
jmp 0x1e0fb
leaq 0x14da8(%rip), %rdi     # 0x32e91
jmp 0x1e0fb
leaq 0x14d91(%rip), %rdi     # 0x32e83
jmp 0x1e0fb
leaq 0x14d9d(%rip), %rdi     # 0x32e98
callq 0x3380
leaq 0x13e6c(%rip), %rdi     # 0x31f73
xorl %eax, %eax
callq 0x3030
movzbl 0x10(%rbx), %r14d
cmpq $0x5, %r14
ja 0x1e2db
leaq 0x138e0(%rip), %rax     # 0x31a04
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0xfc3c(%rip), %rdi      # 0x2dd70
jmp 0x1e1b3
leaq 0x6d7f(%rip), %rdi      # 0x24ebc
movl %r14d, %esi
xorl %eax, %eax
callq 0x3030
leaq 0x13dbc(%rip), %rsi     # 0x31f0a
xorl %edi, %edi
movl %r14d, %edx
xorl %eax, %eax
callq 0x37ec
jmp 0x1e0a3
leaq 0x6d56(%rip), %rdi      # 0x24ebc
movl %r14d, %esi
xorl %eax, %eax
callq 0x3030
leaq 0x13dd3(%rip), %rsi     # 0x31f4a
xorl %edi, %edi
movl %r14d, %edx
xorl %eax, %eax
callq 0x37ec
jmp 0x1e100
leaq 0x14d23(%rip), %rdi     # 0x32eb2
jmp 0x1e1b3
leaq 0x14d2b(%rip), %rdi     # 0x32ec3
jmp 0x1e1b3
leaq 0x14d16(%rip), %rdi     # 0x32eb7
jmp 0x1e1b3
leaq 0x14d20(%rip), %rdi     # 0x32eca
jmp 0x1e1b3
leaq 0x14cf4(%rip), %rdi     # 0x32ea7
callq 0x3380
movb 0x11(%rbx), %al
testb %al, %al
je 0x1e1dc
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
divsd 0x1e4a(%rip), %xmm0     # 0x20018
leaq 0x13dd5(%rip), %rdi     # 0x31faa
movb $0x1, %al
callq 0x3030
movb 0x12(%rbx), %al
testb %al, %al
je 0x1e203
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x1e23(%rip), %xmm0     # 0x20018
leaq 0x13dd7(%rip), %rdi     # 0x31fd3
movb $0x1, %al
callq 0x3030
movzbl 0x13(%rbx), %ebx
testb %bl, %bl
leaq 0x13e1a(%rip), %rax     # 0x3202a
leaq 0x13e0f(%rip), %rsi     # 0x32026
cmovnsq %rax, %rsi
leaq 0x13dd8(%rip), %rdi     # 0x31ffa
xorl %eax, %eax
callq 0x3030
leaq 0x13e08(%rip), %rdi     # 0x32038
xorl %eax, %eax
callq 0x3030
movl %ebx, %eax
shrl $0x3, %eax
andl $0xc, %eax
leaq 0x13866(%rip), %rcx     # 0x31aac
movslq (%rax,%rcx), %rdi
addq %rcx, %rdi
callq 0x3380
testb $0x10, %bl
leaq 0x6bfa(%rip), %rsi      # 0x24e56
leaq 0x2a16(%rip), %r14      # 0x20c79
cmovneq %r14, %rsi
leaq 0x13ddf(%rip), %rdi     # 0x3204d
xorl %eax, %eax
callq 0x3030
leaq 0x13e03(%rip), %rdi     # 0x3207f
xorl %eax, %eax
callq 0x3030
movl %ebx, %eax
andl $0xc, %eax
leaq 0x1382d(%rip), %rcx     # 0x31abc
movslq (%rax,%rcx), %rdi
addq %rcx, %rdi
callq 0x3380
testb $0x2, %bl
leaq 0x13aaf(%rip), %rsi     # 0x31d54
cmovneq %r14, %rsi
leaq 0x13ded(%rip), %rdi     # 0x3209d
xorl %eax, %eax
callq 0x3030
testb $0x1, %bl
jne 0x1e2c4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x13dfd(%rip), %rsi     # 0x320c8
xorl %edi, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x37ec
leaq 0x6bda(%rip), %rdi      # 0x24ebc
movl %r14d, %esi
xorl %eax, %eax
callq 0x3030
leaq 0x13c96(%rip), %rsi     # 0x31f89
xorl %edi, %edi
movl %r14d, %edx
xorl %eax, %eax
callq 0x37ec
jmp 0x1e1b8