// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::parse_displayid_type_9_timing(unsigned char const*)
void edid_state::parse_displayid_type_9_timing(const unsigned char *x)
{
	struct timings t = {};
	std::string s("aspect ");

	t.hact = 1 + (x[1] | (x[2] << 8));
	t.vact = 1 + (x[3] | (x[4] << 8));
	calc_ratio(&t);
	s += std::to_string(t.hratio) + ":" + std::to_string(t.vratio);
	switch ((x[0] >> 5) & 0x3) {
	case 0:
		s += ", no 3D stereo";
		break;
	case 1:
		s += ", 3D stereo";
		break;
	case 2:
		s += ", 3D stereo depends on user action";
		break;
	case 3:
		s += ", reserved";
		fail("Reserved stereo 0x03.\n");
		break;
	}
	if (x[0] & 0x10)
		s += ", refresh rate * (1000/1001) supported";

	switch (x[0] & 0x07) {
	case 1: t.rb = RB_CVT_V1; break;
	case 2: t.rb = RB_CVT_V2; break;
	default: break;
	}

	edid_cvt_mode(1 + x[5], t);

	print_timings("    ", &t, "CVT", s.c_str());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0xb0(%rsp), %r15
movaps %xmm0, 0x40(%r15)
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movl $0x0, 0x50(%r15)
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x14dc5(%rip), %rsi     # 0x2ee09
leaq 0x14dc5(%rip), %rdx     # 0x2ee10
leaq 0x50(%rsp), %rdi
callq 0x8f6e
movzwl 0x1(%r14), %eax
incl %eax
movl %eax, (%r15)
movzwl 0x3(%r14), %eax
incl %eax
movl %eax, 0x4(%r15)
movq %r15, %rdi
callq 0x3c2c
movl 0xb8(%rsp), %ebp
movl $0x1, %eax
cmpl $0xa, %ebp
jb 0x1a0c7
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebp, %edx
cmpl $0x63, %edx
jbe 0x1a0c0
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x1a0c5
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x1a0c7
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x1a08f
addl $-0x3, %eax
jmp 0x1a0c7
addl $-0x2, %eax
jmp 0x1a0c7
decl %eax
movl %eax, %esi
leaq 0xa0(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x90(%rsp), %rdi
xorl %edx, %edx
callq 0x32a0
leaq 0x90(%rsp), %r15
movq (%r15), %rdi
movl 0x8(%r15), %esi
movl %ebp, %edx
callq 0x8c91
leaq 0x6f84(%rip), %rsi      # 0x21085
movq %r15, %rdi
callq 0x3420
leaq 0x80(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1a136
movq %rdx, 0x70(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x80(%rsp)
jmp 0x1a13d
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x78(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0xbc(%rsp), %ebp
movl $0x1, %eax
cmpl $0xa, %ebp
jb 0x1a1aa
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebp, %edx
cmpl $0x63, %edx
jbe 0x1a1a3
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x1a1a8
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x1a1aa
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x1a172
addl $-0x3, %eax
jmp 0x1a1aa
addl $-0x2, %eax
jmp 0x1a1aa
decl %eax
movl %eax, %esi
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x30(%rsp), %rdi
xorl %edx, %edx
callq 0x32a0
movq 0x30(%rsp), %rdi
movl 0x38(%rsp), %esi
movl %ebp, %edx
callq 0x8c91
movq 0x70(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0x38(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r15, %rcx
je 0x1a1f7
movq 0x80(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1a212
movl $0xf, %esi
cmpq %r12, 0x30(%rsp)
je 0x1a20d
movq 0x40(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1a223
movq 0x30(%rsp), %rsi
leaq 0x70(%rsp), %rdi
callq 0x30b0
jmp 0x1a231
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3290
leaq 0x20(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x1a255
movq %rsi, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x1a25b
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x50(%rsp), %rdi
callq 0x30b0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a2a7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x1a2be
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x1a2d8
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x1a2f5
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3260
movzbl (%r14), %eax
shrl $0x5, %eax
andl $0x3, %eax
leaq 0x14442(%rip), %rcx     # 0x2e748
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x14b25(%rip), %rsi     # 0x2ee3b
jmp 0x1a34b
leaq 0x14b37(%rip), %rsi     # 0x2ee56
jmp 0x1a34b
leaq 0x10257(%rip), %rsi     # 0x2a57f
leaq 0x50(%rsp), %rdi
callq 0x3420
leaq 0x14b40(%rip), %rsi     # 0x2ee79
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
jmp 0x1a355
leaq 0x14aff(%rip), %rsi     # 0x2ee4a
leaq 0x50(%rsp), %rdi
callq 0x3420
testb $0x10, (%r14)
je 0x1a36c
leaq 0x15356(%rip), %rsi     # 0x2f6b8
leaq 0x50(%rsp), %rdi
callq 0x3420
movzbl (%r14), %eax
andl $0x7, %eax
cmpl $0x1, %eax
je 0x1a382
cmpl $0x2, %eax
jne 0x1a389
movl $0x2, %eax
movl %eax, 0xc4(%rsp)
movzbl 0x5(%r14), %esi
incl %esi
leaq 0xb0(%rsp), %rdx
movq %rbx, %rdi
callq 0x1fd24
movq 0x50(%rsp), %r8
movl $0x1, (%rsp)
leaq 0xb094(%rip), %rsi      # 0x25447
leaq 0x169d4(%rip), %rcx     # 0x30d8e
leaq 0xb0(%rsp), %rdx
movq %rbx, %rdi
xorl %r9d, %r9d
callq 0x3ebe
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x1a3e9
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3260
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a41e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1a41e
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x1a43a
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1a43a
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x1a459
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1a459
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x1a47d
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1a47d
jmp 0x1a47a
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x1a499
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x3400
nop