// File: rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::parse_displayid_video_timing_range_limits(unsigned char const*)
void edid_state::parse_displayid_video_timing_range_limits(const unsigned char *x)
{
	check_displayid_datablock_revision(x[1]);

	if (!check_displayid_datablock_length(x, 15, 15))
		return;
	printf("    Pixel Clock: %.3f-%.3f MHz\n",
	       (double)((x[3] | (x[4] << 8) | (x[5] << 16)) + 1) / 100.0,
	       (double)((x[6] | (x[7] << 8) | (x[8] << 16)) + 1) / 100.0);
	printf("    Horizontal Frequency: %u-%u kHz\n", x[9], x[10]);
	printf("    Minimum Horizontal Blanking: %u pixels\n", x[11] | (x[12] << 8));
	printf("    Vertical Refresh: %u-%u Hz\n", x[13], x[14]);
	printf("    Minimum Vertical Blanking: %u lines\n", x[15] | (x[16] << 8));
	if (x[17] & 0x80)
		printf("    Supports Interlaced\n");
	if (x[17] & 0x40)
		printf("    Supports CVT\n");
	if (x[17] & 0x20)
		printf("    Supports CVT Reduced Blanking\n");
	if (x[17] & 0x10)
		printf("    Discrete frequency display device\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
xorl %ecx, %ecx
movzbl 0x1(%rax), %esi
movl %ecx, %edx
callq 0x21b00
movq -0x10(%rbp), %rdi
movl $0xf, %edx
xorl %ecx, %ecx
movl %edx, %esi
callq 0x21f90
testb $0x1, %al
jne 0x23ac0
jmp 0x23c34
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %eax
movq -0x10(%rbp), %rcx
movzbl 0x4(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x5(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
addl $0x1, %eax
cvtsi2sd %eax, %xmm0
movsd 0xb547(%rip), %xmm1     # 0x2f038
divsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movzbl 0x6(%rax), %eax
movq -0x10(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x8(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
addl $0x1, %eax
cvtsi2sd %eax, %xmm1
movsd 0xb512(%rip), %xmm2     # 0x2f038
divsd %xmm2, %xmm1
leaq 0x1aad0(%rip), %rdi     # 0x3e601
movb $0x2, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x9(%rax), %esi
movq -0x10(%rbp), %rax
movzbl 0xa(%rax), %edx
leaq 0x1aad2(%rip), %rdi     # 0x3e621
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0xb(%rax), %esi
movq -0x10(%rbp), %rax
movzbl 0xc(%rax), %eax
shll $0x8, %eax
orl %eax, %esi
leaq 0x1aad4(%rip), %rdi     # 0x3e646
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0xd(%rax), %esi
movq -0x10(%rbp), %rax
movzbl 0xe(%rax), %edx
leaq 0x1aae2(%rip), %rdi     # 0x3e672
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0xf(%rax), %esi
movq -0x10(%rbp), %rax
movzbl 0x10(%rax), %eax
shll $0x8, %eax
orl %eax, %esi
leaq 0x1aadf(%rip), %rdi     # 0x3e692
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x11(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x23bda
leaq 0x1aae8(%rip), %rdi     # 0x3e6bb
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x11(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x23bf8
leaq 0x1aae3(%rip), %rdi     # 0x3e6d4
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x11(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x23c16
leaq 0x1aad7(%rip), %rdi     # 0x3e6e6
movb $0x0, %al
callq 0x4050
movq -0x10(%rbp), %rax
movzbl 0x11(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x23c34
leaq 0x1aadc(%rip), %rdi     # 0x3e709
movb $0x0, %al
callq 0x4050
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)