// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0xa0, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
cmpb $0x1f, 0x910(%rsi)
ja 0x1b090
leaq 0x15080(%rip), %rcx     # 0x300a0
movq %rsp, %rdi
movl $0x14, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3390
testb %bpl, %bpl
jne 0x1b0ae
leal -0x2(%r14), %eax
cmpb $0x3, %al
setb %al
cmpb $0x6, %r14b
sete %cl
orb %al, %cl
movb %cl, 0x91d(%r15)
cmpb $0x6, %r14b
ja 0x1b15f
movzbl %r14b, %eax
leaq 0x1374f(%rip), %rcx     # 0x2e7b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x15039(%rip), %rsi     # 0x300b5
leaq 0x15043(%rip), %rdx     # 0x300c6
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
leaq 0x150e6(%rip), %rcx     # 0x3017d
movq %rsp, %rdi
movl $0x20, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3390
testb %bpl, %bpl
je 0x1b0cc
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq (%rsp), %rcx
cmpq %r12, %rcx
je 0x1b113
movq %rcx, (%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x1b11b
leal -0x2(%r14), %eax
cmpb $0x7, %al
setb 0x91d(%r15)
cmpb $0x8, %r14b
ja 0x1b15f
movzbl %r14b, %eax
leaq 0x136a5(%rip), %rcx     # 0x2e790
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x1509c(%rip), %rsi     # 0x3019e
leaq 0x150be(%rip), %rdx     # 0x301c7
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
movups (%r12), %xmm0
movups %xmm0, (%rax)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %r12, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x1b14c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rdx
movzbl %r14b, %ebp
leaq 0x150fe(%rip), %rsi     # 0x3026c
xorl %edi, %edi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x37cc
leaq 0x15100(%rip), %rsi     # 0x30280
leaq 0x80(%rsp), %rdi
movq %rsp, %rdx
callq 0x8855
leaq 0x123c0(%rip), %rsi     # 0x2d557
leaq 0x80(%rsp), %rdi
callq 0x3420
leaq 0x50(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1b3ae
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x1b3b5
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x14f60(%rip), %rsi     # 0x30140
leaq 0x14f6c(%rip), %rdx     # 0x30153
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x14ee9(%rip), %rsi     # 0x300eb
leaq 0x14f1c(%rip), %rdx     # 0x30125
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x14f02(%rip), %rsi     # 0x30126
leaq 0x14f14(%rip), %rdx     # 0x3013f
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x14e81(%rip), %rsi     # 0x300c7
leaq 0x14e9d(%rip), %rdx     # 0x300ea
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x14eec(%rip), %rsi     # 0x30154
leaq 0x14ef8(%rip), %rdx     # 0x30167
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x14ede(%rip), %rsi     # 0x30168
leaq 0x14eeb(%rip), %rdx     # 0x3017c
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x12178(%rip), %rsi     # 0x2d424
leaq 0x1218d(%rip), %rdx     # 0x2d440
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x14efa(%rip), %rsi     # 0x301c8
leaq 0x14f28(%rip), %rdx     # 0x301fd
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x14f0e(%rip), %rsi     # 0x301fe
leaq 0x14f1e(%rip), %rdx     # 0x30215
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x14f04(%rip), %rsi     # 0x30216
leaq 0x14f26(%rip), %rdx     # 0x3023f
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x14d93(%rip), %rsi     # 0x300c7
leaq 0x14daf(%rip), %rdx     # 0x300ea
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x120eb(%rip), %rsi     # 0x2d441
leaq 0x120fa(%rip), %rdx     # 0x2d457
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x120e0(%rip), %rsi     # 0x2d458
leaq 0x120ed(%rip), %rdx     # 0x2d46c
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x14ea6(%rip), %rsi     # 0x30240
leaq 0x14eca(%rip), %rdx     # 0x3026b
movq %rbx, %rdi
callq 0x8d58
jmp 0x1b136
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x60(%rsp), %rdi
movl %ebp, %esi
callq 0x59f2
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %r8
movq 0x68(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r14, %rcx
je 0x1b3fb
movq 0x50(%rsp), %rdi
movq 0x60(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x1b41e
leaq 0x70(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x1b419
movq 0x70(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x1b42a
leaq 0x40(%rsp), %rdi
callq 0x30b0
jmp 0x1b438
leaq 0x60(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3290
leaq 0x30(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x1b45c
movq %rsi, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x1b462
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x11427(%rip), %rsi     # 0x2c8ad
leaq 0x20(%rsp), %rdi
callq 0x3420
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x1b4b2
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x1b4b8
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1b4ea
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3260
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1b505
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x1b51c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3260
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1b136
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1b136
jmp 0x1b61a
jmp 0x1b61a
jmp 0x1b61a
jmp 0x1b61a
jmp 0x1b61a
jmp 0x1b61a
jmp 0x1b61a
jmp 0x1b61a
jmp 0x1b61a
jmp 0x1b61a
jmp 0x1b61a
jmp 0x1b61a
jmp 0x1b61a
jmp 0x1b61a
jmp 0x1b61a
jmp 0x1b61a
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1b5b9
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1b5b9
movq %rax, %rbx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1b5d9
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1b5d9
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x1b5f5
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1b5f5
movq %rax, %rbx
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1b61d
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1b61d
jmp 0x1b61a
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x1b633
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x3400
nop