// File: rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::product_type[abi:cxx11](unsigned char, bool)
std::string edid_state::product_type(unsigned char x, bool heading)
{
	std::string headingstr;

	if (dispid.version < 0x20) {
		headingstr = "Display Product Type";
		if (heading) return headingstr;
		dispid.is_display = x == 2 || x == 3 || x == 4 || x == 6;
		switch (x) {
		case 0: return "Extension Section";
		case 1: return "Test Structure; test equipment only";
		case 2: return "Display panel or other transducer, LCD or PDP module, etc.";
		case 3: return "Standalone display device";
		case 4: return "Television receiver";
		case 5: return "Repeater/translator";
		case 6: return "DIRECT DRIVE monitor";
		default: break;
		}
	} else {
		headingstr = "Display Product Primary Use Case";
		if (heading) return headingstr;
		dispid.is_display = x >= 2 && x <= 8;
		switch (x) {
		case 0: return "Same primary use case as the base section";
		case 1: return "Test Structure; test equipment only";
		case 2: return "None of the listed primary use cases; generic display";
		case 3: return "Television (TV) display";
		case 4: return "Desktop productivity display";
		case 5: return "Desktop gaming display";
		case 6: return "Presentation display";
		case 7: return "Head-mounted Virtual Reality (VR) display";
		case 8: return "Head-mounted Augmented Reality (AR) display";
		default: break;
		}
	}
	fail("Unknown %s 0x%02x.\n", headingstr.c_str(), x);
	return std::string("Unknown " + headingstr + " (") + utohex(x) + ")";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0xf0(%rbp)
movb %cl, %al
movb %dl, %cl
movq %rdi, %rdx
movq %rdx, -0xe8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %cl, -0x11(%rbp)
andb $0x1, %al
movb %al, -0x12(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4430
movq -0xe0(%rbp), %rax
movzbl 0x910(%rax), %eax
cmpl $0x20, %eax
jge 0x281f9
leaq 0x18449(%rip), %rsi     # 0x402fb
leaq -0x38(%rbp), %rdi
callq 0x4420
jmp 0x27ebd
testb $0x1, -0x12(%rbp)
je 0x27ef0
movq -0xf0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x41e0
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x28717
movzbl -0x11(%rbp), %ecx
movb $0x1, %al
cmpl $0x2, %ecx
movb %al, -0xf1(%rbp)
je 0x27f33
movzbl -0x11(%rbp), %ecx
movb $0x1, %al
cmpl $0x3, %ecx
movb %al, -0xf1(%rbp)
je 0x27f33
movzbl -0x11(%rbp), %ecx
movb $0x1, %al
cmpl $0x4, %ecx
movb %al, -0xf1(%rbp)
je 0x27f33
movzbl -0x11(%rbp), %eax
cmpl $0x6, %eax
sete %al
movb %al, -0xf1(%rbp)
movq -0xe0(%rbp), %rax
movb -0xf1(%rbp), %cl
andb $0x1, %cl
movb %cl, 0x91d(%rax)
movzbl -0x11(%rbp), %eax
movq %rax, -0x100(%rbp)
subq $0x6, %rax
ja 0x281f2
movq -0x100(%rbp), %rax
leaq 0x15ec4(%rip), %rcx     # 0x3de30
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x49(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x108(%rbp), %rdx
leaq 0x18376(%rip), %rsi     # 0x40310
callq 0xb510
jmp 0x27fa1
leaq -0x49(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x49(%rbp), %rdi
callq 0x4370
jmp 0x28717
leaq -0x4a(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x110(%rbp), %rdx
leaq 0x1832d(%rip), %rsi     # 0x40322
callq 0xb510
jmp 0x27ffc
leaq -0x4a(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x4a(%rbp), %rdi
callq 0x4370
jmp 0x28717
leaq -0x4b(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x118(%rbp), %rdx
leaq 0x182f6(%rip), %rsi     # 0x40346
callq 0xb510
jmp 0x28057
leaq -0x4b(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x4b(%rbp), %rdi
callq 0x4370
jmp 0x28717
leaq -0x4c(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x120(%rbp), %rdx
leaq 0x182d6(%rip), %rsi     # 0x40381
callq 0xb510
jmp 0x280b2
leaq -0x4c(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x4c(%rbp), %rdi
callq 0x4370
jmp 0x28717
leaq -0x4d(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x128(%rbp), %rdx
leaq 0x18295(%rip), %rsi     # 0x4039b
callq 0xb510
jmp 0x2810d
leaq -0x4d(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x4d(%rbp), %rdi
callq 0x4370
jmp 0x28717
leaq -0x4e(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x130(%rbp), %rdx
leaq 0x1824e(%rip), %rsi     # 0x403af
callq 0xb510
jmp 0x28168
leaq -0x4e(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x4e(%rbp), %rdi
callq 0x4370
jmp 0x28717
leaq -0x4f(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x138(%rbp), %rdx
leaq 0x18207(%rip), %rsi     # 0x403c3
callq 0xb510
jmp 0x281c3
leaq -0x4f(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x4f(%rbp), %rdi
callq 0x4370
jmp 0x28717
jmp 0x281f4
jmp 0x285c7
leaq 0x181d8(%rip), %rsi     # 0x403d8
leaq -0x38(%rbp), %rdi
callq 0x4420
jmp 0x2820b
testb $0x1, -0x12(%rbp)
je 0x2822d
movq -0xf0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x41e0
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movzbl -0x11(%rbp), %ecx
xorl %eax, %eax
cmpl $0x2, %ecx
movb %al, -0x139(%rbp)
jl 0x2824e
movzbl -0x11(%rbp), %eax
cmpl $0x8, %eax
setle %al
movb %al, -0x139(%rbp)
movq -0xe0(%rbp), %rax
movb -0x139(%rbp), %cl
andb $0x1, %cl
movb %cl, 0x91d(%rax)
movzbl -0x11(%rbp), %eax
movq %rax, -0x148(%rbp)
subq $0x8, %rax
ja 0x285c3
movq -0x148(%rbp), %rax
leaq 0x15b85(%rip), %rcx     # 0x3de0c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x50(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x150(%rbp), %rdx
leaq 0x18144(%rip), %rsi     # 0x403f9
callq 0xb510
jmp 0x282bc
leaq -0x50(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x4370
jmp 0x28717
leaq -0x51(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x158(%rbp), %rdx
leaq 0x18012(%rip), %rsi     # 0x40322
callq 0xb510
jmp 0x28317
leaq -0x51(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x51(%rbp), %rdi
callq 0x4370
jmp 0x28717
leaq -0x52(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x160(%rbp), %rdx
leaq 0x180b8(%rip), %rsi     # 0x40423
callq 0xb510
jmp 0x28372
leaq -0x52(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x52(%rbp), %rdi
callq 0x4370
jmp 0x28717
leaq -0x53(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x168(%rbp), %rdx
leaq 0x18093(%rip), %rsi     # 0x40459
callq 0xb510
jmp 0x283cd
leaq -0x53(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x53(%rbp), %rdi
callq 0x4370
jmp 0x28717
leaq -0x54(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x170(%rbp), %rdx
leaq 0x155b4(%rip), %rsi     # 0x3d9d5
callq 0xb510
jmp 0x28428
leaq -0x54(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x54(%rbp), %rdi
callq 0x4370
jmp 0x28717
leaq -0x55(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x178(%rbp), %rdx
leaq 0x15576(%rip), %rsi     # 0x3d9f2
callq 0xb510
jmp 0x28483
leaq -0x55(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x55(%rbp), %rdi
callq 0x4370
jmp 0x28717
leaq -0x56(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x180(%rbp), %rdx
leaq 0x15532(%rip), %rsi     # 0x3da09
callq 0xb510
jmp 0x284de
leaq -0x56(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x56(%rbp), %rdi
callq 0x4370
jmp 0x28717
leaq -0x57(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x188(%rbp), %rdx
leaq 0x17f3f(%rip), %rsi     # 0x40471
callq 0xb510
jmp 0x28539
leaq -0x57(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x57(%rbp), %rdi
callq 0x4370
jmp 0x28717
leaq -0x58(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x4560
movq -0xf0(%rbp), %rdi
movq -0x190(%rbp), %rdx
leaq 0x17f0e(%rip), %rsi     # 0x4049b
callq 0xb510
jmp 0x28594
leaq -0x58(%rbp), %rdi
callq 0x4370
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x4370
jmp 0x28717
jmp 0x285c5
jmp 0x285c7
leaq -0x38(%rbp), %rdi
callq 0x4150
movq %rax, %rdx
movzbl -0x11(%rbp), %ecx
leaq 0x17ee9(%rip), %rsi     # 0x404c7
xorl %edi, %edi
movb %dil, %al
callq 0x47d0
jmp 0x285ea
leaq 0x17eea(%rip), %rsi     # 0x404db
leaq -0xb8(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0xb5c0
jmp 0x28603
leaq 0x154fe(%rip), %rdx     # 0x3db08
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xb4c0
jmp 0x2861f
movzbl -0x11(%rbp), %esi
leaq -0xd8(%rbp), %rdi
callq 0x7530
jmp 0x28631
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0xd8(%rbp), %rdx
callq 0xb7b0
jmp 0x2864a
movq -0xf0(%rbp), %rdi
leaq 0x142bd(%rip), %rdx     # 0x3c915
leaq -0x78(%rbp), %rsi
callq 0xb4c0
jmp 0x28663
leaq -0x78(%rbp), %rdi
callq 0x41f0
leaq -0xd8(%rbp), %rdi
callq 0x41f0
leaq -0x98(%rbp), %rdi
callq 0x41f0
leaq -0xb8(%rbp), %rdi
callq 0x41f0
movl $0x1, -0x48(%rbp)
jmp 0x286fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x286f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x286e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x286d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x41f0
leaq -0xd8(%rbp), %rdi
callq 0x41f0
leaq -0x98(%rbp), %rdi
callq 0x41f0
leaq -0xb8(%rbp), %rdi
callq 0x41f0
jmp 0x28717
leaq -0x38(%rbp), %rdi
callq 0x41f0
movq -0xe8(%rbp), %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x41f0
movq -0x40(%rbp), %rdi
callq 0x4550
nopl (%rax)