// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
andq $0x0, -0x8(%r13)
movb $0x0, (%r13)
cmpb $0x1f, 0x910(%rsi)
movzbl %r15b, %r14d
ja 0x16097
leaq 0x14065(%rip), %rsi     # 0x2a0a0
leaq 0x28(%rsp), %rdi
callq 0x3460
testb %bpl, %bpl
jne 0x160ad
leal -0x2(%r15), %eax
cmpb $0x3, %al
setb %al
cmpb $0x6, %r15b
sete %cl
orb %al, %cl
movb %cl, 0x91d(%r12)
cmpb $0x6, %r15b
ja 0x16147
leaq 0x12747(%rip), %rax     # 0x287bc
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x14030(%rip), %rsi     # 0x2a0b5
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
leaq 0x140df(%rip), %rsi     # 0x2a17d
leaq 0x28(%rsp), %rdi
callq 0x3460
testb %bpl, %bpl
je 0x160cc
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x28(%rsp), %rcx
cmpq %r13, %rcx
je 0x16107
movq %rcx, (%rbx)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x1610f
leal -0x2(%r15), %eax
cmpb $0x7, %al
setb 0x91d(%r12)
cmpb $0x8, %r15b
ja 0x16147
leaq 0x126b0(%rip), %rax     # 0x28798
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x140a6(%rip), %rsi     # 0x2a19e
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
movups (%r13), %xmm0
movups %xmm0, (%rax)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %r13, 0x28(%rsp)
andq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x3130
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%rsp), %rdx
leaq 0x14119(%rip), %rsi     # 0x2a26c
xorl %edi, %edi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x362c
leaq 0x1411a(%rip), %rsi     # 0x2a280
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x75ff
leaq 0x113e0(%rip), %rdx     # 0x2755c
leaq 0x88(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x75a4
leaq 0x48(%rsp), %rdi
movl %r14d, %esi
callq 0x4e28
leaq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x76b4
leaq 0x106f4(%rip), %rdx     # 0x268ad
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x75a4
leaq 0x8(%rsp), %rdi
callq 0x3130
leaq 0x48(%rsp), %rdi
callq 0x3130
leaq 0x88(%rsp), %rdi
callq 0x3130
leaq 0x68(%rsp), %rdi
callq 0x3130
jmp 0x16128
leaq 0x13f43(%rip), %rsi     # 0x2a140
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
leaq 0x13ed5(%rip), %rsi     # 0x2a0eb
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
leaq 0x13ef7(%rip), %rsi     # 0x2a126
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
leaq 0x13e7f(%rip), %rsi     # 0x2a0c7
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
leaq 0x13ef3(%rip), %rsi     # 0x2a154
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
leaq 0x13eee(%rip), %rsi     # 0x2a168
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
leaq 0x11196(%rip), %rsi     # 0x27429
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
leaq 0x13f1c(%rip), %rsi     # 0x2a1c8
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
leaq 0x13f39(%rip), %rsi     # 0x2a1fe
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
leaq 0x13f38(%rip), %rsi     # 0x2a216
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
leaq 0x13dd0(%rip), %rsi     # 0x2a0c7
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
leaq 0x11136(%rip), %rsi     # 0x27446
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
leaq 0x11134(%rip), %rsi     # 0x2745d
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
leaq 0x13efe(%rip), %rsi     # 0x2a240
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x75c4
jmp 0x16128
jmp 0x163b5
jmp 0x163b5
jmp 0x163b5
jmp 0x163b5
jmp 0x163b5
jmp 0x163b5
jmp 0x163b5
jmp 0x163b5
jmp 0x163b5
jmp 0x163b5
jmp 0x163b5
jmp 0x163b5
jmp 0x163b5
jmp 0x163b5
jmp 0x163b5
jmp 0x163b5
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3130
jmp 0x16386
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x3130
jmp 0x16395
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x3130
jmp 0x163a7
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x3130
jmp 0x163b8
jmp 0x163b5
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3430