// File: rpavlik[P]edid-decode/parse-displayid-block.cpp
// Function: edid_state::parse_displayid_type_4_8_timing(unsigned char, unsigned short, bool)
void edid_state::parse_displayid_type_4_8_timing(unsigned char type, unsigned short id, bool is_cta)
{
	const struct timings *t = NULL;
	char type_name[16];

	switch (type) {
	case 0: t = find_dmt_id(id); sprintf(type_name, "DMT 0x%02x", id); break;
	case 1: t = find_vic_id(id); sprintf(type_name, "VIC %3u", id); break;
	case 2: t = find_hdmi_vic_id(id); sprintf(type_name, "HDMI VIC %u", id); break;
	default: break;
	}
	if (t)
		print_timings("    ", t, type_name);
	if (t && is_cta && !cta.t8vtdb.is_valid()) {
		timings_ext te(*t, type_name, "");
		cta.t8vtdb = te;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movb %cl, %al
movw %dx, %cx
movb %sil, %dl
movq %rdi, -0x8(%rbp)
movb %dl, -0x9(%rbp)
movw %cx, -0xc(%rbp)
andb $0x1, %al
movb %al, -0xd(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x130(%rbp)
movq $0x0, -0x18(%rbp)
movzbl -0x9(%rbp), %eax
movl %eax, -0x128(%rbp)
testl %eax, %eax
je 0x23810
jmp 0x237f6
movl -0x128(%rbp), %eax
subl $0x1, %eax
je 0x23838
jmp 0x23803
movl -0x128(%rbp), %eax
subl $0x2, %eax
je 0x23860
jmp 0x23888
movw -0xc(%rbp), %ax
movzbl %al, %edi
callq 0xe6b0
movq %rax, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
movzwl -0xc(%rbp), %edx
leaq 0xc28a(%rip), %rsi      # 0x2fab9
movb $0x0, %al
callq 0x40a0
jmp 0x2388a
movw -0xc(%rbp), %ax
movzbl %al, %edi
callq 0x154d0
movq %rax, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
movzwl -0xc(%rbp), %edx
leaq 0xc287(%rip), %rsi      # 0x2fade
movb $0x0, %al
callq 0x40a0
jmp 0x2388a
movw -0xc(%rbp), %ax
movzbl %al, %edi
callq 0x15560
movq %rax, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
movzwl -0xc(%rbp), %edx
leaq 0xc27d(%rip), %rsi      # 0x2fafc
movb $0x0, %al
callq 0x40a0
jmp 0x2388a
jmp 0x2388a
cmpq $0x0, -0x18(%rbp)
je 0x238bd
movq -0x130(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq -0x30(%rbp), %rcx
leaq 0x10f38(%rip), %rsi     # 0x347df
leaq 0xc60b(%rip), %r8       # 0x2feb9
xorl %r9d, %r9d
movl $0x1, (%rsp)
callq 0x50c0
cmpq $0x0, -0x18(%rbp)
je 0x23a66
testb $0x1, -0xd(%rbp)
je 0x23a66
movq -0x130(%rbp), %rdi
addq $0x180, %rdi            # imm = 0x180
addq $0x90, %rdi
callq 0xb880
testb $0x1, %al
jne 0x23a66
movq -0x18(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x4560
movq -0x138(%rbp), %rdx
leaq -0xe8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xb510
jmp 0x2392b
leaq -0x121(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x4560
movq -0x148(%rbp), %rdx
leaq 0xc56d(%rip), %rsi      # 0x2feb9
leaq -0x120(%rbp), %rdi
callq 0xb510
jmp 0x2395a
movq -0x140(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rdx
leaq -0x120(%rbp), %rcx
callq 0x148f0
jmp 0x2397d
leaq -0x120(%rbp), %rdi
callq 0x41f0
leaq -0x121(%rbp), %rdi
callq 0x4370
leaq -0xe8(%rbp), %rdi
callq 0x41f0
leaq -0xe9(%rbp), %rdi
callq 0x4370
movq -0x130(%rbp), %rdi
addq $0x210, %rdi            # imm = 0x210
leaq -0xc8(%rbp), %rsi
callq 0x149c0
jmp 0x239c9
leaq -0xc8(%rbp), %rdi
callq 0xc3d0
jmp 0x23a66
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x23a38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x23a20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x41f0
leaq -0x121(%rbp), %rdi
callq 0x4370
leaq -0xe8(%rbp), %rdi
callq 0x41f0
leaq -0xe9(%rbp), %rdi
callq 0x4370
jmp 0x23a6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0xc3d0
jmp 0x23a6f
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0xf8(%rbp), %rdi
callq 0x4550
nopl (%rax,%rax)