// File: /workspace/github_cpp_makefile_star2_O3/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 0x1429b(%rip), %rcx     # 0x31f24
movl $0xe, %r8d
xorl %esi, %esi
callq 0x3390
movq 0x30(%r14), %rsi
leaq 0x716a(%rip), %rdi      # 0x24e0b
xorl %eax, %eax
callq 0x3030
leaq 0x14284(%rip), %rdi     # 0x31f33
xorl %eax, %eax
callq 0x3030
movzbl 0xe(%rbx), %r14d
cmpq $0x4, %r14
ja 0x1dd98
leaq 0x13d50(%rip), %rax     # 0x31a1c
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x100bc(%rip), %rdi     # 0x2dd98
jmp 0x1dd00
leaq 0x1517f(%rip), %rdi     # 0x32e64
jmp 0x1dd00
leaq 0x155d1(%rip), %rdi     # 0x332bf
jmp 0x1dd00
leaq 0x15197(%rip), %rdi     # 0x32e8e
jmp 0x1dd00
leaq 0x1300d(%rip), %rdi     # 0x30d0d
callq 0x3380
leaq 0x14260(%rip), %rdi     # 0x31f6c
xorl %eax, %eax
callq 0x3030
movzbl 0xf(%rbx), %r14d
cmpq $0x4, %r14
ja 0x1ddc1
leaq 0x13d07(%rip), %rax     # 0x31a30
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x1005f(%rip), %rdi     # 0x2dd98
jmp 0x1dd5d
leaq 0x15176(%rip), %rdi     # 0x32eb8
jmp 0x1dd5d
leaq 0x15186(%rip), %rdi     # 0x32ed1
jmp 0x1dd5d
leaq 0x1516f(%rip), %rdi     # 0x32ec3
jmp 0x1dd5d
leaq 0x1517b(%rip), %rdi     # 0x32ed8
callq 0x3380
leaq 0x1424a(%rip), %rdi     # 0x31fb3
xorl %eax, %eax
callq 0x3030
movzbl 0x10(%rbx), %r14d
cmpq $0x5, %r14
ja 0x1df3d
leaq 0x13cbe(%rip), %rax     # 0x31a44
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x10002(%rip), %rdi     # 0x2dd98
jmp 0x1de15
leaq 0x716d(%rip), %rdi      # 0x24f0c
movl %r14d, %esi
xorl %eax, %eax
callq 0x3030
leaq 0x1419a(%rip), %rsi     # 0x31f4a
xorl %edi, %edi
movl %r14d, %edx
xorl %eax, %eax
callq 0x37cc
jmp 0x1dd05
leaq 0x7144(%rip), %rdi      # 0x24f0c
movl %r14d, %esi
xorl %eax, %eax
callq 0x3030
leaq 0x141b1(%rip), %rsi     # 0x31f8a
xorl %edi, %edi
movl %r14d, %edx
xorl %eax, %eax
callq 0x37cc
jmp 0x1dd62
leaq 0x15101(%rip), %rdi     # 0x32ef2
jmp 0x1de15
leaq 0x15109(%rip), %rdi     # 0x32f03
jmp 0x1de15
leaq 0x150f4(%rip), %rdi     # 0x32ef7
jmp 0x1de15
leaq 0x150fe(%rip), %rdi     # 0x32f0a
jmp 0x1de15
leaq 0x150d2(%rip), %rdi     # 0x32ee7
callq 0x3380
movb 0x11(%rbx), %al
testb %al, %al
je 0x1de3e
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
divsd 0x21f0(%rip), %xmm0     # 0x20020
leaq 0x141b3(%rip), %rdi     # 0x31fea
movb $0x1, %al
callq 0x3030
movb 0x12(%rbx), %al
testb %al, %al
je 0x1de65
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x21c9(%rip), %xmm0     # 0x20020
leaq 0x141b5(%rip), %rdi     # 0x32013
movb $0x1, %al
callq 0x3030
movzbl 0x13(%rbx), %ebx
testb %bl, %bl
leaq 0x141f8(%rip), %rax     # 0x3206a
leaq 0x141ed(%rip), %rsi     # 0x32066
cmovnsq %rax, %rsi
leaq 0x141b6(%rip), %rdi     # 0x3203a
xorl %eax, %eax
callq 0x3030
leaq 0x141e6(%rip), %rdi     # 0x32078
xorl %eax, %eax
callq 0x3030
movl %ebx, %eax
shrl $0x3, %eax
andl $0xc, %eax
leaq 0x13c44(%rip), %rcx     # 0x31aec
movslq (%rax,%rcx), %rdi
addq %rcx, %rdi
callq 0x3380
testb $0x10, %bl
leaq 0x6fe8(%rip), %rsi      # 0x24ea6
leaq 0x2dc4(%rip), %r14      # 0x20c89
cmovneq %r14, %rsi
leaq 0x141bd(%rip), %rdi     # 0x3208d
xorl %eax, %eax
callq 0x3030
leaq 0x141e1(%rip), %rdi     # 0x320bf
xorl %eax, %eax
callq 0x3030
movl %ebx, %eax
andl $0xc, %eax
leaq 0x13c0b(%rip), %rcx     # 0x31afc
movslq (%rax,%rcx), %rdi
addq %rcx, %rdi
callq 0x3380
testb $0x2, %bl
leaq 0x13e8d(%rip), %rsi     # 0x31d94
cmovneq %r14, %rsi
leaq 0x141cb(%rip), %rdi     # 0x320dd
xorl %eax, %eax
callq 0x3030
testb $0x1, %bl
jne 0x1df26
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x141db(%rip), %rsi     # 0x32108
xorl %edi, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x37cc
leaq 0x6fc8(%rip), %rdi      # 0x24f0c
movl %r14d, %esi
xorl %eax, %eax
callq 0x3030
leaq 0x14074(%rip), %rsi     # 0x31fc9
xorl %edi, %edi
movl %r14d, %edx
xorl %eax, %eax
callq 0x37cc
jmp 0x1de1a