// File: /workspace/github_cpp_makefile_star2_O3/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
movups %xmm0, 0x44(%r15)
movups %xmm0, 0x38(%r15)
movups %xmm0, 0x28(%r15)
movups %xmm0, 0x18(%r15)
movups %xmm0, 0x8(%r15)
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x14f4c(%rip), %rsi     # 0x2ee49
leaq 0x14f4c(%rip), %rdx     # 0x2ee50
leaq 0x30(%rsp), %rdi
callq 0x8d58
movd 0x1(%r14), %xmm0
punpcklwd 0x14c84(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1],xmm0[2],mem[2],xmm0[3],mem[3]
pcmpeqd %xmm1, %xmm1
psubd %xmm1, %xmm0
movq %xmm0, (%r15)
movq %r15, %rdi
callq 0x3c00
movl 0xb8(%rsp), %ebp
movl $0x1, %eax
cmpl $0xa, %ebp
jb 0x19f86
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebp, %edx
cmpl $0x63, %edx
jbe 0x19f7f
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x19f84
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x19f86
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x19f4e
addl $-0x3, %eax
jmp 0x19f86
addl $-0x2, %eax
jmp 0x19f86
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 0x8a6d
leaq 0x70d5(%rip), %rsi      # 0x21095
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 0x19ff5
movq %rdx, 0x70(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x80(%rsp)
jmp 0x19ffe
movdqu (%rcx), %xmm0
movdqu %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 0x1a06b
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebp, %edx
cmpl $0x63, %edx
jbe 0x1a064
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x1a069
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x1a06b
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x1a033
addl $-0x3, %eax
jmp 0x1a06b
addl $-0x2, %eax
jmp 0x1a06b
decl %eax
movl %eax, %esi
leaq 0x60(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x50(%rsp), %rdi
xorl %edx, %edx
callq 0x32a0
movq 0x50(%rsp), %rdi
movl 0x58(%rsp), %esi
movl %ebp, %edx
callq 0x8a6d
movq 0x70(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0x58(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r15, %rcx
je 0x1a0b8
movq 0x80(%rsp), %rdi
movq 0x50(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x1a0d6
movl $0xf, %edi
cmpq %r12, %rsi
je 0x1a0d1
movq 0x60(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x1a0e2
leaq 0x70(%rsp), %rdi
callq 0x30b0
jmp 0x1a0f0
leaq 0x50(%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 0x1a114
movq %rsi, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x1a11c
movdqu (%rcx), %xmm0
movdqu %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 0x30(%rsp), %rdi
callq 0x30b0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a168
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x1a17f
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x1a199
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x1a1b6
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3260
movzbl (%r14), %eax
shrl $0x5, %eax
andl $0x3, %eax
leaq 0x145a9(%rip), %rcx     # 0x2e770
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x14ca4(%rip), %rsi     # 0x2ee7b
jmp 0x1a20c
leaq 0x14cb6(%rip), %rsi     # 0x2ee96
jmp 0x1a20c
leaq 0x103be(%rip), %rsi     # 0x2a5a7
leaq 0x30(%rsp), %rdi
callq 0x3420
leaq 0x14cbf(%rip), %rsi     # 0x2eeb9
xorl %edi, %edi
xorl %eax, %eax
callq 0x37cc
jmp 0x1a216
leaq 0x14c7e(%rip), %rsi     # 0x2ee8a
leaq 0x30(%rsp), %rdi
callq 0x3420
movb (%r14), %al
testb $0x10, %al
je 0x1a231
leaq 0x154d4(%rip), %rsi     # 0x2f6f8
leaq 0x30(%rsp), %rdi
callq 0x3420
movb (%r14), %al
andb $0x7, %al
movzbl %al, %eax
cmpb $0x1, %al
je 0x1a244
cmpl $0x2, %eax
jne 0x1a24b
movl $0x2, %eax
movl %eax, 0xc4(%rsp)
movzbl 0x5(%r14), %esi
incl %esi
leaq 0xb0(%rsp), %rdx
movq %rbx, %rdi
callq 0x1f964
movq 0x30(%rsp), %r8
movl $0x1, (%rsp)
leaq 0xb222(%rip), %rsi      # 0x25497
leaq 0x16b52(%rip), %rcx     # 0x30dce
leaq 0xb0(%rsp), %rdx
movq %rbx, %rdi
xorl %r9d, %r9d
callq 0x3e8c
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x1a2ab
movq 0x40(%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 0x1a2e0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1a2e0
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x1a2fc
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1a2fc
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x1a31b
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1a31b
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x1a33f
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1a33f
jmp 0x1a33c
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x1a35b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x3400
nop