// File: rpavlik[P]edid-decode/edid-decode.cpp
// Function: timings_close_match(timings const&, timings const&)
bool timings_close_match(const timings &t1, const timings &t2)
{
	// We don't want to deal with borders, you're on your own
	// if you are using those.
	if (t1.hborder || t1.vborder ||
	    t2.hborder || t2.vborder)
		return false;
	if (t1.hact != t2.hact || t1.vact != t2.vact ||
	    t1.interlaced != t2.interlaced ||
	    t1.pixclk_khz != t2.pixclk_khz ||
	    t1.hfp + t1.hsync + t1.hbp != t2.hfp + t2.hsync + t2.hbp ||
	    t1.vfp + t1.vsync + t1.vbp != t2.vfp + t2.vsync + t2.vbp)
		return false;
	if (t1.hfp == t2.hfp &&
	    t1.hsync == t2.hsync &&
	    t1.hbp == t2.hbp &&
	    t1.pos_pol_hsync == t2.pos_pol_hsync &&
	    t1.vfp == t2.vfp &&
	    t1.vsync == t2.vsync &&
	    t1.vbp == t2.vbp &&
	    t1.pos_pol_vsync == t2.pos_pol_vsync)
		return false;
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
jne 0x4f44
movq -0x10(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jne 0x4f44
movq -0x18(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
jne 0x4f44
movq -0x18(%rbp), %rax
cmpl $0x0, 0x40(%rax)
je 0x4f4d
movb $0x0, -0x1(%rbp)
jmp 0x50b1
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x4ffc
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x4ffc
movq -0x10(%rbp), %rax
movb 0x18(%rax), %al
andb $0x1, %al
movzbl %al, %eax
movq -0x18(%rbp), %rcx
movb 0x18(%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x4ffc
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jne 0x4ffc
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movq -0x10(%rbp), %rcx
addl 0x20(%rcx), %eax
movq -0x10(%rbp), %rcx
addl 0x24(%rcx), %eax
movq -0x18(%rbp), %rcx
movl 0x1c(%rcx), %ecx
movq -0x18(%rbp), %rdx
addl 0x20(%rdx), %ecx
movq -0x18(%rbp), %rdx
addl 0x24(%rdx), %ecx
cmpl %ecx, %eax
jne 0x4ffc
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movq -0x10(%rbp), %rcx
addl 0x30(%rcx), %eax
movq -0x10(%rbp), %rcx
addl 0x34(%rcx), %eax
movq -0x18(%rbp), %rcx
movl 0x2c(%rcx), %ecx
movq -0x18(%rbp), %rdx
addl 0x30(%rdx), %ecx
movq -0x18(%rbp), %rdx
addl 0x34(%rdx), %ecx
cmpl %ecx, %eax
je 0x5005
movb $0x0, -0x1(%rbp)
jmp 0x50b1
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jne 0x50ad
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jne 0x50ad
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jne 0x50ad
movq -0x10(%rbp), %rax
movb 0x28(%rax), %al
andb $0x1, %al
movzbl %al, %eax
movq -0x18(%rbp), %rcx
movb 0x28(%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x50ad
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
jne 0x50ad
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x30(%rcx), %eax
jne 0x50ad
movq -0x10(%rbp), %rax
movl 0x34(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x34(%rcx), %eax
jne 0x50ad
movq -0x10(%rbp), %rax
movb 0x38(%rax), %al
andb $0x1, %al
movzbl %al, %eax
movq -0x18(%rbp), %rcx
movb 0x38(%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x50ad
movb $0x0, -0x1(%rbp)
jmp 0x50b1
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopl (%rax,%rax)