// File: /workspace/github_cpp_makefile_star2_O1/rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::parse_displayid_type_10_timing(unsigned char const*, bool)
void edid_state::parse_displayid_type_10_timing(const unsigned char *x, bool is_cta)
{
	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;
	}

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

	if (x[0] & 0x10) {
		if (t.rb == RB_CVT_V2) {
			s += ", refresh rate * (1000/1001) supported";
			t.rb |= RB_ALT;
		} else if (t.rb == RB_CVT_V3) {
			s += ", hblank is 160 pixels";
			t.rb |= RB_ALT;
		} else {
			fail("VR_HB must be 0.\n");
		}
	}
	if (x[0] & 0x80)
		s += ", YCbCr 4:2:0";

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

	print_timings("    ", &t, "CVT", s.c_str());
	if (is_cta) {
		timings_ext te(t, "CVT", s);
		cta.vec_vtdbs.push_back(te);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movl %edx, 0x34(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x130(%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 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1452b(%rip), %rsi     # 0x2ee09
leaq 0x1452b(%rip), %rdx     # 0x2ee10
leaq 0x38(%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 0x138(%rsp), %r15d
movl $0x1, %eax
cmpl $0xa, %r15d
jb 0x1a964
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %r15d, %edx
cmpl $0x63, %edx
jbe 0x1a95d
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x1a962
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x1a964
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x1a92c
addl $-0x3, %eax
jmp 0x1a964
addl $-0x2, %eax
jmp 0x1a964
decl %eax
movl %eax, %esi
leaq 0x88(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x78(%rsp), %rdi
xorl %edx, %edx
callq 0x32a0
leaq 0x78(%rsp), %r12
movq (%r12), %rdi
movl 0x8(%r12), %esi
movl %r15d, %edx
callq 0x8c91
leaq 0x66ea(%rip), %rsi      # 0x21085
movq %r12, %rdi
callq 0x3420
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1a9cb
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x1a9d3
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x13c(%rsp), %r15d
movl $0x1, %eax
cmpl $0xa, %r15d
jb 0x1aa43
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %r15d, %edx
cmpl $0x63, %edx
jbe 0x1aa3c
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x1aa41
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x1aa43
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x1aa0b
addl $-0x3, %eax
jmp 0x1aa43
addl $-0x2, %eax
jmp 0x1aa43
decl %eax
movl %eax, %esi
leaq 0x68(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x58(%rsp), %rdi
xorl %edx, %edx
callq 0x32a0
movq 0x58(%rsp), %rdi
movl 0x60(%rsp), %esi
movl %r15d, %edx
callq 0x8c91
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %r8
movq 0x60(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0x1aa8d
movq 0x20(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1aaa8
movl $0xf, %esi
cmpq %rbp, 0x58(%rsp)
je 0x1aaa3
movq 0x68(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1aab9
movq 0x58(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x30b0
jmp 0x1aac7
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3290
leaq 0xa8(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x1aaf4
movq %rsi, 0x98(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xa8(%rsp)
jmp 0x1aafa
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0xa0(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rdx
leaq 0x38(%rsp), %rdi
callq 0x30b0
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1ab55
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1ab6c
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x1ab83
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x1ab9d
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3260
movzbl (%r14), %eax
shrl $0x5, %eax
andl $0x3, %eax
leaq 0x13baa(%rip), %rcx     # 0x2e758
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1427d(%rip), %rsi     # 0x2ee3b
jmp 0x1abf3
leaq 0x1428f(%rip), %rsi     # 0x2ee56
jmp 0x1abf3
leaq 0xf9af(%rip), %rsi      # 0x2a57f
leaq 0x38(%rsp), %rdi
callq 0x3420
leaq 0x14298(%rip), %rsi     # 0x2ee79
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
jmp 0x1abfd
leaq 0x14257(%rip), %rsi     # 0x2ee4a
leaq 0x38(%rsp), %rdi
callq 0x3420
movzbl (%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
leal -0x1(%rcx), %edx
cmpb $0x2, %dl
ja 0x1ac15
movl %ecx, 0x144(%rsp)
testb $0x10, %al
je 0x1ac5e
movl 0x144(%rsp), %eax
cmpl $0x2, %eax
je 0x1ac33
cmpl $0x3, %eax
jne 0x1ac4e
leaq 0x152bd(%rip), %rsi     # 0x2feee
jmp 0x1ac3a
leaq 0x14a7e(%rip), %rsi     # 0x2f6b8
leaq 0x38(%rsp), %rdi
callq 0x3420
orb $-0x80, 0x144(%rsp)
jmp 0x1ac5e
leaq 0x152b0(%rip), %rsi     # 0x2ff05
xorl %edi, %edi
xorl %eax, %eax
callq 0x37ec
cmpb $0x0, (%r14)
jns 0x1ac75
leaq 0x14225(%rip), %rsi     # 0x2ee90
leaq 0x38(%rsp), %rdi
callq 0x3420
movzbl 0x5(%r14), %esi
incl %esi
leaq 0x130(%rsp), %rdx
movq %rbx, %rdi
callq 0x1fd24
movq 0x38(%rsp), %r8
movl $0x1, (%rsp)
leaq 0xa7a8(%rip), %rsi      # 0x25447
leaq 0x160e8(%rip), %rcx     # 0x30d8e
leaq 0x130(%rsp), %rdx
movq %rbx, %rdi
xorl %r9d, %r9d
callq 0x3ebe
cmpb $0x0, 0x34(%rsp)
je 0x1ad6e
leaq 0x10(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x160bb(%rip), %rsi     # 0x30d8e
leaq 0x160b7(%rip), %rdx     # 0x30d91
callq 0x8f6e
leaq 0x98(%rsp), %rdi
leaq 0x130(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x38(%rsp), %rcx
callq 0xdce2
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x1ad15
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3260
addq $0x1a8, %rbx            # imm = 0x1A8
leaq 0x98(%rsp), %rsi
movq %rbx, %rdi
callq 0xdd72
leaq 0x120(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1ad4d
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x3260
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1ad6e
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x1ad8a
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3260
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xdd9e
jmp 0x1ae4d
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x1ae4d
movq 0x20(%rsp), %rsi
jmp 0x1ae3e
jmp 0x1ae4a
movq %rax, %rbx
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1adf4
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1adf4
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1ae10
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1ae10
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x1ae2c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1ae2c
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x1ae4d
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x1ae4d
jmp 0x1ae4a
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x1ae69
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x3400
nop